public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: Paul Moore <paul@paul-moore.com>
Cc: rgb@redhat.com, linux-audit@redhat.com
Subject: Re: [RFC PATCH ghak10 v3 0/3] audit: Log modifying adjtimex(2) calls
Date: Wed, 18 Jul 2018 18:34:37 -0400	[thread overview]
Message-ID: <1858468.tZHkgshBbV@x2> (raw)
In-Reply-To: <CAHC9VhSsXvV1hXDO=63hLosf_Y542rMnubB4sMFGm=Y4EfC2rg@mail.gmail.com>

On Wednesday, July 18, 2018 3:59:24 PM EDT Paul Moore wrote:
> On Wed, Jul 18, 2018 at 3:36 PM Steve Grubb <sgrubb@redhat.com> wrote:
> > On Wednesday, July 18, 2018 2:36:11 PM EDT Paul Moore wrote:
> > > > Changes in v2:
> > > > - The audit_adjtime() function has been modified to only log those
> > > > fields that contain values that are actually used, resulting in more
> > > > compact records.
> > > > - The audit_adjtime() call has been moved to do_adjtimex() in
> > > > timekeeping.c
> > > > - Added an additional patch (for review) that simplifies the
> > > > detection
> > > > if the syscall is read-only.
> > > 
> > > Looking at these new records, and trying to guess a bit at the
> > > original intent of the feature request, I think we may be going a bit
> > > overboard with the information we are logging.  I'm thinking all we
> > > really need to capture in the audit log is the system time both before
> > > and after the change (for the sake of simplicity I suggest using a
> > > data format similar to the audit record timestamp).
> > > 
> > > While I created the GH issue for this, I believe the original request
> > > came from a Red Hat BZ that Steve created; Steve, what sort of
> > > certification requirements (if any?) are there for logging system time
> > > changes?
> > 
> > That we record any attempts to change the system time. The problem is
> > that
> > adjtimex passes a data structure that is opaque to user space. So, we
> > can't tell if someone is setting time, adjusting a tolerance, or simply
> > retrieving status.
> > 
> > With stime, we can clearly see the time that was sent into the kernel and
> > it unconditionally sets time. With settimeofday, it uses a data
> > structure that we cannot see, but whatever the contents are we are
> > definitely setting time. Same goes for clock_settime. Only in 1 case do
> > we actually see what the time is. So, that is not really needed. So, I
> > think what we need to know is did the syscall do anything that adjusted
> > the system's notion of time? And that's all.
> 
> So presumably my above suggestion of simply recording the system time
> both before and after the change would be sufficient, yes?

Well, I think that we need to make it obvious that a time setting has changed 
as in a y/n answer. Doing a comparison of the time to get a y/n answer is 
less obvious if you are doing a grep. Also, what time will the event have? I 
presume that the event will have the new time since we are on the exit 
filter. So, do we really need to collect that?

-Steve

  reply	other threads:[~2018-07-18 22:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 12:44 [RFC PATCH ghak10 v3 0/3] audit: Log modifying adjtimex(2) calls Ondrej Mosnacek
2018-07-03 12:44 ` [RFC PATCH ghak10 v3 1/3] audit: Add AUDIT_TIME_* record types Ondrej Mosnacek
2018-07-03 12:44 ` [RFC PATCH ghak10 v3 2/3] audit: Add functions to log time adjustments Ondrej Mosnacek
2018-07-03 12:44 ` [RFC PATCH ghak10 v3 3/3] timekeeping/ntp: Audit clock/NTP params adjustments Ondrej Mosnacek
2018-07-13 19:21   ` Richard Guy Briggs
2018-07-16  8:15     ` Ondrej Mosnacek
2018-07-16 17:36       ` Richard Guy Briggs
2018-07-18 18:36 ` [RFC PATCH ghak10 v3 0/3] audit: Log modifying adjtimex(2) calls Paul Moore
2018-07-18 19:36   ` Steve Grubb
2018-07-18 19:59     ` Paul Moore
2018-07-18 22:34       ` Steve Grubb [this message]
2018-07-18 23:58         ` Paul Moore
2018-07-19  7:36       ` Ondrej Mosnacek
2018-07-19 23:01         ` Paul Moore

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=1858468.tZHkgshBbV@x2 \
    --to=sgrubb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=rgb@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