xref: /freebsd/contrib/openbsm/libbsm/libbsm.3 (revision 7bd6fde3)
1.\"-
2.\" Copyright (c) 2005-2006 Robert N. M. Watson
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/libbsm.3#8 $
27.\"
28.Dd April 19, 2005
29.Dt LIBBSM 3
30.Os
31.Sh NAME
32.Nm libbsm
33.Nd "Basic Security Module (BSM) Audit API"
34.Sh LIBRARY
35.Lb libbsm
36.Sh SYNOPSIS
37.In libbsm.h
38.Sh DESCRIPTION
39The
40.Nm
41library routines provide an interface to BSM audit record streams, allowing
42both the parsing of existing audit streams, as well as the creation of new
43audit records and streams.
44.Sh INTERFACES
45.Nm
46provides a large number of Audit programming interfaces in several classes:
47event stream interfaces, class interfaces, control interfaces, event
48interfaces, I/O interfaces, mask interfaces, notification interfaces, token
49interfaces, and user interfaces.
50These are described respectively in the
51.Xr au_class 3 ,
52.Xr au_control 3 ,
53.Xr au_event 3 ,
54.Xr au_mask 3 ,
55.Xr au_notify 3 ,
56.Xr au_stream 3 ,
57.Xr au_token 3 ,
58and
59.Xr au_user 3
60manual pages.
61.Ss Audit Event Stream Interfaces
62Audit event stream interfaces support interaction with file-backed audit
63event streams:
64.Xr au_close 3 ,
65.Xr au_close_buffer 3 ,
66.Xr au_free_token 3 ,
67.Xr au_open 3 ,
68.Xr au_write 3 ,
69.Xr audit_submit 3 .
70.Ss Audit Class Interfaces
71Audit class interfaces support the look up of information from the
72.Xr audit_class 5
73database:
74.Xr endauclass 3 ,
75.Xr getauclassent 3 ,
76.Xr getauclassent_r 3 ,
77.Xr getauclassnam 3 ,
78.Xr getauclassnam_r 3 ,
79.Xr setauclass 3 .
80.Ss Audit Control Interfaces
81Audit control interfaces support the look up of information from the
82.Xr audit_control 5
83database:
84.Xr endac 3 ,
85.Xr setac 3 ,
86.Xr getacdir 3 ,
87.Xr getacfilesz 3 ,
88.Xr getacflg 3 ,
89.Xr getacmin 3 ,
90.Xr getacna 3 ,
91.Xr getacpol 3 ,
92.Xr au_poltostr 3 ,
93.Xr au_strtopol 3 .
94.Ss Audit Event Interfaces
95Audit event interfaces support the look up of information from the
96.Xr audit_event 5
97database:
98.Xr endauevent 3 ,
99.Xr setauevent 3 ,
100.Xr getauevent 3 ,
101.Xr getauevent_r 3 ,
102.Xr getauevnam 3 ,
103.Xr getauevnam_r 3 ,
104.Xr getauevnonam 3 ,
105.Xr getauevnonam_r 3 ,
106.Xr getauevnum 3 ,
107.Xr getauevnum_r 3 .
108.Ss Audit I/O Interfaces
109Audit I/O interfaces support the processing and printing of tokens, as well
110as the reading of audit records:
111.Xr au_fetch_tok 3 ,
112.Xr au_print_tok 3 ,
113.Xr au_read_rec 3 .
114.Ss Audit Mask Interfaces
115Audit mask interfaces convert support the conversion between strings and
116.Vt au_mask_t
117values.
118They may also be used to determine if a particular audit event is matched
119by a mask:
120.Xr au_preselect 3 ,
121.Xr getauditflagsbin 3 ,
122.Xr getauditflagschar 3 .
123.Ss Audit Notification Interfaces
124Audit notification routines track audit state in a form permitting efficient
125update, avoiding frequent system calls to check the kernel audit state:
126.Xr au_get_state 3 ,
127.Xr au_notify_initialize 3 ,
128.Xr au_notify_terminate 3 .
129These interfaces are implemented only for Darwin/Mac OS X.
130.Ss Audit Token Interface
131Audit token interfaces permit the creation of tokens for use in creating
132audit records for submission to event streams.
133Each interface converts a C type to its
134.Vt token_t
135representation.
136.Xr au_to_arg 3 ,
137.Xr au_to_arg32 3 ,
138.Xr au_to_arg64 3 ,
139.Xr au_to_attr64 3 ,
140.Xr au_to_data 3 ,
141.Xr au_to_exec_args 3 ,
142.Xr au_to_exec_env 3 ,
143.Xr au_to_exit 3 ,
144.Xr au_to_file 3 ,
145.Xr au_to_groups 3 ,
146.Xr au_to_header32 3 ,
147.Xr au_to_header64 3 ,
148.Xr au_to_in_addr 3 ,
149.Xr au_to_in_addr_ex 3 ,
150.Xr au_to_ip 3 ,
151.Xr au_to_ipc 3 ,
152.Xr au_to_ipc_perm 3 ,
153.Xr au_to_iport 3 ,
154.Xr au_to_me 3 ,
155.Xr au_to_newgroups 3 ,
156.Xr au_to_opaque 3 ,
157.Xr au_to_path 3 ,
158.Xr au_to_process 3 ,
159.Xr au_to_process32 3 ,
160.Xr au_to_process64 3 ,
161.Xr au_to_process_ex 3 ,
162.Xr au_to_process32_ex 3 ,
163.Xr au_to_process64_ex 3 ,
164.Xr au_to_return 3 ,
165.Xr au_to_return32 3 ,
166.Xr au_to_return64 3 ,
167.Xr au_to_seq 3 ,
168.Xr au_to_sock_inet 3 ,
169.Xr au_to_sock_inet32 3 ,
170.Xr au_to_sock_inet128 3 ,
171.Xr au_to_subject 3 ,
172.Xr au_to_subject32 3 ,
173.Xr au_to_subject64 3 ,
174.Xr au_to_subject_ex 3 ,
175.Xr au_to_subject32_ex 3 ,
176.Xr au_to_subject64_ex 3 ,
177.Xr au_to_text 3 ,
178.Xr au_to_trailer 3 .
179.Ss Audit User Interfaces
180Audit user interfaces support the look up of information from the
181.Xr audit_user 5
182database:
183.Xr au_user_mask 3 ,
184.Xr endauuser 3 ,
185.Xr setauuser 3 ,
186.Xr getauuserent 3 ,
187.Xr getauuserent_r 3 ,
188.Xr getauusernam 3 ,
189.Xr getauusernam_r 3 ,
190.Xr getfauditflags 3 .
191.Sh SEE ALSO
192.Xr au_class 3 ,
193.Xr au_mask 3 ,
194.Xr au_notify 3 ,
195.Xr au_stream 3 ,
196.Xr au_token 3 ,
197.Xr au_user 3 ,
198.Xr audit_submit 3 ,
199.Xr audit_class 5 ,
200.Xr audit_control 5
201.Sh AUTHORS
202This software was created by Robert Watson, Wayne Salamon, and Suresh
203Krishnaswamy for McAfee Research, the security research division of McAfee,
204Inc., under contract to Apple Computer, Inc.
205.Pp
206The Basic Security Module (BSM) interface to audit records and audit event
207stream format were defined by Sun Microsystems.
208.Sh HISTORY
209The OpenBSM implementation was created by McAfee Research, the security
210division of McAfee Inc., under contract to Apple Computer, Inc., in 2004.
211It was subsequently adopted by the TrustedBSD Project as the foundation for
212the OpenBSM distribution.
213.Sh BUGS
214Bugs would not be unlikely.
215.Pp
216The
217.Nm
218library implementations are generally thread-safe, but not reentrant.
219.Pp
220The assignment of routines to classes could use some work, as it is
221decidely ad hoc.
222For example,
223.Fn au_read_rec
224should probably be considered a stream routine.
225