-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathauditing-ops-man.html.md.erb
225 lines (190 loc) · 9.01 KB
/
auditing-ops-man.html.md.erb
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
---
title: Auditing Ops Manager User Activity
owner: Ops Man
---
This topic describes how operators can audit the activity of <%= vars.ops_manager_full %> users. The sections in this topic define the relevant logs for auditing user activity and describe how to access and forward the logs.
## <a id ='overview'></a> Overview
You can audit <%= vars.ops_manager %> user activity to help improve security practices in your environment. Auditing user activity also helps you ensure that your environment is compliant with existing security standards.
For example, you can view the timestamp of any requests made in the <%= vars.ops_manager %> UI as well as the username of the user that made the request.
You can find relevant information for auditing user activity in <%= vars.ops_manager %> in the following <%= vars.ops_manager %> logs:
* SSH login logs. For more information, see [Logs for Auditing User Activity](#logs).
* UAA login and failed UAA login logs. For more information, see [Logs for Auditing User Activity](#logs).
* The <%= vars.ops_manager %> `audit_log.txt` file. For more information, see [Audit Logs Text File](#audit-logs-text-file).
## <a id='access-logs'></a> Access Logs on the <%= vars.ops_manager %> VM
You can access logs for auditing user activity by logging on to the <%= vars.ops_manager %> VM using SSH.
To access logs for auditing user activity:
1. SSH onto the <%= vars.ops_manager %> VM using your private SSH key.
1. Navigate to the location of the logs and open or preview the log file. For example, to view the `audit_log.txt` file, run:
```
cat /var/log/opsmanager/audit_log.txt
```
## <a id='logs'></a> Logs for Auditing User Activity
The table below describes the types of user actions that you can audit with logs and the location of the logs.
For information about how to access the logs in this table, see [Access Logs on the <%= vars.ops_manager %> VM](#access-logs).
<table>
<tr>
<th width="15%">User Action</th>
<th width="25%">Description</th>
<th width="30%">Location of Logs</th>
<th width="30%">Example Log Trace</th>
</tr>
<tr>
<td>SSH logins</td>
<td>User logs on to the <%= vars.ops_manager %> VM with SSH.</td>
<td><code>/var/log/auth.log</code></td>
<td>
<code>
2019-06-20T21:58:50.864147+00:00 HOSTNAME sshd[18028]: Accepted publickey for USERNAME from IPADDRESS port PORT ssh2: RSA SHA256:SIGNATURE
2019-06-20T21:58:50.865750+00:00 HOSTNAME sshd[18028]: pam_unix(sshd:session): session
</code>
</td>
</tr>
<tr>
<td>UAA logins</td>
<td>User logs in to <%= vars.ops_manager %> through UAA.</td>
<td><code>/home/tempest-web/uaa/<br />tomcat/logs/uaa.log</code></td>
<td>
<code>
[2019-08-01 07:57:45.830] uaa - 5320 [http-nio-127.0.0.1-8080-exec-7] .... INFO --- Audit: IdentityProviderAuthenticationSuccess ('admin'): principal=1df75be4-7875-4e7e-97fa-fe76dbff4a41, origin=[remoteAddress=127.0.0.1, sessionId=<SESSION>], identityZoneId=[uaa], authenticationType=[uaa]
[2019-08-01 07:57:45.832] uaa - 5320 [http-nio-127.0.0.1-8080-exec-7] .... INFO --- Audit: UserAuthenticationSuccess ('admin'): principal=1df75be4-7875-4e7e-97fa-fe76dbff4a41, origin=[remoteAddress=127.0.0.1, sessionId=<SESSION>], identityZoneId=[uaa]
...
</code>
</td>
</tr>
<tr>
<td>Failed UAA logins</td>
<td>User makes failed login attempt through UAA.</td>
<td><code>/home/tempest-web/uaa/<br />tomcat/logs/uaa.log</code></td>
<td>
<code>
[2019-07-31 23:13:48.437] uaa - 1184 [http-nio-127.0.0.1-8080-exec-5] .... INFO --- Audit: IdentityProviderAuthenticationFailure ('admin'): principal=null, origin=[remoteAddress=209.234.137.222, sessionId=<SESSION>], identityZoneId=[uaa], authenticationType=[uaa]
[2019-07-31 23:13:48.438] uaa - 1184 [http-nio-127.0.0.1-8080-exec-5] .... INFO --- Audit: UserAuthenticationFailure ('admin'): principal=2bdf7f2a-862d-47d7-bf7f-ba92da6850c0, origin=[remoteAddress=209.234.137.222, sessionId=<SESSION>], identityZoneId=[uaa]
...
</code>
</td>
</tr>
<tr>
<td>User requests</td>
<td>User makes requests in the <%= vars.ops_manager %> app. The <code>audit_log.txt</code> file includes metadata about user requests in the <%= vars.ops_manager %> app.</td>
<td><code>/var/log/opsmanager/<br/>audit_log.txt</code></td>
<td>For information about the properties in the <code>audit_log.txt</code> file, see <a href=#audit-logs-text-file><%= vars.ops_manager %> Audit Logs Text File</a>.</td>
</tr>
</table>
## <a id='audit-logs-text-file'></a> Audit Logs Text File
The <%= vars.ops_manager %> `audit_log.txt` file includes metadata about actions taken by users in the <%= vars.ops_manager %> app in JSON format.
Below is an example of the content in the `audit_log.txt` file:
```
{
"timestamp":"2019-07-13T00:43:08.783+00:00",
"component":"<%= vars.ops_manager %> 2.7.0-build.87",
"component_scheme":"https",
"component_host":"<%= vars.product_name_lc %>.example.opsmanager.cf-app.com",
"component_port":443,
"result":200,
"target":"/proxy_settings",
"event_type":"PUT",
"origination":"123.456.789",
"user_identification":"admin",
"uaa_authentication_mechanism":"uaa",
"request_body":{
"authenticity_token":"[FILTERED]",
"proxy_settings":{
"http_proxy":"http://example.com",
"https_proxy":"https://example.com",
"no_proxy":"1.2.3.4"
}
}
}
```
The table below describes the properties in the `audit_log.txt` file and provides example values for each property:
<table>
<tr>
<th width="35%">User Action Property</th>
<th width="35%">Description</th>
<th width="30%">Example Value</th>
</tr>
<tr>
<td><code>user_identification</code></td>
<td>The username or client ID that submitted a request.</td>
<td><code>admin</code></td>
</tr>
<tr>
<td><code>uaa_authentication_mechanism</code></td>
<td>The authentication method used to make the request.
<br/><br/>
<code>(unauthenticated)</code> for unauthenticated requests, <code>uaa</code> for a UAA user login, or <code>client_authenticated</code> for an API-only client.</td>
<td><code>uaa</code></td>
</tr>
<tr>
<td><code>origination</code></td>
<td>The IP address that made the request to the server.</td>
<td><code>198.10.1.25</code></td>
</tr>
<tr>
<td><code>timestamp</code></td>
<td>The time that the server received the request.</td>
<td><code>2019-07-21 08:34:00</code></td>
</tr>
<tr>
<td><code>target</code></td>
<td>The relative URL path associated with the request.</td>
<td><code>/infrastructure/director/resource_config/edit</code></td>
</tr>
<tr>
<td><code>event_type</code></td>
<td>The HTTP verb associated with the request.</td>
<td><code>GET</code></td>
</tr>
<tr>
<td><code>result</code></td>
<td>The HTTP response code associated with the request.
<br/><br/>
Results beginning with <code>2</code> indicate a successful request. Results beginning with <code>4</code> indicate a failed request due to user error. Results beginning with <code>5</code> indicate a server error.</td>
<td><code>200</code></td>
</tr>
<tr>
<td><code>component</code></td>
<td>The version of <%= vars.ops_manager %> on which the request was made.</td>
<td><code><%= vars.ops_manager %> 2.7.0-build.234</code></td>
</tr>
<tr>
<td><code>component_scheme</code></td>
<td>The transport protocol used for the request.</td>
<td><code>HTTPS</code></td>
</tr>
<tr>
<td><code>component_host</code></td>
<td>The domain name used for the request.</td>
<td><code><%= vars.product_name_lc %>.ops-manager-domain.com</code></td>
</tr>
<tr>
<td><code>component_port</code></td>
<td>The port used for the request.</td>
<td><code>443</code></td>
</tr>
<tr>
<td><code>request_body</code></td>
<td>A JSON object that contains the contents of the query paramaters, request body, and routing parameters for the request. Any credentials sent within the request are replaced with the value <code>[FILTERED]</code>. Any file uploads are excluded.</td>
<td>
<code>
{ "authenticity_token": "[FILTERED]",
"director_configuration": {
"ntp_servers_string": "ntp-server",
"encryption": {
"keys": "[FILTERED]"
},
"blobstore_type": "local"
}
}
</code>
</td>
</tr>
</table>
## <a id='forward-syslog'></a> Forward Logs
You can forward some <%= vars.ops_manager %> logs using syslog forwarding. This allows you to forward logs to a syslog server or other third-party destination for storage and analysis.
These logs contain relevant information for auditing user activity and can be forwarded using syslog forwarding:
* `audit_log.txt`
* `uaa.log`
* `uaa_events.logs`
When syslog forwarding is enabled, <%= vars.ops_manager %> automatically forwards BOSH Director access events. These events allow you to audit BOSH Director access and the execution of BOSH CLI commands. For more information about BOSH Director access events, see [Logging API Access](https://bosh.io/docs/director-access-events/) in the BOSH documentation.
For more information about syslog forwarding in <%= vars.ops_manager %>, see [Syslog](../customizing/pcf-interface.html#syslog) in _Using the <%= vars.ops_manager %> Interface_.