SlideShare a Scribd company logo
WHITEPAPER




Options for User Auditing on
Linux and Solaris Platforms

Cyril Plisko, CTO of Grigale Ltd.




January 2012




                    Like a Security Camera on Your Servers!
WHITEPAPER                                                                                                                                                          2




        Executive Summary
                 A variety of methods exist for auditing user activity in UNIX and Linux environments. Some of them come preinstalled
                 within common distributions, some can be downloaded as freeware, and some are commercially available products.

                 This whitepaper looks at the most popular methods for auditing. Each method is described, along with tips for how to
                 make the best use of each method. In addition, guidance is provided to show what type of auditing each method is
                 best suited for.

                 The auditing methods covered include:
                  script
                  screen
                  sudo auditing
                  Native audit facility (auditd, auditctl, etc.)
                  ObserveIT

        Scenario 1: Auditing using script(1)
             How script is setup and started:
                 ‘script’ is a well-known tool used for basic auditing. In many installations, it comes preinstalled. When not, it can be
                 added to any Linux or Solaris environment with no additional configuration is required.

                 Using script will start auditing as soon as a user types the
                                                                                                                                        Configure SSH so that script is
                 command ‘script’.                                                                                           TIP!
                                                                                                                                        fired immediately upon launch.
             What script records:
                 All the typing activity and screen I/O is recorded once the script command is given. Content is saved in a default file
                 named ‘typescript’, or in additional files if desired.

             Security and audit implications:
                 Using script is quick and easy, but script is easy to circumvent, and so is difficult to enforce reliably. For example, one
                 can bypass it simply by deleting the output typescript file, or by exiting out of the script session.

                 Additionally, script only displays interactive activity. It does not detail what might be taking place underneath the
                 hood in system calls or processes spawned by an interactive command.




                                                                     Screenshot: recording started by typing in ‘script’

             When to use script:
                 The best and most common use for script is to record and audit your own sessions. This is due to the fact that it is
                 cumbersome to configure it as a reliable security auditing tool for other users. Other methods described below are
                 better suited for monitoring other users.




Copyright © 2011 ObserveIT. All rights reserved.
All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only.   www.observeit.com
WHITEPAPER                                                                                                                                                          3




        Scenario 2: Auditing Using screen(1)
             How screen is setup and started:
                 ‘screen’ is not provided with Linux or Solaris 10 by default, but can be downloaded and installed easily. As with sudo
                 and script above, screen is not a dedicating auditing tool: Its original purpose is to be used as a multiplexing tool to
                 connect various users to one session for collaboration. However, this very concept can be used for auditing as well.




                                                                                  Launching screen after login

                 Screen can be combined with SSH to force launching of screen immediately upon login, by creating an entry in
                 authorized_keys: (Edit authorized_keys, determine whether there is any screen executable and associate it with the
                 screen script.) In the example below, the script called ‘wrapper’ is used for this purpose.




                                                          Script named ‘wrapper’ uses screen to record what the user types

             What screen records:
                 In the example configuration above, whenever the user enters any command, the command is run through the
                 ‘wrapper’ script as an invariant variable
                 ‘SSH_ORIGINAL_COMMAND’, and is logged by screen.                             The main purpose of screen -x is
                                                                                                                                  TIP!
                                                                                                                                            for collaboration. So be sure to
             Security and audit implications:
                                                                                                                                            launch it in read-only mode when
                 Screen allows live monitoring of user activity, without buffering. It                                                      viewing or recording sessions.
                 allows you to connect to the session from another session, with the
                 second window exactly duplicating the original. However, it must be
                 used in read only mode otherwise the second window will reflect typing in the original window and the user will
                 become aware that of the auditing activity in real-time.

                 You can also disconnect from the session without terminating it, and return to it later.

                 The live monitoring and the disconnect/reconnect abilities make screen an improvement over script. But similar to
                 script, screen does not record internals (spawned processes / commands). Only the interactive session is logged.

                 An SSH key can be used to login to the session to authenticate that screen is running.




Copyright © 2011 ObserveIT. All rights reserved.
All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only.   www.observeit.com
WHITEPAPER                                                                                                                                                          4




                                                                Live monitoring: first screen duplicated in second screen

             When to use screen:
                 Screen is best for auditing purposes that require interactive collaboration. For example when the user knows that s/he
                 is being monitored and the auditor provides feedback on actions being done within the session. Screen bridges a gap
                 between a subset of security audit requirements and user training requirements.

        Scenario 3: Auditing using sudo
             How sudo auditing is setup and started:
                 As we all know, sudo is not an auditing tool by nature. Its core purpose is for enabling non-root users to run root
                 commands. But sudo can be used for auditing as well, by configuring it to record the session and store it.

                 ‘sudo’ comes preinstalled in Solaris 11 [sudo(1M)] and Linux [sudo(8)], and can be easily downloaded for installation in
                 Solaris 10 via OpenCSW. (ex: pkgadd -d http://get.opencsw.org/now and /opt/csw/bin/pkgutil -i screen sudo)

             What sudo can record:
                 sudo can record the entire interactive session by                                                   Use the runas and group parameters on
                                                                                                           TIP!
                 logging all the commands used, and can store the                                                    sudoreplay to filter commands that were not
                 session info in a home directory or remote machine,                                       asd
                                                                                                                     run as root (or were run as a specific user).
                 for future viewing/auditing.

             Security and audit implications:
                 The entire session can be replayed later in both normal and fast forward modes, using sudoreplay. This shows exactly
                 what happened in the session and also shows who the specific user was. However, you cannot see the underlying
                 system calls and you also do not get information about whether each command succeeded, unless there is explicit
                 screen output that says so.

                 More importantly, sudo bash can be used to bypass sudo (or ‘fool’ the audit), so it is not entirely reliable.

             When to use sudo:
                 This method is very effective for answer the question ‘Who is using / abusing sudo’. In other words, if you have specific
                 issue only surrounding root activity of non-root users, then sudo is effective. If you need a more holistic audit that also
                 covers actions of normal users, you’ll need to merge multiple audit sources.




Copyright © 2011 ObserveIT. All rights reserved.
All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only.   www.observeit.com
WHITEPAPER                                                                                                                                                            5




        Scenario 4: Auditing using the native auditd audit facility
             How auditd is setup and started:
                 The native audit facility is preconfigured in Linux [auditd(8)], but must be configured in Solaris [auditd(1M)]. (The
                 Solaris setup of auditd is not rocket science, but does involve some level of complication.) Configuration of the audit
                 facility can be done via the graphical application under X Windows, via the auditctl utility or directly via configuration
                 file modification.




                                                                          Audit facility configuration in X Windows

                 Once installed, it is easy to use and automatically starts with each user session in Solaris 11 or Linux. Solaris 10 systems
                 will require the machine to be rebooted to go into auditing mode, and configuration will require kernel tweaking.

             What auditd records:
                 The audit facility records data from the kernel, included the                                                   Because the audit facility is easy to turn
                                                                                                                       TIP!
                 system calls, user ID and process ID. It captures all the low-                                                  on and runs automatically, you should
                 level internals with a high level of granular detail. The                                                       avoid huge log files by implementing a
                 information can be stored locally or sent to a central server.                                                  log-file rotation policy from day 1.
                 In Solaris 10, packets are chopped at 1024 bytes. In Solaris
                 11, the packets can be made larger by a plug-in so that
                 information is not lost in chopping.




                                                            Example of information captured using the native audit facility

             Security and Audit Implications:
                 Configuration allows you to determine what events or system calls should be recorded. These are recorded directly
                 from the kernel and are highly-reliable. The events can be tagged so that they are easy to sort through, but the huge
                 amount of data often makes it difficult to locate what you are looking for.



Copyright © 2011 ObserveIT. All rights reserved.
All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only.   www.observeit.com
WHITEPAPER                                                                                                                                                          6




                 Unlike script and screen, auditd will capture the deep internals. However, it has the opposite problem because it does
                 not capture screen I/O. The audit data is of a very technical nature, and does not necessarily state what the user was
                 doing. (i.e. It will show actions spawned within a script, but does not show the script being run or the interactive
                 command launched.)

             When to use auditd:
                 The audit facility is best applied for monitoring of non-interactive activity such as file changes and system
                 configuration changes.

        Scenario 5: Auditing Using ObserveIT
             How ObserveIT is setup and started:
                 ObserveIT is a commercial product that runs as an agent intercepting all interactive session activity. Once installed, it
                 generates log data and delivers that content to an application server. It monitors all activity automatically, starting
                 from the initial login of the user session.

             What ObserveIT records:
                 ObserveIT collects interactive activity (text I/O) along with kernel data (spawned system calls / commands). ObserveIT
                 provides a full audit review web console, which allows for video-style replay of user sessions as well as detailed audit
                 drill-down into the system call kernel data. In the ObserveIT window, any user session can be viewed or replayed, and
                 current sessions can be monitored in real-time.

                 In the example below, an interactive user ‘brad’ logged in and typed ‘rm –r do*’ to delete the documents directory.




                       User typed ‘rm -r do*’ and deleted the documents directory                                        ObserveIT shows I/O as well as system calls

                 ObserveIT captured the interactive command (rm –r do*) and also the internal commands (the actual filenames
                 deleted, for example.)

             Security and audit implications:
                 ObserveIT links the system calls to the actions in the interactive session, and therefore gives a more bulletproof audit
                 review. ObserveIT generates the video and metadata logs, and also provides the platform for actually searching or
                 navigating within the audit data. This platform includes automated reporting and alerts across any number of Linux or
                 Solaris machines. (The audit database can also include non-Unix/Linux machines such as Windows servers or
                 desktops, if necessary.) Beyond security audits, ObserveIT can also for used for troubleshooting.

             When to use ObserveIT:
                 ObserveIT is best applied when ‘the whole picture’ is necessary.

                 This more complete picture is applicable for highly-regulated audit requirements where massive log data alone is
                 insufficient. (ex: PCI security regulations, HIPAA, internal security regulations for highly-sensitive data applications,
                 etc.)



Copyright © 2011 ObserveIT. All rights reserved.
All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only.   www.observeit.com
WHITEPAPER                                                                                                                                                            7




                          Searching for commands related to documents directory                                        Video-like replay of user interactive session



        Conclusion
                 As with most matters in Linux and Solaris, there are many ways to achieve user activity audit information. When
                 choosing a desired method, it is important to weigh the various benefits that each method provides. For a simple view
                 into highly-managed processes, script and screen can be extended to expose user actions. For issues specifically
                 related to privileged use, sudo can be hacked to capture audit data. For configuration monitoring, the native auditd
                 facility can capture clear file and system changes. ObserveIT provides a more holistic audit that generates logs for any
                 user (root, sudo, named user) which include interactive I/O plus underlying system internals. This more complete
                 picture is applicable for highly-regulated audit requirements where massive log data alone is insufficient. (ex: PCI
                 security regulations, HIPAA, internal security regulations for highly-sensitive data applications, etc.)




Copyright © 2011 ObserveIT. All rights reserved.
All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only.     www.observeit.com
WHITEPAPER                                                                                                                                                          8




        About the Author
                 Cyril is co-founder of Grigale Ltd, a Solaris and Linux consulting firm. Cyril Plisko is a well-known UNIX expert, with
                 vast system administration and kernel development background. He has rich experience in enterprise storage and
                 network solution design as well as performance analysis and tuning for both small and large system configurations.

                 Cyril is a long-time member of the Solaris community and a technical leader of the Polaris project, as well as Bluetooth
                 stack and Device Mapper projects. He is a Sun-Certified Instructor and is the proud carrier of OpenSolaris Contributor
                 Agreement #OS0001.

                 During the rare times that he is not hacking, Cyril is most likely to be found at sea, at the helm of a yacht.

                 Cyrl can be reached at cyril.plisko@grigale.com.




        About ObserveIT
                 ObserveIT User Activity Monitoring software meets the complex compliance and security challenges related to user
                 activity auditing, one of the key issues that IT, Security and Compliance officers are facing today.

                 ObserveIT acts like a security camera on your servers, generating audit logs and video recording of every action the
                 user performs. ObserveIT captures all activity, even for applications that do not produce their own internal logs. Every
                 action performed by remote vendors, developers, sysadmins and business users is tied to a video recording, providing
                 bulletproof forensic evidence.

                 ObserveIT is the ideal solution for 3rd Party Vendor Monitoring, and PCI/HIPAA/SOX/ISO Compliance Accountability.

                 Founded in 2006, ObserveIT has a worldwide customer base of Global 2000 companies that spans many industry
                 segments including finance, healthcare, manufacturing, telecom, government and IT services.


                                                                                                     For more information, please contact ObserveIT at:
                                                                                                     www.observeit.com
                                                                                                     sales@observeit.com
                                                                                                     US Phone: 1-800-687-0137
                                                                                                     Int’l Phone: +972-3-648-0614




Copyright © 2011 ObserveIT. All rights reserved.
All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only.   www.observeit.com

More Related Content

PDF
ObserveIT Brochure - Like a Security Camera on your Servers
PDF
How to not disable SELinux
PDF
The SElinux Notebook :the foundations - Vol 1
PPT
Joanna Rutkowska Subverting Vista Kernel
PDF
OSMC 2009 | Windows monitoring - Going where no man has gone before... by Mic...
PDF
Droidcon it 2015: Android Lollipop for Enterprise
PDF
Understanding SELinux For the Win
ObserveIT Brochure - Like a Security Camera on your Servers
How to not disable SELinux
The SElinux Notebook :the foundations - Vol 1
Joanna Rutkowska Subverting Vista Kernel
OSMC 2009 | Windows monitoring - Going where no man has gone before... by Mic...
Droidcon it 2015: Android Lollipop for Enterprise
Understanding SELinux For the Win

What's hot (20)

PPTX
[Wroclaw #3] Trusted Computing
PDF
MR201406 A Re-introduction to SELinux
PPTX
Server Hardening Primer - Eric Vanderburg - JURINNOV
PPTX
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
PPTX
Security Onion Conference - 2016
ODP
SELinux Basic Usage
PDF
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!
PDF
SCAP for openSUSE
PPT
Learning AOSP - Android Booting Process
PDF
Oracle11g On Fedora14
PDF
Mitigating Java Deserialization attacks from within the JVM
PDF
SANS Windows Artifact Analysis 2012
PDF
Android Boot Time Optimization
PPT
TechMentor Fall, 2011 - Packaging Software for Automated Deployment with Wind...
PPT
Technology to Stop Hackers
ODP
Monitoring at/with SUSE 2015
PPT
Android booting sequece and setup and debugging
PDF
BlueHat v18 || First strontium uefi rootkit unveiled
PPTX
Android Booting Sequence
[Wroclaw #3] Trusted Computing
MR201406 A Re-introduction to SELinux
Server Hardening Primer - Eric Vanderburg - JURINNOV
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Security Onion Conference - 2016
SELinux Basic Usage
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!
SCAP for openSUSE
Learning AOSP - Android Booting Process
Oracle11g On Fedora14
Mitigating Java Deserialization attacks from within the JVM
SANS Windows Artifact Analysis 2012
Android Boot Time Optimization
TechMentor Fall, 2011 - Packaging Software for Automated Deployment with Wind...
Technology to Stop Hackers
Monitoring at/with SUSE 2015
Android booting sequece and setup and debugging
BlueHat v18 || First strontium uefi rootkit unveiled
Android Booting Sequence
Ad

Viewers also liked (20)

PDF
2009-08-24 The Linux Audit Subsystem Deep Dive
PDF
The Linux Audit Framework
PDF
Case Study - System Access Audit Compliance at The Center to Promote HealthCa...
PPTX
Insider Threat Law: Balancing Privacy and Protection
PPTX
ObserveIT Version 6.7 Release Highlights
PPTX
Observe it v67 webinar v5
PDF
Protecting confidential files using SE-Linux
PDF
SHOWDOWN: Threat Stack vs. Red Hat AuditD
PDF
Linux audit framework
PDF
How To Train Your Python
PPT
Open Audit
PDF
Bringing Infosec Into The Devops Tribe: Q&A With Gene Kim and Pete Cheslock
PDF
Dealing with Linux Malware
PPTX
Everyone Matters In Infosec 2014
PDF
Python build your security tools.pdf
PDF
MySQL Day Paris 2016 - MySQL Enterprise Edition
PDF
2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview
PDF
Network Security and Analysis with Python
PDF
Linux Security Scanning with Lynis
PDF
Handling of compromised Linux systems
2009-08-24 The Linux Audit Subsystem Deep Dive
The Linux Audit Framework
Case Study - System Access Audit Compliance at The Center to Promote HealthCa...
Insider Threat Law: Balancing Privacy and Protection
ObserveIT Version 6.7 Release Highlights
Observe it v67 webinar v5
Protecting confidential files using SE-Linux
SHOWDOWN: Threat Stack vs. Red Hat AuditD
Linux audit framework
How To Train Your Python
Open Audit
Bringing Infosec Into The Devops Tribe: Q&A With Gene Kim and Pete Cheslock
Dealing with Linux Malware
Everyone Matters In Infosec 2014
Python build your security tools.pdf
MySQL Day Paris 2016 - MySQL Enterprise Edition
2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview
Network Security and Analysis with Python
Linux Security Scanning with Lynis
Handling of compromised Linux systems
Ad

Similar to Whitepaper: User Audit Options for Linux and Solaris (20)

PDF
System Hardening Using Ansible
PPTX
Static code analysis
PDF
Pentesting iOS Apps
PDF
Top 9 DevOps Tools: Which DevOps Tool Should I Learn
PPT
Chapter 09
PPTX
InfrastructureDevOps.pptx it is most sui
PDF
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
PDF
Sa No Scan Paper
PPTX
Drupal Continuous Integration with Jenkins - Deploy
PPT
Windows Vista and Trust Worthy Computing
PPTX
I hunt sys admins 2.0
PDF
Escape the defaults - Configure Sling like AEM as a Cloud Service
PPT
Free tools for win server administration
PDF
PuppetConf 2016: Watching the Puppet Show – Sean Porter, Heavy Water Operations
PDF
Ubuntu Core 技术详解
PDF
开放原码手机操作系统 Ubuntu Phone 架构、移植与刷机
PDF
Salt conf 2014 - Using SaltStack in high availability environments
PDF
DevOps: Continuous Delivery and Windows Azure
PDF
DevOps: Continuous Delivery and Windows Azure
PDF
Dev ops: Continuous delivery and Windows Azure
System Hardening Using Ansible
Static code analysis
Pentesting iOS Apps
Top 9 DevOps Tools: Which DevOps Tool Should I Learn
Chapter 09
InfrastructureDevOps.pptx it is most sui
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Sa No Scan Paper
Drupal Continuous Integration with Jenkins - Deploy
Windows Vista and Trust Worthy Computing
I hunt sys admins 2.0
Escape the defaults - Configure Sling like AEM as a Cloud Service
Free tools for win server administration
PuppetConf 2016: Watching the Puppet Show – Sean Porter, Heavy Water Operations
Ubuntu Core 技术详解
开放原码手机操作系统 Ubuntu Phone 架构、移植与刷机
Salt conf 2014 - Using SaltStack in high availability environments
DevOps: Continuous Delivery and Windows Azure
DevOps: Continuous Delivery and Windows Azure
Dev ops: Continuous delivery and Windows Azure

More from ObserveIT (20)

PPTX
How to Implement an Insider Threat Program
PPTX
You've caught an Insider Threat, now what? The Human Side of Insider Threat I...
PPTX
Phish, Spoof, Scam: Insider Threats, the GDPR & Other Regulations
PPTX
ObserveIT Webinar: Privileged Identity Management
PPTX
ObserveIT Customer Webcast: AIG Pioneers User-Centric Security Strategy
PPTX
Cloud Security Allianz Webinar
PPTX
ObserveIT - Unintentional Insider Threat featuring Dr. Eric Cole
PPTX
Insider Threat Summit - The Future of Insider Threat Detection
PPTX
Why Insider Threat is a C-Level Priority
PDF
How to Build an Insider Threat Program in 30 Minutes
PPTX
Insider Threats: Out of Sight, Out of Mind?
PPTX
Prevent Insider Threats with User Activity Monitoring
PPTX
Ins and outs of ObserveIT
PPTX
Super User or Super Threat?
PPTX
Data Protection Webinar
PPTX
User Activity Monitoring: Identify and Manage the Risk of Your Users - ISACA ...
PDF
Xerox: Improving Data & App Security
PPTX
2014: The Year of the Data Breach
PPTX
3 steps to 4x the risk coverage of CA ControlMinder
PDF
3 Tips for Managing Risky User Activity in 2015
How to Implement an Insider Threat Program
You've caught an Insider Threat, now what? The Human Side of Insider Threat I...
Phish, Spoof, Scam: Insider Threats, the GDPR & Other Regulations
ObserveIT Webinar: Privileged Identity Management
ObserveIT Customer Webcast: AIG Pioneers User-Centric Security Strategy
Cloud Security Allianz Webinar
ObserveIT - Unintentional Insider Threat featuring Dr. Eric Cole
Insider Threat Summit - The Future of Insider Threat Detection
Why Insider Threat is a C-Level Priority
How to Build an Insider Threat Program in 30 Minutes
Insider Threats: Out of Sight, Out of Mind?
Prevent Insider Threats with User Activity Monitoring
Ins and outs of ObserveIT
Super User or Super Threat?
Data Protection Webinar
User Activity Monitoring: Identify and Manage the Risk of Your Users - ISACA ...
Xerox: Improving Data & App Security
2014: The Year of the Data Breach
3 steps to 4x the risk coverage of CA ControlMinder
3 Tips for Managing Risky User Activity in 2015

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
Teaching material agriculture food technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Empathic Computing: Creating Shared Understanding
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Chapter 3 Spatial Domain Image Processing.pdf
Understanding_Digital_Forensics_Presentation.pptx
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Teaching material agriculture food technology
MIND Revenue Release Quarter 2 2025 Press Release
“AI and Expert System Decision Support & Business Intelligence Systems”
Empathic Computing: Creating Shared Understanding
sap open course for s4hana steps from ECC to s4
Programs and apps: productivity, graphics, security and other tools
Spectral efficient network and resource selection model in 5G networks
Reach Out and Touch Someone: Haptics and Empathic Computing

Whitepaper: User Audit Options for Linux and Solaris

  • 1. WHITEPAPER Options for User Auditing on Linux and Solaris Platforms Cyril Plisko, CTO of Grigale Ltd. January 2012 Like a Security Camera on Your Servers!
  • 2. WHITEPAPER 2 Executive Summary A variety of methods exist for auditing user activity in UNIX and Linux environments. Some of them come preinstalled within common distributions, some can be downloaded as freeware, and some are commercially available products. This whitepaper looks at the most popular methods for auditing. Each method is described, along with tips for how to make the best use of each method. In addition, guidance is provided to show what type of auditing each method is best suited for. The auditing methods covered include:  script  screen  sudo auditing  Native audit facility (auditd, auditctl, etc.)  ObserveIT Scenario 1: Auditing using script(1) How script is setup and started: ‘script’ is a well-known tool used for basic auditing. In many installations, it comes preinstalled. When not, it can be added to any Linux or Solaris environment with no additional configuration is required. Using script will start auditing as soon as a user types the Configure SSH so that script is command ‘script’. TIP! fired immediately upon launch. What script records: All the typing activity and screen I/O is recorded once the script command is given. Content is saved in a default file named ‘typescript’, or in additional files if desired. Security and audit implications: Using script is quick and easy, but script is easy to circumvent, and so is difficult to enforce reliably. For example, one can bypass it simply by deleting the output typescript file, or by exiting out of the script session. Additionally, script only displays interactive activity. It does not detail what might be taking place underneath the hood in system calls or processes spawned by an interactive command. Screenshot: recording started by typing in ‘script’ When to use script: The best and most common use for script is to record and audit your own sessions. This is due to the fact that it is cumbersome to configure it as a reliable security auditing tool for other users. Other methods described below are better suited for monitoring other users. Copyright © 2011 ObserveIT. All rights reserved. All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only. www.observeit.com
  • 3. WHITEPAPER 3 Scenario 2: Auditing Using screen(1) How screen is setup and started: ‘screen’ is not provided with Linux or Solaris 10 by default, but can be downloaded and installed easily. As with sudo and script above, screen is not a dedicating auditing tool: Its original purpose is to be used as a multiplexing tool to connect various users to one session for collaboration. However, this very concept can be used for auditing as well. Launching screen after login Screen can be combined with SSH to force launching of screen immediately upon login, by creating an entry in authorized_keys: (Edit authorized_keys, determine whether there is any screen executable and associate it with the screen script.) In the example below, the script called ‘wrapper’ is used for this purpose. Script named ‘wrapper’ uses screen to record what the user types What screen records: In the example configuration above, whenever the user enters any command, the command is run through the ‘wrapper’ script as an invariant variable ‘SSH_ORIGINAL_COMMAND’, and is logged by screen. The main purpose of screen -x is TIP! for collaboration. So be sure to Security and audit implications: launch it in read-only mode when Screen allows live monitoring of user activity, without buffering. It viewing or recording sessions. allows you to connect to the session from another session, with the second window exactly duplicating the original. However, it must be used in read only mode otherwise the second window will reflect typing in the original window and the user will become aware that of the auditing activity in real-time. You can also disconnect from the session without terminating it, and return to it later. The live monitoring and the disconnect/reconnect abilities make screen an improvement over script. But similar to script, screen does not record internals (spawned processes / commands). Only the interactive session is logged. An SSH key can be used to login to the session to authenticate that screen is running. Copyright © 2011 ObserveIT. All rights reserved. All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only. www.observeit.com
  • 4. WHITEPAPER 4 Live monitoring: first screen duplicated in second screen When to use screen: Screen is best for auditing purposes that require interactive collaboration. For example when the user knows that s/he is being monitored and the auditor provides feedback on actions being done within the session. Screen bridges a gap between a subset of security audit requirements and user training requirements. Scenario 3: Auditing using sudo How sudo auditing is setup and started: As we all know, sudo is not an auditing tool by nature. Its core purpose is for enabling non-root users to run root commands. But sudo can be used for auditing as well, by configuring it to record the session and store it. ‘sudo’ comes preinstalled in Solaris 11 [sudo(1M)] and Linux [sudo(8)], and can be easily downloaded for installation in Solaris 10 via OpenCSW. (ex: pkgadd -d http://get.opencsw.org/now and /opt/csw/bin/pkgutil -i screen sudo) What sudo can record: sudo can record the entire interactive session by Use the runas and group parameters on TIP! logging all the commands used, and can store the sudoreplay to filter commands that were not session info in a home directory or remote machine, asd run as root (or were run as a specific user). for future viewing/auditing. Security and audit implications: The entire session can be replayed later in both normal and fast forward modes, using sudoreplay. This shows exactly what happened in the session and also shows who the specific user was. However, you cannot see the underlying system calls and you also do not get information about whether each command succeeded, unless there is explicit screen output that says so. More importantly, sudo bash can be used to bypass sudo (or ‘fool’ the audit), so it is not entirely reliable. When to use sudo: This method is very effective for answer the question ‘Who is using / abusing sudo’. In other words, if you have specific issue only surrounding root activity of non-root users, then sudo is effective. If you need a more holistic audit that also covers actions of normal users, you’ll need to merge multiple audit sources. Copyright © 2011 ObserveIT. All rights reserved. All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only. www.observeit.com
  • 5. WHITEPAPER 5 Scenario 4: Auditing using the native auditd audit facility How auditd is setup and started: The native audit facility is preconfigured in Linux [auditd(8)], but must be configured in Solaris [auditd(1M)]. (The Solaris setup of auditd is not rocket science, but does involve some level of complication.) Configuration of the audit facility can be done via the graphical application under X Windows, via the auditctl utility or directly via configuration file modification. Audit facility configuration in X Windows Once installed, it is easy to use and automatically starts with each user session in Solaris 11 or Linux. Solaris 10 systems will require the machine to be rebooted to go into auditing mode, and configuration will require kernel tweaking. What auditd records: The audit facility records data from the kernel, included the Because the audit facility is easy to turn TIP! system calls, user ID and process ID. It captures all the low- on and runs automatically, you should level internals with a high level of granular detail. The avoid huge log files by implementing a information can be stored locally or sent to a central server. log-file rotation policy from day 1. In Solaris 10, packets are chopped at 1024 bytes. In Solaris 11, the packets can be made larger by a plug-in so that information is not lost in chopping. Example of information captured using the native audit facility Security and Audit Implications: Configuration allows you to determine what events or system calls should be recorded. These are recorded directly from the kernel and are highly-reliable. The events can be tagged so that they are easy to sort through, but the huge amount of data often makes it difficult to locate what you are looking for. Copyright © 2011 ObserveIT. All rights reserved. All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only. www.observeit.com
  • 6. WHITEPAPER 6 Unlike script and screen, auditd will capture the deep internals. However, it has the opposite problem because it does not capture screen I/O. The audit data is of a very technical nature, and does not necessarily state what the user was doing. (i.e. It will show actions spawned within a script, but does not show the script being run or the interactive command launched.) When to use auditd: The audit facility is best applied for monitoring of non-interactive activity such as file changes and system configuration changes. Scenario 5: Auditing Using ObserveIT How ObserveIT is setup and started: ObserveIT is a commercial product that runs as an agent intercepting all interactive session activity. Once installed, it generates log data and delivers that content to an application server. It monitors all activity automatically, starting from the initial login of the user session. What ObserveIT records: ObserveIT collects interactive activity (text I/O) along with kernel data (spawned system calls / commands). ObserveIT provides a full audit review web console, which allows for video-style replay of user sessions as well as detailed audit drill-down into the system call kernel data. In the ObserveIT window, any user session can be viewed or replayed, and current sessions can be monitored in real-time. In the example below, an interactive user ‘brad’ logged in and typed ‘rm –r do*’ to delete the documents directory. User typed ‘rm -r do*’ and deleted the documents directory ObserveIT shows I/O as well as system calls ObserveIT captured the interactive command (rm –r do*) and also the internal commands (the actual filenames deleted, for example.) Security and audit implications: ObserveIT links the system calls to the actions in the interactive session, and therefore gives a more bulletproof audit review. ObserveIT generates the video and metadata logs, and also provides the platform for actually searching or navigating within the audit data. This platform includes automated reporting and alerts across any number of Linux or Solaris machines. (The audit database can also include non-Unix/Linux machines such as Windows servers or desktops, if necessary.) Beyond security audits, ObserveIT can also for used for troubleshooting. When to use ObserveIT: ObserveIT is best applied when ‘the whole picture’ is necessary. This more complete picture is applicable for highly-regulated audit requirements where massive log data alone is insufficient. (ex: PCI security regulations, HIPAA, internal security regulations for highly-sensitive data applications, etc.) Copyright © 2011 ObserveIT. All rights reserved. All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only. www.observeit.com
  • 7. WHITEPAPER 7 Searching for commands related to documents directory Video-like replay of user interactive session Conclusion As with most matters in Linux and Solaris, there are many ways to achieve user activity audit information. When choosing a desired method, it is important to weigh the various benefits that each method provides. For a simple view into highly-managed processes, script and screen can be extended to expose user actions. For issues specifically related to privileged use, sudo can be hacked to capture audit data. For configuration monitoring, the native auditd facility can capture clear file and system changes. ObserveIT provides a more holistic audit that generates logs for any user (root, sudo, named user) which include interactive I/O plus underlying system internals. This more complete picture is applicable for highly-regulated audit requirements where massive log data alone is insufficient. (ex: PCI security regulations, HIPAA, internal security regulations for highly-sensitive data applications, etc.) Copyright © 2011 ObserveIT. All rights reserved. All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only. www.observeit.com
  • 8. WHITEPAPER 8 About the Author Cyril is co-founder of Grigale Ltd, a Solaris and Linux consulting firm. Cyril Plisko is a well-known UNIX expert, with vast system administration and kernel development background. He has rich experience in enterprise storage and network solution design as well as performance analysis and tuning for both small and large system configurations. Cyril is a long-time member of the Solaris community and a technical leader of the Polaris project, as well as Bluetooth stack and Device Mapper projects. He is a Sun-Certified Instructor and is the proud carrier of OpenSolaris Contributor Agreement #OS0001. During the rare times that he is not hacking, Cyril is most likely to be found at sea, at the helm of a yacht. Cyrl can be reached at cyril.plisko@grigale.com. About ObserveIT ObserveIT User Activity Monitoring software meets the complex compliance and security challenges related to user activity auditing, one of the key issues that IT, Security and Compliance officers are facing today. ObserveIT acts like a security camera on your servers, generating audit logs and video recording of every action the user performs. ObserveIT captures all activity, even for applications that do not produce their own internal logs. Every action performed by remote vendors, developers, sysadmins and business users is tied to a video recording, providing bulletproof forensic evidence. ObserveIT is the ideal solution for 3rd Party Vendor Monitoring, and PCI/HIPAA/SOX/ISO Compliance Accountability. Founded in 2006, ObserveIT has a worldwide customer base of Global 2000 companies that spans many industry segments including finance, healthcare, manufacturing, telecom, government and IT services. For more information, please contact ObserveIT at: www.observeit.com sales@observeit.com US Phone: 1-800-687-0137 Int’l Phone: +972-3-648-0614 Copyright © 2011 ObserveIT. All rights reserved. All trademarks, trade names, service marks and logos referenced herein belong to their respective companies. This document is for informational purposes only. www.observeit.com