From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Cc: tianyong1979sh <tianyong1979sh@126.com>
Subject: Re: problem about audit
Date: Tue, 9 Mar 2010 10:53:00 -0500 [thread overview]
Message-ID: <201003091053.00372.sgrubb@redhat.com> (raw)
In-Reply-To: <1cf1fccf.1fac.12740921e36.Coremail.tianyong1979sh@126.com>
On Monday 08 March 2010 08:37:50 pm tianyong1979sh wrote:
> my work is that when user input "getfacl" or "setfacl", whatever
> success or failed, the process of auditd can log this operation
On Linux, ACLs are stored as extended attributes. You can audit success and
failure by using these rules:
-a exit,always -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S
removexattr -S lremovexattr -S fremovexattr
-a exit,always -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S
removexattr -S lremovexattr -S fremovexattr
-a exit,always -F arch=b32 -S getxattr -S lgetxattr -S fgetxattr -S listxattr
-S llistxattr -S flistxattr
-a exit,always -F arch=b64 -S getxattr -S lgetxattr -S fgetxattr -S listxattr
-S llistxattr -S flistxattr
You can also add a -k setfacl and -k getfacl respectively if you wanted. SE
Linux also writes to the xattrs when policy is updated, so you would possible
have that issue, too.
> and the operation type is AUDIT_DAC_CHECHK that is defined in libaudit.h.
That type is meant for applications that do access control. In other words,
suppose an application connects to a local server and the server checks its
access control rules and decides that a connection should be allowed or
rejected. In that case, you would use this type. For any other use, the
generic AUDIT_TRUSTED_APP type is available for anything.
> In order to reach the destination ,i modified the codes in the packets
> of acl-2.2.39 and audit-1.7.7 . Firstly ,i added the function
> audit_log_acct_message() in the file of getfacl.c and setfacl.c in the
> audited place and the function audit_log_acct_message() is in file
> audit_logging.c of the audit-1.7.7. Secondly, i make the the project of
> acl and the result is ok .And i run the object file of getfacl. When the
> user is root,the audit message of getfacl operation can be logged.But when
> the user is normal user,the audit message cann't be logged.
Correct. This is so that unprivileged users and operations cannot spam the
audit logs. Allowing anything to write to the audit system would destroy the
integrity guarantees and reduce it to being another syslog.
> The VAR "errno" value is "Operation not permitted".when i execute the
> command "chmod u+s getfacl" as root. and then the audit message of getfacl
> operation can be logged au normal user. how i can reslove the problem that
> when normal user and normal authority execute the command "getfacl" ,the
> audit system still can log the operation?????
You would need to make the application setuid root or if your OS supports file
system based capabilities, then you can grant CAP_AUDIT_WRITE to the program.
But, do you really need to alter getfacl and setfacl? We were able to obtain
Common Criteria certification without modifying those apps. Besides, someone
could use another app besides those two to write/read the ACLs. Only watching
the syscalls can provide a complete solution.
-Steve
prev parent reply other threads:[~2010-03-09 15:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-09 1:37 problem about audit tianyong1979sh
2010-03-09 15:53 ` Steve Grubb [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201003091053.00372.sgrubb@redhat.com \
--to=sgrubb@redhat.com \
--cc=linux-audit@redhat.com \
--cc=tianyong1979sh@126.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).