From: ramsdell@mitre.org (John D. Ramsdell)
To: Steve Grubb <sgrubb@redhat.com>
Cc: linux-audit@redhat.com
Subject: Re: Should open syscall records occur without a path record?
Date: 24 Jul 2007 08:06:44 -0400 [thread overview]
Message-ID: <ogtlkd6ovjf.fsf@oolong.mitre.org> (raw)
In-Reply-To: <200707231556.12993.sgrubb@redhat.com>
Steve Grubb <sgrubb@redhat.com> writes:
> setroubleshoot is written in python and it sorts its input stream to solve
> this in the mean time. You might look there for some example code.
I was unable to find the relevant code with a quick look, but I didn't
take much time as I knew a short script would to do the trick. I just
sorted on the serial numbers in the audit message. Diff'ing showed
quite a bit of motion in the sorted output. Also, I notice that in
just one message, the msg field value does not end with a colon:
type=DAEMON_START msg=audit(1185203485.586:824) auditd start, ver=1.5.5, format=raw, auid=500 pid=24638 res=success, auditd pid=24638
John
#! /bin/sh
python -E -c '
import sys, re
def main():
pattern = re.compile("\smsg=audit\(\d+\.\d+:(\d+)\):?\s")
for line in sys.stdin:
match = pattern.search(line)
if not match:
sys.stderr.write("cannot parse audit message: '\''%s'\''\n" % line)
sys.exit(1)
sys.stdout.write(match.group(1) + "\t" + line)
if __name__ == "__main__":
main()
' | sort -n -s -k 1 | cut -f 2-
next prev parent reply other threads:[~2007-07-24 12:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 13:09 Should open syscall records occur without a path record? John D. Ramsdell
2007-07-23 13:51 ` Steve Grubb
2007-07-23 14:07 ` John D. Ramsdell
2007-07-23 18:47 ` John D. Ramsdell
2007-07-23 19:00 ` Steve Grubb
2007-07-23 19:41 ` John D. Ramsdell
2007-07-23 19:56 ` Steve Grubb
2007-07-24 12:06 ` John D. Ramsdell [this message]
2007-07-24 21:30 ` 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=ogtlkd6ovjf.fsf@oolong.mitre.org \
--to=ramsdell@mitre.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox