]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/openbsm/libbsm/au_token.3
Merge nc(1) from OpenBSD 4.4. While there, rename our '-O' (no
[FreeBSD/FreeBSD.git] / contrib / openbsm / libbsm / au_token.3
1 .\"-
2 .\" Copyright (c) 2005-2007 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 AUTHOR 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 AUTHOR 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/au_token.3#15 $
27 .\"
28 .Dd April 19, 2005
29 .Dt AU_TOKEN 3
30 .Os
31 .Sh NAME
32 .Nm au_to_arg32 ,
33 .Nm au_to_arg64 ,
34 .Nm au_to_arg ,
35 .Nm au_to_attr64 ,
36 .Nm au_to_data ,
37 .Nm au_to_exit ,
38 .Nm au_to_groups ,
39 .Nm au_to_newgroups ,
40 .Nm au_to_in_addr ,
41 .Nm au_to_in_addr_ex ,
42 .Nm au_to_ip ,
43 .Nm au_to_ipc ,
44 .Nm au_to_ipc_perm ,
45 .Nm au_to_iport ,
46 .Nm au_to_opaque ,
47 .Nm au_to_file ,
48 .Nm au_to_text ,
49 .Nm au_to_path ,
50 .Nm au_to_process32 ,
51 .Nm au_to_process64 ,
52 .Nm au_to_process ,
53 .Nm au_to_process32_ex ,
54 .Nm au_to_process64_ex ,
55 .Nm au_to_process_ex ,
56 .Nm au_to_return32 ,
57 .Nm au_to_return64 ,
58 .Nm au_to_return ,
59 .Nm au_to_seq ,
60 .Nm au_to_sock_inet32 ,
61 .Nm au_to_sock_inet128 ,
62 .Nm au_to_sock_inet ,
63 .Nm au_to_subject32 ,
64 .Nm au_to_subject64 ,
65 .Nm au_to_subject ,
66 .Nm au_to_subject32_ex ,
67 .Nm au_to_subject64_ex ,
68 .Nm au_to_subject_ex ,
69 .Nm au_to_me ,
70 .Nm au_to_exec_args ,
71 .Nm au_to_exec_env ,
72 .Nm au_to_header ,
73 .Nm au_to_header32 ,
74 .Nm au_to_header64 ,
75 .Nm au_to_header_ex ,
76 .Nm au_to_header32_ex ,
77 .Nm au_to_trailer ,
78 .Nm au_to_zonename
79 .Nd "routines for generating BSM audit tokens"
80 .Sh LIBRARY
81 .Lb libbsm
82 .Sh SYNOPSIS
83 .In bsm/libbsm.h
84 .Ft "token_t *"
85 .Fn au_to_arg32 "char n" "const char *text" "u_int32_t v"
86 .Ft "token_t *"
87 .Fn au_to_arg64 "char n" "const char *text" "u_int64_t v"
88 .Ft "token_t *"
89 .Fn au_to_arg "char n" "const char *text" "u_int32_t v"
90 .Ft "token_t *"
91 .Fn au_to_attr32 "struct vattr *attr"
92 .Ft "token_t *"
93 .Fn au_to_attr64 "struct vattr *attr"
94 .Ft "token_t *"
95 .Fn au_to_attr "struct vattr *attr"
96 .Ft "token_t *"
97 .Fn au_to_data "char unit_print" "char unit_type" "char unit_count" "const char *p"
98 .Ft "token_t *"
99 .Fn au_to_exit "int retval" "int err"
100 .Ft "token_t *"
101 .Fn au_to_groups "int *groups"
102 .Ft "token_t *"
103 .Fn au_to_newgroups "u_int16_t n" "gid_t *groups"
104 .Ft "token_t *"
105 .Fn au_to_in_addr "struct in_addr *internet_addr"
106 .Ft "token_t *"
107 .Fn au_to_in_addr_ex "struct in6_addr *internet_addr"
108 .Ft "token_t *"
109 .Fn au_to_ip "struct ip *ip"
110 .Ft "token_t *"
111 .Fn au_to_ipc "char type" "int id"
112 .Ft "token_t *"
113 .Fn au_to_ipc_perm "struct ipc_perm *perm"
114 .Ft "token_t *"
115 .Fn au_to_iport "u_int16_t iport"
116 .Ft "token_t *"
117 .Fn au_to_opaque "const char *data" "u_int16_t bytes"
118 .Ft "token_t *"
119 .Fn au_to_file "const char *file" "struct timeval tm"
120 .Ft "token_t *"
121 .Fn au_to_text "const char *text"
122 .Ft "token_t *"
123 .Fn au_to_path "const char *text"
124 .Ft "token_t *"
125 .Fo au_to_process32
126 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
127 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_t *tid"
128 .Fc
129 .Ft "token_t *"
130 .Fo au_to_process64
131 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
132 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_t *tid"
133 .Fc
134 .Ft "token_t *"
135 .Fo au_to_process32_ex
136 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
137 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_addr_t *tid"
138 .Fc
139 .Ft "token_t *"
140 .Fo au_to_process64_ex
141 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
142 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_addr_t *tid"
143 .Fc
144 .Ft "token_t *"
145 .Fn au_to_return32 "char status" "u_int32_t ret"
146 .Ft "token_t *"
147 .Fn au_to_return64 "char status" "u_int64_t ret"
148 .Ft "token_t *"
149 .Fn au_to_return "char status" "u_int32_t ret"
150 .Ft "token_t *"
151 .Fn au_to_seq "long audit_count"
152 .Ft "token_t *"
153 .Fn au_to_sock_inet32 "struct sockaddr_in *so"
154 .Ft "token_t *"
155 .Fn au_to_sock_inet128 "struct sockaddr_in6 *so"
156 .Ft "token_t *"
157 .Fn au_to_sock_int "struct sockaddr_in *so"
158 .Ft "token_t *"
159 .Fo au_to_subject32
160 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
161 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_t *tid"
162 .Fc
163 .Ft "token_t *"
164 .Fo au_to_subject64
165 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
166 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_t *tid"
167 .Fc
168 .Ft "token_t *"
169 .Fo au_to_subject
170 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
171 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_t *tid"
172 .Fc
173 .Ft "token_t *"
174 .Fo au_to_subject32_ex
175 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
176 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_addr_t *tid"
177 .Fc
178 .Ft "token_t *"
179 .Fo au_to_subject64_ex
180 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
181 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_addr_t *tid"
182 .Fc
183 .Ft "token_t *"
184 .Fo au_to_subject_ex
185 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid"
186 .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_addr_t *tid"
187 .Fc
188 .Ft "token_t *"
189 .Fn au_to_me void
190 .Ft "token_t *"
191 .Fn au_to_exec_args "char **argv"
192 .Ft "token_t *"
193 .Fn au_to_exec_env "char **envp"
194 .Ft "token_t *"
195 .Fn au_to_header "int rec_size" "au_event_t e_type" "au_emod_t emod"
196 .Ft "token_t *"
197 .Fn au_to_header32 "int rec_size" "au_event_t e_type" "au_emod_t emod"
198 .Ft "token_t *"
199 .Fn au_to_header64 "int rec_size" "au_event_t e_type" "au_emod_t e_mod"
200 .Ft "token_t *"
201 .Fn au_to_header_ex "int rec_size" "au_event_t e_type" "au_emod_t e_mod"
202 .Ft "token_t *"
203 .Fn au_to_header32_ex "int rec_size" "au_event_t e_type" "au_emod_t e_mod"
204 .Ft "token_t *"
205 .Fn au_to_trailer "int rec_size"
206 .Ft "token_t *"
207 .Fn au_to_zonename "const char *zonename"
208 .Sh DESCRIPTION
209 These interfaces support the allocation of BSM audit tokens, represented by
210 .Vt token_t ,
211 for various data types.
212 .Sh RETURN VALUES
213 On success, a pointer to a
214 .Vt token_t
215 will be returned; the allocated
216 .Vt token_t
217 can be freed via a call to
218 .Xr au_free_token 3 .
219 On failure,
220 .Dv NULL
221 will be returned, and an error condition returned via
222 .Va errno .
223 .Sh SEE ALSO
224 .Xr libbsm 3
225 .Sh HISTORY
226 The OpenBSM implementation was created by McAfee Research, the security
227 division of McAfee Inc., under contract to Apple Computer, Inc., in 2004.
228 It was subsequently adopted by the TrustedBSD Project as the foundation for
229 the OpenBSM distribution.
230 .Sh AUTHORS
231 .An -nosplit
232 This software was created by
233 .An Robert Watson ,
234 .An Wayne Salamon ,
235 and
236 .An Suresh Krishnaswamy
237 for McAfee Research, the security research division of McAfee,
238 Inc., under contract to Apple Computer, Inc.
239 .Pp
240 The Basic Security Module (BSM) interface to audit records and audit event
241 stream format were defined by Sun Microsystems.