LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-22-2008, 06:40 AM   #1
mccartjd
Member
 
Registered: Apr 2008
Posts: 108

Rep: Reputation: 15
Smile How to Setup Routine Auditing Events


New to Linux so please forgive me. I am using Linux 4, 64bit Enterprise and wanted to know how to setup the auditing aspect of the operating system. The items I wish to audit include failed logins, account lockouts, successful logins, policy changes, increased privlige assignments, account creation, account deletion (basically account management).

My next question is if I setup / configure the policies how do I view the security audits. Is there a interface that is easy to read or do I review a log file and if so where is the output sent?

A million thanks for any help anyone can provide.

John

Last edited by win32sux; 05-19-2008 at 06:51 PM. Reason: Removed ridiculously large font.
 
Old 04-22-2008, 08:42 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Hello ans welcome to LQ. Hope you like it here.


Quote:
Originally Posted by mccartjd View Post
I am using Linux 4, 64bit [SIZE="5"]Enterprise
Maybe you meant something like "Red Hat Enterprise Linux Advanced Workstation release 4" (RHEL AS 4). Being correct and complete helps. While you're at it please don't muck around with font/size unless you're nearly blind or thinking we are :-]


Quote:
Originally Posted by mccartjd View Post
The items I wish to audit include
Most of those point to PAM which logs to syslog (also see 'auditd', 'last', 'lastb', 'faillog') except policy and role changes which point to SELinux (if applicable) which has Auditd log to audit.log or Syslog, else, w/o SELinux: none. You can get (e-mailed) reports with say Logwatch, but audit.log isn't covered by that AFAIK.

Last edited by unSpawn; 04-22-2008 at 08:55 AM.
 
Old 05-15-2008, 03:09 PM   #3
mccartjd
Member
 
Registered: Apr 2008
Posts: 108

Original Poster
Rep: Reputation: 15
Smile RHEL 4 - Auditing, LAuS, SNARE.

1. Although a general user was refused access to write to the hosts file it was not recorded in the Audits

2. General User attempts to kill a process; although the user was refused it was not recorded in the Audits

3. File Created in security relevant directories (/etc); although the user was refused it was not recorded in the Audits

I’m using the GUI Red Hat built in audit program and it is somewhat limited. Is there some way in Red Hat to add additional items to audit? The GUI Audit program, built into RHEL, seems to be pointing to all the logs /var/logs/ but RHEL is just not tracking the above 3 items.

Is SNARE or LAUS a third party auditing tool, I was told SNARE was best.

Thanks
John
 
Old 05-19-2008, 05:22 PM   #4
mccartjd
Member
 
Registered: Apr 2008
Posts: 108

Original Poster
Rep: Reputation: 15
Smile SNARE or Not to SNARE

I'm having a difficult time getting LAuS working via the auditd and auditcntrl found in my /sbin to write to the var/log/audit/audit.log.
I have a audit.rules in my /etc and that's about it. I'm considering using snare to supplment auditd not functioning as designed. I've posted my LAuS anomolies under Newbie.



Has anyone had a bad expierence with SNARE?

FYI, using Red Hat Enterprise Linux 4 Workstation 64bit Kernel 2.6.9-5.Elsmp

Thanks
John
 
Old 05-19-2008, 07:41 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Wrt your three questions you should show the relevant rules in /etc/audit/audit.rules to get a meaningful reply. My ESP-fu is really low today.


Quote:
Originally Posted by mccartjd View Post
I’m using the GUI Red Hat built in audit program and it is somewhat limited.
Please elaborate on the "weak" part?


Quote:
Originally Posted by mccartjd View Post
Is there some way in Red Hat to add additional items to audit?
Sure. I 'vi /etc/audit/audit.rules' or use 'auditctl' directly from the CLI.


Quote:
Originally Posted by mccartjd View Post
The GUI Audit program, built into RHEL, seems to be pointing to all the logs /var/logs/ but RHEL is just not tracking the above 3 items.
Sorry. I don't know that "GUI Audit program".


Quote:
Originally Posted by mccartjd View Post
Is SNARE or LAUS a third party auditing tool,
LAuS and SNARE are not that interchangable or even comparable:
- LAuS is distribution default, SNARE is third party,
- LAuS rules act on and log in the local domain, SNARE rules act on the local domain and log to a SNARE server,
- LAuS has no concept of networking, SNARE follows the client-server paradigm,
- LAuS works with default RHEL and vanilla kernel.org kernels, SNARE needs a kernel patch,
- LAuS is GPL, SNARE agents are GPL but the necessary SNARE server is proprietary software,
- LAuS is part of SuSE and RHEL's Enterprise Linux in their CAPP/EAL4(+?) configuration and certification, AFAIK SNARE is not.


Quote:
Originally Posted by mccartjd View Post
I was told SNARE was best.
Define "best"? And at least tell us who exactly told you that and what his or her qualifications are.

Last edited by unSpawn; 05-19-2008 at 07:52 PM. Reason: Just Because I can
 
Old 05-21-2008, 08:29 AM   #6
mccartjd
Member
 
Registered: Apr 2008
Posts: 108

Original Poster
Rep: Reputation: 15
I got Auditd and the auditing function working; long story short in terminal mode (connected to the internet) typed command, up2date and only updated two packages (up2date and audit). Man do I feel stupid but then I again I'm new at this and very conservative unitll I get a better feel for linux.


Now I am attempting to configure auditing and I have typed the commands:
chkconfg auditd on
chkconfig auditd start

Next I rebooted and for good measure typed auditctl -e 1 to enable audit system calls. It appears all the auditd services are running (typed ps -ef). Logged in as a user (smithers) and attempted to provoke an act I wish to monitor (users who attempt to write to /etc directory but are denied access)

In the /etc/audit.rules file I typed the below:

-w /etc -p wa

Above says report back write and atrribute change permission to /var/log/audit/audit.log?

I logged in as a user and tried to write to the /etc directory and was denied (which is good) but the logs did not reflect my attempt to write to the /etc directory; should I be using a different permission to monitor?
 
Old 05-21-2008, 08:56 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by mccartjd View Post
I logged in as a user and tried to write to the /etc directory and was denied (which is good) but the logs did not reflect my attempt to write to the /etc directory; should I be using a different permission to monitor?
No, permissions look OK. (What I do is always supply a tag with "-k", easier to grep log for.) Wrt logging, IIRC audit.rules is read TTB so rules higher up could block a log lower down. If you've got lotsa rules maybe post your audit.rules and excerpt from audit.log? BTW, also do not forget to react on questions and issues above.
 
Old 05-21-2008, 09:25 AM   #8
mccartjd
Member
 
Registered: Apr 2008
Posts: 108

Original Poster
Rep: Reputation: 15
Below is my audit log /var/log/audit/audit.log:

type=DAEMON_START msg=audit(1211315963.855:5339) auditd start, ver=1.0.15, format=raw, auid=4294967295 res=success, auditd pid=2891
type=KERNEL msg=audit(1211315963.854:0): audit_enabled=1 old=0
type=KERNEL msg=audit(1211372699.654:10387609): audit_enabled=1 old=1
type=KERNEL msg=audit(1211372699.654:10387609): syscall=44 exit=48 a0=3 a1=7fbfff8850 a2=30 a3=0 items=0 pid=6307 loginuid=-1 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0

Below is my Audit rule /etc/audit.rules:
# This file contains the auditctl rules that are loaded
# whenever the audit daemon is started via the initscripts.
# The rules are simply the parameters that would be passed
# to auditctl.

# First rule - delete all
-D

# Increase the buffers to survive stress events
# Make this bigger for busy systems
-b 256

# Feel free to add below this line. See auditctl man page

# Increase the buffers to survive stress events
-b 256
#
-w /var/log/audit/audit.log -p wa -k LOG_audit
-w /etc/ -p wa
-w /etc/shadow -p wa
-w /var/log -p wa

Below is my auditd.conf /etc/auditd.conf:

#
# This file controls the configuration of the audit daemon
#

log_file = /var/log/audit/audit.log
log_format = RAW
priority_boost = 3
flush = INCREMENTAL
freq = 20
num_logs = 4
#dispatcher = /sbin/audispd
#disp_qos = lossy
max_log_file = 5
max_log_file_action = ROTATE
space_left = 75
space_left_action = SYSLOG
action_mail_acct = root
admin_space_left = 50
admin_space_left_action = SUSPEND
disk_full_action = SUSPEND
disk_error_action = SUSPEND


UnSpawn special note in file directly above:
#dispatcher = /sbin/audispd

Should this be commented out and FYI I do not have a audispd located in /sbin/

Thanks
John
 
Old 05-21-2008, 12:28 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Your auditd.conf looks like default. AFAIK audisp isn't crucial, since it's a python script that dispatches audit events to 3rd parties like Prelude, but why you have none in your audit package is beyond me. Your rules file doesn't show any glaring errors except the absence of a trailing slash for the /var/log/ directoryname. I wonder what requirements you followed to get a ruleset like that? Audit packaged CAPP rules says about anything /var/:
Code:
-w /var/log/audit/ -k LOG_audit
-w /var/log/audit/audit.log -k LOG_audit.log
-w /var/spool/cron/root -k CFG_crontab_root
-w /var/log/faillog -p wa -k LOG_faillog
-w /var/log/lastlog -p wa -k LOG_lastlog
-w /var/log/tallylog -p wa -k LOG_tallylog
and I wonder if there's something to say for monitoring the /var/log inode itself or even the *whole* of /var/log/ in terms of performance and false alerts...
BTW, what rules and requirements do you follow to secure this machine?

Last edited by unSpawn; 05-21-2008 at 12:33 PM.
 
Old 05-21-2008, 01:41 PM   #10
mccartjd
Member
 
Registered: Apr 2008
Posts: 108

Original Poster
Rep: Reputation: 15
Per your comment "Your rules file doesn't show any glaring errors except the absence of a trailing slash for the /var/log/ directoryname." good catch and I will correct. As a matter of fact I will remove the reference all together. My main concern is for user activity on the /etc/ directory ensuring they do not attempt to write files to the log and if they attempt to I need to audit this. Maybe explaining that need will help?

Thanks
John
 
Old 05-21-2008, 04:12 PM   #11
mccartjd
Member
 
Registered: Apr 2008
Posts: 108

Original Poster
Rep: Reputation: 15
Here is what I got after typing Save the file and do auditctl -R /etc/audit.rules

[root@localhost ~]# auditctl -R /etc/audit.rules

No rules

File system watches not supported

There was an error in line 4 of /etc/audit.rules

Below is the actual audit.rules file


# This file contains the auditctl rules that are loaded
# whenever the audit daemon is started via the initscripts.
# First rule - delete all
-D
# Feel free to add below this line. See auditctl man page
# Increase the buffers to survive stress events
-b 256
-w /etc/shadow -p wa




My concern is it says File system watches not supported. Is this a Kernel issue?
 
Old 05-21-2008, 05:47 PM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Fix error, then try again.

BTW, also do not forget to react on questions and issues above.
 
Old 01-26-2009, 04:24 PM   #13
legcard
Member
 
Registered: May 2007
Posts: 33

Rep: Reputation: 15
Auditing not reporting activity

I'm not sure if this is still active. I noticed it while looking for something else.

We use a python program/script to read and format our audit logs daily. We have the cron run it and mail the report to root. You can find it at:

http://www.g-loaded.eu/2006/12/20/se...eports-script/

It reports AVC, logins, and account mods by date/time, auid, term and more. I'm not sure if this meets your needs but though that I would suggest it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
obtain uudecode for RHEL 4 Workstation 64bit Kernel 2.6.9.5-ELsmp. mccartjd Linux - Newbie 1 05-12-2008 05:11 PM
RHEL 4 64bit Workstation Allow specifc user Admin Power mccartjd Linux - Newbie 7 05-08-2008 11:35 AM
RHEL 4 64bit Workstation mccartjd Linux - Newbie 3 05-06-2008 06:26 PM
RHEL Workstation and AS | Registration the_gripmaster Red Hat 2 09-13-2006 08:25 AM
Cannot install RHEL workstation 3.0 on VIA C3 architechture anybody1234 Linux - Hardware 2 02-17-2006 04:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration