Telnet to TCP port works even without a valid implicit/explicit security policy

cancel
Showing results for 
Search instead for 
Did you mean: 

Telnet to TCP port works even without a valid implicit/explicit security policy

L1 Bithead

There is no FW policy which allows the SSL application over port  TCP 27017 between the given source/destinations. In fact it shows deny in the monitor -> logs but I'm able to telnet the from the source  to the destination - 172.20.249.77 over port 27017 successfully which is weird really. What could be the reason for this?Deny LogsDeny Logs

 

 

6 REPLIES 6

Cyber Elite
Cyber Elite

Hello,

For the Telnet traffic, which policy is allowing this, in the traffic logs? Also you can create a policy that will allow SSL over other ports, Just select SSL as the application, and then select a custom Service (port).

OtakarKlier_0-1655131841923.png

You will have to create the new server 27017. Just click new on the drop down.

Regards,

Thanks for your reply but I would like to give more clarity on my issue where telnet to 27017 works even there is no policy and it's not showing in the logs as well. It took me backwards while seeing such occurence when I did a troubleshooting. 

 

PS : it's not allowed by any implicit policies also. 

L5 Sessionator

Hi @VivekPAN ,

 

Do you have other L7 rules that might allow tcp/27017 before the application is identified?  When you telnet to a port, you execute the TCP 3-way handshake.  This traffic may be allowed until the NGFW sees enough packets to identify the application.  Once the NGFW has determined the application, it can allow or deny the traffic based upon the L7 rules.  The best practice to avoid allowing these initial packets is to ensure that you set application-default as the service for your L7 rules.  Then only the default ports are initially allowed.  Verify you do not have an L7 rules with a service of any.  For apps with non-standard ports, use a custom service.

 

Thanks,

 

Tom

Help the community: Like helpful comments and mark solutions.

L1 Bithead

Hi Tom,

 

Thanks for your response.

 

1/ I don't have a firewall rule which allows the tcp/27017 at all but the telnet to the port 27017 from the source goes successful.

 

2, I have another query which is no way related to above query. For example, I have the below policy in place in my FW. The actual SSL application works fine from the source to the destination. But if I do a "telnet 172.1.1.2 443" from source - 10.1.1.1, the connection gets "TCP timeout" as a result. Do I need to allow "Telnet" application also in the same policy to make this work? And which means telnet'ing the destination with TCP port does not help to verify the 3-way handshake unless we don't have "telnet" app is allowed between them?

 

source - 10.1.1.1

destination - 172.1.1.2

destination port - 443

application - ssl

service - application-default

action - allow

 

 

 

 

L5 Sessionator

Hi @VivekPAN ,

 

That's very interesting.  Do you have any rules with a service of "any"?  That may allow the TCP 3-way handshake on port 27017.  Or maybe application-default for one of your applications may include port 27017.

 

Query #2 is actually very related to query #1.  I would think the Telnet would initially succeed.  Maybe it does more than the 3-way handshake.

 

Thanks,

 

Tom

Help the community: Like helpful comments and mark solutions.

Regarding Query #1, I would suggest to replicate it again and check the Session Browser (Monitor > Session Browser) to see which security rule the traffic is hitting. Then, it will be much clearer what's happening.

 

Regarding Query #2, since you said, "the actual SSL application works fine" and the service port is 443, I understand that an https server is running on port 443. If you run "telnet 172.1.1.2 443", the application won't be identified as ssl simply because it's not ssl thus the traffic won't hit the security policy that you mentioned. It won't be identified as telnet either because telnet server isn't running on that port (443). The firewall will not identify the application based on the port number, so the TCP 3way-handshake isn't enough to identify the application.
What do you want to achieve or what do you expect by running "telnet 172.1.1.2 443" against an https server? Are you trying to allow/block traffic based on the port number?

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!