Customer support forums for Atomic Protector (formerly Atomic Secured Linux). There is no such thing as a bad question here as long as it pertains to using Atomic Protector. Newbies feel free to get help getting started or asking questions that may be obvious. Regular users are asked to be gentle.
I followed that wiki about adding advanced rules and at the end it says to add a drop rule for everything using insert? When I did that using insert the drop rule was at the top and blocked everything. I left it out because there was a drop rule at the bottom for lo then I got to thinking I better add a drop with append or rule number for everything else.
Here are my rules I ended up with. I think they right but not sure about the drop rules because of that wiki guide. Is the wiki right? The drop should not be at the top from what I understand.
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DROP all -- 0.0.0.0/0 0.0.0.0/0 state INVALID
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ASL-UPDATES tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 state NEW
DROP all -- 0.0.0.0/0 0.0.0.0/0 state INVALID
ASL-Firewall-OUTPUT all -- 0.0.0.0/0 0.0.0.0/0
Chain ASL-ACTIVE-RESPONSE (3 references)
target prot opt source destination
DROP all -- 0.0.0.0/0 0.0.0.0/0
When I did that using insert the drop rule was at the top and blocked everything.
You want to use append.
From the firewall rule documentation:
Step 5: Select the command, Append or Insert. In the Linux firewall, Append means to add the rule after all other rules. Linux firewalling is linear, that means it processes the rules in order "first come first served". Appending places it last. Insert places the rule first. With insert you can also set the rule number in case you prefer that the rule run second, third, etc. Be very careful with Insert as you can end up setting you rules up in the opposite order of what you want (for example, putting your drop rules before your allow rules).
Yes I read that but I was following these instructions and it says insert the drop rule after adding all my accept rules. Not sure if it's a mistake but it tripped me up the first time so I thought I better let you know just in case so other newbs don't get confused.
blah...
Step 11: Continue adding ACCEPT rules for all the IPs and/or networks you want to allow by repeating Steps 1-10.
Step 12: If you are done adding IPs and/or networks to allow, now you will add in your rule to block all other IPs/Networks. Click the "Add Rule" button.
Step 13: For table, select filter.
Step 14: For Chain select "INPUT"
Step 15: For command select "Insert"
Step 16: For protocol select tcp in the drop down, and leave the first drop down as "-".
Step 17: Type in the source IP/Network for this rule. If you want to block all sources, just leave this blank.
Step 18: In the Destination port window type in the port number you wish to block. For example, if you want to block connections to port 22, type in 22. Leave the first drop down as "-".
Step 19: Set the "Jump Target" to "DROP" or "REJECT". DROP will silently block the attempt so the client is not sure why it was blocked, REJECT will send ICMP destination denied packets to the client applications network stack telling the stack that the connection was dropped at the network level.
Step 20: Then press the Add Rule button.
Your new ruleset to restrict access to a port, except from certain IPs/Networks is now implemented.
Anyway. This first drop rule is for the network card lo according to the ui, I'm pretty sure it came from the access list so I thought I better add another one at the bottom to drop everything else. That's ok like that isn't it or do I only need to drop everything from lo? I guess invalid means the lo interface?
DROP all -- 0.0.0.0/0 0.0.0.0/0 state INVALID
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:30000 state NEW
ASL-TORTIXD-ACL tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:30000 state NEW
ASL-Firewall-INPUT all -- 0.0.0.0/0 0.0.0.0/0 DROP all -- 0.0.0.0/0 0.0.0.0/0 state NEW
Yes I read that but I was following these instructions and it says insert the drop rule after adding all my accept rules. Not sure if it's a mistake but it tripped me up the first time so I thought I better let you know just in case so other newbs don't get confused.
Yep, its not clear in that part of the guidance and I can see how it would confuse someone, so we updated it. Thanks for bringing it to our attention.
Thats a broadcast packet, this means you havent configured your system to allow in broadcast packets. A linux server shouldnt need this, but if you do you'll need to add in custom rules for this. Please see the firewall documentation if you want to do this: