mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: Paul Moore <pmoore@redhat.com>
Cc: peter@hda3.com, linux-audit@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V6 1/4] audit: implement audit by executable
Date: Fri, 17 Jul 2015 16:27:23 -0400	[thread overview]
Message-ID: <20150717202723.GA28281@madcap2.tricolour.ca> (raw)
In-Reply-To: <20150717153317.GH32473@madcap2.tricolour.ca>

On 15/07/17, Richard Guy Briggs wrote:
> On 15/07/16, Paul Moore wrote:
> > On Tuesday, July 14, 2015 11:50:23 AM Richard Guy Briggs wrote:
> > > From: Eric Paris <eparis@redhat.com>
> > > 
> > > This patch implements the ability to filter on the executable.  It is
> > > clearly incomplete!  This patch adds the inode/dev of the executable at
> > > the moment the rule is loaded.  It does not update if the executable is
> > > updated/moved/whatever.  That should be added.  But at this moment, this
> > > patch works.

<snip>

> > > diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> > > index 9fb9d1c..bf745c7 100644
> > > --- a/kernel/auditsc.c
> > > +++ b/kernel/auditsc.c
> > > @@ -71,6 +72,7 @@
> > >  #include <linux/capability.h>
> > >  #include <linux/fs_struct.h>
> > >  #include <linux/compat.h>
> > > +#include <linux/sched.h>
> > >  #include <linux/ctype.h>
> > >  #include <linux/string.h>
> > >  #include <uapi/linux/limits.h>
> > > @@ -466,6 +468,20 @@ static int audit_filter_rules(struct task_struct *tsk,
> > >  				result = audit_comparator(ctx->ppid, f->op, f->val);
> > >  			}
> > >  			break;
> > > +		case AUDIT_EXE:
> > > +			result = audit_exe_compare(tsk, rule->exe);
> > > +			break;
> > > +		case AUDIT_EXE_CHILDREN:
> > > +		{
> > > +			struct task_struct *ptsk;
> > > +			for (ptsk = tsk; ptsk->parent->pid > 0; ptsk =
> > >              find_task_by_vpid(ptsk->parent->pid)) {
> > > +				if (audit_exe_compare(ptsk, rule->exe)) {
> > > +					++result;
> > > +					break;
> > > +				}
> > > +			}
> > > +		}
> > > +			break;
> > 
> > I don't completely understand the point of AUDIT_EXE_CHILDREN filter, what 
> > problem are we trying to solve?  It checks to see if there is an executable 
> > match starting with the current process and walking up the process' parents in 
> > the current pid namespace?
> 
> Say we want to monitor /usr/sbin/apache2 and all its spawned processes.
> Set up a rule that uses AUDIT_EXE_CHILDREN with /usr/sbin/apache2, then
> when it spawns a cgi running perl or php, those actions will be caught.
> 
> > Help me understand what this accomplishes, I'm a little tried right now and I 
> > just don't get it.
> 
> This was Peter Moody's idea and it made sense, so we kept it.

Peter, do you have anything to add to justify keeping
AUDIT_EXE_CHILDREN?

> > paul moore
> 
> - RGB

- RGB

--
Richard Guy Briggs <rbriggs@redhat.com>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

  parent reply	other threads:[~2015-07-17 20:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 15:50 [PATCH V6 0/4] audit by executable name Richard Guy Briggs
2015-07-14 15:50 ` [PATCH V6 1/4] audit: implement audit by executable Richard Guy Briggs
2015-07-17  1:18   ` Paul Moore
2015-07-17 15:33     ` Richard Guy Briggs
2015-07-17 18:24       ` Paul Moore
2015-07-17 20:46         ` Richard Guy Briggs
2015-07-20 15:10           ` Paul Moore
2015-07-17 20:27       ` Richard Guy Briggs [this message]
2015-07-14 15:50 ` [PATCH V6 2/4] audit: clean simple fsnotify implementation Richard Guy Briggs
2015-07-17  1:45   ` Paul Moore
2015-08-01 20:03     ` Richard Guy Briggs
2015-07-14 15:50 ` [PATCH V6 3/4] audit: convert audit_exe to audit_fsnotify Richard Guy Briggs
2015-07-17  1:54   ` Paul Moore
2015-07-17  2:02     ` Richard Guy Briggs
2015-07-14 15:50 ` [PATCH V6 4/4] audit: avoid double copying the audit_exe path string Richard Guy Briggs
2015-07-17  1:56   ` Paul Moore
2015-07-17  2:01     ` Richard Guy Briggs
2015-07-17  2:42       ` Paul Moore
2015-07-17  3:01       ` Eric Paris
2015-07-17  3:24         ` Paul Moore
2015-07-17 16:48           ` Richard Guy Briggs
2015-07-17 18:09             ` Paul Moore
2015-07-17 16:18         ` Richard Guy Briggs
2015-07-17 18:01           ` Paul Moore
2015-07-15 12:28 ` [PATCH V6 0/4] audit by executable name Steve Grubb
2015-07-15 18:23   ` Richard Guy Briggs

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=20150717202723.GA28281@madcap2.tricolour.ca \
    --to=rgb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@hda3.com \
    --cc=pmoore@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®