16.2. 审计日志消息示例
日志消息的格式如下:
{
"headers": {
"Accept-Encoding": [
"gzip"
],
"Content-Length": [
"586"
],
"Content-Type": [
"application/json"
],
"User-Agent": [
"Go-http-client/1.1"
]
},
"data": {
"audit": {
"interaction": "CREATE",
"method": "UI",
"request": {
"endpoint": "/v1/notifiers",
"method": "POST",
"source": {
"requestAddr": "10.131.0.7:58276",
"xForwardedFor": "8.8.8.8",
},
"sourceIp": "8.8.8.8",
"payload": {
"@type": "storage.Notifier",
"enabled": true,
"generic": {
"auditLoggingEnabled": true,
"endpoint": "http://samplewebhookserver.com:8080"
},
"id": "b53232ee-b13e-47e0-b077-1e383c84aa07",
"name": "Webhook",
"type": "generic",
"uiEndpoint": "https://localhost:8000"
}
},
"status": "REQUEST_SUCCEEDED",
"time": "2019-05-28T16:07:05.500171300Z",
"user": {
"friendlyName": "John Doe",
"role": {
"globalAccess": "READ_WRITE_ACCESS",
"name": "Admin"
},
"username": "john.doe@example.com"
}
}
}
}
请求的源 IP 地址显示在源参数中,这有助于调查审计日志请求并识别其源。
要确定请求的源 IP 地址,RHACS 使用以下参数:
-
XForwardedFor: X-Forwarded-For 标头。 -
requestAddr:远程地址标头。 -
SourceIp:HTTP 请求的 IP 地址。
重要
源 IP 地址的确定取决于您如何在外部公开 Central。您可以考虑以下选项:
- 如果您在负载均衡器后面公开 Central,例如,如果您在 Google Kubernetes Engine (GKE)或 Amazon Elastic Kubernetes Service (Amazon EKS)上运行 Central,请参阅 保留客户端源 IP。
- 如果您在使用 X-Forwarded-For 标头 转发请求的 Ingress Controller 后公开 Central,则不需要进行任何配置更改。
- 如果您使用 TLS passthrough 路由公开 Central,则无法确定客户端的源 IP 地址。源参数中会显示集群内部 IP 地址,作为客户端的源 IP 地址。