LinuxQuestions.org
Help answer threads with 0 replies.
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 06-22-2010, 08:15 AM   #1
listreq
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Rep: Reputation: 0
Auditd Configuration


Hi All;

I need watch to write/read operations from all directorys in root(/), but not watch /proc and /dev paths?

How to configure /etc/audit/audit.rules file for this action?

Thanks,
Best Regards
 
Old 06-22-2010, 10:23 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
Welcome to LQ. Hope you like it here.


Did you read man 'audit.rules'?
Have you checked CAPP / NISPOM / et cetera rulesets available on your system to get an idea about how to write rules?
What have rules you tried?
Can you post those examples?
Did you read 'man auditctl'? (The "-w path" explanation wrt inserting watches at the top level directory should be a hint.)
 
Old 06-22-2010, 01:16 PM   #3
listreq
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
Welcome to LQ. Hope you like it here.


Did you read man 'audit.rules'?
Have you checked CAPP / NISPOM / et cetera rulesets available on your system to get an idea about how to write rules?
What have rules you tried?
Can you post those examples?
Did you read 'man auditctl'? (The "-w path" explanation wrt inserting watches at the top level directory should be a hint.)
Thank you for your delicacy.

Example, i write this rule to audit.rules file; with -w parameter:

-w /home -p w -k WriteProcess
-w /home -p r -k ReadProcess

This is running, but this technic require write all directory names(listed all top directory names from top level root directory).

Example: /home, /etc, /opt ...

But yet, i need this directory names automatically watch with audit daemon. If adding directory to system, this directory not watching(if not adding manually).

e.g. -> user added directory to /testing(mkdir /testing). At work, not watch write permissions, because not defined to audit.rules file.

I have try -W parameter, for remove a watch from watching list after watch root directory with -w. But, not working?

-w / -p w
-W /proc

Quote:
man auditctl:
-W path
Remove a watch for the file system object at path.
Hope i explain to.

Thank you.

// EDIT: Sorry for my bad english.

Last edited by listreq; 06-22-2010 at 01:18 PM.
 
Old 06-23-2010, 06:08 AM   #4
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 listreq View Post
this technic require write all directory names (listed all top directory names from top level root directory). (..) But yet, i need this directory names automatically watch with audit daemon. If adding directory to system, this directory not watching (if not adding manually). e.g. -> user added directory to /testing(mkdir /testing). At work, not watch write permissions, because not defined to audit.rules file.
Top level directories aren't added commonly and don't change (nor should they) so you could use 'find / -maxdepth 1 -type d -iname "[a-z]*" | egrep -ve "^/(media|selinux|dev|sys|proc|lost\+found)"|while read TOPDIR; do echo auditctl -w "${TOPDIR}" -p w -k write_${TOPDIR//\//}; done'. With respect to a user adding a directory to /testing (say /testing/username) watches are recursive, so they should be picked up. Let me know if they aren't.


Quote:
Originally Posted by listreq View Post
I have try -W parameter, for remove a watch from watching list after watch root directory with -w. But, not working?
Best give auditctl the full command line. So if you used "-w /home -p w -k WriteProcess" then try "-W /home -p w -k WriteProcess". If that doesn't work then try reloading the Auditd service. That's not elegant but unless you wrote your rules to /etc/audit/audit.rules that should work. If you did write your rules to /etc/audit/audit.rules then comment out the "wrong" rules and then restart the Auditd service.
 
Old 06-23-2010, 02:14 PM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
This thread has been moved to "Security" so that it may get the exposure it deserves.

Sasha
 
Old 06-28-2010, 02:25 AM   #6
listreq
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
Top level directories aren't added commonly and don't change (nor should they) so you could use 'find / -maxdepth 1 -type d -iname "[a-z]*" | egrep -ve "^/(media|selinux|dev|sys|proc|lost\+found)"|while read TOPDIR; do echo auditctl -w "${TOPDIR}" -p w -k write_${TOPDIR//\//}; done'. With respect to a user adding a directory to /testing (say /testing/username) watches are recursive, so they should be picked up. Let me know if they aren't.



Best give auditctl the full command line. So if you used "-w /home -p w -k WriteProcess" then try "-W /home -p w -k WriteProcess". If that doesn't work then try reloading the Auditd service. That's not elegant but unless you wrote your rules to /etc/audit/audit.rules that should work. If you did write your rules to /etc/audit/audit.rules then comment out the "wrong" rules and then restart the Auditd service.
Thank you for your reply.

I think easyl configuration for full disk watching; but not. Okay, all directory names adding to rules file; and maybe follow new directory names add to system.

Thank You
Best Regards
 
  


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
Interfacing with the Auditd scourge99 Linux - Kernel 6 07-08-2009 07:23 PM
auditd: auditd startup failed cmschube Red Hat 2 05-11-2009 07:08 AM
Linux auditd configuration papasj Linux - Security 1 04-29-2007 03:57 AM
auditd and laus kronixx Red Hat 0 07-15-2005 05:33 PM
Help with crond and auditd pfaendtner Linux - Software 4 04-25-2005 10:41 AM

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

All times are GMT -5. The time now is 07:56 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