Skip to contentSkip to conversation

audit 2.3.6 released

DISCUSSION Steve Grubb 2 participants 6 messages Apr 11, 2014 – Apr 23, 2014

lore
Share & tools
lore
#0 lore raw

I've just released a new version of the audit daemon. It can be downloaded from http://people.redhat.com/sgrubb/audit. It will also be in rawhide soon. The ChangeLog is:

- Add an option to auditctl to interpret a0 - a3 of syscall rules when listing
- Improve ARM and AARCH64 support (AKASHI Takahiro)
- Add ausearch --checkpoint feature (Burn Alting)
- Add --arch option to ausearch
- Improve too long config line in audispd, auditd, and auparse (#1071580)
- Fix aulast to accept the new AUDIT_LOGIN record format
- Remove clear_config symbol in auparse

I decided to go ahead and release this one because of some concern about an unintended symbol popping up in the auparse ABI.

This release include a bunch of new stuff. You can now add a '-i' to the listing command of auditctl and it will interpret a0-a3 if they are included in any rules.

There is new support for arm as mentioned in an email a few weeks ago. If you were compiling --with-armeb, you now need to change to --with-arm. Cross compile support is not yet in place.

There is a new checkpoint feature to ausearch. What it does is give you all the events that have occurred since the last checkpoint.

Ausearch now has a --arch search option just in case you needed to find i386 events on a x86_64 machine.

There were a number of cleanups to the code as well.

Please let me know if you run across any problems with this release.

-Steve

#1 lore raw

Steve,

I have identified an edge case with checkpointing where the recorded inode is still a valid inode for one of the /var/log/audit.log* files but the recorded event is not in the identified file.

This is reproduced by performing an ausearch with checkpoint, then generate sufficient audit events such that all the events in the /var/log/audit.log* files are more recent than the checkpointed event. Quite often, one of the audit.log* files will have the same inode as initially recorded in the ausearch checkpoint file.

A patch is attached that addresses this.

Essentially the modification
- notices if we identify an audit.log file to use but we do not find the recorded audit event in that log file and so report an error (to stderr) and return a new exit code (12)
- allows checkpointing to only use the recorded time from the checkpoint file for comparisons.

You will note that the patch also contains changes to swig/audit.py. Although this file is automatically generated, it is part of the 2.3.6 release ... should it be? I also note that a lot of Makefile.in's are also part of the release. Again, should these automatically generated files be part of the release?

Rgds

Quoted 31 lines · Steve Grubb

I've just released a new version of the audit daemon. It can be downloaded from http://people.redhat.com/sgrubb/audit. It will also be in rawhide soon. The ChangeLog is:

- Add an option to auditctl to interpret a0 - a3 of syscall rules when listing
- Improve ARM and AARCH64 support (AKASHI Takahiro)
- Add ausearch --checkpoint feature (Burn Alting)
- Add --arch option to ausearch
- Improve too long config line in audispd, auditd, and auparse (#1071580)
- Fix aulast to accept the new AUDIT_LOGIN record format
- Remove clear_config symbol in auparse

I decided to go ahead and release this one because of some concern about an unintended symbol popping up in the auparse ABI.

This release include a bunch of new stuff. You can now add a '-i' to the listing command of auditctl and it will interpret a0-a3 if they are included in any rules.

There is new support for arm as mentioned in an email a few weeks ago. If you were compiling --with-armeb, you now need to change to --with-arm. Cross compile support is not yet in place.

There is a new checkpoint feature to ausearch. What it does is give you all the events that have occurred since the last checkpoint.

Ausearch now has a --arch search option just in case you needed to find i386 events on a x86_64 machine.

There were a number of cleanups to the code as well.

Quoted 8 lines

Please let me know if you run across any problems with this release.

-Steve

--
Linux-audit mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-audit

docs/ausearch.8 +20 -0
diff -Npru audit-2.3.6/docs/ausearch.8 audit-2.3.6_checkpoint_mods/docs/ausearch.8
@@ -50,6 +50,24 @@ Should the file or checkpointed complete
 will terminate.
 
 .TP
+.BR \-\-checkpoint-time-only
+When checkpointing, this option will only rely upon the checkpoint files' timestamp 
+for comparison. Thus it will ignore inode, device, serial, node and event type.
+
+Essentailly, this is the recovery action should an \fIausearch\fP with a checkpoint fail with an
+exit status of 10, 11 or 12. An appropriate script extract might look like
+.sp
+.nf
+.na
+ausearch --checkpoint /etc/audit/auditd_checkpoint.txt -i
+_au_status=$?
+if test ${_au_status} eq 10 -o ${_au_status} eq 11 -o ${_au_status} eq 12
+then
+	ausearch --checkpoint /etc/audit/auditd_checkpoint.txt --checkpoint-time-only -i
+fi
+.ad
+.fi
+.TP
 .BR \-e,\  \-\-exit \ \fIexit-code-or-errno\fP
 Search for an event based on the given syscall \fIexit code or errno\fP.
 .TP
@@ -183,6 +201,8 @@ if nothing found, or argument errors or
 bad checkpoint data,
 11
 checkpoint processing error
+12
+checkpoint file corruption
 .SH "SEE ALSO"
 .BR auditd (8),
 .BR pam_loginuid (8).
src/ausearch.c +74 -5

123 lines not on this page · raw message

src/ausearch-checkpt.h +1 -0
diff -Npru audit-2.3.6/src/ausearch-checkpt.h audit-2.3.6_checkpoint_mods/src/ausearch-checkpt.h
@@ -31,6 +31,7 @@ int load_ChkPt(const char *fn);
 #define	CP_STATFAILED	0x0002	/* stat() call on last log file failed */
 #define	CP_STATUSIO	0x0004	/* cannot open/read/write checkpoint file */
 #define	CP_STATUSBAD	0x0008	/* malformed status checkpoint entries */
+#define	CP_CORRUPTED	0x0010	/* corrupted times in checkpoint file */
 
 extern unsigned checkpt_failure;
 
src/ausearch-common.h +10 -0
diff -Npru audit-2.3.6/src/ausearch-common.h audit-2.3.6_checkpoint_mods/src/ausearch-common.h
@@ -28,6 +28,16 @@
 
 #include "ausearch-string.h"
 
+/*
+ * MAX_EVENT_DELTA_SECS is the maximum number of seconds it would take for auditd
+ * and the kernel to emit all an events records.  Thus, when scanning a list of
+ * audit records without any End of Event marker, we can determine if all an event's
+ * records have been collected if we compare that event's time with the time of the
+ * event we are currently scanning. If MAX_EVENT_DELTA_SECS have passed, then the 
+ * event is deamed to be complete and we have all it's records.
+ */
+#define	MAX_EVENT_DELTA_SECS	2
+
 /* Global variables that describe what search is to be performed */
 extern time_t start_time, end_time;
 extern unsigned int event_id;
src/ausearch-lol.c +2 -2
diff -Npru audit-2.3.6/src/ausearch-lol.c audit-2.3.6_checkpoint_mods/src/ausearch-lol.c
@@ -195,8 +195,8 @@ static void check_events(lol *lo, time_t
 	for(i=0;i<=lo->maxi; i++) {
 		lolnode *cur = &lo->array[i];
 		if (cur->status == L_BUILDING) {
-			// If 2 seconds have elapsed, we are done
-			if (cur->l->e.sec + 2 < sec) { 
+			// If MAX_EVENT_DELTA_SECS seconds have elapsed, we are done
+			if (cur->l->e.sec + MAX_EVENT_DELTA_SECS < sec) { 
 				cur->status = L_COMPLETE;
 				ready++;
 			} else if (cur->l->e.type < AUDIT_FIRST_EVENT ||
src/ausearch-options.c +11 -1
diff -Npru audit-2.3.6/src/ausearch-options.c audit-2.3.6_checkpoint_mods/src/ausearch-options.c
@@ -56,6 +56,11 @@ int event_session_id = -2;
 int event_exit = 0, event_exit_is_set = 0;
 int line_buffered = 0;
 int event_debug = 0;
+/*
+ * Holds command line flag options. See ausearch-options.h
+ */
+unsigned	control_options = 0;
+
 const char *event_key = NULL;
 const char *event_filename = NULL;
 const char *event_exe = NULL;
@@ -83,7 +88,7 @@ S_HOSTNAME, S_INTERP, S_INFILE, S_MESSAG
 S_TIME_END, S_TIME_START, S_TERMINAL, S_ALL_UID, S_EFF_UID, S_UID, S_LOGINID,
 S_VERSION, S_EXACT_MATCH, S_EXECUTABLE, S_CONTEXT, S_SUBJECT, S_OBJECT,
 S_PPID, S_KEY, S_RAW, S_NODE, S_IN_LOGS, S_JUST_ONE, S_SESSION, S_EXIT,
-S_LINEBUFFERED, S_UUID, S_VMNAME, S_DEBUG, S_CHECKPOINT, S_ARCH };
+S_LINEBUFFERED, S_UUID, S_VMNAME, S_DEBUG, S_CHECKPOINT, S_ARCH, S_CHECKPOINT_TIME_ONLY };
 
 static struct nv_pair optiontab[] = {
 	{ S_EVENT, "-a" },
@@ -92,6 +97,7 @@ static struct nv_pair optiontab[] = {
 	{ S_COMM, "-c" },
 	{ S_COMM, "--comm" },
 	{ S_CHECKPOINT, "--checkpoint" },
+	{ S_CHECKPOINT_TIME_ONLY, "--checkpoint-time-only" },
 	{ S_DEBUG, "--debug" },
 	{ S_EXIT, "-e" },
 	{ S_EXIT, "--exit" },
@@ -183,6 +189,7 @@ static void usage(void)
 	"\t--arch <CPU>\t\t\tsearch based on the CPU architecture\n"
 	"\t-c,--comm  <Comm name>\t\tsearch based on command line name\n"
 	"\t--checkpoint <checkpoint file>\tsearch from last complete event\n"
+	"\t--checkpoint-time-only\tonly use saved time for comparisions when checkpointing\n"
 	"\t--debug\t\t\tWrite malformed events that are skipped to stderr\n"
 	"\t-e,--exit  <Exit code or errno>\tsearch based on syscall exit code\n"
 	"\t-f,--file  <File name>\t\tsearch based on file name\n"
@@ -1154,6 +1161,9 @@ int check_params(int count, char *vars[]
 			}
 			c++;
 			break;
+		case S_CHECKPOINT_TIME_ONLY:
+			control_options |= OPT_CHKPT_TIME_ONLY;
+			break;
 		default:
 			fprintf(stderr, "%s is an unsupported option\n", 
 				vars[c]);
src/ausearch-options.h +7 -0
diff -Npru audit-2.3.6/src/ausearch-options.h audit-2.3.6_checkpoint_mods/src/ausearch-options.h
@@ -47,5 +47,12 @@ extern report_t report_format;
 /* Function to process commandline options */
 extern int check_params(int count, char *vars[]);
 
+extern unsigned	control_options;
+
+/*
+ * Flags for control_options
+ */
+#define	OPT_CHKPT_TIME_ONLY	0x0001	/* when checkpointing, only use time for comparisons */
+
 #endif
 
swig/audit.py +0 -992

992 lines not on this page · raw message

#2 lore raw
Quoted 8 lines · Burn Alting

A patch is attached that addresses this.

Essentially the modification
- notices if we identify an audit.log file to use but we do not find the recorded audit event in that log file and so report an error (to stderr) and return a new exit code (12)
- allows checkpointing to only use the recorded time from the checkpoint file for comparisons.

I'd like to look at these two pieces separately. Let's have 1 bug/feature per patch. This way if something looks good, it can be applied immediately. Whereas if something needs more discussion, it would block application of the part that is good.

Quoted 3 lines

You will note that the patch also contains changes to swig/audit.py. Although this file is automatically generated, it is part of the 2.3.6 release ... should it be?

I suppose it should be. What is in the release is decided by automake/autoconf. If there are any mistakes in the Makefile.am file, I would take a patch.

Quoted 2 lines

I also note that a lot of Makefile.in's are also part of the release. Again, should these automatically generated files be part of the release?

The audit package release is done by a script that pretty much does the following (its way more complicated than this, but this is the essential pieces):

mkdir audit
cd audit
svn co http://svn.fedorahosted.org/svn/audit/trunk . ./autogen.sh
./configure
make -j 8 distcheck

If it finishes saying it created the tar ball, I send it to rawhide to make sure it builds on a current OS. If that is also successful, then I push it to my people page and then commit a branch in svn. I also run the development audit package on all my systems during the whole development cycle to make sure bugs are fixed, nothing new shows up, and its builds under normal conditions.

So, anything that is there, is because autotools think it should be there unless I made a mistake in a Makefile.am. :-) Patches are welcome.

Thanks,
-Steve

#3 lore raw

Steve,

Please find attached a patch against 2.3.6 that, when checkpointing, notices if we identify an audit.log file to use (ie the dev and inode match) but we find a complete event whose time is > 2 seconds past the checkpoint time. This should not happen, as the checkpoint event should be found BEFORE any other complete event for the checkpoint event was the last displayed complete event in the file. When this occurs, a message is printed to stderr and ausearch will terminate with an exit code of 12.

This typically occurs if there is a lot of processing or a long time occurs between two invocations of ausearch --checkpoint. Basically, an inode is reused in one of the new audit.log files.

Rgds

Quoted 46 lines · Steve Grubb
Quoted 8 lines · Burn Alting

A patch is attached that addresses this.

Essentially the modification
- notices if we identify an audit.log file to use but we do not find the recorded audit event in that log file and so report an error (to stderr) and return a new exit code (12)
- allows checkpointing to only use the recorded time from the checkpoint file for comparisons.

I'd like to look at these two pieces separately. Let's have 1 bug/feature per patch. This way if something looks good, it can be applied immediately. Whereas if something needs more discussion, it would block application of the part that is good.

Quoted 3 lines

You will note that the patch also contains changes to swig/audit.py. Although this file is automatically generated, it is part of the 2.3.6 release ... should it be?

I suppose it should be. What is in the release is decided by automake/autoconf. If there are any mistakes in the Makefile.am file, I would take a patch.

Quoted 2 lines

I also note that a lot of Makefile.in's are also part of the release. Again, should these automatically generated files be part of the release?

The audit package release is done by a script that pretty much does the following (its way more complicated than this, but this is the essential pieces):

mkdir audit
cd audit
svn co http://svn.fedorahosted.org/svn/audit/trunk . ./autogen.sh
./configure
make -j 8 distcheck

If it finishes saying it created the tar ball, I send it to rawhide to make sure it builds on a current OS. If that is also successful, then I push it to my people page and then commit a branch in svn. I also run the development audit package on all my systems during the whole development cycle to make sure bugs are fixed, nothing new shows up, and its builds under normal conditions.

Quoted 5 lines

So, anything that is there, is because autotools think it should be there unless I made a mistake in a Makefile.am. :-) Patches are welcome.

Thanks,
-Steve

docs/ausearch.8 +10 -5
diff -Npru audit-2.3.6/docs/ausearch.8 audit-2.3.6_checkpt_1/docs/ausearch.8
@@ -46,8 +46,7 @@ ausearch will load this checkpoint data
 complete events until it matches the checkpointed one. At this point, it will start
 outputting complete events.
 
-Should the file or checkpointed completed event not be found, an error will result and ausearch
-will terminate.
+Should the file or checkpointed completed event not be found, one of a number of errors will result and ausearch will terminate. See \fBEXIT STATUS\fP for detail.
 
 .TP
 .BR \-e,\  \-\-exit \ \fIexit-code-or-errno\fP
@@ -173,16 +172,22 @@ String based matches must match the whol
 .BR \-x ,\  \-\-executable \ \fIexecutable\fP
 Search for an event matching the given \fIexecutable\fP name.
 
-.SS "Exit status:"
-.TP
+.SH "EXIT STATUS"
+.TP 5
 0
 if OK,
+.TP
 1
 if nothing found, or argument errors or minor file acces/read errors,
+.TP
 10
-bad checkpoint data,
+invalid checkpoint data found in checkpoint file,
+.TP
 11
 checkpoint processing error
+.TP
+12
+checkpoint event not found in matching log file
 .SH "SEE ALSO"
 .BR auditd (8),
 .BR pam_loginuid (8).
src/ausearch.c +52 -4

82 lines not on this page · raw message

src/ausearch-checkpt.h +1 -0
diff -Npru audit-2.3.6/src/ausearch-checkpt.h audit-2.3.6_checkpt_1/src/ausearch-checkpt.h
@@ -31,6 +31,7 @@ int load_ChkPt(const char *fn);
 #define	CP_STATFAILED	0x0002	/* stat() call on last log file failed */
 #define	CP_STATUSIO	0x0004	/* cannot open/read/write checkpoint file */
 #define	CP_STATUSBAD	0x0008	/* malformed status checkpoint entries */
+#define	CP_CORRUPTED	0x0010	/* corrupted times in checkpoint file */
 
 extern unsigned checkpt_failure;
 
src/ausearch-common.h +11 -0
diff -Npru audit-2.3.6/src/ausearch-common.h audit-2.3.6_checkpt_1/src/ausearch-common.h
@@ -28,6 +28,17 @@
 
 #include "ausearch-string.h"
 
+/*
+ * MAX_EVENT_DELTA_SECS is the maximum number of seconds it would take for
+ * auditd and the kernel to emit all of an events' records. Thus, when scanning
+ * a list of audit records without any End of Event marker, we can determine if
+ * all an event's records have been collected if we compare that event's time
+ * with the time of the event we are currently scanning. If
+ * MAX_EVENT_DELTA_SECS have passed, then the event is deamed to be complete
+ * and we have all it's records.
+ */
+#define	MAX_EVENT_DELTA_SECS	2
+
 /* Global variables that describe what search is to be performed */
 extern time_t start_time, end_time;
 extern unsigned int event_id;
#4 lore raw
Quoted 9 lines · Burn Alting

Please find attached a patch against 2.3.6 that, when checkpointing, notices if we identify an audit.log file to use (ie the dev and inode match) but we find a complete event whose time is > 2 seconds past the checkpoint time. This should not happen, as the checkpoint event should be found BEFORE any other complete event for the checkpoint event was the last displayed complete event in the file. When this occurs, a message is printed to stderr and ausearch will terminate with an exit code of 12.

Quoted 3 lines

This typically occurs if there is a lot of processing or a long time occurs between two invocations of ausearch --checkpoint. Basically, an inode is reused in one of the new audit.log files.

Thanks for the patch. Applied as commit 950 with a couple formatting changes.

-Steve

#5 lore raw
In reply to Steve Grubb

Steve,

Please find a patch against 2.3.6 that, when checkpointing, ausearch will only use the recorded event time in the checkpoint file when deciding what complete events to display. Basically, it will display all complete events found after the event time found in the checkpoint file.

Normally, one would use checkpointing in a periodic script that records all 'new' audit events. Should certain errors occur, we need to recover and continue to record 'new' audit events. This option allows use to do a 'brute force' recovery by finding all events since the last recorded time we have in the checkpoint file.

For example, the core of a periodic script may contain

  ausearch --checkpoint /usr/security/auditd_checkpoint.txt -i
  _aus=$?
  if test ${_aus} -eq 10 -o ${_aus} -eq 11 -o ${_aus} -eq 12
  then
    ausearch --checkpoint /usr/security/auditd_checkpoint.txt \
      --checkpoint-time-only -i
  fi

Rgds

Quoted 46 lines · Steve Grubb
Quoted 8 lines · Burn Alting

A patch is attached that addresses this.

Essentially the modification
- notices if we identify an audit.log file to use but we do not find the recorded audit event in that log file and so report an error (to stderr) and return a new exit code (12)
- allows checkpointing to only use the recorded time from the checkpoint file for comparisons.

I'd like to look at these two pieces separately. Let's have 1 bug/feature per patch. This way if something looks good, it can be applied immediately. Whereas if something needs more discussion, it would block application of the part that is good.

Quoted 3 lines

You will note that the patch also contains changes to swig/audit.py. Although this file is automatically generated, it is part of the 2.3.6 release ... should it be?

I suppose it should be. What is in the release is decided by automake/autoconf. If there are any mistakes in the Makefile.am file, I would take a patch.

Quoted 2 lines

I also note that a lot of Makefile.in's are also part of the release. Again, should these automatically generated files be part of the release?

The audit package release is done by a script that pretty much does the following (its way more complicated than this, but this is the essential pieces):

mkdir audit
cd audit
svn co http://svn.fedorahosted.org/svn/audit/trunk . ./autogen.sh
./configure
make -j 8 distcheck

If it finishes saying it created the tar ball, I send it to rawhide to make sure it builds on a current OS. If that is also successful, then I push it to my people page and then commit a branch in svn. I also run the development audit package on all my systems during the whole development cycle to make sure bugs are fixed, nothing new shows up, and its builds under normal conditions.

Quoted 5 lines

So, anything that is there, is because autotools think it should be there unless I made a mistake in a Makefile.am. :-) Patches are welcome.

Thanks,
-Steve

docs/ausearch.8 +19 -0
diff -Npru audit-2.3.6/docs/ausearch.8 audit-2.3.6_checkpt_2/docs/ausearch.8
@@ -50,6 +50,25 @@ Should the file or checkpointed complete
 will terminate.
 
 .TP
+.BR \-\-checkpoint-time-only
+When checkpointing, this option will only rely upon the checkpoint files'
+timestamp for comparison. Thus it will ignore inode, device, serial, node and
+event type.
+
+Essentailly, this is the recovery action should an \fIausearch\fP with a checkpoint fail with an
+exit status of 10, 11 or 12. An appropriate script extract might look like
+.sp
+.nf
+.na
+  ausearch --checkpoint /usr/security/auditd_checkpoint.txt -i
+  _au_status=$?
+  if test ${_au_status} -eq 10 -o ${_au_status} -eq 11 -o ${_au_status} -eq 12
+  then
+    ausearch --checkpoint /usr/security/auditd_checkpoint.txt --checkpoint-time-only -i
+  fi
+.ad
+.fi
+.TP
 .BR \-e,\  \-\-exit \ \fIexit-code-or-errno\fP
 Search for an event based on the given syscall \fIexit code or errno\fP.
 .TP
src/ausearch.c +32 -4
diff -Npru audit-2.3.6/src/ausearch.c audit-2.3.6_checkpt_2/src/ausearch.c
@@ -236,8 +236,15 @@ static int process_logs(void)
 			 */
 			if (	(sbuf.st_dev == chkpt_input_dev) &&
 				(sbuf.st_ino == chkpt_input_ino) ) {
-				found_chkpt_file = num++;
-				break;
+
+				/*
+ 				 * If we are only using the checkpoint file's time, then
+ 				 * we always want to find the 'oldest' file. Thus we only break if we are NOT using the checkpoint files time only.
+ 				 */
+				if (!((control_options & OPT_CHKPT_TIME_ONLY) == OPT_CHKPT_TIME_ONLY)) {
+					found_chkpt_file = num++;
+					break;
+				}
 			}
 		}
 
@@ -245,8 +252,10 @@ static int process_logs(void)
 		snprintf(filename, len, "%s.%d", config.log_file, num);
 	} while (1);
 
-	/* If a checkpoint is loaded but can't find it's file, error */
-	if (checkpt_filename && have_chkpt_data && found_chkpt_file == -1) {
+	/* If a checkpoint is loaded but can't find it's file, and
+ 	 * we are not only checking time, we need to error */
+	if (checkpt_filename && have_chkpt_data && found_chkpt_file == -1
+	&& !((control_options & OPT_CHKPT_TIME_ONLY) == OPT_CHKPT_TIME_ONLY)) {
 		free(filename);
 		free_config(&config);
 		return 10;
@@ -329,6 +338,25 @@ static int chkpt_output_decision(event *
 		return 1;	/* can output on this event */
 	}
 
+	/*
+	 * If we are ignoring all but event time, then we output if the current
+	 * event's time is greater than or equal to the checkpoint time.
+	 */
+	if ((control_options & OPT_CHKPT_TIME_ONLY) == OPT_CHKPT_TIME_ONLY) {
+		if (
+			(chkpt_input_levent.sec < e->sec)
+		||
+			(
+				(chkpt_input_levent.sec == e->sec)
+			&&
+				(chkpt_input_levent.milli <= e->milli)
+			)
+		) {
+			can_output = 1;
+			return 1;   /* can output on this event */
+		}
+	}
+
 	if ( chkpt_input_levent.sec == e->sec &&
 		chkpt_input_levent.milli == e->milli &&
 		chkpt_input_levent.serial == e->serial &&
src/ausearch-options.c +12 -1
diff -Npru audit-2.3.6/src/ausearch-options.c audit-2.3.6_checkpt_2/src/ausearch-options.c
@@ -72,6 +72,11 @@ ilist *event_type;
 
 slist *event_node_list = NULL;
 
+/*
+ * Bitmap for command line options. See ausearch-options.h for values.
+ */
+unsigned	control_options	= 0x0;
+
 struct nv_pair {
     int        value;
     const char *name;
@@ -83,7 +88,8 @@ S_HOSTNAME, S_INTERP, S_INFILE, S_MESSAG
 S_TIME_END, S_TIME_START, S_TERMINAL, S_ALL_UID, S_EFF_UID, S_UID, S_LOGINID,
 S_VERSION, S_EXACT_MATCH, S_EXECUTABLE, S_CONTEXT, S_SUBJECT, S_OBJECT,
 S_PPID, S_KEY, S_RAW, S_NODE, S_IN_LOGS, S_JUST_ONE, S_SESSION, S_EXIT,
-S_LINEBUFFERED, S_UUID, S_VMNAME, S_DEBUG, S_CHECKPOINT, S_ARCH };
+S_LINEBUFFERED, S_UUID, S_VMNAME, S_DEBUG, S_CHECKPOINT, S_ARCH,
+S_CHECKPOINT_TIME_ONLY };
 
 static struct nv_pair optiontab[] = {
 	{ S_EVENT, "-a" },
@@ -92,6 +98,7 @@ static struct nv_pair optiontab[] = {
 	{ S_COMM, "-c" },
 	{ S_COMM, "--comm" },
 	{ S_CHECKPOINT, "--checkpoint" },
+	{ S_CHECKPOINT_TIME_ONLY, "--checkpoint-time-only" },
 	{ S_DEBUG, "--debug" },
 	{ S_EXIT, "-e" },
 	{ S_EXIT, "--exit" },
@@ -183,6 +190,7 @@ static void usage(void)
 	"\t--arch <CPU>\t\t\tsearch based on the CPU architecture\n"
 	"\t-c,--comm  <Comm name>\t\tsearch based on command line name\n"
 	"\t--checkpoint <checkpoint file>\tsearch from last complete event\n"
+	"\t--checkpoint-time-only\tuse only checkpoint time for comparisions when deciding to display output\n"
 	"\t--debug\t\t\tWrite malformed events that are skipped to stderr\n"
 	"\t-e,--exit  <Exit code or errno>\tsearch based on syscall exit code\n"
 	"\t-f,--file  <File name>\t\tsearch based on file name\n"
@@ -1154,6 +1162,9 @@ int check_params(int count, char *vars[]
 			}
 			c++;
 			break;
+		case S_CHECKPOINT_TIME_ONLY:
+			control_options |= OPT_CHKPT_TIME_ONLY;
+			break;
 		default:
 			fprintf(stderr, "%s is an unsupported option\n", 
 				vars[c]);
src/ausearch-options.h +10 -0
diff -Npru audit-2.3.6/src/ausearch-options.h audit-2.3.6_checkpt_2/src/ausearch-options.h
@@ -47,5 +47,15 @@ extern report_t report_format;
 /* Function to process commandline options */
 extern int check_params(int count, char *vars[]);
 
+/*
+ * Bitmap for command line options
+ */
+extern unsigned	control_options;
+
+/*
+ * Flags for control_options
+ */
+#define	OPT_CHKPT_TIME_ONLY	0x0001	/* when checkpointing, only use event time for comparisons */ 
+
 #endif