1ca0716f5SRobert Watson.\"- 222ccb20dSRobert Watson.\" Copyright (c) 2005-2006 Robert N. M. Watson 37a0a89d2SRobert Watson.\" Copyright (c) 2008 Apple Inc. 4ca0716f5SRobert Watson.\" All rights reserved. 5ca0716f5SRobert Watson.\" 6ca0716f5SRobert Watson.\" Redistribution and use in source and binary forms, with or without 7ca0716f5SRobert Watson.\" modification, are permitted provided that the following conditions 8ca0716f5SRobert Watson.\" are met: 9ca0716f5SRobert Watson.\" 1. Redistributions of source code must retain the above copyright 10ca0716f5SRobert Watson.\" notice, this list of conditions and the following disclaimer. 11ca0716f5SRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright 12ca0716f5SRobert Watson.\" notice, this list of conditions and the following disclaimer in the 13ca0716f5SRobert Watson.\" documentation and/or other materials provided with the distribution. 14ca0716f5SRobert Watson.\" 15ca0716f5SRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16ca0716f5SRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17ca0716f5SRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18ca0716f5SRobert Watson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19ca0716f5SRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20ca0716f5SRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21ca0716f5SRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22ca0716f5SRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23ca0716f5SRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24ca0716f5SRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25ca0716f5SRobert Watson.\" SUCH DAMAGE. 26ca0716f5SRobert Watson.\" 27bc168a6cSRobert Watson.Dd November 5, 2006 28ca0716f5SRobert Watson.Dt AUDIT.LOG 5 29ca0716f5SRobert Watson.Os 30ca0716f5SRobert Watson.Sh NAME 31ca0716f5SRobert Watson.Nm audit 32bc168a6cSRobert Watson.Nd "Basic Security Module (BSM) file format" 33ca0716f5SRobert Watson.Sh DESCRIPTION 34ca0716f5SRobert WatsonThe 35ca0716f5SRobert Watson.Nm 36ca0716f5SRobert Watsonfile format is based on Sun's Basic Security Module (BSM) file format, a 37ca0716f5SRobert Watsontoken-based record stream to represent system audit data. 38ca0716f5SRobert WatsonThis file format is both flexible and extensible, able to describe a broad 39ca0716f5SRobert Watsonrange of data types, and easily extended to describe new data types in a 40ca0716f5SRobert Watsonmoderately backward and forward compatible way. 41ca0716f5SRobert Watson.Pp 42ca0716f5SRobert WatsonBSM token streams typically begin and end with a 43bc168a6cSRobert Watson.Dq file 44ca0716f5SRobert Watsontoken, which provides time stamp and file name information for the stream; 45ca0716f5SRobert Watsonwhen processing a BSM token stream from a stream as opposed to a single file 46ca0716f5SRobert Watsonsource, file tokens may be seen at any point between ordinary records 47ca0716f5SRobert Watsonidentifying when particular parts of the stream begin and end. 48ca0716f5SRobert WatsonAll other tokens will appear in the context of a complete BSM audit record, 49ca0716f5SRobert Watsonwhich begins with a 50bc168a6cSRobert Watson.Dq header 51ca0716f5SRobert Watsontoken, and ends with a 52bc168a6cSRobert Watson.Dq trailer 53ca0716f5SRobert Watsontoken, which describe the audit record. 54ca0716f5SRobert WatsonBetween these two tokens will appear a variety of data tokens, such as 55ca0716f5SRobert Watsonprocess information, file path names, IPC object information, MAC labels, 56ca0716f5SRobert Watsonsocket information, and so on. 57ca0716f5SRobert Watson.Pp 58ca0716f5SRobert WatsonThe BSM file format defines specific token orders for each record event type; 59ca0716f5SRobert Watsonhowever, some variation may occur depending on the operating system in use, 60ca0716f5SRobert Watsonwhat system options, such as mandatory access control, are present. 61ca0716f5SRobert Watson.Pp 62ca0716f5SRobert WatsonThis manual page documents the common token types and their binary format, and 63ca0716f5SRobert Watsonis intended for reference purposes only. 64ca0716f5SRobert WatsonIt is recommended that application programmers use the 65ca0716f5SRobert Watson.Xr libbsm 3 66ca0716f5SRobert Watsoninterface to read and write tokens, rather than parsing or constructing 67ca0716f5SRobert Watsonrecords by hand. 68ca0716f5SRobert Watson.Ss File Token 69ca0716f5SRobert WatsonThe 70bc168a6cSRobert Watson.Dq file 71ca0716f5SRobert Watsontoken is used at the beginning and end of an audit log file to indicate 72ca0716f5SRobert Watsonwhen the audit log begins and ends. 73ca0716f5SRobert WatsonIt includes a pathname so that, if concatenated together, original file 74ca0716f5SRobert Watsonboundaries are still observable, and gaps in the audit log can be identified. 75ca0716f5SRobert WatsonA 76bc168a6cSRobert Watson.Dq file 77ca0716f5SRobert Watsontoken can be created using 78ca0716f5SRobert Watson.Xr au_to_file 3 . 79bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 80bc168a6cSRobert Watson.It Sy "Field Bytes Description" 81bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 82bc168a6cSRobert Watson.It "Seconds 4 bytes File time stamp" 83bc168a6cSRobert Watson.It "Microseconds 4 bytes File time stamp" 84aa772005SRobert Watson.It "File name length 2 bytes File name of audit trail" 85bc168a6cSRobert Watson.It "File pathname N bytes + 1 NUL File name of audit trail" 86ca0716f5SRobert Watson.El 87ca0716f5SRobert Watson.Ss Header Token 88ca0716f5SRobert WatsonThe 89bc168a6cSRobert Watson.Dq header 90ca0716f5SRobert Watsontoken is used to mark the beginning of a complete audit record, and includes 91ca0716f5SRobert Watsonthe length of the total record in bytes, a version number for the record 92ca0716f5SRobert Watsonlayout, the event type and subtype, and the time at which the event occurred. 9322ccb20dSRobert WatsonA 32-bit 94bc168a6cSRobert Watson.Dq header 95ca0716f5SRobert Watsontoken can be created using 9622ccb20dSRobert Watson.Xr au_to_header32 3 ; 9722ccb20dSRobert Watsona 64-bit 98bc168a6cSRobert Watson.Dq header 9922ccb20dSRobert Watsontoken can be created using 10022ccb20dSRobert Watson.Xr au_to_header64 3 . 101bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 102bc168a6cSRobert Watson.It Sy "Field Bytes Description" 103bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 104bc168a6cSRobert Watson.It "Record Byte Count 4 bytes Number of bytes in record" 105*3008333dSChristian S.J. Peron.It "Version Number 1 byte Record version number" 106bc168a6cSRobert Watson.It "Event Type 2 bytes Event type" 107bc168a6cSRobert Watson.It "Event Modifier 2 bytes Event sub-type" 108bc168a6cSRobert Watson.It "Seconds 4/8 bytes Record time stamp (32/64-bits)" 109bc168a6cSRobert Watson.It "Nanoseconds 4/8 bytes Record time stamp (32/64-bits)" 110ca0716f5SRobert Watson.El 111ca0716f5SRobert Watson.Ss Expanded Header Token 112ca0716f5SRobert WatsonThe 113bc168a6cSRobert Watson.Dq expanded header 114ca0716f5SRobert Watsontoken is an expanded version of the 115bc168a6cSRobert Watson.Dq header 116ca0716f5SRobert Watsontoken, with the addition of a machine IPv4 or IPv6 address. 11722ccb20dSRobert WatsonA 32-bit extended 118bc168a6cSRobert Watson.Dq header 11922ccb20dSRobert Watsontoken can be created using 12022ccb20dSRobert Watson.Xr au_to_header32_ex 3 ; 12122ccb20dSRobert Watsona 64-bit extended 122bc168a6cSRobert Watson.Dq header 12322ccb20dSRobert Watsontoken can be created using 12422ccb20dSRobert Watson.Xr au_to_header64_ex 3 . 125bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 126bc168a6cSRobert Watson.It Sy "Field Bytes Description" 127bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 128bc168a6cSRobert Watson.It "Record Byte Count 4 bytes Number of bytes in record" 129*3008333dSChristian S.J. Peron.It "Version Number 1 byte Record version number" 130bc168a6cSRobert Watson.It "Event Type 2 bytes Event type" 131bc168a6cSRobert Watson.It "Event Modifier 2 bytes Event sub-type" 132bc168a6cSRobert Watson.It "Address Type/Length 1 byte Host address type and length" 133bc168a6cSRobert Watson.It "Machine Address 4/16 bytes IPv4 or IPv6 address" 134bc168a6cSRobert Watson.It "Seconds 4/8 bytes Record time stamp (32/64-bits)" 135bc168a6cSRobert Watson.It "Nanoseconds 4/8 bytes Record time stamp (32/64-bits)" 136ca0716f5SRobert Watson.El 137ca0716f5SRobert Watson.Ss Trailer Token 138ca0716f5SRobert WatsonThe 139bc168a6cSRobert Watson.Dq trailer 140ca0716f5SRobert Watsonterminates a BSM audit record, and contains a magic number, 1417a0a89d2SRobert Watson.Dv AUT_TRAILER_MAGIC 142ca0716f5SRobert Watsonand length that can be used to validate that the record was read properly. 143ca0716f5SRobert WatsonA 144bc168a6cSRobert Watson.Dq trailer 145ca0716f5SRobert Watsontoken can be created using 146ca0716f5SRobert Watson.Xr au_to_trailer 3 . 147bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 148bc168a6cSRobert Watson.It Sy "Field Bytes Description" 149bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 150bc168a6cSRobert Watson.It "Trailer Magic 2 bytes Trailer magic number" 151bc168a6cSRobert Watson.It "Record Byte Count 4 bytes Number of bytes in record" 152ca0716f5SRobert Watson.El 153ca0716f5SRobert Watson.Ss Arbitrary Data Token 154ca0716f5SRobert WatsonThe 155bc168a6cSRobert Watson.Dq arbitrary data 156ca0716f5SRobert Watsontoken contains a byte stream of opaque (untyped) data. 157ca0716f5SRobert WatsonThe size of the data is calculated as the size of each unit of data 158aa772005SRobert Watsonmultiplied by the number of units of data. 159ca0716f5SRobert WatsonA 160bc168a6cSRobert Watson.Dq How to print 161ca0716f5SRobert Watsonfield is present to specify how to print the data, but interpretation of 162ca0716f5SRobert Watsonthat field is not currently defined. 16322ccb20dSRobert WatsonAn 164bc168a6cSRobert Watson.Dq arbitrary data 16522ccb20dSRobert Watsontoken can be created using 16622ccb20dSRobert Watson.Xr au_to_data 3 . 167bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 168bc168a6cSRobert Watson.It Sy "Field Bytes Description" 169bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 170bc168a6cSRobert Watson.It "How to Print 1 byte User-defined printing information" 171bc168a6cSRobert Watson.It "Basic Unit 1 byte Size of a unit in bytes" 172bc168a6cSRobert Watson.It "Unit Count 1 byte Number of units of data present" 173bc168a6cSRobert Watson.It "Data Items Variable User data" 174ca0716f5SRobert Watson.El 175ca0716f5SRobert Watson.Ss in_addr Token 176ca0716f5SRobert WatsonThe 177bc168a6cSRobert Watson.Dq in_addr 17852267f74SRobert Watsontoken holds a network byte order IPv4 address. 179ca0716f5SRobert WatsonAn 180bc168a6cSRobert Watson.Dq in_addr 181ca0716f5SRobert Watsontoken can be created using 182ca0716f5SRobert Watson.Xr au_to_in_addr 3 18352267f74SRobert Watsonfor an IPv4 address. 18452267f74SRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 18552267f74SRobert Watson.It Sy "Field Bytes Description" 18652267f74SRobert Watson.It "Token ID 1 byte Token ID" 18752267f74SRobert Watson.It "IP Address 4 bytes IPv4 address" 18852267f74SRobert Watson.El 18952267f74SRobert Watson.Ss Expanded in_addr Token 19052267f74SRobert WatsonThe 19152267f74SRobert Watson.Dq in_addr_ex 19252267f74SRobert Watsontoken holds a network byte order IPv4 or IPv6 address. 19352267f74SRobert WatsonAn 19452267f74SRobert Watson.Dq in_addr_ex 19552267f74SRobert Watsontoken can be created using 196ca0716f5SRobert Watson.Xr au_to_in_addr_ex 3 197ca0716f5SRobert Watsonfor an IPv6 address. 198ca0716f5SRobert Watson.Pp 199bc168a6cSRobert WatsonSee the 200bc168a6cSRobert Watson.Sx BUGS 201bc168a6cSRobert Watsonsection for information on the storage of this token. 202bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 203bc168a6cSRobert Watson.It Sy "Field Bytes Description" 204bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 205bc168a6cSRobert Watson.It "IP Address Type 1 byte Type of address" 206bc168a6cSRobert Watson.It "IP Address 4/16 bytes IPv4 or IPv6 address" 207ca0716f5SRobert Watson.El 208ca0716f5SRobert Watson.Ss ip Token 209ca0716f5SRobert WatsonThe 210bc168a6cSRobert Watson.Dq ip 211ca0716f5SRobert Watsontoken contains an IP packet header in network byte order. 212ca0716f5SRobert WatsonAn 213bc168a6cSRobert Watson.Dq ip 21423bf6e20SRobert Watsontoken can be created using 215ca0716f5SRobert Watson.Xr au_to_ip 3 . 216bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 217bc168a6cSRobert Watson.It Sy "Field Bytes Description" 218bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 219bc168a6cSRobert Watson.It "Version and IHL 1 byte Version and IP header length" 220bc168a6cSRobert Watson.It "Type of Service 1 byte IP TOS field" 221bc168a6cSRobert Watson.It "Length 2 bytes IP packet length in network byte order" 222bc168a6cSRobert Watson.It "ID 2 bytes IP header ID for reassembly" 223bc168a6cSRobert Watson.It "Offset 2 bytes IP fragment offset and flags, network byte order" 224bc168a6cSRobert Watson.It "TTL 1 byte IP Time-to-Live" 225bc168a6cSRobert Watson.It "Protocol 1 byte IP protocol number" 226bc168a6cSRobert Watson.It "Checksum 2 bytes IP header checksum, network byte order" 227bc168a6cSRobert Watson.It "Source Address 4 bytes IPv4 source address" 228bc168a6cSRobert Watson.It "Destination Address 4 bytes IPv4 destination address" 229ca0716f5SRobert Watson.El 230ca0716f5SRobert Watson.Ss iport Token 231ca0716f5SRobert WatsonThe 232bc168a6cSRobert Watson.Dq iport 233ca0716f5SRobert Watsontoken stores an IP port number in network byte order. 234ca0716f5SRobert WatsonAn 235bc168a6cSRobert Watson.Dq iport 236ca0716f5SRobert Watsontoken can be created using 237ca0716f5SRobert Watson.Xr au_to_iport 3 . 238bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 239bc168a6cSRobert Watson.It Sy "Field Bytes Description" 240bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 241bc168a6cSRobert Watson.It "Port Number 2 bytes Port number in network byte order" 242ca0716f5SRobert Watson.El 243ca0716f5SRobert Watson.Ss Path Token 244ca0716f5SRobert WatsonThe 245bc168a6cSRobert Watson.Dq path 246ca0716f5SRobert Watsontoken contains a pathname. 247ca0716f5SRobert WatsonA 248bc168a6cSRobert Watson.Dq path 249ca0716f5SRobert Watsontoken can be created using 25023bf6e20SRobert Watson.Xr au_to_path 3 . 251bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 252bc168a6cSRobert Watson.It Sy "Field Bytes Description" 253bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 254bc168a6cSRobert Watson.It "Path Length 2 bytes Length of path in bytes" 255bc168a6cSRobert Watson.It "Path N bytes + 1 NUL Path name" 256ca0716f5SRobert Watson.El 257ca0716f5SRobert Watson.Ss path_attr Token 258ca0716f5SRobert WatsonThe 259bc168a6cSRobert Watson.Dq path_attr 260bc168a6cSRobert Watsontoken contains a set of NUL-terminated path names. 261ca0716f5SRobert WatsonThe 262ca0716f5SRobert Watson.Xr libbsm 3 26323bf6e20SRobert WatsonAPI cannot currently create a 264bc168a6cSRobert Watson.Dq path_attr 265ca0716f5SRobert Watsontoken. 266bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 267bc168a6cSRobert Watson.It Sy "Field Bytes Description" 268bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 269bc168a6cSRobert Watson.It "Count 2 bytes Number of NUL-terminated string(s) in token" 270bc168a6cSRobert Watson.It "Path Variable count NUL-terminated string(s)" 271ca0716f5SRobert Watson.El 272ca0716f5SRobert Watson.Ss Process Token 273ca0716f5SRobert WatsonThe 274bc168a6cSRobert Watson.Dq process 275ca0716f5SRobert Watsontoken contains a description of the security properties of a process 276ca0716f5SRobert Watsoninvolved as the target of an auditable event, such as the destination for 277ca0716f5SRobert Watsonsignal delivery. 278ca0716f5SRobert WatsonIt should not be confused with the 279bc168a6cSRobert Watson.Dq subject 280ca0716f5SRobert Watsontoken, which describes the subject performing an auditable event. 281ca0716f5SRobert WatsonThis includes both the traditional 282ca0716f5SRobert Watson.Ux 283ca0716f5SRobert Watsonsecurity properties, such as user IDs and group IDs, but also audit 28423bf6e20SRobert Watsoninformation such as the audit user ID and session. 285ca0716f5SRobert WatsonA 286bc168a6cSRobert Watson.Dq process 287ca0716f5SRobert Watsontoken can be created using 288ca0716f5SRobert Watson.Xr au_to_process32 3 289ca0716f5SRobert Watsonor 290ca0716f5SRobert Watson.Xr au_to_process64 3 . 291bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 292bc168a6cSRobert Watson.It Sy "Field Bytes Description" 293bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 294bc168a6cSRobert Watson.It "Audit ID 4 bytes Audit user ID" 295bc168a6cSRobert Watson.It "Effective User ID 4 bytes Effective user ID" 296bc168a6cSRobert Watson.It "Effective Group ID 4 bytes Effective group ID" 297bc168a6cSRobert Watson.It "Real User ID 4 bytes Real user ID" 298bc168a6cSRobert Watson.It "Real Group ID 4 bytes Real group ID" 299bc168a6cSRobert Watson.It "Process ID 4 bytes Process ID" 300bc168a6cSRobert Watson.It "Session ID 4 bytes Audit session ID" 301bc168a6cSRobert Watson.It "Terminal Port ID 4/8 bytes Terminal port ID (32/64-bits)" 302bc168a6cSRobert Watson.It "Terminal Machine Address 4 bytes IP address of machine" 303ca0716f5SRobert Watson.El 304ca0716f5SRobert Watson.Ss Expanded Process Token 305742561f0SRobert WatsonThe 306bc168a6cSRobert Watson.Dq expanded process 307ca0716f5SRobert Watsontoken contains the contents of the 308bc168a6cSRobert Watson.Dq process 309ca0716f5SRobert Watsontoken, with the addition of a machine address type and variable length 310ca0716f5SRobert Watsonaddress storage capable of containing IPv6 addresses. 31123bf6e20SRobert WatsonAn 312bc168a6cSRobert Watson.Dq expanded process 313ca0716f5SRobert Watsontoken can be created using 314ca0716f5SRobert Watson.Xr au_to_process32_ex 3 315ca0716f5SRobert Watsonor 31623bf6e20SRobert Watson.Xr au_to_process64_ex 3 . 317bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 318bc168a6cSRobert Watson.It Sy "Field Bytes Description" 319bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 320bc168a6cSRobert Watson.It "Audit ID 4 bytes Audit user ID" 321bc168a6cSRobert Watson.It "Effective User ID 4 bytes Effective user ID" 322bc168a6cSRobert Watson.It "Effective Group ID 4 bytes Effective group ID" 323bc168a6cSRobert Watson.It "Real User ID 4 bytes Real user ID" 324bc168a6cSRobert Watson.It "Real Group ID 4 bytes Real group ID" 325bc168a6cSRobert Watson.It "Process ID 4 bytes Process ID" 326bc168a6cSRobert Watson.It "Session ID 4 bytes Audit session ID" 327bc168a6cSRobert Watson.It "Terminal Port ID 4/8 bytes Terminal port ID (32/64-bits)" 328*3008333dSChristian S.J. Peron.It "Terminal Address Type/Length 4 bytes Length of machine address" 329bc168a6cSRobert Watson.It "Terminal Machine Address 4 bytes IPv4 or IPv6 address of machine" 330ca0716f5SRobert Watson.El 331ca0716f5SRobert Watson.Ss Return Token 332ca0716f5SRobert WatsonThe 333bc168a6cSRobert Watson.Dq return 334ca0716f5SRobert Watsontoken contains a system call or library function return condition, including 335ca0716f5SRobert Watsonreturn value and error number associated with the global variable 336ca0716f5SRobert Watson.Er errno . 337ca0716f5SRobert WatsonA 338bc168a6cSRobert Watson.Dq return 339ca0716f5SRobert Watsontoken can be created using 340ca0716f5SRobert Watson.Xr au_to_return32 3 341ca0716f5SRobert Watsonor 342ca0716f5SRobert Watson.Xr au_to_return64 3 . 343bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 344bc168a6cSRobert Watson.It Sy "Field Bytes Description" 345bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 346bc168a6cSRobert Watson.It "Error Number 1 byte Errno value, or 0 if undefined" 347bc168a6cSRobert Watson.It "Return Value 4/8 bytes Return value (32/64-bits)" 348ca0716f5SRobert Watson.El 349ca0716f5SRobert Watson.Ss Subject Token 350ca0716f5SRobert WatsonThe 351bc168a6cSRobert Watson.Dq subject 352ca0716f5SRobert Watsontoken contains information on the subject performing the operation described 353ca0716f5SRobert Watsonby an audit record, and includes similar information to that found in the 354bc168a6cSRobert Watson.Dq process 355ca0716f5SRobert Watsonand 356bc168a6cSRobert Watson.Dq expanded process 357ca0716f5SRobert Watsontokens. 358ca0716f5SRobert WatsonHowever, those tokens are used where the process being described is the 359ca0716f5SRobert Watsontarget of the operation, not the authorizing party. 360ca0716f5SRobert WatsonA 361bc168a6cSRobert Watson.Dq subject 362ca0716f5SRobert Watsontoken can be created using 363ca0716f5SRobert Watson.Xr au_to_subject32 3 364ca0716f5SRobert Watsonand 365ca0716f5SRobert Watson.Xr au_to_subject64 3 . 366bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 367bc168a6cSRobert Watson.It Sy "Field Bytes Description" 368bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 369bc168a6cSRobert Watson.It "Audit ID 4 bytes Audit user ID" 370bc168a6cSRobert Watson.It "Effective User ID 4 bytes Effective user ID" 371bc168a6cSRobert Watson.It "Effective Group ID 4 bytes Effective group ID" 372bc168a6cSRobert Watson.It "Real User ID 4 bytes Real user ID" 373bc168a6cSRobert Watson.It "Real Group ID 4 bytes Real group ID" 374bc168a6cSRobert Watson.It "Process ID 4 bytes Process ID" 375bc168a6cSRobert Watson.It "Session ID 4 bytes Audit session ID" 376bc168a6cSRobert Watson.It "Terminal Port ID 4/8 bytes Terminal port ID (32/64-bits)" 377bc168a6cSRobert Watson.It "Terminal Machine Address 4 bytes IP address of machine" 378ca0716f5SRobert Watson.El 379ca0716f5SRobert Watson.Ss Expanded Subject Token 380ca0716f5SRobert WatsonThe 381bc168a6cSRobert Watson.Dq expanded subject 382ca0716f5SRobert Watsontoken consists of the same elements as the 383bc168a6cSRobert Watson.Dq subject 384ca0716f5SRobert Watsontoken, with the addition of type/length and variable size machine address 385ca0716f5SRobert Watsoninformation in the terminal ID. 38623bf6e20SRobert WatsonAn 387bc168a6cSRobert Watson.Dq expanded subject 388ca0716f5SRobert Watsontoken can be created using 389ca0716f5SRobert Watson.Xr au_to_subject32_ex 3 390ca0716f5SRobert Watsonor 391ca0716f5SRobert Watson.Xr au_to_subject64_ex 3 . 392bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 393bc168a6cSRobert Watson.It Sy "Field Bytes Description" 394bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 395bc168a6cSRobert Watson.It "Audit ID 4 bytes Audit user ID" 396bc168a6cSRobert Watson.It "Effective User ID 4 bytes Effective user ID" 397bc168a6cSRobert Watson.It "Effective Group ID 4 bytes Effective group ID" 398bc168a6cSRobert Watson.It "Real User ID 4 bytes Real user ID" 399bc168a6cSRobert Watson.It "Real Group ID 4 bytes Real group ID" 400bc168a6cSRobert Watson.It "Process ID 4 bytes Process ID" 401bc168a6cSRobert Watson.It "Session ID 4 bytes Audit session ID" 402bc168a6cSRobert Watson.It "Terminal Port ID 4/8 bytes Terminal port ID (32/64-bits)" 403bc168a6cSRobert Watson.It "Terminal Address Type/Length 1 byte Length of machine address" 404bc168a6cSRobert Watson.It "Terminal Machine Address 4 bytes IPv4 or IPv6 address of machine" 405ca0716f5SRobert Watson.El 406ca0716f5SRobert Watson.Ss System V IPC Token 407ca0716f5SRobert WatsonThe 408bc168a6cSRobert Watson.Dq System V IPC 409bc168a6cSRobert Watsontoken contains the System V IPC message handle, semaphore handle or shared 410bc168a6cSRobert Watsonmemory handle. 411bc168a6cSRobert WatsonA System V IPC token may be created using 412bc168a6cSRobert Watson+.Xr au_to_ipc 3 . 413bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 414bc168a6cSRobert Watson.It Sy "Field Bytes Description" 415bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 416bc168a6cSRobert Watson.It "Object ID type 1 byte Object ID" 417bc168a6cSRobert Watson.It "Object ID 4 bytes Object ID" 418ca0716f5SRobert Watson.El 419ca0716f5SRobert Watson.Ss Text Token 420ca0716f5SRobert WatsonThe 421bc168a6cSRobert Watson.Dq text 422bc168a6cSRobert Watsontoken contains a single NUL-terminated text string. 423ca0716f5SRobert WatsonA 424bc168a6cSRobert Watson.Dq text 425ca0716f5SRobert Watsontoken may be created using 426ca0716f5SRobert Watson.Xr au_to_text 3 . 427bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 428bc168a6cSRobert Watson.It Sy "Field Bytes Description" 429bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 430bc168a6cSRobert Watson.It "Text Length 2 bytes Length of text string including NUL" 431bc168a6cSRobert Watson.It "Text N bytes + 1 NUL Text string including NUL" 432ca0716f5SRobert Watson.El 433ca0716f5SRobert Watson.Ss Attribute Token 434ca0716f5SRobert WatsonThe 435bc168a6cSRobert Watson.Dq attribute 436ca0716f5SRobert Watsontoken describes the attributes of a file associated with the audit event. 437ca0716f5SRobert WatsonAs files may be identified by 0, 1, or many path names, a path name is not 438ca0716f5SRobert Watsonincluded with the attribute block for a file; optional 439bc168a6cSRobert Watson.Dq path 440ca0716f5SRobert Watsontokens may also be present in an audit record indicating which path, if any, 441ca0716f5SRobert Watsonwas used to reach the object. 44223bf6e20SRobert WatsonAn 443bc168a6cSRobert Watson.Dq attribute 444ca0716f5SRobert Watsontoken can be created using 445ca0716f5SRobert Watson.Xr au_to_attr32 3 446ca0716f5SRobert Watsonor 447ca0716f5SRobert Watson.Xr au_to_attr64 3 . 448bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 449bc168a6cSRobert Watson.It Sy "Field Bytes Description" 450bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 451bc168a6cSRobert Watson.It "File Access Mode 1 byte mode_t associated with file" 452bc168a6cSRobert Watson.It "Owner User ID 4 bytes uid_t associated with file" 453bc168a6cSRobert Watson.It "Owner Group ID 4 bytes gid_t associated with file" 454bc168a6cSRobert Watson.It "File System ID 4 bytes fsid_t associated with file" 455bc168a6cSRobert Watson.It "File System Node ID 8 bytes ino_t associated with file" 456bc168a6cSRobert Watson.It "Device 4/8 bytes Device major/minor number (32/64-bit)" 457ca0716f5SRobert Watson.El 458ca0716f5SRobert Watson.Ss Groups Token 459ca0716f5SRobert WatsonThe 460bc168a6cSRobert Watson.Dq groups 461ca0716f5SRobert Watsontoken contains a list of group IDs associated with the audit event. 462ca0716f5SRobert WatsonA 463bc168a6cSRobert Watson.Dq groups 464ca0716f5SRobert Watsontoken can be created using 465ca0716f5SRobert Watson.Xr au_to_groups 3 . 466bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 467bc168a6cSRobert Watson.It Sy "Field Bytes Description" 468bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 469bc168a6cSRobert Watson.It "Number of Groups 2 bytes Number of groups in token" 470bc168a6cSRobert Watson.It "Group List N * 4 bytes List of N group IDs" 471ca0716f5SRobert Watson.El 472ca0716f5SRobert Watson.Ss System V IPC Permission Token 473ca0716f5SRobert WatsonThe 474bc168a6cSRobert Watson.Dq System V IPC permission 475bc168a6cSRobert Watsontoken contains a System V IPC access permissions. 476bc168a6cSRobert WatsonA System V IPC permission token may be created using 477bc168a6cSRobert Watson.Xr au_to_ipc_perm 3 . 478bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 479bc168a6cSRobert Watson.It Sy "Field Bytes Description" 480bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 481bc168a6cSRobert Watson.It Li "Owner user ID" Ta "4 bytes" Ta "User ID of IPC owner" 482bc168a6cSRobert Watson.It Li "Owner group ID" Ta "4 bytes" Ta "Group ID of IPC owner" 483bc168a6cSRobert Watson.It Li "Creator user ID" Ta "4 bytes" Ta "User ID of IPC creator" 484bc168a6cSRobert Watson.It Li "Creator group ID" Ta "4 bytes" Ta "Group ID of IPC creator" 485bc168a6cSRobert Watson.It Li "Access mode" Ta "4 bytes" Ta "Access mode" 486aa772005SRobert Watson.It Li "Sequence number" Ta "4 bytes" Ta "Sequence number" 487bc168a6cSRobert Watson.It Li "Key" Ta "4 bytes" Ta "IPC key" 488ca0716f5SRobert Watson.El 489ca0716f5SRobert Watson.Ss Arg Token 490ca0716f5SRobert WatsonThe 491bc168a6cSRobert Watson.Dq arg 492aa772005SRobert Watsontoken contains information about arguments of the system call. 493bc168a6cSRobert WatsonDepending on the size of the desired argument value, an Arg token may be 494bc168a6cSRobert Watsoncreated using 495bc168a6cSRobert Watson.Xr au_to_arg32 3 496bc168a6cSRobert Watsonor 497bc168a6cSRobert Watson.Xr au_to_arg64 3 . 498bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 499bc168a6cSRobert Watson.It Sy "Field Bytes Description" 500bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 501bc168a6cSRobert Watson.It Li "Argument ID" Ta "1 byte" Ta "Argument ID" 502bc168a6cSRobert Watson.It Li "Argument value" Ta "4/8 bytes" Ta "Argument value" 503bc168a6cSRobert Watson.It Li "Length" Ta "2 bytes" Ta "Length of the text" 504bc168a6cSRobert Watson.It Li "Text" Ta "N bytes + 1 nul" Ta "The string including nul" 505ca0716f5SRobert Watson.El 506ca0716f5SRobert Watson.Ss exec_args Token 507ca0716f5SRobert WatsonThe 508bc168a6cSRobert Watson.Dq exec_args 509aa772005SRobert Watsontoken contains information about arguments of the exec() system call. 510bc168a6cSRobert WatsonAn exec_args token may be created using 511bc168a6cSRobert Watson.Xr au_to_exec_args 3 . 512bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 513bc168a6cSRobert Watson.It Sy "Field Bytes Description" 514bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 515bc168a6cSRobert Watson.It Li "Count" Ta "4 bytes" Ta "Number of arguments" 5167a0a89d2SRobert Watson.It Li "Text" Ta "* bytes" Ta "Count nul-terminated strings" 517ca0716f5SRobert Watson.El 518ca0716f5SRobert Watson.Ss exec_env Token 519ca0716f5SRobert WatsonThe 520bc168a6cSRobert Watson.Dq exec_env 521aa772005SRobert Watsontoken contains current environment variables to an exec() system call. 522bc168a6cSRobert WatsonAn exec_args token may be created using 523bc168a6cSRobert Watson.Xr au_to_exec_env 3 . 524bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 525bc168a6cSRobert Watson.It Sy "Field Bytes Description" 526bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 527bc168a6cSRobert Watson.It Li "Count ID" Ta "4 bytes" Ta "Number of variables" 528bc168a6cSRobert Watson.It Li "Text" Ta "* bytes" Ta "Count nul-terminated strings" 529ca0716f5SRobert Watson.El 530ca0716f5SRobert Watson.Ss Exit Token 531ca0716f5SRobert WatsonThe 532bc168a6cSRobert Watson.Dq exit 533ca0716f5SRobert Watsontoken contains process exit/return code information. 534ca0716f5SRobert WatsonAn 535bc168a6cSRobert Watson.Dq exit 536ca0716f5SRobert Watsontoken can be created using 537ca0716f5SRobert Watson.Xr au_to_exit 3 . 538bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 539bc168a6cSRobert Watson.It Sy "Field Bytes Description" 540bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 541bc168a6cSRobert Watson.It "Status 4 bytes Process status on exit" 542bc168a6cSRobert Watson.It "Return Value 4 bytes Process return value on exit" 543ca0716f5SRobert Watson.El 544ca0716f5SRobert Watson.Ss Socket Token 545ca0716f5SRobert WatsonThe 546bc168a6cSRobert Watson.Dq socket 54752267f74SRobert Watsontoken contains information about UNIX domain and Internet sockets. 548bc168a6cSRobert WatsonEach token has four or eight fields. 54952267f74SRobert WatsonDepending on the type of socket, a socket token may be created using 550bc168a6cSRobert Watson.Xr au_to_sock_unix 3 , 55152267f74SRobert Watson.Xr au_to_sock_inet32 3 55252267f74SRobert Watsonor 553bc168a6cSRobert Watson.Xr au_to_sock_inet128 3 . 55452267f74SRobert Watson.Bl -column -offset 3n ".Sy Field Name Width XX" ".Sy XX Bytes XXXX" ".Sy Description" 555ca0716f5SRobert Watson.It Sy "Field" Ta Sy Bytes Ta Sy Description 556ca0716f5SRobert Watson.It Li "Token ID" Ta "1 byte" Ta "Token ID" 557bc168a6cSRobert Watson.It Li "Socket family" Ta "2 bytes" Ta "Socket family" 558bc168a6cSRobert Watson.It Li "Local port" Ta "2 bytes" Ta "Local port" 559bc168a6cSRobert Watson.It Li "Socket address" Ta "4 bytes" Ta "Socket address" 560bc168a6cSRobert Watson.El 561ca0716f5SRobert Watson.Ss Expanded Socket Token 562ca0716f5SRobert WatsonThe 563bc168a6cSRobert Watson.Dq expanded socket 56452267f74SRobert Watsontoken contains information about IPv4 and IPv6 sockets. 5657a0a89d2SRobert WatsonA 5667a0a89d2SRobert Watson.Dq expanded socket 5677a0a89d2SRobert Watsontoken can be created using 5687a0a89d2SRobert Watson.Xr au_to_socket_ex 3 . 569bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 570bc168a6cSRobert Watson.It Sy "Field Bytes Description" 5717a0a89d2SRobert Watson.It Li "Token ID" Ta "1 byte" Ta "Token ID" 5727a0a89d2SRobert Watson.It Li "Socket domain" Ta "2 bytes" Ta "Socket domain" 5737a0a89d2SRobert Watson.It Li "Socket type" Ta "2 bytes" Ta "Socket type" 5747a0a89d2SRobert Watson.It Li "Address type" Ta "2 byte" Ta "Address type (IPv4/IPv6)" 5757a0a89d2SRobert Watson.It Li "Local port" Ta "2 bytes" Ta "Local port" 5767a0a89d2SRobert Watson.It Li "Local IP address" Ta "4/16 bytes" Ta "Local IP address" 5777a0a89d2SRobert Watson.It Li "Remote port" Ta "2 bytes" Ta "Remote port" 5787a0a89d2SRobert Watson.It Li "Remote IP address" Ta "4/16 bytes" Ta "Remote IP address" 579ca0716f5SRobert Watson.El 580ca0716f5SRobert Watson.Ss Seq Token 581ca0716f5SRobert WatsonThe 582bc168a6cSRobert Watson.Dq seq 583ca0716f5SRobert Watsontoken contains a unique and monotonically increasing audit event sequence ID. 584ca0716f5SRobert WatsonDue to the limited range of 32 bits, serial number arithmetic and caution 585ca0716f5SRobert Watsonshould be used when comparing sequence numbers. 586bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 587bc168a6cSRobert Watson.It Sy "Field Bytes Description" 588bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 589bc168a6cSRobert Watson.It "Sequence Number 4 bytes Audit event sequence number" 590ca0716f5SRobert Watson.El 591ca0716f5SRobert Watson.Ss privilege Token 592ca0716f5SRobert WatsonThe 593bc168a6cSRobert Watson.Dq privilege 594ca0716f5SRobert Watsontoken ... 595bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 596bc168a6cSRobert Watson.It Sy "Field Bytes Description" 597bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 598ca0716f5SRobert Watson.El 599ca0716f5SRobert Watson.Ss Use-of-auth Token 600ca0716f5SRobert WatsonThe 601bc168a6cSRobert Watson.Dq use-of-auth 602ca0716f5SRobert Watsontoken ... 603bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 604bc168a6cSRobert Watson.It Sy "Field Bytes Description" 605bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 606ca0716f5SRobert Watson.El 607ca0716f5SRobert Watson.Ss Command Token 608ca0716f5SRobert WatsonThe 609bc168a6cSRobert Watson.Dq command 610ca0716f5SRobert Watsontoken ... 611bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 612bc168a6cSRobert Watson.It Sy "Field Bytes Description" 613bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 614ca0716f5SRobert Watson.El 615ca0716f5SRobert Watson.Ss ACL Token 616ca0716f5SRobert WatsonThe 617bc168a6cSRobert Watson.Dq ACL 618ca0716f5SRobert Watsontoken ... 619bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 620bc168a6cSRobert Watson.It Sy "Field Bytes Description" 621bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 622ca0716f5SRobert Watson.El 623ca0716f5SRobert Watson.Ss Zonename Token 624ca0716f5SRobert WatsonThe 625bc168a6cSRobert Watson.Dq zonename 62652267f74SRobert Watsontoken holds a NUL-terminated string with the name of the zone or jail from 62752267f74SRobert Watsonwhich the record originated. 62852267f74SRobert WatsonA 629aa772005SRobert Watson.Dq zonename 63052267f74SRobert Watsontoken can be created using 63152267f74SRobert Watson.Xr au_to_zonename 3 . 632bc168a6cSRobert Watson.Bl -column -offset 3n ".No Terminal Address Type/Length" ".No N bytes + 1 NUL" 633bc168a6cSRobert Watson.It Sy "Field Bytes Description" 634bc168a6cSRobert Watson.It "Token ID 1 byte Token ID" 63552267f74SRobert Watson.It "Zonename length 2 bytes Length of zonename string including NUL" 63652267f74SRobert Watson.It "Zonename N bytes + 1 NUL Zonename string including NUL" 637ca0716f5SRobert Watson.El 638ca0716f5SRobert Watson.Sh SEE ALSO 639bc168a6cSRobert Watson.Xr auditreduce 1 , 640bc168a6cSRobert Watson.Xr praudit 1 , 64123bf6e20SRobert Watson.Xr libbsm 3 , 642bc168a6cSRobert Watson.Xr audit 4 , 643bc168a6cSRobert Watson.Xr auditpipe 4 , 64423bf6e20SRobert Watson.Xr audit 8 645bc168a6cSRobert Watson.Sh HISTORY 646bc168a6cSRobert WatsonThe OpenBSM implementation was created by McAfee Research, the security 647bc168a6cSRobert Watsondivision of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. 648bc168a6cSRobert WatsonIt was subsequently adopted by the TrustedBSD Project as the foundation for 649bc168a6cSRobert Watsonthe OpenBSM distribution. 650ca0716f5SRobert Watson.Sh AUTHORS 651ca0716f5SRobert WatsonThe Basic Security Module (BSM) interface to audit records and audit event 652ca0716f5SRobert Watsonstream format were defined by Sun Microsystems. 653ca0716f5SRobert Watson.Pp 654ca0716f5SRobert WatsonThis manual page was written by 655ca0716f5SRobert Watson.An Robert Watson Aq rwatson@FreeBSD.org . 656ca0716f5SRobert Watson.Sh BUGS 657ca0716f5SRobert WatsonThe 658bc168a6cSRobert Watson.Dq How to print 659ca0716f5SRobert Watsonfield in the 660bc168a6cSRobert Watson.Dq arbitrary data 661ca0716f5SRobert Watsontoken has undefined values. 662ca0716f5SRobert Watson.Pp 663ca0716f5SRobert WatsonThe 664bc168a6cSRobert Watson.Dq in_addr 665ca0716f5SRobert Watsonand 666bc168a6cSRobert Watson.Dq in_addr_ex 667ca0716f5SRobert Watsontoken layout documented here appears to be in conflict with the 668ca0716f5SRobert Watson.Xr libbsm 3 66952267f74SRobert Watsonimplementation of 670ca0716f5SRobert Watson.Xr au_to_in_addr_ex 3 . 671