HOW TO: Secure Your Box With Bastille

January 4, 2006 on 9:40 pm | In Linux, HOW TO, Security |

Bastille is a hardening tool which is very effective at locking down your system, and all it requires is a few minutes of your time! It is currently available for the major Linux distributions: SUSE, Mandrake (the available RPM should work with Mandriva), Fedora Core, Red Hat, Debian, and Gentoo, and it is also available for HP-UX and Mac OS X, as well as the source code which can be compiled on most *nix systems. In this tutorial I shall take you through the steps of installing it and setting it up properly in order to secure your system better than before. Please note that this tutorial is designed for users new to Linux, and so may be slightly cumbersome for the more advanced users out there.

First of all, we’ll install it. As my demonstration system I am using a laptop running Fedora Core 3, and I am installing Bastille version 3.0.8. You may use the method described on Bastille’s site to install it if you have a different distro or Operating System to mine. Here is how I installed it:

  1. Download the Bastille RPM - which will work for Red Hat, Fedora Core, SUSE, or Mandrake. Install it onto your system, either by using the inbuilt package manager or the following commands in console:
    $ su
    Password:
    # rpm -ivh Bastille-3.0.8-1.0.noarch.rpm
  2. Now, download perl-Curses (although non-graphical, at the end of the day it tends to cause fewer problems than installing perl-Tk). Choose the correct one for your distro and release at the module table. Install it the same way you installed Bastille in part 1.
  3. Once you have installed both of these, fire up Bastille’s configuration in the console by typing the following command (still as root):
    # bastille -c
    Note: If that doesn’t work, type the following into the console: PATH=/usr/sbin:$PATH - then try to run Bastille again, and it should work.

A word of advice: I may tell you to just ‘Press “Next”‘ or ‘Hit “Yes”‘ in some places, but you should read the text to make sure you understand what you are configuring and that the choice I am leading you to is the right one.

Having started up Bastille, some lines of text should appear on your screen.

  1. Press Ctrl + C and it will scroll to the end of the text, as shown below:

    24bastille

  2. Type “accept” and press Enter. Now you will be taken to Bastille’s configuration, and introduced to the program. Press “Next” to continue.

    24bastille

  3. At this first question you may want to press “No”, for if not simple commands like ‘ifconfig’ and ‘runlevel’ will be disabled to all users but root (and I personally use them quite a lot) - although hitting “Yes” is the more secure option.

    24bastille

  4. Press “Next”.

    24bastille

  5. Press “No”, because if not you will be unable to mount and unmount devices after boot (unless you are root).

    24bastille

  6. At the next screen, hit “Yes”.

    24bastille

  7. Once again, press “Yes”.

    24bastille

  8. Press “Yes” at the ‘r-tools’ question.

    24bastille

  9. And “Yes” at the ‘usernetctl’ one.

    24bastille

  10. “Yes” again, to leave traceroute available to all users.

    24bastille

  11. “Yes” to disable r-protocols.

    24bastille

  12. At this screen, it is a good idea to press “Yes” - this will get you into the good habit of renewing your password every 60 days.

    24bastille

  13. Press “Yes” to set the default umask.

    24bastille

  14. Here, leaving 077 is a good idea - it means that no other users on your system can read or write to your files (of course, this is your choice). When you’re happy, hit Tab and then “Next”.

    24bastille

  15. I have decided to set this one as “Yes”, because if you need to become root on the other tty’s then you can just ’su’ from a normal user’s account.

    24bastille

  16. “No” at password-securing the GRUB prompt, because this isn’t necessary unless you’re scared a cracker may be able to access your computer physically.

    24bastille

  17. It’s also fine to choose “No” at this one.

    24bastille

  18. Hitting “Yes” here is a good option.

    24bastille

  19. Leave the following one as “No”.

    24bastille

  20. For a bit of ‘fun’, leave this one as “Yes”. :)

    24bastille

  21. Press Tab at this screen.

    24bastille

  22. Type in your name here, and then press Tab and hit “Next”.

    25bastille

  23. If you’re running a server you may want to set this one as “Yes”, but otherwise leave it as the default “No”.

    26bastille

  24. Choose “No” here unless the computer is a public one and you want to restrict console access to some users.

    27bastille

  25. Also choose “No” here - if not you will end up with some pretty large logs.

    28bastille

  26. This screen is another informative one, so just hit “Next”.

    29bastille

  27. As my computer is a laptop, I chose “No” here. But, if you’re using a desktop, press “Yes”.

    30bastille

  28. Press “No” here if you are on a Local Area Network (LAN) and connect to other computers regularly.

    31bastille

  29. Again, if you are using a laptop you’ll probably want to press “No”. Otherwise, “Yes” is fine.

    32bastille

  30. GPM is fairly useless unless you do not like using the keyboard to move around in console, so hit “Yes” here unless you really do want it.

    33bastille

  31. If you have a Hewlett-Packard all-in-one scanner/fax/printer, then choose “No”. Otherwise choose “Yes”. (Most of you should not see this screen).

    34bastille

  32. Unless you connect to the internet via ISDN, choose “Yes”.

    35bastille

  33. Choose “Yes” here to deactivate ‘kudzu’. (Most of you should not see this screen)

    36bastille

  34. Hit “Yes” to stop sendmail running in daemon mode.

    37bastille

  35. Another info screen - press “Next”.

    38bastille

  36. I advise you press “No” here to keep printing enabled.

    39bastille

  37. Hit “No” not to install the TMPDIR/TMP scripts.

    40bastille

  38. Then, press “Yes” to run the packet filtering script. Here is where we shall configure the firewall.

    42bastille

  39. Hit “Next”.

    43bastille

  40. Hit “No” (unless your computer is acting as a gateway to the internet, and you plan to have a LAN behind it).

    44bastille

  41. Remove the text and hit “Next”.

    45bastille

  42. Hit “Next”.

    46bastille

  43. Hit “Next”.

    47bastille

  44. Hit “Next”.

    48bastille

  45. Type in “echo-request” and hit “Next”.

    49bastille

  46. Hit “Next”.

    50bastille

  47. Hit “Next”.

    51bastille

  48. Press “No” (to keep things simple).

    52bastille

  49. Hit “Next”.

    53bastille

  50. Hit “Next”.

    54bastille

  51. Hit “Next”.

    55bastille

  52. Press “Yes”.

    56bastille

  53. Hit “Next”.

    57bastille

  54. Type in your network interfaces (’eth0 ppp0′ are the likely ones) and press “Next” - this shouldn’t matter if you’re running kernel 2.4+

    58bastille

  55. Hit “Next”.

    59bastille

  56. Hit “Next”.

    60bastille

  57. Press “Yes”.

    61bastille

  58. PSAD is not necessary, but if you’re security-conscious you might want to set it up to log any suspicious (possible) crack attempts. I will cover it anyway - so, if you would like to set it up, hit “Yes”. Otherwise, choose “No” (in that case, skip to #70).

    62bastille

  59. Hit “Next”.

    63bastille

  60. Hit “Next”.

    64bastille

  61. Press “No”.

    65bastille

  62. Hit “Next”.

    66bastille

  63. Press “No”.

    67bastille

  64. Leave the default values and hit “Next”.

    68bastille

  65. Type in your email address (to which any security alerts will be reported) and hit “Next”.

    69bastille

  66. Hit “Next”.

    70bastille

  67. Press “Yes”.

    71bastille

  68. Press “No”.

    72bastille

  69. Press “Yes”.

    73bastille

  70. Finally, press “Yes”!

    74bastille

You have now finished installing Bastille - an array of daemons have ceased to run, and your system is now more secure. Tedious, but worthwhile in the long run! ;)

Please leave a comment below or contact me if you have a problem.

Online certifications are for those professionals who want to recognize their skills and authentication in a field of their specific specialization. All professionals chose some best quality transcender help to get through the typical online exams like comptia a+ and Microsoft’s mcse certification exams. Cisco have little different scene, ccna certification needs proper study knowledge and concepts of multi layer model of networks while itil certification required handsome study approach to pass the exam.

Add to:
del.icio.us  digg it

17 Comments »

RSS feed for comments on this post. TrackBack URI

  1. […] A must-have security application, along with Bastille Linux! // Used for showing and hiding user information in the comment form function ShowUtils() { document.getElementById(”authorinfo”).style.display = “”; document.getElementById(”showinfo”).style.display = “none”; document.getElementById(”hideinfo”).style.display = “”; } function HideUtils() { document.getElementById(”authorinfo”).style.display = “none”; document.getElementById(”showinfo”).style.display = “”; document.getElementById(”hideinfo”).style.display = “none”; } […]

    Pingback by AppArmor Turns Open Source at J_K9 @ Linux — January 15, 2006 #
    Using WordPress WordPress 1.5.2

  2. Bastille may ‘harden’ your Linux, but, is (unnecessarily?) tedious.
    I think I’ll opt for having a root canal done first.

    Comment by Root Canal — January 26, 2006 #
    Using Mozilla Firefox Mozilla Firefox 1.5 on Linux Linux

  3. It may be tedious, but is an added security bonus in the long run - especially if you’re on a direct connection to the internet or connect to public WAN’s. Nothing in the security world is meant to be quick or easy - if it is, it probably isn’t secure enough.

    And with Linux’s increasing popularity will come more people trying to break into it - it’s always best to be prepared. :)

    Comment by J_K9 — January 26, 2006 #
    Using Mozilla Firefox Mozilla Firefox 1.5 on Windows Windows XP

  4. […] HOW TO: Secure Your Box With Bastille (tags: howto Linux security) […]

    Pingback by Drugi dom » Blog Archive » links for 2006-01-26 — January 26, 2006 #
    Using WordPress WordPress MU

  5. Just two questions:

    1. Since I’ve installed Bastille, I can’t download torrent files (only upload). How can I fix this?

    2. How can I remove Bastille from my Fedora 4?

    Can you help me? Thank you.

    Comment by David — February 4, 2006 #
    Using Mozilla Firefox Mozilla Firefox 1.5 on Fedora Linux Fedora Linux

  6. David - I am not sure why it has locked up your BitTorrent uploads. Are you sure it is not your BitTorrent app? Try using another application, or if not you may have to allow the port again…

    To remove Bastille, do the following:
    # rpm -e Bastille (as root)

    Comment by J_K9 — February 5, 2006 #
    Using Mozilla Firefox Mozilla Firefox 1.5.0.1 on Windows Windows XP

  7. It was a problem with my ISP because now everything is ok.

    Firstly, I thought the problem was caused by Bastille because 1 or 2 minutes after it installation, I losted all my BitTorrent download speeds. People who use this ISP also reported the same case at the same hour.

    Thank you again and nice guide.

    Comment by David — February 5, 2006 #
    Using Mozilla Firefox Mozilla Firefox 1.5 on Fedora Linux Fedora Linux

  8. David - No problem, and I’m glad it’s resolved! :D

    Comment by J_K9 — February 12, 2006 #
    Using Mozilla Firefox Mozilla Firefox 1.5.0.1 on Windows Windows XP

  9. When Bastille firewall will be available on Fedora 5?

    Comment by Evgeny — April 4, 2006 #
    Using Mozilla Firefox Mozilla Firefox 1.5.0.1 on Fedora Linux Fedora Linux

  10. […] Continue reading HOW TO: Secure Your Box With Bastille howto security software tutorial […]

    Pingback by SigmaLab » Blog Archive » HOWTO: Secure Your Box With Bastille — December 4, 2006 #
    Using WordPress WordPress 2.0.5

  11. Just want to say thanks!

    Comment by Acura Lens — February 24, 2007 #
    Using Internet Explorer Internet Explorer 6.0 on Windows Windows XP

  12. Online pharmacy gt buy nexium….

    Buy nexium medication from online pharmacy. Online pharmacy gt buy nexium. Buy nexium in canada….

    Trackback by Buy nexium online pharmacy. — February 2, 2008 #
    Using Unknown browser

  13. Zoloft withdrawals….

    Generic zoloft. Side effects of zoloft….

    Trackback by Zoloft dosing. — February 9, 2008 #
    Using Unknown browser

  14. free instant credit check…

    generation hoisted fortune …

    Trackback by free instant credit check — February 9, 2008 #
    Using Internet Explorer Internet Explorer 6.0 on Windows Windows XP

  15. Tramadol….

    Tramadol….

    Trackback by Tramadol. — July 16, 2008 #
    Using Unknown browser

  16. piggs peak casino bonus code…

    lager:Saturnalia,periscope lightens,bristle?…

    Trackback by piggs peak casino bonus code — July 19, 2008 #
    Using Internet Explorer Internet Explorer 4.01 on Windows Windows 95

  17. where can i find pocher to play for free…

    benefactors containable?synthesizer biennium appointive reclaimers …

    Trackback by where can i find pocher to play for free — October 2, 2008 #
    Using Internet Explorer Internet Explorer 5.0 on Mac OS Mac OS

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Powered by WordPress with Pool theme.
Entries and comments feeds. Valid XHTML and CSS. ^Top^
0.369 seconds.

Credit - Refinance - Personal Loan - Debt Help