From: ramsdell@mitre.org (John D. Ramsdell)
To: linux-audit@redhat.com
Subject: High-level audit parser module
Date: 16 Jul 2007 14:01:28 -0400 [thread overview]
Message-ID: <ogty7hgns7b.fsf@oolong.mitre.org> (raw)
John,
I'm working on a high-level audit reading Python library built on top
of the auparse module. I suspect it could be made to be useful to
others besides myself. I have enclosed the generated documentation
for the relevant classes in my module.
If you think it could be generally useful, the key question is what
methods should be defined in the AuditEvent and AuditRecord classes.
Some of the current ones are too specific to my needs.
CLASSES
class AuditEvent(__builtin__.list)
| AuditEvent(AuEvent)
|
| An audit event is represented as a list of AuditRecord's. Each
| AuditRecord is a dictionary that represents one of the records
| that make up the event.
|
| Method resolution order:
| AuditEvent
| __builtin__.list
| __builtin__.object
|
| Methods defined here:
|
| __init__(self, timestamp)
|
| find_record_of_type(self, typ)
| Find record of type
|
| Returns a record in the event that has the given type.
| Returns None when there is no such record.
|
| find_value(self, name)
| Find a value
|
| Returns a value associated with the given name in some record
| in the event. Raises KeyError if no field has the given name.
|
| get_timestamp(self)
| Get the timestamp associated with this event.
|
| path_name(self, item)
| Find name and security context in PATH record
|
| Return the name and the security context in a PATH record that
| matches the given item number. Raises KeyError if PATH record
| cannot be found.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from __builtin__.list:
!!! inherited methods omitted !!!
class AuditLog(__builtin__.object)
| AuditLog(AuParser or file, bool)
|
| Encapsulates a log accessed by the auparse module. It provides an
| interator to the log's events. Each call to the next method of
| the interator returns an AuditEvent. The boolean determines if
| numeric entities in fields are interpreted.
|
| Methods defined here:
|
| __init__(self, au, interpret=False)
|
| __iter__(self)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class AuditLogIter(__builtin__.object)
| AuditLogIter(AuditLog)
|
| An iterator for an audit log.
|
| Methods defined here:
|
| __init__(self, aulog)
|
| next(self)
| Returns an AuditEvent
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
class AuditRecord(__builtin__.dict)
| AuditRecord(AuditEvent)
|
| An audit record is a dictionary.
|
| Method resolution order:
| AuditRecord
| __builtin__.dict
| __builtin__.object
|
| Methods defined here:
|
| __init__(self, event)
|
| get_event(self)
| Get the event associated with this record.
|
| path_name_record(self, item)
| Find name and security context in PATH record
|
| Return the name and the security context in a PATH record that
| matches the given item number. Raises KeyError if PATH record
| cannot be found.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from __builtin__.dict:
!!! inherited methods omitted !!!
next reply other threads:[~2007-07-16 18:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-16 18:01 John D. Ramsdell [this message]
2007-08-09 19:42 ` High-level audit parser module John D. Ramsdell
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=ogty7hgns7b.fsf@oolong.mitre.org \
--to=ramsdell@mitre.org \
--cc=linux-audit@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