getconf: don't include xpg4 bits, gcc7 includes xpg6 bits for us
[unleashed.git] / share / man / man4 / audit.log.4
blob7dab5e2a15ef5df375ee8287c30b26cafd008b33
1 '\" te
2 .\" Copyright (c) 2017 Peter Tribble
3 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
5 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
6 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH AUDIT.LOG 4 "Mar 6, 2017"
8 .SH NAME
9 audit.log \- audit trail file
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB#include <bsm/audit.h>\fR
14 .fi
16 .LP
17 .nf
18 \fB#include <bsm/audit_record.h>\fR
19 .fi
21 .SH DESCRIPTION
22 .LP
23 \fBaudit.log\fR files are the depository for audit records stored locally or on
24 an NFS-mounted audit server. These files are kept in directories as specified
25 by the \fBp_dir\fR attribute of the \fBaudit_binfile\fR(5) plugin. They are
26 named to reflect the time they are created and are, when possible, renamed to
27 reflect the time they are closed as well. The name takes the form
28 .sp
29 .LP
30 \fIyyyymmddhhmmss\fR\fB\&.not_terminated.\fR\fIhostname\fR
31 .sp
32 .LP
33 when open or if \fBauditd\fR(8) terminated ungracefully, and the form
34 .sp
35 .LP
36 \fIyyyymmddhhmmss\fR\fB\&.\fR\fIyyyymmddhhmmss\fR\fB\&.\fR\fIhostname\fR
37 .sp
38 .LP
39 when properly closed. \fByyyy\fR is the year, \fBmm\fR the month, \fBdd\fR day
40 in the month, \fBhh\fR hour in the day, \fBmm\fR minute in the hour, and
41 \fBss\fR second in the minute. All fields are of fixed width.
42 .sp
43 .LP
44 Audit data is generated in the binary format described below; the default for
45 audit is binary format. See \fBaudit_syslog\fR(5) for an alternate data
46 format.
47 .sp
48 .LP
49 The \fBaudit.log\fR file begins with a standalone \fBfile token\fR and
50 typically ends with one also. The beginning \fBfile token\fR records the
51 pathname of the previous audit file, while the ending \fBfile token\fR records
52 the pathname of the next audit file. If the file name is \fBNULL\fR the
53 appropriate path was unavailable.
54 .sp
55 .LP
56 The \fBaudit.log\fR files contains audit records. Each audit record is made up
57 of \fIaudit tokens\fR. Each record contains a header token followed by various
58 data tokens. Depending on the audit policy in place by \fBauditon\fR(2),
59 optional other tokens such as trailers or sequences may be included.
60 .sp
61 .LP
62 The tokens are defined as follows:
63 .sp
64 .LP
65 The \fBfile\fR token consists of:
66 .sp
67 .in +2
68 .nf
69 token ID                1 byte
70 seconds of time         4 bytes
71 microseconds of time    4 bytes
72 file name length        2 bytes
73 file pathname           N bytes + 1 terminating NULL byte
74 .fi
75 .in -2
76 .sp
78 .sp
79 .LP
80 The \fBheader\fR token consists of:
81 .sp
82 .in +2
83 .nf
84 token ID                1 byte
85 record byte count       4 bytes
86 version #               1 byte    [2]
87 event type              2 bytes
88 event modifier          2 bytes
89 seconds of time         4 bytes/8 bytes (32-bit/64-bit value)
90 nanoseconds of time     4 bytes/8 bytes (32-bit/64-bit value)
91 .fi
92 .in -2
93 .sp
95 .sp
96 .LP
97 The expanded \fBheader\fR token consists of:
98 .sp
99 .in +2
101 token ID                1 byte
102 record byte count       4 bytes
103 version #               1 byte     [2]
104 event type              2 bytes
105 event modifier          2 bytes
106 address type/length     1 byte
107 machine address         4 bytes/16 bytes (IPv4/IPv6 address)
108 seconds of time         4 bytes/8 bytes  (32/64-bits)
109 nanoseconds of time     4 bytes/8 bytes  (32/64-bits)
111 .in -2
116 The \fBtrailer\fR token consists of:
118 .in +2
120 token ID                1 byte
121 trailer magic number    2 bytes
122 record byte count       4 bytes
124 .in -2
129 The  \fBarbitrary\fR \fBdata\fR token is defined:
131 .in +2
133 token ID                1 byte
134 how to print            1 byte
135 basic unit              1 byte
136 unit count              1 byte
137 data items              (depends on basic unit)
139 .in -2
144 The \fBin_addr\fR token consists of:
146 .in +2
148 token ID                1 byte
149 IP address type/length  1 byte
150 IP address        4 bytes/16 bytes (IPv4/IPv6 address)
152 .in -2
157 The expanded \fBin_addr\fR token consists of:
159 .in +2
161 token ID                1 byte
162 IP address type/length  4 bytes/16 bytes (IPv4/IPv6 address)
163 IP address             16 bytes
165 .in -2
170 The \fBip\fR token consists of:
172 .in +2
174 token ID                1 byte
175 version and ihl         1 byte
176 type of service         1 byte
177 length                  2 bytes
178 id                      2 bytes
179 offset                  2 bytes
180 ttl                     1 byte
181 protocol                1 byte
182 checksum                2 bytes
183 source address          4 bytes
184 destination address     4 bytes
186 .in -2
191 The expanded \fBip\fR token consists of:
193 .in +2
195 token ID                1 byte
196 version and ihl         1 byte
197 type of service         1 byte
198 length                  2 bytes
199 id                      2 bytes
200 offset                  2 bytes
201 ttl                     1 byte
202 protocol                1 byte
203 checksum                2 bytes
204 address type/type       1 byte
205 source address          4 bytes/16 bytes (IPv4/IPv6 address)
206 address type/length     1 byte
207 destination address     4 bytes/16 bytes (IPv4/IPv6 address)
209 .in -2
214 The \fBiport\fR token consists of:
216 .in +2
218 token ID                1 byte
219 port IP address         2 bytes
221 .in -2
226 The \fBpath\fR token consists of:
228 .in +2
230 token ID                1 byte
231 path length             2 bytes
232 path                    N bytes + 1 terminating NULL byte
234 .in -2
239 The \fBpath_attr\fR token consists of:
241 .in +2
243 token ID                1 byte
244 count                   4 bytes
245 path                    \fIcount\fR null-terminated string(s)
247 .in -2
252 The \fBprocess\fR token consists of:
254 .in +2
256 token ID                1 byte
257 audit ID                4 bytes
258 effective user ID       4 bytes
259 effective group ID      4 bytes
260 real user ID            4 bytes
261 real group ID           4 bytes
262 process ID              4 bytes
263 session ID              4 bytes
264 terminal ID     
265   port ID               4 bytes/8 bytes (32-bit/64-bit value)
266   machine address       4 bytes
268 .in -2
273 The expanded \fBprocess\fR token consists of:
275 .in +2
277 token ID                1 byte
278 audit ID                4 bytes
279 effective user ID       4 bytes
280 effective group ID      4 bytes
281 real user ID            4 bytes
282 real group ID           4 bytes
283 process ID              4 bytes
284 session ID              4 bytes
285 terminal ID     
286   port ID               4 bytes/8 bytes (32-bit/64-bit value)
287   address type/length   1 byte
288   machine address       4 bytes/16 bytes (IPv4/IPv6 address)
290 .in -2
295 The \fBreturn\fR token consists of:
297 .in +2
299 token ID                1 byte
300 error number            1 byte
301 return value            4 bytes/8 bytes (32-bit/64-bit value)
303 .in -2
308 The \fBsubject\fR token consists of:
310 .in +2
312 token ID                1 byte
313 audit ID                4 bytes
314 effective user ID       4 bytes
315 effective group ID      4 bytes
316 real user ID            4 bytes
317 real group ID           4 bytes
318 process ID              4 bytes
319 session ID              4 bytes
320 terminal ID     
321   port ID               4 bytes/8 bytes (32-bit/64-bit value)
322   machine address       4 bytes
324 .in -2
329 The expanded \fBsubject\fR token consists of:
331 .in +2
333 token ID                1 byte
334 audit ID                4 bytes
335 effective user ID       4 bytes
336 effective group ID      4 bytes
337 real user ID            4 bytes
338 real group ID           4 bytes
339 process ID              4 bytes
340 session ID              4 bytes
341 terminal ID     
342   port ID               4 bytes/8 bytes (32-bit/64-bit value)
343   address type/length   1 byte
344   machine address       4 bytes/16 bytes (IPv4/IPv6 address)
346 .in -2
351 The \fBSystem V IPC\fR token consists of:
353 .in +2
355 token ID                1 byte
356 object ID type          1 byte
357 object ID               4 bytes
359 .in -2
364 The \fBtext\fR token consists of:
366 .in +2
368 token ID                1 byte
369 text length             2 bytes
370 text                    N bytes + 1 terminating NULL byte
372 .in -2
377 The \fBattribute\fR token consists of:
379 .in +2
381 token ID                1 byte
382 file access mode        4 bytes
383 owner user ID           4 bytes
384 owner group ID          4 bytes
385 file system ID          4 bytes
386 node ID                 8 bytes
387 device                  4 bytes/8 bytes (32-bit/64-bit)
389 .in -2
394 The \fBgroups\fR token consists of:
396 .in +2
398 token ID                1 byte
399 number groups           2 bytes
400 group list              N * 4 bytes
402 .in -2
407 The \fBSystem V IPC permission\fR token consists of:
409 .in +2
411 token ID                1 byte
412 owner user ID           4 bytes
413 owner group ID          4 bytes
414 creator user ID         4 bytes
415 creator group ID        4 bytes
416 access mode             4 bytes
417 slot sequence #         4 bytes
418 key                     4 bytes
420 .in -2
425 The \fBarg\fR token consists of:
427 .in +2
429 token ID                1 byte
430 argument #              1 byte
431 argument value          4 bytes/8 bytes (32-bit/64-bit value)
432 text length             2 bytes
433 text                    N bytes + 1 terminating NULL byte
435 .in -2
440 The \fBexec_args\fR token consists of:
442 .in +2
444 token ID                1 byte
445 count                   4 bytes
446 text                    \fIcount\fR null-terminated string(s)
448 .in -2
453 The \fBexec_env\fR token consists of:
455 .in +2
457 token ID                1 byte
458 count                   4 bytes
459 text                    \fIcount\fR null-terminated string(s)
461 .in -2
466 The \fBexit\fR token consists of:
468 .in +2
470 token ID                1 byte
471 status                  4 bytes
472 return value            4 bytes
474 .in -2
479 The \fBsocket\fR token consists of:
481 .in +2
483 token ID                1 byte
484 socket type             2 bytes
485 remote port             2 bytes
486 remote Internet address 4 bytes
488 .in -2
493 The expanded \fBsocket\fR token consists of:
495 .in +2
497 token ID                1 byte
498 socket domain           2 bytes
499 socket type             2 bytes
500 local port              2 bytes
501 address type/length     2 bytes
502 local port              2 bytes
503 local Internet address  4 bytes/16 bytes (IPv4/IPv6 address)
504 remote port             2 bytes
505 remote Internet address 4 bytes/16 bytes (IPv4/IPv6 address)
507 .in -2
512 The \fBseq\fR token consists of:
514 .in +2
516 token ID                1 byte
517 sequence number         4 bytes
519 .in -2
524 The \fBprivilege\fR token consists of:
526 .in +2
528 token ID                1 byte
529 text length             2 bytes
530 privilege set name      N bytes + 1 terminating NULL byte
531 text length             2 bytes
532 list of privileges      N bytes + 1 terminating NULL byte
534 .in -2
538 The \fBuse-of-auth\fR token consists of:
540 .in +2
542 token ID                1 byte
543 text length             2 bytes
544 authorization(s)        N bytes + 1 terminating NULL byte
546 .in -2
550 The \fBuse-of-privilege\fR token consists of:
552 .in +2
554 token ID                1 byte
555 succ/fail               1 byte
556 text length             2 bytes
557 privilege used          N bytes + 1 terminating NULL byte
559 .in -2
563 The \fBcommand\fR token consists of:
565 .in +2
567 token ID                1 byte
568 count of args           2 bytes
569 argument list           (count times)
570 text length             2 bytes
571 argument text           N bytes + 1 terminating NULL byte
572 count of env strings    2 bytes
573 environment list        (count times)
574 text length             2 bytes
575 env. text               N bytes + 1 terminating NULL byte
577 .in -2
581 The \fBACL\fR token consists of:
583 .in +2
585 token ID                            1 byte
586 type                                4 bytes
587 value                       4 bytes
588 file mode                           4 bytes
590 .in -2
594 The ACE token consists of:
596 .in +2
598 token ID           1 byte
599 who                4 bytes
600 access_mask        4 bytes
601 flags              2 bytes
602 type               2 bytes
604 .in -2
608 The \fBzonename\fR token consists of:
610 .in +2
612 token ID            1 byte
613 name length         2 bytes
614 name                \fI<name length>\fR including terminating NULL byte
616 .in -2
620 The \fBfmri\fR token consists of:
622 .in +2
624 token ID            1 byte
625 fmri length         2 bytes
626 fmri                \fI<fmri length>\fR including terminating NULL byte
628 .in -2
632 The \fBlabel\fR token consists of:
634 .in +2
636 token ID                1 byte
637 label ID                1 byte
638 compartment length      1 byte
639 classification          2 bytes
640 compartment words       \fI<compartment length>\fR * 4 bytes
642 .in -2
646 The \fBxatom\fR token consists of:
648 .in +2
650 token ID                1 byte
651 string length           2 bytes
652 atom string             \fIstring length\fR bytes
654 .in -2
658 The \fBxclient\fR token consists of:
660 .in +2
662 token ID                1 byte
663 client ID               4 bytes
665 .in -2
669 The \fBxcolormap\fR token consists of:
671 .in +2
673 token ID                1 byte
674 XID                     4 bytes
675 creator UID             4 bytes
677 .in -2
681 The \fBxcursor\fR token consists of:
683 .in +2
685 token ID                1 byte
686 XID                     4 bytes
687 creator UID             4 bytes
689 .in -2
693 The \fBxfont\fR token consists of:
695 .in +2
697 token ID                1 byte
698 XID                     4 bytes
699 creator UID             4 bytes
701 .in -2
705 The \fBxgc\fR token consists of:
707 .in +2
709 token ID                1 byte
710 XID                     4 bytes
711 creator UID             4 bytes
713 .in -2
717 The \fBxpixmap\fR token consists of:
719 .in +2
721 token ID                1 byte
722 XID                     4 bytes
723 creator UID             4 bytes
725 .in -2
729 The \fBxproperty\fR token consists of:
731 .in +2
733 token ID                1 byte
734 XID                     4 bytes
735 creator UID             4 bytes
736 string length           2 bytes
737 string                  \fIstring length\fR bytes
739 .in -2
743 The \fBxselect\fR token consists of:
745 .in +2
747 token ID                1 byte
748 property length         2 bytes
749 property string         \fIproperty length\fR bytes
750 prop. type len.         2 bytes
751 prop type               \fIprop. type len.\fR bytes
752 data length             2 bytes
753 window data             \fIdata length\fR bytes
755 .in -2
759 The \fBxwindow\fR token consists of:
761 .in +2
763 token ID                1 byte
764 XID                     4 bytes
765 creator UID             4 bytes
767 .in -2
769 .SH ATTRIBUTES
771 See \fBattributes\fR(5) for descriptions of the following attributes:
776 box;
777 c | c
778 l | l .
779 ATTRIBUTE TYPE  ATTRIBUTE VALUE
781 Interface Stability     See below.
786 The binary file format is Committed. The binary file contents is Uncommitted.
787 .SH SEE ALSO
789 \fBaudit\fR(8), \fBauditd\fR(8), \fBaudit\fR(2),
790 \fBauditon\fR(2), \fBau_to\fR(3BSM),
791 \fBaudit_binfile\fR(5), \fBaudit_remote\fR(5), \fBaudit_syslog\fR(5)
792 .SH NOTES
794 Each token is generally written using the \fBau_to\fR(3BSM) family of function
795 calls.