All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: "Andrew G. Morgan" <morgan@kernel.org>
Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org,
	viro@ZenIV.linux.org.uk
Subject: Re: [PATCH 3/4] AUDIT: audit when fcaps increase the permitted or inheritable capabilities
Date: Wed, 29 Oct 2008 17:58:39 -0400	[thread overview]
Message-ID: <1225317519.23736.60.camel@localhost.localdomain> (raw)
In-Reply-To: <48FFFA07.3060707@kernel.org>

On Wed, 2008-10-22 at 21:13 -0700, Andrew G. Morgan wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Serge E. Hallyn wrote:
> >>> ... except if (!issecure(SECURE_NOROOT) && uid==0) I guess?
> >>>
> >>> And then it also might be interesting in the case where
> >>> (!issecure(SECURE_NOROOT) && uid==0) and pP is not full.
> >> I guess so, although this seems like a case of being interested in a
> >> (unusual) non-privileged execve().
> > 
> > I'm not sure what you mean - but this can only happen if bits are taken
> > out of the capability bounding set, right?
> 
> Yes, it can happen as you say.
> 
> This is a case of an unprivileged uid==0 execution. Since we don't
> appear to want to audit other non-privileged execve()s, its not clear to
> me that this one deserves attention.

So what did you two agree on for when to collect fcaps type information?
Any time bprm->cap_post_exec_permitted is non-zero?

> >>>>>  	rc = bprm_caps_from_vfs_caps(&vcaps, bprm);
> >>>>>  
> >>>>> +	audit_log_bprm_fcaps(bprm, &vcaps);
> >>>>> +
> >>>> When rc != 0, the execve() will fail. Is it appropriate to log in this case?
> >>> It might fail because fP contains bits not in pP', right?  That's
> >>> probably interesting to auditors.
> >> In which case, how is the fact it didn't execute captured in the audit log?
> > 
> > I assume as a FAIL?  (Not sure of the exact wording in the logs)
> 
> OK. As long as its clearly identified as a failure and the logs are not
> misleading - making it look like the execve() succeeded with privilege -
> then I'm not as concerned.

The syscall record (rather than this auxilary fcaps record) will
indicate that the syscall failed.  it says something like success=no.

WARNING: multiple messages have this Message-ID (diff)
From: Eric Paris <eparis@redhat.com>
To: "Andrew G. Morgan" <morgan@kernel.org>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>,
	linux-kernel@vger.kernel.org, linux-audit@redhat.com,
	sgrubb@redhat.com, viro@ZenIV.linux.org.uk, sgrubb@redhat.com
Subject: Re: [PATCH 3/4] AUDIT: audit when fcaps increase the permitted or inheritable capabilities
Date: Wed, 29 Oct 2008 17:58:39 -0400	[thread overview]
Message-ID: <1225317519.23736.60.camel@localhost.localdomain> (raw)
In-Reply-To: <48FFFA07.3060707@kernel.org>

On Wed, 2008-10-22 at 21:13 -0700, Andrew G. Morgan wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Serge E. Hallyn wrote:
> >>> ... except if (!issecure(SECURE_NOROOT) && uid==0) I guess?
> >>>
> >>> And then it also might be interesting in the case where
> >>> (!issecure(SECURE_NOROOT) && uid==0) and pP is not full.
> >> I guess so, although this seems like a case of being interested in a
> >> (unusual) non-privileged execve().
> > 
> > I'm not sure what you mean - but this can only happen if bits are taken
> > out of the capability bounding set, right?
> 
> Yes, it can happen as you say.
> 
> This is a case of an unprivileged uid==0 execution. Since we don't
> appear to want to audit other non-privileged execve()s, its not clear to
> me that this one deserves attention.

So what did you two agree on for when to collect fcaps type information?
Any time bprm->cap_post_exec_permitted is non-zero?

> >>>>>  	rc = bprm_caps_from_vfs_caps(&vcaps, bprm);
> >>>>>  
> >>>>> +	audit_log_bprm_fcaps(bprm, &vcaps);
> >>>>> +
> >>>> When rc != 0, the execve() will fail. Is it appropriate to log in this case?
> >>> It might fail because fP contains bits not in pP', right?  That's
> >>> probably interesting to auditors.
> >> In which case, how is the fact it didn't execute captured in the audit log?
> > 
> > I assume as a FAIL?  (Not sure of the exact wording in the logs)
> 
> OK. As long as its clearly identified as a failure and the logs are not
> misleading - making it look like the execve() succeeded with privilege -
> then I'm not as concerned.

The syscall record (rather than this auxilary fcaps record) will
indicate that the syscall failed.  it says something like success=no.


  reply	other threads:[~2008-10-29 21:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-20 22:25 [PATCH 0/4] Audit support for file capabilities Eric Paris
2008-10-20 22:25 ` Eric Paris
2008-10-20 22:26 ` [PATCH 1/4] CAPABILITIES: add cpu endian vfs caps structure Eric Paris
2008-10-20 22:26   ` Eric Paris
2008-10-21  5:50   ` Andrew G. Morgan
2008-10-21 13:22     ` Eric Paris
2008-10-21 13:22       ` Eric Paris
2008-10-20 22:26 ` [PATCH 2/4] AUDIT: output permitted and inheritable fcaps in PATH records Eric Paris
2008-10-20 22:26   ` Eric Paris
2008-10-20 22:26 ` [PATCH 3/4] AUDIT: audit when fcaps increase the permitted or inheritable capabilities Eric Paris
2008-10-20 22:26   ` Eric Paris
2008-10-21  5:53   ` Andrew G. Morgan
2008-10-21 19:16     ` Serge E. Hallyn
2008-10-21 19:16       ` Serge E. Hallyn
2008-10-22 12:51       ` Andrew G. Morgan
2008-10-22 14:14         ` Serge E. Hallyn
2008-10-22 14:14           ` Serge E. Hallyn
2008-10-23  4:13           ` Andrew G. Morgan
2008-10-29 21:58             ` Eric Paris [this message]
2008-10-29 21:58               ` Eric Paris
2008-10-30 13:35               ` Serge E. Hallyn
2008-10-30 13:35                 ` Serge E. Hallyn
2008-10-20 22:26 ` [PATCH 4/4] AUDIT: emit new record type showing all capset information Eric Paris
2008-10-20 22:26   ` Eric Paris

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=1225317519.23736.60.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=morgan@kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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.