Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Question Regarding Default Deny Rules

    General pfSense Questions
    7
    112
    40.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator @GPz1100
      last edited by johnpoz

      @GPz1100 on my wan sure

      wanrules.jpg

      I have some floating rules as well that block stuff before it even gets to my wan rules - shodan IPs, Digital Ocean IPs, some other known scanner networks.. Have zero desire for any of my ports that I do have open to end up in some db somewhere - all that could ever do is attract more noise.

      floating.jpg

      An intelligent man is sometimes forced to be drunk to spend time with his fools
      If you get confused: Listen to the Music Play
      Please don't Chat/PM me for help, unless mod related
      SG-4860 24.11 | Lab VMs 2.7.2, 24.11

      GPz1100G 1 Reply Last reply Reply Quote 0
      • GPz1100G
        GPz1100 @johnpoz
        last edited by GPz1100

        @johnpoz Thanks for posting that.

        Doesn't this generate a lot of log entries?
        253b6d85-149f-47fa-b3a2-277e47caf6fb-image.png

        Or is there some way to only log initial packets?

        a777e718-4c7a-4140-820d-18e4de688b7c-image.png
        Which advanced settings are enabled for this one? Maybe a screen shot if possible? Define clean block?

        What do you consider CommonUDP ports?

        I too have a number of block lists for inbound. Only inbound traffic for now is tcp/25 and a small block of ~50 upper range udp ports that get forwarded the to voip server for RTP media. I limit that to north american IP's only as there are no none NA calls ever made. This is to satisfy anveodirect who doesn't proxy RTP traffic.

        Fortunately floating rules take precedence before the port forward interface firewall rule. This minimizes noise and spam received at the mail server. Default block logging is disabled as im generally not interested what I consider internet noise. But your logging options may be of interest.

        The above is interesting; according to https://docs.netgate.com/pfsense/en/latest/nat/process-order.html, port forwarding/nat gets processed before floating/firewall rules. Perhaps one interpretation of this is the port forward (with respect to inbound traffic) is indeed processed before the firewall rules, but then any firewall rules associated with that get processed based on firewall rule processing priority?

        johnpozJ 1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @GPz1100
          last edited by johnpoz

          @GPz1100 only the initial allowed is log - it doesn't log all the traffic.

          Here is the setting for only logging syn, in the advanced options part of the rule

          synadvanced.jpg

          As to common udp ports - those are just in an alias

          lotsoftheme.jpg

          I created that alias quite a few years ago as you can see.. I just did some research on common udp ports.. That rule you can see doesn't really log much. 856KB since most likely when I updated to 24.11 and the counters reset.

          Yes port forwards are evaluated first, but there has to be a firewall rule to allow the traffic. If I didn't put in the specific block, then the traffic I don't want to see that my port is open would be allowed.. For example I pretty much allow any IP in the US, and currently Belgium because I have some family living there currently.

          But I sure don't want a shodan IP to get to that port, so while my port forward might allow that - my block in floating doesn't so they never see that port open.

          Once I started blocking the scanners and such - I don't really see a lot of hits on my clean block any more.

          here is example of one of those scanners being blocked - sketchoid

          scanner.jpg

          I don't have that port open anyway - but there is zero reason to answer them if they happen upon a port I do have open..

          That first IP there is owned by Palo Alto Networks, they have scanners searching the net as well for open ports.. They have zero reason to see mine ;) You are suppose to be able to get on their no scan list, but have had little luck with those - so I just block their IPs.. Scan your customers that want that service - have zero reason for my IP to get put into your db that I have a port open on X.

          Also when you have specific rules that block specific things, other than just anything like the default deny - its easier to filter to look for specific things.. And you know you can bump what does get shown in your gui to more lines - notice mine is 5000 entries.. So with ability to filter, and more entries its easier to keep an eye on your log. If you are really curious, you could send them to a syslog - and then you can get really fancy with all kinds of stuff - what geo location are most of your blocks coming from with bigger blobs on a graph, etc.. It can be some interesting eye candy - I ran such a setup for a while - but then got board with having to run the resources on a vm to provide what amounts to nothing more than eye candy.

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.7.2, 24.11

          GPz1100G 1 Reply Last reply Reply Quote 0
          • GPz1100G
            GPz1100 @johnpoz
            last edited by

            @johnpoz I'm still digesting your post.

            You got me curious about stretchoid. I haven't seen any hits in the email server from them for some time (many months). Was trying to find which list was blocking it but unsuccessful.

            DO is already blocked at ASN level.

            johnpozJ 1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @GPz1100
              last edited by

              @GPz1100 said in Question Regarding Default Deny Rules:

              stretchoid

              maybe you opted out?

              https://stretchoid.com/

              But those seem to never work - so I just block their IPs.

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.7.2, 24.11

              1 Reply Last reply Reply Quote 0
              • D
                djtech2k
                last edited by

                I have noticed that the pfblocker fw rules all show up as rejected instead of blocked. Any idea why? I was thinking that a block would be better than sending a response back. I could certainly be wrong but I was wondering why it was reject and not block.

                johnpozJ 1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator @djtech2k
                  last edited by johnpoz

                  @djtech2k because you set them that way? Personally I don't use any sort of auto rules in pfblocker - I just use it to create aliases that I then use in my own rules.

                  pfblock.jpg

                  Yeah its not good practice to send reject external, its fine locally and can save some retrans that client will do if it just doesn't get an answer.. Only time you would want to send reject is like in my rules and the ability to traceroute through/to pfsense, etc. To see the hop that is pfsense you would need to send the reject.

                  See if I do a traceroute to my IP from out on the internet (vps of mine) the last hop which is my IP answers

                  traceroute.jpg

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                  1 Reply Last reply Reply Quote 0
                  • D
                    djtech2k
                    last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • D
                      djtech2k
                      last edited by

                      I just went back and looked and it shows pfblocker sets Block as the default for Inbound rules and Reject for outbound rule. I guess I was thinking it was reject on WAN, which did not make sense to me. I get it now.

                      johnpozJ 1 Reply Last reply Reply Quote 0
                      • johnpozJ
                        johnpoz LAYER 8 Global Moderator @djtech2k
                        last edited by

                        @djtech2k yeah I was going to say - a reject on local would make sense as default..

                        If device on your network wants to go to somethingblocked, might as well reject it - or he just going to retrans multiple times wanting an answer back from where he wanted to go.

                        If you tell him right away - hey you not going there, then it shouldn't spend any time doing retrans.

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.