Hey Lynis, Audit This by Russ Mcree – ISSA Senior Member, Puget Sound (Seattle), USA Chapter

Hey Lynis, Audit This by Russ Mcree – ISSA Senior Member, Puget Sound (Seattle), USA Chapter

toolsmith Hey Lynis, Audit This By Russ McRee – ISSA Senior Member, Puget Sound (Seattle), USA Chapter Prerequisites/dependencies solution will include the existing Lynis Unix/Linux operating systems client that we’ll cover here, a management and reporting interface, as well as related plugins. Michael says they’re making great progress and each appy Holidays to all readers, the ISSA community, day brings them closer to an official first version. Specific to and infosec tool users everywhere. As part of De- the plugins, while a work in progress, they create specialized cember’s editorial theme for the ISSA Journal, Di- hooks via the client. As an example, imagine heuristics scan- Hsaster Recovery/Disaster Planning, I thought I’d try to con- ning with correlation at the central node to detect security in- nect tooling and tactics to said theme. I’m going to try and do trusions. Compliance checking for the likes of Basel II, GLBA, this more often so you don’t end up with a web application HIPAA, PCI DSS, and SOX is another likely plugin candidate. hacking tool as part of the forensics and analysis issue. I can The short-term road map consists of finishing the web inter- hear Thom (editor) and Joel (editorial advisory board chair) face, followed by the presenting and supporting documents. now: “Congratulations Russ, it only took you seven years to This will include documentation, checklists, control over- catch up with everyone else, you stubborn git.” views, and materials for system administrators, security pro- Better late than never I always say, so back to it. As cited in fessionals, and auditors in particular. This will be followed by many resources, including Georgetown University’s System the plugins and related services. In the meantime CISOfy will and Operations Continuity page, “Of companies that had a heavily support the development of the existing Lynis tool, major loss of business data, 43% never reopen, 51% close within as it is the basis of the enterprise solution. Michael mentions two years, and only 6% will survive long-term.”1 Clearly then, a that Lynis is already being used by thousands of people re- sound disaster recovery and planning practice is essential to sponsible for keeping their systems secure. survival. The three control measures for effective disaster re- A key tenet for Lynis is proper information gathering and covery planning are preventive, detective, and corrective. This vulnerability determination/analysis in order to provide us- month we’ll discuss Lynis, a security and system auditing ers with the best advice regarding system hardening. Lynis tool to harden Unix/Linux (*nix) systems, as a means to fa- will ultimately provide both auditing functionality as well as cilitate both preventative (intended to prevent an event from monitoring and control mechanisms; remember the above occurring) and detective (intended to detect and/or discover mentioned preventative and detective controls? For monitor- unwanted events) controls. How better to do so than with ing, there will be a clear dashboard to review the environ- a comprehensive and effective tool that performs a security ment for expected and unexpected changes with light touch scan and determines the security posture of your *nix sys- for system administrators and integration with existing SIEM tems while providing suggestions or warnings for any detect- or configuration management tools. The goal is to leverage ed security issues? I caught wind of Lynis via ToolsWatch,2 a existing solutions and not reinvent the wheel. great security tools site that provides quick snapshots on tools useful to infosec practitioners. NJ Ouchn (@ToolsWatch), Lynis and Lynis Enterprise will ultimately provide guidance who runs ToolsWatch and the Blackhat Arsenal Tools event to organizations who can then more easily comply with reg- during Blackhat conferences, mentioned a new venture for ulations, standards, and best practices by defining security the Lynis author (CISOfy3), so it seemed like a great time to baselines and ready-to-use plans for system hardening in a get the scoop directly from Rootkit.nl’s Michael Boelen, the more measurable and action-oriented manner. Lynis developer and project lead. One other significant advantage of Lynis is how lightweight According to Michael, there is much to be excited about as a it is and easy to implement. The requirements to run the tool Lynis Enterprise solution, including plugins for malware de- are almost non-existent; and it is, of course, open source, al- tection, forensics, and heuristics, is under development. This lowing ready inspection and assurances that it’s not overly intrusive. Michael intends to provide the supporting tools (such as the management interface) as a Software-as-as-Ser- 1 http://continuity.georgetown.edu/dr/. vice (SaaS) solution, but he did indicate that, depending on 2 http://www.toolswatch.org/2013/11/lynis-the-auditing-tool-for-unixlinux-v1-3-5- with-the-support-of-many-linux-flavors/. 3 http://cisofy.com/. ©2013 ISSA • www.issa.org • [email protected] • Permission for author use only. December 2013 | ISSA Journal – 37 toolsmith: Hey Lynis, Audit This | Russ McRee Figure 1 – Lynis kicking off customer feedback and need, CISOfy might consider appli- 3. In VMWare menu, selected VM, then Removable De- ances at a later stage. vices, and checked Toshiba Data Traveler to make my I conducted an interesting little study of three unique, secu- USB stick available to the three virtual machines men- rity-centric Linux distributions running as VMWare virtual tioned above. machines to put Lynis through its paces and compare results, You can opt to make modifications to the profile configura- namely, SIFT 2.1.4, SamuraiWTF2.1, and Kali 1.0. Each of tion (default.prf) file to disable or enable certain checks, and these was assessed as pristine, new instances, as if they’d just establish a template for operating system, system role, and/or been installed or initialized. security level. I ran my test on the three VMs with the default profile. Setting Lynis up for use Lynis is designed to be portable and as such is incredibly easy Using Lynis to install. Simply download and unpack Lynis to a directory This won’t be one of thosetoolsmith columns with lots of of your choosing. You can also create custom packages if you pretty pictures; we’re dealing with a command prompt and wish; Lynis has been tested on multiple operating systems in- text output when using the Lynis client. Which is to say, cluding Linux, all versions of BSD, Mac OS X, and Solaris. change directories to your USB drive, cd /media/LYNIS/ly- It’s also been tested with all the package managers related nis-1.3.5 on my first test instance, followed bysh lynis – to these operating systems, so deployment and upgrading is auditor HolisticInfoSec –c from a root prompt as seen fundamentally simple. To validate its portability, I installed it in figure 1. on USB media as follows. You can choose to use the –q switch for quiet mode, which 1. On a Linux system downloaded4 lynis-1.3.5.tar.gz prompts only on warnings and doesn’t require you to step 2. Copied and unpacked it to /media/LYNIS/lynis-1.3.5 through each prompted phase. Once Lynis is finished, you (an ext2-formatted USB stick) can immediately review results via /var/log/lynis-report. dat and grep for suggestions and warnings. You’re ultimately 4 http://cisofy.com/downloads/. aiming for a hardening index of 100. Unfortunately our first 38 – ISSA Journal | December 2013 ©2013 ISSA • www.issa.org • [email protected] • Permission for author use only. toolsmith: Hey Lynis, Audit This | Russ McRee pass on the Kali system yielded only a 50. Lynis suggested I ran sudo ufw enable to fire up active iptables rules, then installing auditd and removing unneeded compilers. Please edited /etc/ssh/sshd _con fig with PermitRootLogin no to note, I am not suggesting you actually do this with your Kali ensure no direct root login. Always do this as root will be instance, fine if it’s a VM snapshot; this is just to prove my bruteforce attacked, and you can sudo as needed from a regu- point re: Lynis findings. Doing so did, however, increase the lar user account with sudoers permissions. Finally changing hardening index to a 51. expose_php to Off in /etc/php5/apache2/php.ini solves the Lynis really showed its stuff while auditing the SANS SIFT PHP finding. 2.1.4 instance. The first pass gave us a hardening index of 59 Running Lynis again after just these four fixes improved the and a number of easily rectified warnings. I immediately cor- hardening index from 59 to 69. Sweet! rect the following and ran Lynis again: Last but not least, an initial Lynis run against SamuraiWTF warning[]=AUTH-9216|M|grpck binary found errors in informed us of a hardening index of 47. Uh-oh, thank good- one or more group files| ness the suggestion list per sudo cat /var/log/lynis-re- warning[]=FIRE-4512|L|iptables module(s) loaded, but no rules active| port.dat | grep suggestion gave us a lot of options to make warning[]=SSH-7412|M|Root can directly login via some systemic improvements as seen in figure 2. SSH| Updating just a few entries pushed the hardening index to 50; warning[]=PHP-2372|M|PHP option expose_php is possibly turned on, which can reveal useful you can spend as much time and effort as you believe neces- information for attackers.| sary to increase the system’s security posture along with the Running grpck told me that “sansforensics” is a member of hardening index.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    4 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us