open-vault/http
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
..
assets.go Convert to Go 1.17 go:build directive (#13579) 2022-01-05 12:02:03 -06:00
assets_stub.go Convert to Go 1.17 go:build directive (#13579) 2022-01-05 12:02:03 -06:00
auth_token_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
cors.go Migrate to sdk/internalshared libs in go-secure-stdlib (#12090) 2021-07-15 20:17:31 -04:00
custom_header_test.go Customizing HTTP headers in the config file (#12485) 2021-10-13 11:06:33 -04:00
forwarded_for_test.go Revert "Migrate internalshared out (#9727)" (#10141) 2020-10-13 16:38:21 -07:00
forwarding_bench_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
forwarding_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
handler.go VAULT-1564 report in-flight requests (#13024) 2021-12-08 17:34:42 -05:00
handler_test.go add retry logic to TestKV_Patch_RootToken (#13586) 2022-01-07 14:46:26 -05:00
help.go Reorganize request handling code so that we don't touch storage until we have the stateLock. (#11835) 2021-06-11 13:18:16 -04:00
help_test.go Authenticate to "login" endpoint for non-existent mount path bug (#13162) 2021-11-22 17:06:59 -08:00
http_test.go Customizing HTTP headers in the config file (#12485) 2021-10-13 11:06:33 -04:00
logical.go Add remote_port in the audit logs when it is available (#12790) 2022-01-26 15:47:15 -08:00
logical_test.go Add remote_port in the audit logs when it is available (#12790) 2022-01-26 15:47:15 -08:00
plugin_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
sys_audit_test.go Re-add injecting into top routes (#5244) 2018-09-05 11:45:17 -04:00
sys_auth_test.go Add missed description field for GET /sys/auth/:path/tune endpoint (#8193) 2020-02-15 10:32:47 -08:00
sys_config_cors_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
sys_config_state_test.go VAULT-1564 report in-flight requests (#13024) 2021-12-08 17:34:42 -05:00
sys_feature_flags.go Feature flags API (#10613) 2021-01-06 16:05:00 -06:00
sys_generate_root.go Migrate to sdk/internalshared libs in go-secure-stdlib (#12090) 2021-07-15 20:17:31 -04:00
sys_generate_root_test.go Add helper for encoding/decoding root tokens and OTP generation in SDK module (#10504) (#10505) 2021-12-01 08:05:49 -05:00
sys_health.go Migrate to sdk/internalshared libs in go-secure-stdlib (#12090) 2021-07-15 20:17:31 -04:00
sys_health_test.go OSS parts of #1891 (sys/health license addition) (#11676) 2021-05-20 13:32:15 -04:00
sys_hostinfo_test.go sys: add host-info endpoint (#7330) 2019-10-03 09:43:52 -07:00
sys_in_flight_requests.go VAULT-1564 report in-flight requests (#13024) 2021-12-08 17:34:42 -05:00
sys_in_flight_requests_test.go VAULT-1564 report in-flight requests (#13024) 2021-12-08 17:34:42 -05:00
sys_init.go Support processing parameters sent as a URL-encoded form (#8325) 2020-02-12 14:20:22 -08:00
sys_init_test.go Tackle #4929 a different way (#4932) 2018-07-24 13:57:25 -07:00
sys_internal_test.go Kv preflight (#4430) 2018-04-23 15:00:02 -07:00
sys_leader.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
sys_leader_test.go core: Record the time a node became active (#10489) 2020-12-11 16:50:19 -08:00
sys_lease_test.go Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
sys_metrics.go Customizing HTTP headers in the config file (#12485) 2021-10-13 11:06:33 -04:00
sys_metrics_test.go Authenticate to "login" endpoint for non-existent mount path bug (#13162) 2021-11-22 17:06:59 -08:00
sys_monitor_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
sys_mount_test.go Add a new parameter "allowed_managed_keys" to mount config (#13202) 2021-11-21 19:08:38 -06:00
sys_mounts_test.go Rename "generic" secret backend to "kv" (#3292) 2017-09-15 09:02:29 -04:00
sys_policy_test.go Re-add injecting into top routes (#5244) 2018-09-05 11:45:17 -04:00
sys_raft.go Migrate to sdk/internalshared libs in go-secure-stdlib (#12090) 2021-07-15 20:17:31 -04:00
sys_rekey.go Support processing parameters sent as a URL-encoded form (#8325) 2020-02-12 14:20:22 -08:00
sys_rekey_test.go The big one (#5346) 2018-09-17 23:03:00 -04:00
sys_rotate_test.go OSS side barrier encryption tracking and automatic rotation (#11007) 2021-02-25 14:27:25 -06:00
sys_seal.go Implement sys/seal-status and sys/leader in system backend (#10725) 2021-01-20 14:04:24 -06:00
sys_seal_test.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
sys_wrapping_test.go Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
testing.go Customizing HTTP headers in the config file (#12485) 2021-10-13 11:06:33 -04:00
unwrapping_raw_body_test.go Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
util.go Upgrade go-limiter to fix building on 1.17 (#12358) 2021-09-01 16:28:47 -05:00