open-vault/sdk/plugin
Rémi Lapeyre cf8b5642f2
Add remote_port in the audit logs when it is available (#12790)
* Add remote_port in the audit logs when it is available

The `request.remote_port` field is now present in the audit log when it
is available:

```
{
  "time": "2021-10-10T13:53:51.760039Z",
  "type": "response",
  "auth": {
    "client_token": "hmac-sha256:1304aab0ac65747684e1b58248cc16715fa8f558f8d27e90fcbcb213220c0edf",
    "accessor": "hmac-sha256:f8cf0601dadd19aac84f205ded44c62898e3746a42108a51105a92ccc39baa43",
    "display_name": "root",
    "policies": [
      "root"
    ],
    "token_policies": [
      "root"
    ],
    "token_type": "service",
    "token_issue_time": "2021-10-10T15:53:44+02:00"
  },
  "request": {
    "id": "829c04a1-0352-2d9d-9bc9-00b928d33df5",
    "operation": "update",
    "mount_type": "system",
    "client_token": "hmac-sha256:1304aab0ac65747684e1b58248cc16715fa8f558f8d27e90fcbcb213220c0edf",
    "client_token_accessor": "hmac-sha256:f8cf0601dadd19aac84f205ded44c62898e3746a42108a51105a92ccc39baa43",
    "namespace": {
      "id": "root"
    },
    "path": "sys/audit/file",
    "data": {
      "description": "hmac-sha256:321a1d105f8c6fd62be4f34c4da4f0e6d1cdee9eb2ff4af0b59e1410950fe86b",
      "local": false,
      "options": {
        "file_path": "hmac-sha256:2421b5bf8dab1f9775b2e6e66e58d7bca99ab729f3f311782fda50717eee55b3"
      },
      "type": "hmac-sha256:30dff9607b4087e3ae6808b4a3aa395b1fc064e467748c55c25ddf0e9b150fcc"
    },
    "remote_address": "127.0.0.1",
    "remote_port": 54798
  },
  "response": {
    "mount_type": "system"
  }
}
```

Closes https://github.com/hashicorp/vault/issues/7716

* Add changelog entry

* Empty commit to trigger CI

* Add test and explicit error handling

* Change temporary file pattern in test
2022-01-26 15:47:15 -08:00
..
mock Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
pb Add remote_port in the audit logs when it is available (#12790) 2022-01-26 15:47:15 -08:00
backend.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
grpc_backend.go Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
grpc_backend_client.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
grpc_backend_server.go Update protobuf & grpc libraries and protoc plugins (#12679) 2021-09-29 18:25:15 -07:00
grpc_backend_test.go AWS upgrade role entries (#7025) 2019-07-05 16:55:40 -07:00
grpc_storage.go Update protobuf & grpc libraries and protoc plugins (#12679) 2021-09-29 18:25:15 -07:00
grpc_system.go Update protobuf & grpc libraries and protoc plugins (#12679) 2021-09-29 18:25:15 -07:00
grpc_system_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
logger.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
logger_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
middleware.go AWS upgrade role entries (#7025) 2019-07-05 16:55:40 -07:00
plugin.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
serve.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
storage_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00