From: Keith Kaple <kak@cisco.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: linux-audit@redhat.com
Subject: Re: open() syscall and success=0 question
Date: Tue, 13 May 2008 10:36:58 -0400 [thread overview]
Message-ID: <20080513143657.GC4939@cisco.com> (raw)
In-Reply-To: <200805131024.42025.sgrubb@redhat.com>
Thanks Steve,
Can you ellaborate a little on EPERM vs. EACCES?
Say a normal user tries to cp /etc/passwd and gets "permission denied" in the shell, will exit=-EPERM or -EACCESS?
I assume there will be an entry for both if perhaps success=0 alone is used..
Keith
On Tue, May 13, 2008 at 10:24:41AM -0400, Steve Grubb wrote:
> On Tuesday 13 May 2008 10:13:53 Keith Kaple wrote:
> > When open fails, the open() manpage says it will return -1 so that will make
> > success false or 0. When success is false, auditd seems to use the negated
> > value of ERRNO to populate the exit= field, is that correct?
>
> This is actually done by the kernel, not auditd. But you are correct.
>
> > So a rule such as:
> >
> > auditctl -a exit,always -S open -F success=0 -F exit=-13
> >
> > Would log only permission related failures, correct?
>
> Correct. But that can be reduced to:
>
> auditctl -a exit,always -S open -F exit=-EPERM
>
> Syscall rules affect every single syscall made by every program. So, you want
> the rule to be efficient. In this case, checking the success field is
> redundant.
>
> -Steve
--
| |
. | | | . | | | .
' '
C I S C O
GGSG VoIP
next prev parent reply other threads:[~2008-05-13 14:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 14:13 open() syscall and success=0 question Keith Kaple
2008-05-13 14:24 ` Steve Grubb
2008-05-13 14:36 ` Keith Kaple [this message]
2008-05-13 14:46 ` Steve Grubb
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=20080513143657.GC4939@cisco.com \
--to=kak@cisco.com \
--cc=linux-audit@redhat.com \
--cc=sgrubb@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.