forked from pivotal-cf/docs-ops-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauditing-ops-man.html.md.erb
222 lines (188 loc) · 8.34 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
---
title: Auditing Ops Manager User Activity
owner: Ops Man
---
This topic describes how operators can audit the activity of Ops Manager 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 Ops Manager user activity to help improve security practices for your <%= vars.first_product_name %> 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 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 Ops Manager in the following Ops Manager logs:
* SSH login logs. See [Logs for Auditing User Activity](#logs).
* UAA login and failed UAA login logs. See [Logs for Auditing User Activity](#logs).
* The Ops Manager `audit_log.txt` file. See [Audit Logs Text File](#audit-logs-text-file).
## <a id='access-logs'></a> Access Logs on the Ops Manager VM
You can access logs for auditing user activity by logging on to the Ops Manager VM using SSH.
To access logs for auditing user activity, do the following:
1. SSH onto the 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 the following command:
```
cat /var/log/opsmanager/audit_log.txt
```
## <a id='logs'></a> Logs for Auditing User Activity
The following table describes the types of user actions that you can audit with logs. The table also lists the location of the logs.
For information about how to access the logs in the following table, see [Access Logs on the 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 onto the 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 into 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 Ops Manager app. The <code>audit_log.txt</code> file includes metadata about user requests in the Ops Manager app.</td>
<td><code>/var/log/opsmanager/<br/>audit_log.txt</code></td>
<td>
See <a href=#audit-logs-text-file>Ops Manager Audit Logs Text File</a> for information about the properties in the <code>audit_log.txt</code> file.
</td>
</tr>
</table>
## <a id='audit-logs-text-file'></a> Audit Logs Text File
The Ops Manager `audit_log.txt` file includes metadata about actions taken by users in the Ops Manager app in JSON format.
The following is an example of the content in the `audit_log.txt` file:
```
{
"timestamp":"2019-07-13T00:43:08.783+00:00",
"component":"Ops Manager 2.7.0-build.87",
"component_scheme":"https",
"component_host":"pcf.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 following table describes the properties in the `audit_log.txt` file. It also 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>user_identification</td>
<td>The username or client ID that submitted a request.</td>
<td><code>admin</code></td>
</tr>
<tr>
<td>uaa_authentication_mechanism</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>origination</td>
<td>The IP address that made the request to the server.</td>
<td><code>198.10.1.25</code></td>
</tr>
<tr>
<td>timestamp</td>
<td>The time that the server received the request.</td>
<td><code>2019-07-21 08:34:00</code></td>
</tr>
<tr>
<td>target</td>
<td>The relative URL path associated with the request.</td>
<td><code>/infrastructure/director/resource_config/edit</code></td>
</tr>
<tr>
<td>event_type</td>
<td>The HTTP verb associated with the request.</td>
<td><code>GET</code></td>
</tr>
<tr>
<td>result</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>component</td>
<td>The version of Ops Manager on which the request was made.</td>
<td><code>Ops Manager 2.7.0-build.234</code></td>
</tr>
<tr>
<td>component_scheme</td>
<td>The transport protocol used for the request.</td>
<td><code>HTTPS</code></td>
</tr>
<tr>
<td>component_host</td>
<td>The domain name used for the request.</td>
<td><code>pcf.my-ops-manager.com</code></td>
</tr>
<tr>
<td>component_port</td>
<td>The port used for the request.</td>
<td><code>443</code></td>
</tr>
<tr>
<td>request_body</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 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.
The logs in `audit_log.txt` contain relevant information for auditing user activity and can be forwarded using syslog forwarding. However, the logs in `/home/tempest-web/uaa/tomcat/logs/uaa.log` cannot be forwarded using syslog forwarding.
For more information about syslog forwarding in Ops Manager, see the [Syslog](../customizing/pcf-interface.html#syslog) section in the _Using the Ops Manager Interface_ topic.