This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

just a simple packet filter rule

hi,

looks like i'm to stupid for that kind of firewall...  [:S]

my config:

eth0 = 10.0.0.10 (LAN)
eth1 = public IP from ISP (Internet)
eth2 = 172.16.0.10 (DMZ)

NAT works fine. now the next step would be to configure the packet filter in order to let only pass the traffic that shall 

pass. that traffic shall be dns and http from LAN to internet.

So i created the following rules:

LAN_Network__ DNS Any Allow 
LAN_Network__ HTTP Any Allow 

it works fine, the users can surf. but of course it's not quiet secure to allow the traffic go to "any" destination. so the 

next step would be to allow only dns and http traffic from LAN to the internet interface. therefor, i thought, i just need to 

change the rules to that:

LAN_Network__ DNS Internet_Interface__ Allow 
LAN_Network__ HTTP Internet_Interface__ Allow 

anyway it doesn't work. i tried diffrent variations but it doesn't work at all...  


This thread was automatically locked due to age.
Parents
  • [ QUOTE ]
     change the rules to that:

    LAN_Network__ DNS Internet_Interface__ Allow
    LAN_Network__ HTTP Internet_Interface__ Allow

    anyway it doesn't work. i tried diffrent variations but it doesn't work at all...

    [/ QUOTE ]

    It is highly unlikely that the final destination of any of your outbound DNS and HTTP traffic is your Internet _Interface. It therefore seems quite pointless to incorporate the Internet_Interface in any outbound packet filtering rules. Don't confuse traffic going THROUGH your Internet_Interface with traffic going TO it. Any packets from the Internal network that are leaving the local LAN for locations out on the Internet somewhere, needs to have packet filter rules that use "Any" as the destination, in order for the rules to be effective.

    Reading your message, I have to wonder why you want to block all the outbound traffic except DNS and HTTP. ASL has proxies for both of those, so why not use the proxies?  Then you could block all the direct traffic from the Internal network to the outside world.

    I do the opposite on my network. I allow all the outbound traffic to go through, except for ports 135, 137, 138, 139 & 445 (the Microsoft netbios ports).

    I think of a private network the way I think of a house. I want it to be secure and locked down, I want intrusion detection and alarms, but I do refrain from painting my windows black, so that I can no longer see out. Doing that, in my view, although it is technically possible, has very little to do with implementing security. I therefore prefer to have simple filter rules such as these:

    Any Any Broadcast32 Drop
    Internal_Network { Drop-Group } Internal_Interface__  Drop 
    Internal_Network { Drop-Group } Internal_Broadcast__ Drop
    Internal_Network { Drop-Group }  Any Drop
    Internal_Network  Any Any Allow
    Any { Allowed-Services } Any Allow

    Then I put all the netbios ports into my Drop-Group, and all the services that I want into the Allowed-Services group.

    If you block everything except DNS and HTTP, you have then created a LAN where email, news, FTP, network time sync, VPNs and a number of other usefull services won't work.     
Reply
  • [ QUOTE ]
     change the rules to that:

    LAN_Network__ DNS Internet_Interface__ Allow
    LAN_Network__ HTTP Internet_Interface__ Allow

    anyway it doesn't work. i tried diffrent variations but it doesn't work at all...

    [/ QUOTE ]

    It is highly unlikely that the final destination of any of your outbound DNS and HTTP traffic is your Internet _Interface. It therefore seems quite pointless to incorporate the Internet_Interface in any outbound packet filtering rules. Don't confuse traffic going THROUGH your Internet_Interface with traffic going TO it. Any packets from the Internal network that are leaving the local LAN for locations out on the Internet somewhere, needs to have packet filter rules that use "Any" as the destination, in order for the rules to be effective.

    Reading your message, I have to wonder why you want to block all the outbound traffic except DNS and HTTP. ASL has proxies for both of those, so why not use the proxies?  Then you could block all the direct traffic from the Internal network to the outside world.

    I do the opposite on my network. I allow all the outbound traffic to go through, except for ports 135, 137, 138, 139 & 445 (the Microsoft netbios ports).

    I think of a private network the way I think of a house. I want it to be secure and locked down, I want intrusion detection and alarms, but I do refrain from painting my windows black, so that I can no longer see out. Doing that, in my view, although it is technically possible, has very little to do with implementing security. I therefore prefer to have simple filter rules such as these:

    Any Any Broadcast32 Drop
    Internal_Network { Drop-Group } Internal_Interface__  Drop 
    Internal_Network { Drop-Group } Internal_Broadcast__ Drop
    Internal_Network { Drop-Group }  Any Drop
    Internal_Network  Any Any Allow
    Any { Allowed-Services } Any Allow

    Then I put all the netbios ports into my Drop-Group, and all the services that I want into the Allowed-Services group.

    If you block everything except DNS and HTTP, you have then created a LAN where email, news, FTP, network time sync, VPNs and a number of other usefull services won't work.     
Children
  • Velvet,

    I have a question related to your netbios drops...I'm using the same netbios drop rules but I still see some TCP drop traffic on kernel log...the thing is that its going from consecutive source ports on my PC to port 80 on internal interface...here's some of the log file...

     Code:


    2004-Mar 27 02:34:01 (none) kernel: TCP Drop: IN=eth0 OUT= MAC=00:04:75:7e:53:f5:00:01:29:4e:45:45:08:00 SRC=192.168.2.101 DST=192.168.2.1 LEN=48 TOS=0x00 PREC=0x00 TTL=128 ID=33299 DF PROTO=TCP SPT=1179 DPT=80 WINDOW=65268 RES=0x00 SYN URGP=0 
    2004-Mar 27 02:34:04 (none) kernel: TCP Drop: IN=eth0 OUT= MAC=00:04:75:7e:53:f5:00:01:29:4e:45:45:08:00 SRC=192.168.2.101 DST=192.168.2.1 LEN=48 TOS=0x00 PREC=0x00 TTL=128 ID=33303 DF PROTO=TCP SPT=1179 DPT=80 WINDOW=65268 RES=0x00 SYN URGP=0 
    2004-Mar 27 02:34:10 (none) kernel: TCP Drop: IN=eth0 OUT= MAC=00:04:75:7e:53:f5:00:01:29:4e:45:45:08:00 SRC=192.168.2.101 DST=192.168.2.1 LEN=48 TOS=0x00 PREC=0x00 TTL=128 ID=33308 DF PROTO=TCP SPT=1179 DPT=80 WINDOW=65268 RES=0x00 SYN URGP=0 

     

     

    192.168.2.101 is my PC and 192.168.2.1 is the internal interface...

    Any suggestions?

    I've also I was having some UDP Drop traffic from my server on a DMZ to the broadcast address (192.168.3.75 --> 192.168.3.255)...

     Code:


    2004-Mar 27 02:36:28 (none) kernel: UDP Drop: IN=eth2 OUT= MAC=ff:ff:ff:ff:ff:ff:00:50:bf:0a:b0:8a:08:00 SRC=192.168.3.75 DST=192.168.3.255 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=20625 PROTO=UDP SPT=137 DPT=137 LEN=58 
    2004-Mar 27 02:36:29 (none) kernel: UDP Drop: IN=eth2 OUT= MAC=ff:ff:ff:ff:ff:ff:00:50:bf:0a:b0:8a:08:00 SRC=192.168.3.75 DST=192.168.3.255 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=20626 PROTO=UDP SPT=137 DPT=137 LEN=58 
    2004-Mar 27 02:36:30 (none) kernel: UDP Drop: IN=eth2 OUT= MAC=ff:ff:ff:ff:ff:ff:00:50:bf:0a:b0:8a:08:00 SRC=192.168.3.75 DST=192.168.3.255 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=20627 PROTO=UDP SPT=137 DPT=137 LEN=58 



     


    so I just changed the rules from: 

    Internal_Network_ {netbios-all} Internal_Interface_ Drop

    to

    DMZ_Network_ {netbios-all} DMZ_Interface_ Drop

    and repeated for the other two...

    is that valid?...

    TIA   
  • [ QUOTE ]
     so I just changed the rules from:

    Internal_Network_ {netbios-all} Internal_Interface_ Drop

    to

    DMZ_Network_ {netbios-all} DMZ_Interface_ Drop 

    [/ QUOTE ]
    Why the one rule instead of the other? Use both of them.

    I am curious why your workstation is sending port 80 traffic to the Internal interface. I think you need to examine the running tasks on your PC to see what is doing that. A misconfiguration of some program on the PC perhaps? You haven't accidentally set your web browser's HTTP proxy service to point to port 80 instead of port 8080 on the ASL box' internal interface by any chance?   
  • I meant to say that I was going to be using both set of rules for Internal and DMZ...

    I don't know whats going on with that port 80 drop...I'll check out the software I have installed...
  • I use this filter rule setup in my ASL box at home:

    Any  Any  Broadcast32   Drop
    Internal_Network__  { Drop-Group } Internal_Interface__  Drop
    Internal_Network__  { Drop-Group } Internal_Broadcast__  Drop
    DMZ_Network__  { Drop-Group }  DMZ_Interface__   Drop
    DMZ_Network__  { Drop-Group }  DMZ_Broadcast__  Drop
    Internal_Network  Any  Any  Allow
    DMZ_Network__  { DMZ-Services }  Any  Allow
    DMZ_Network__  Any Internal_Network__ Drop
    Any  { Local-Services }  Any  Allow
    Any  Any  Any  Drop

    I then have the services I want to let through defined in the two service groups, while the Drop-Group contains the netbios ports and port 445. 

    Any configuration changes I need to make, I do by editing the three custom service groups I have used in the filter rules.   
  • I checked my programs (at least the ones I thought could be trouble) and ran Spyware detection programs (just to make sure) but I was still seeing the port 80 drops in the kernel live log...

    I just appended my packet rules woth "any any any drop" as the last rule...  
  • thx for help velvet

    seems like i misunderstood how the asl treats the packet or how the packet filter has to be set in order to work properly. 

    rules for the sidewinder and winroute for instance work different. i used dns and http only for test purpose so i could make sure i understand how the packet filter works.

    in the end it makes sense. 

    i allow every kind of service with "Internal_Network Any Any Allow". after that i create a rule "Any Any Any Drop" which is 
    the last rule. no matter how much interfaces, networks an dmz i have, only the internal_network will be able to communitcate with the internet. 


    "Any Any Broadcast32 Drop"   what kind of service exactly is broadcast32?

    What do you think of a combination of proxy and nat?    
  • [ QUOTE ]
    "Any Any Broadcast32 Drop"   what kind of service exactly is broadcast32?

    [/ QUOTE ] Broadcast32 is a network definition that you will have to define yourself, since it does not come predefined in ASL v4.

    Broadcast32 - IP Addr: 255.255.255.255 - Netmask: 255.255.255.255

    It is the global broadcast address for the entire Internet.



    [ QUOTE ]
     What do you think of a combination of proxy and nat? 

    [/ QUOTE ] I use both. I try to make use of all the features in my ASL box as best as I can.  Did you have something specific in mind?  
  • No it just came to me that both services could be used together.  
      
  • Well, you can use SNAT rules to move a service from one port to another. I have a web server on one internal machine that I map to my External interface. I also have a mail server on my internal network with webmail access, which I map out to port 88 on the External interface, since port 80 is already used by the web server. The mail server port 80 to 88 remapping is done like this:

    WebMail  Any -> External_Interface__ / HTTP-88  None  mail.mynet.local / HTTP