Linux-audit Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: Roi Martin <nibble.ds@gmail.com>
Cc: linux-audit@redhat.com
Subject: Re: Monitoring of linux containers
Date: Thu, 3 Sep 2015 01:38:23 -0400	[thread overview]
Message-ID: <20150903053823.GG22102@madcap2.tricolour.ca> (raw)
In-Reply-To: <CAK-N_m9askC0ytS=WwutYRGb5PD_esjxw6CncoMip90PsLGRdw@mail.gmail.com>

On 15/09/02, Roi Martin wrote:
> Hello,

Hi Roi,

> First, let me give you a bit of context about what we are trying to do.
> Basically, we are working on a monitoring solution for linux containers
> based on audit. The idea is logging all the syscalls executed within
> certain container and take metrics, that are compared with a baseline in
> order to find anomalies on the executed services. For instance, take as
> example a micro-service running within a container, if suddenly we see a
> clone, followed by an execve of "/bin/sh", this should be detected and
> actions would be taken automatically.
> 
> The thing is that to accomplish this, we need to create an audit rule that
> allows to filter only those system calls executed in the context of the
> monitored containers. For this, I can think on two possible ways:
> 1. By PID: Creating a rule like "filter all the syscalls executed by the
> process with PID X and all its current and future children".

A general problem with filtering on PID X is that currently is keyed on
a number, which can roll.  Reaping the rule when that process terminates
(and all its children) might be one way to do it, but that is not
currently implemented.

> 2. By namespace: It would be great to be able to create a rule that filters
> all the syscalls executed under a given list of namespaces, in this case,
> those corresponding to the monitored container.

Agreed!  A number of people have been thinking about this problem.  The 
problem is how to define a container and how to track a namespace.
There have been a number of patches submitted in the last couple of
years to try to address this, but discussion and development are still
on-going.

> But, after reading the audit's documentation, looks like right now any of
> these options are supported without applying some unofficial patch.
> 
> A work-around would be to automatically add a new rule per new child, but
> the new processes wouldn't be monitoring the time since its start until the
> creation the rule, causing race conditions (creation of a new child, that
> would not be detected, etc.)
> 
> Are you aware of some other option that would allow what we need?

Not yet, but that problem definitely needs to be solved, so please keep
the conversation going.

One goal is to be able to run an audit daemon in a container, isolated
from the master audit daemon on the system.  It would be able to monitor
activity in that container and any other containers spawned by it, but
not be able to change the configuration of any that are containing it.

> Thanks in advance.
> 
> Regards,
> Roi

> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit


- 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

      reply	other threads:[~2015-09-03  5:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 21:46 Monitoring of linux containers Roi Martin
2015-09-03  5:38 ` Richard Guy Briggs [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=20150903053823.GG22102@madcap2.tricolour.ca \
    --to=rgb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=nibble.ds@gmail.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