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 the
6 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH AUDIT_REMOTE 5 "Mar 6, 2017"
9 audit_remote \- send audit logs to a remote server
13 \fB/usr/lib/security/audit_remote.so\fR
18 The \fBaudit_remote\fR plugin module for audit,
19 \fB/usr/lib/security/audit_remote.so\fR, sends binary audit records
20 (\fBaudit.log\fR(4)) to audit servers specified in the plugin's attributes
21 configured by \fBauditconfig\fR(1M).
22 .SS "Object Attributes"
24 The following attributes specify the configuration of the \fBaudit_remote\fR
36 \fIhost1\fR[:[\fIport1\fR][:\fImech1\fR]][,\fIhost2\fR[:[\fIport2\fR][:\fImech2\fR]],... \e
37 \fIhostn\fR[:[\fIportn\fR][:\fImechn\fR]]]
42 A list of audit hosts/servers. Audit records are sent to the first available
43 host. If a host is unreachable or a timeout occurs while sending data, the next
44 host in the list is tried. If connection to all hosts fails, the list is tried
45 again from the beginning.
47 The \fIhost\fR part of a \fBp_hosts\fR entry can be in any form acceptable to
48 \fBgetipnodebyname\fR(3SOCKET).
50 The \fIport\fR part of a \fBp_hosts\fR entry is the port on host that is
51 contacted to initiate an audit server connection. If not specified, the port
52 number is that assigned to the \fBsolaris-audit\fR service. See
53 \fBgetservbyname\fR(3XNET).
55 The \fBmech\fR part of a \fBp_host\fR entry is the GSS-API mechanism name
56 (\fBmech\fR(4)). If not specified, the local host's default mechanism is used.
57 The recommended mechanism is \fBkerberos_v5\fR.
67 The number of retries for connecting to and sending data to a server.
69 The default value is \fB3\fR.
79 The number of seconds in which a connection/sending data timeouts.
81 The default value is \fB5\fR seconds.
91 The maximum number of outstanding audit records to keep.
93 The default is the value of the kernel queue control high water mark. See
94 \fBauditconfig\fR(1M).
99 The \fBaudit_remote plugin\fR is a TCP client that authenticates configured
100 audit servers using the GSS-API (\fBlibgss\fR(3LIB)). Binary Audit
101 records are sent with integrity and confidentiality protection as per-message
102 tokens generated by \fBgss_wrap\fR(3GSS).
105 The plugin initiates a TCP connection to an audit server (\fIhost:port:mech\fR)
106 and establishes a GSS security context (with \fBgss_init_sec_context\fR(3GSS)),
107 with appropriate security mechanism (\fBmech\fR(4)).
110 If no port is specified, the service name \fBsolaris-audit\fR is looked up to
111 obtain a TCP port number. If no mechanism is specified, the \fBGSS_C_NO_OID\fR
112 is used as a \fBmech_type\fR parameter of \fBgss_init_sec_context\fR(3GSS), and
113 causes the underlying \fBGSS-API\fR to use the local default mechanism.
116 \fBgss_init_sec_context\fR(3GSS) uses \fBGSS_C_NO_CREDENTIAL\fR as the
117 initiator credential handle and a target name of the form
118 \fBaudit@<ost_fqdn>\fR. The server is expected to use
119 \fBgss_accept_sec_context\fR(3GSS) to complete the context establishment.
122 Once the security context is established, the client (\fBaudit_remote\fR
123 plugin) calls \fBgss_wrap\fR(3GSS) to achieve the confidentiality of the
124 transferred payload - the audit records. The server is expected to use
125 \fBgss_unwrap\fR(3GSS) to unwrap the received data and \fBgss_get_mic\fR(3GSS)
126 to obtain the MIC (Message Integrity Code) to be later sent back to the plugin
127 as a message retrieval acknowledgment.
130 For example, if the \fBkerberos_v5\fR mechanism is configured as \fBGSS_API\fR
131 mechanism on the client and both sides agree on using this mechanism, the
132 client side has to be eligible to non-interactively gain session keys for the
133 \fBaudit/<host_fqdn>@<REALM>\fR principal from the Kerberos KDC/TGS. At the
134 same time the identity running the audit server application has to have the
135 long term keys associated with the \fBaudit/<host_fqdn>@<REALM>\fR principal
136 stored in the \fBkeytab\fR file (\fBkrb5.conf\fR(4)) to be able to decrypt the
140 The \fBaudit_remote\fR plugin initiates a connection to first server in the
141 \fBp_hosts\fR list. If the connection fails or audit record sends are not
142 responded to in \fBp_timeout\fR seconds, after \fBp_retries\fR attempts the
143 plugin tries to connect to the next server. If the connection to the last
144 server fails, the plugin retries to connect to the first host in the list.
145 \fBaudit_warn\fR(1M) is executed at every unsuccessful attempt to connect to
146 the server or send timeout with the plugin option plugin \fBaudit_remote.so
147 retry <count> <error>.<error>\fR is connection \fB<host:port> <the network
148 error>\fR\&. An \fBEPROTO\fR network error indicates that the client plugin did
149 not get a successful protocol version handshake.
150 .SS "PROTOCOL DESCRIPTION"
152 All protocol messages are preceded by the 4 octets of the size of the data to
153 follow. This size is in network byte order.
156 The protocol begins with version negotiation followed by a \fBGSS-API\fR
157 security context token exchange. On error the connection is closed (and any
158 output token optionally sent).
161 The version negotiation takes place in the clear with the plugin sending an
162 octet array of the comma (\fB,\fR) separated list of versions supported. The
163 current version number is the characters \fB01\fR. The receiver is expected to
164 respond with the version that they accept (in the current case that is the
165 characters \fB01\fR). A mismatch is considered an error and the connection is
169 The version octet array sent by the plugin and the version characters accepted
170 by the receiver are concatenated together to make up the application data field
171 of the channel bindings of the GSS security context establishment.
175 <plugin version characters> || <server accepted version characters>"
176 ||" represents concatenation
182 Subsequent tokens contain a 64 bit sequence number in network byte order and a
183 single audit record (\fBaudit.log\fR(4)); the client uses confidentiality
184 protection. wrap (64 bit sequence number || audit record)
187 The server acknowledges the receipt (and is then responsible for any data loss)
188 with the received 64 bit sequence number and a MIC token of the unwrapped 64
189 bit sequence number and audit record. MIC verification on the client side
190 acknowledges the audit record can be freed and not saved for possible
195 64 bit sequence number || mic (64 bit sequence number || audit record)
201 Secure remote audit client/server communication flow:
205 1) Client <--> Server - TCP handshake
207 2) Client <--> Server - protocol version negotiation:
208 a) Client --> Server - send data size - uint32_t value (2)
209 b) Client --> Server - send clear text message of the versions
210 supported comma separated, e.g.,
211 "01,02,03" for versions 1 and 2 and 3.
212 The only version supported at present is
214 c) Client <-- Server - send data size - uint32_t value (2)
215 d) Client <-- Server - send clear text version selected
217 :no version match; close connection; try next host
219 3) Security context initiation:
220 a) Client - Construct channel bindings application data value
222 b) Client --> Server - send token (data) size - uint32_t value
223 c) Client --> Server - GSS-API per-context token
224 d) Client <-- Server - send token (data) size
225 e) Client <-- Server - GSS-API per-context token
226 :repeat a-e until security context is initialized; if unsuccessful,
227 close connection; try next host
229 4) Client - transmit thread, when audit record to be sent:
230 a) Client --> Server - send data size
231 b) Client --> Server - GSS-API per-message token
232 wrap (sequence number || audit record)
233 :repeat a-b while less than max (qsize) outstanding records
235 5) Client - receive thread:
236 a) Client <-- Server - receive data size - uint32_t value
237 b) Client <-- Server - receive sequence number - uint64_t value
238 c) Client <-- Server - receive MIC
239 d) Client - MIC verification - OK
240 e) Client - remove particular audit record
241 pointed by the sequence number from the
243 :repeat a-e, on error close connection; try next host;
244 retransmit unacknowledged audit records
246 6) Server - receive thread:
247 a) Client --> Server - receive data size
248 b) Client --> Server - GSS-API receive, uwrap, store
251 7) Server - transmit thread:
252 a) Server - MIC generation - message integrity code
253 mic (sequence number || audit record)
254 b) Client <-- Server - send data size
255 c) Client < -- Server - send sequence number
256 d) Client <-- Server - send MIC
262 \fBExample 1 \fRActivating \fBaudit_remote.so\fR and Specifying attributes
265 The following commands cause \fBaudit_remote.so\fR to be activated and set
266 the \fBp_retries\fR and \fBp_timeout\fR attributes. Note that using
267 \fBauditconfig\fR(1M) only allows one attribute to be set at a time.
272 # auditconfig -setplugin audit_remote active p_retries=2
273 # auditconfig -setplugin audit_remote active p_timeout=90
278 \fBExample 2 \fRActivating \fBaudit_remote.so\fR and Specifying the Remote Audit
282 The following command causes \fBaudit_remote.so\fR to be activated and specifies
283 the remote audit servers to where the audit records are sent. The
284 \fBkerberos_v5\fR security mechanism is defined to be used when communicating
290 # auditconfig -setplugin audit_remote active \e
291 p_hosts=eggplant.eng.sun.com::kerberos_v5,\e
292 purple.ebay.sun.com:4592:kerberos_v5
297 \fBExample 3 \fRUsing the Configuration of Usage Default Security Mechanism
300 The following example shows the configuration of usage of default security
301 mechanism. It also shows use of default port on one of the configured servers:
306 # auditconfig -setplugin audit_remote active \e
307 p_hosts=jedger.eng.sun.com,\e
308 jbadams.ebay.sun.com:4592
315 See \fBattributes\fR(5) for a description of the following attributes:
323 ATTRIBUTE TYPE ATTRIBUTE VALUE
327 Interface Stability See below.
332 The plugin configuration parameters are Committed. The client/server protocol
333 (version \fB"01"\fR) is Contracted Project Private. See \fBaudit.log\fR(4) for
334 the audit record format and content stability.
337 \fBauditd\fR(1M), \fBauditconfig\fR(1M), \fBaudit_warn\fR(1M),
338 \fBgetipnodebyname\fR(3SOCKET), \fBgetservbyname\fR(3XNET),
339 \fBgss_accept_sec_context\fR(3GSS), \fBgss_get_mic\fR(3GSS),
340 \fBgss_init_sec_context\fR(3GSS), \fBgss_wrap\fR(3GSS), \fBgss_unwrap\fR(3GSS),
341 \fBlibgss\fR(3LIB), \fBlibsocket\fR(3LIB),
342 \fBaudit.log\fR(4), \fBkrb5.conf\fR(4), \fBmech\fR(4), \fBattributes\fR(5),
343 \fBkerberos\fR(5), \fBtcp\fR(7P)
346 \fBaudit_remote\fR authenticates itself to the remote audit service by way of
347 GSS-API (\fBlibgss\fR(3LIB)). Default gss credentials are used as provided by
348 the \fBgss\fR implementation mechanism, such as Kerberos.
351 The \fBsolaris-audit\fR service port assigned by IANA is \fB16162\fR.