|
|
Heads Up: changes in build of userland auditing (adt_* interfaces)
Date: Mon, 07 May 2007 14:53:31 +0200
From: Tomas Zeman <Tomas.Zeman at Sun dot COM>
To: onnv-gate at onnv dot eng dot sun dot com
Subject: Heads Up: changes in build of userland auditing (adt_* interfaces)
If you are not dealing with audit interfaces in userspace (adt_* in
$SRC/lib/libbsm or $SRC/lib/libadt_jni) you can skip this message.
The putback of
6522311 adt_ interfaces need automated build process
simplifies adding new userland audit events (generated via adt_* interfaces).
All source files which were generated manually via a set of AuditMagic scripts
are now generated automatically during the build process. Adt events are
defined via $SRC/lib/libbsm/common/adt.xml file which now includes information
needed for bsmrecord(1m) database. That means that for adt_ events, you no
longer need to edit $SRC/cmd/bsmrecord/audit_record_attr.txt to document format
of the audit record.
Below is detailed description of the changes.
Feel free to contact Audit Core team at audit-core at sun dot com if you need help.
Regards,
Tomas
Overview
There is a set of unofficial scripts AuditMagic [1] which
processes adt.xml file and writes adt_xlate.c and several
libadt_jni java sources.
Those scripts are modularized and imported into ON sources to:
- usr/src/lib/libbsm
- usr/src/lib/libadt_jni
- usr/src/cmd/bsmrecord
adt.xml file is an XML file with the following structure:
specification
|
+ event(id,reorder,header,idNo,omit)
| |
| + altname
| + entry(id)
| |
| + internal(token,order,format)
| + external(opt,type)
|
+ token(id,usage)
|
+ msg_list(id,header,start,public,deprecated)
|
+ msg(id)
Note: the picture above shows an xml tree with tags and attributes
in ().
Central in AuditMagic is an auditxml script which takes several files
and generates appropriate sources:
Input files: Output files:
from AuditMagic: to usr/src/lib/libbsm/common:
adt_jni_eventC.txt adt_xlate.c
adt_xlateC.txt adt_event.h
AuditEventJ.txt
mapfile-vers.txt to usr/src/lib/libadt_jni:
adt_eventH.txt adt_jni_event.c
AuditEvent.java
AuditEvent_*.java
from usr/src/lib/libbsm: mapfile-vers
adt_xml.txt
audit_event.txt
Changes to AuditMagic scripts
1. auditxml script and associated perl packages are modularized so that
each affected component (libbsm, libadt_jni, bsmrecord) has build
scripts in its build directory, using perl packages from libbsm
directory.
2. Perl scripts are fixed to use strict mode to restrict unsafe
operations.
3. adt_xml.txt is renamed to adt.xml and extended with several tags
enabling automatic generation of audit_record_attr file used as
documentation database for bsmrecord(1m). The audit_record_attr file
will then be constructed from a skeleton (audit_record_attr.txt) which
contains non adt_ events (kernel and several applications), comments
etc. and generated documentation for events generated via adt
interfaces. Changes are implemented in audit_record_xml script.
adt.xml extensions:
- event
|
+ title # used as an event title in bsmrecord output
+ program # program(s) which create this event
+ see # reference to manpages or other docs
+ note # a note for this event
- entry
|
+ comment # comment for a token
Build process/Makefiles changes
Changes introduce the following cross-directory dependencies
(for source repository checkout):
usr/src/lib/libadt_jni and usr/src/cmd/bsmrecord
depend on
usr/src/lib/libbsm
The build order/parallelization is not affected, ie. all components can
be built in parallel as they share non-built adt.xml file and perl
packages.
Changes to Makefiles:
Source and header files generation is defined as appropriate target in
Makefiles:
usr/src/lib/libbsm/Makefile
- define generated sources GENSRC and the corresponding rule
- extend clean/clobber target
usr/src/lib/libadt_jni/Makefile
- define generated sources GENSRC and the corresponding rule
- extend clean/clobber target
usr/src/lib/libadt_jni/com/sun/audit/Makefile
- clean/clobber AuditEvent*.java sources
Repository changes and keywords expansion
Auto-generated files are deleted from the source repository as they
will be regenerated on every build.
Generated sources are not part of the repository and are used by C or
Java compilers to create libraries or executables and therefore do not
contain any CDDL and SCCS ident notes.
atd.xml validation
Newly created XML schema definition file adt.xsd defines proper format
of adt.xml file.
Location: usr/src/libbsm/common/adt.xsd
[1] /ws/onnv-gate/public/src/audit/AuditMagic.tar
|