aboutsummaryrefslogtreecommitdiff
path: root/libbsm/au_control.3
blob: d4d4450264710086a7fde3f3c44e41b45e28d256 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
.\"-
.\" Copyright (c) 2005-2006 Robert N. M. Watson
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd April 19, 2005
.Dt AU_CONTROL 3
.Os
.Sh NAME
.Nm setac ,
.Nm endac ,
.Nm getacdir ,
.Nm getacdist ,
.Nm getacexpire ,
.Nm getacfilesz ,
.Nm getacflg ,
.Nm getachost ,
.Nm getacmin ,
.Nm getacna ,
.Nm getacpol ,
.Nm au_poltostr ,
.Nm au_strtopol
.Nd "look up information from the audit_control database"
.Sh LIBRARY
.Lb libbsm
.Sh SYNOPSIS
.In bsm/libbsm.h
.Ft void
.Fn setac void
.Ft void
.Fn endac void
.Ft int
.Fn getacdir "char *name" "int len"
.Ft int
.Fn getacdist "void"
.Ft int
.Fn getacexpire "int *andflg" "time_t *age" "size_t *size"
.Ft int
.Fn getacfilesz "size_t *size_val"
.Ft int
.Fn getacflg "char *auditstr" "int len"
.Ft int
.Fn getachost "char *auditstr" "int len"
.Ft int
.Fn getacmin "int *min_val"
.Ft int
.Fn getacna "char *auditstr" "int len"
.Ft int
.Fn getacpol "char *auditstr" "size_t len"
.Ft ssize_t
.Fn au_poltostr "int policy" "size_t maxsize" "char *buf"
.Ft int
.Fn au_strtopol "const char *polstr" "int *policy"
.Sh DESCRIPTION
These interfaces may be used to look up information from the
.Xr audit_control 5
database, which contains various audit-related administrative parameters.
.Pp
The
.Fn setac
function
resets the database iterator to the beginning of the database; see the
.Sx BUGS
section for more information.
.Pp
The
.Fn endac
function
closes the
.Xr audit_control 5
database.
.Pp
The
.Fn getacdir
function
returns the name of the directory where log data is stored via the passed
character buffer
.Fa name
of length
.Fa len .
.Pp
The
.Fn getacdist
function returns a value that allows to decide if trail files distribution is
turned on or off.
.Pp
The
.Fn getacexpire
function
returns the audit trail file expiration parameters in the passed
.Vt int
buffer
.Fa andflg ,
.Vt time_t
buffer
.Fa age
and
.Vt size_t
buffer
.Fa size .
If the parameter is not specified in the
.Xr audit_control 5
file it is set to zero.
.Pp
The
.Fn getacfilesz
function
returns the audit trail rotation size in the passed
.Vt size_t
buffer
.Fa size_val .
.Pp
The
.Fn getacflg
function
returns the audit system flags via the the passed character buffer
.Fa auditstr
of length
.Fa len .
.Pp
The
.Fn getachost
function
returns the local systems's audit host information via the the passed character
buffer
.Fa auditstr
of length
.Fa len .
.Pp
The
.Fn getacmin
function
returns the minimum free disk space for the audit log target file system via
the passed
.Fa min_val
variable.
.Pp
The
.Fn getacna
function
returns the non-attributable flags via the passed character buffer
.Fa auditstr
of length
.Fa len .
.Pp
The
.Fn getacpol
function
returns the audit policy flags via the passed character buffer
.Fa auditstr
of length
.Fa len .
.Pp
The
.Fn au_poltostr
function
converts a numeric audit policy mask,
.Fa policy ,
to a string in the passed character buffer
.Fa buf
of lenth
.Fa maxsize .
.Pp
The
.Fn au_strtopol
function
converts an audit policy flags string,
.Fa polstr ,
to a numeric audit policy mask returned via
.Fa policy .
.Sh RETURN VALULES
The
.Fn getacfilesz ,
.Fn getacdir ,
.Fn getacexpire ,
.Fn getacflg ,
.Fn getachost ,
.Fn getacmin ,
.Fn getacna ,
.Fn getacpol ,
and
.Fn au_strtopol
functions
return 0 on success, or a negative value on failure, along with error
information in
.Va errno .
.Pp
The
.Fn au_poltostr
function
returns a string length of 0 or more on success, or a negative value on
if there is a failure.
.Pp
The
.Fn getacdist
function returns 1 if trail files distribution is turned on, 0 if it is turned
off or negative value on failure.
.Pp
Functions that return a string value will return a failure if there is
insufficient room in the passed character buffer for the full string.
.Sh SEE ALSO
.Xr libbsm 3 ,
.Xr audit_control 5
.Sh HISTORY
The OpenBSM implementation was created by McAfee Research, the security
division of McAfee Inc., under contract to Apple Computer, Inc., in 2004.
It was subsequently adopted by the TrustedBSD Project as the foundation for
the OpenBSM distribution.
.Sh AUTHORS
.An -nosplit
This software was created by
.An Robert Watson ,
.An Wayne Salamon ,
and
.An Suresh Krishnaswamy
for McAfee Research, the security research division of McAfee,
Inc., under contract to Apple Computer, Inc.
.Pp
The Basic Security Module (BSM) interface to audit records and audit event
stream format were defined by Sun Microsystems.
.Sh BUGS
These routines cannot currently distinguish between an entry not being found
and an error accessing the database.
The implementation should be changed to return an error via
.Va errno
when
.Dv NULL
is returned.
.Pp
There is no reason for the
.Fn setac
interface to be exposed as part of the public API, as it is called implicitly
by other access functions and iteration is not supported.
.Pp
These interfaces inconsistently return various negative values depending on
the failure mode, and do not always set
.Va errno
on failure.