Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Bastille works.
when I do
/etc/rc.d/init.d/bastille-firewall start
it starts.
when I do
iptables --list
it lists.
all good.
but what I cant figure out is this:
what is the recommended process for adding hosts to deny access? I have found a very roundabout screwy way of doing it, but whats the preferred/recommended way?
You can use iptables to deny all access from a specific host with:
iptables -I INPUT -s xxx.xxx.xxx.xxx -j DROP
If you would like to deny access to only certain services, then you will need to provide more details about what you are trying to accomplish. You can alternatively use host.deny, however it only is functional for certain services.
Thanks for the reply.
sorry, I wasnt clear.
If I run the iptables command line that you suggested, it works. But if I then startup bastille, it flushes the iptables before it loads its own. I could then run the command line you suggest, but I was wondering if there is a best practice for this? Is the best practice just having a script run all of my iptables blocks after I start bastille?
edit:
one more thing...
if I run
/etc/rc.d/init.d/iptables start
it will load my iptables that I saved, but this flushes what bastille put in.
I don't use bastille that much, so I'm not really that familiar with it. But I would imagine that you could do this several ways. The easiest would be to take a look at the bastille-firewall script in initd and see if you can find the location that it grabs the firewall rules from. Then just append your desired rules to the bottom of it (though make sure to use -I option). Alternatively you could put all your rules in a separate executable file and modify the bastille script to execute that file after it finishes loading its own rules.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.