mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-19 05:31:10 +02:00
* Tidy up of files * Add concepts page for filtering * Update 'Common configuration options' * Update table format (metrics) * Filtering metrics * audit specific filtering * Fix nav and naming of files * updates to audit filtering concept page * Tweaks * audit updates and glossary page addition for 'request' * update CLI docs (audit enable) * added metrics to 'all metrics' page * fallback example and link fix * improve links * updated based on feedback * some extra details on a request for glossary * format fix * use description on fallback device * test message properties * Sort out weird merge for events.mdx * Update website/content/docs/concepts/filtering/audit.mdx Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com> * Update website/content/docs/concepts/filtering/audit.mdx Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com> * Update website/content/docs/concepts/filtering/audit.mdx Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com> * Update website/content/docs/concepts/filtering/audit.mdx Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com> * Update website/content/docs/concepts/filtering/audit.mdx Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com> * Intro paragraph about filtering/normal devices, and uppercase bullets * Fix casing on bullets and table layour * Uppercase bullets * Update website/content/docs/glossary.mdx Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com> * Improvement? * PR feedback * Updated based on PR feedback * Include common options * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Remove extra space * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Split out metrics * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Remove extra word * Updated table formatting, remove close code block etc. * Update website/content/docs/concepts/filtering/index.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> --------- Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com> Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
137 lines
3.6 KiB
Plaintext
137 lines
3.6 KiB
Plaintext
---
|
||
layout: api
|
||
page_title: /sys/audit - HTTP API
|
||
description: The `/sys/audit` endpoint is used to enable and disable audit devices.
|
||
---
|
||
|
||
# `/sys/audit`
|
||
|
||
@include 'alerts/restricted-root.mdx'
|
||
|
||
The `/sys/audit` endpoint is used to list, enable, and disable audit devices.
|
||
Audit devices must be enabled before use, and more than one device may be
|
||
enabled at a time.
|
||
|
||
## List enabled audit devices
|
||
|
||
This endpoint lists only the enabled audit devices (it does not list all
|
||
available audit devices).
|
||
|
||
- **`sudo` required** – This endpoint requires `sudo` capability in addition to
|
||
any path-specific capabilities.
|
||
|
||
| Method | Path |
|
||
|:-------|:-------------|
|
||
| `GET` | `/sys/audit` |
|
||
|
||
### Sample request
|
||
|
||
```shell-session
|
||
$ curl \
|
||
--header "X-Vault-Token: ..." \
|
||
http://127.0.0.1:8200/v1/sys/audit
|
||
```
|
||
|
||
### Sample response
|
||
|
||
```javascript
|
||
{
|
||
"file": {
|
||
"type": "file",
|
||
"description": "Store logs in a file",
|
||
"options": {
|
||
"file_path": "/var/log/vault.log"
|
||
}
|
||
}
|
||
}
|
||
```
|
||
|
||
## Enable audit device
|
||
|
||
This endpoint enables a new audit device at the supplied path. The path can be a
|
||
single word name or a more complex, nested path.
|
||
|
||
- **`sudo` required** – This endpoint requires `sudo` capability in addition to
|
||
any path-specific capabilities.
|
||
|
||
| Method | Path |
|
||
|:-------|:-------------------|
|
||
| `POST` | `/sys/audit/:path` |
|
||
|
||
### Parameters
|
||
|
||
- `path` `(string: <required>)` – Specifies the path in which to enable the audit
|
||
device. This is part of the request URL.
|
||
|
||
- `description` `(string: "")` – Specifies a human-friendly description of the
|
||
audit device.
|
||
|
||
- `options` `(map<string|string>: nil)` – Specifies configuration options to pass to the audit device itself.
|
||
There are a set of [common options](#common-configuration-options)
|
||
which can be applied to all types of audit device.
|
||
For more details, please see the relevant page for an audit device `type`,
|
||
under [Audit Devices docs](/vault/docs/audit).
|
||
|
||
- `type` `(string: <required>)` – Specifies the type of the audit device.
|
||
Valid types are `file`, `socket` and `syslog`.
|
||
|
||
Additionally, the following options are allowed in Vault Community Edition, but
|
||
relevant functionality is only supported in Vault Enterprise:
|
||
|
||
- `local` `(bool: false)` – Applies exclusively to performance replication. Specifies if the audit device is local within the cluster only. Local
|
||
audit devices are not replicated nor (if a secondary) removed by replication.
|
||
|
||
#### Common configuration options
|
||
|
||
@include 'audit-options-common.mdx'
|
||
|
||
### Sample payload
|
||
|
||
```json
|
||
{
|
||
"type": "file",
|
||
"options": {
|
||
"file_path": "/var/log/vault/log"
|
||
}
|
||
}
|
||
```
|
||
|
||
### Sample request
|
||
|
||
```shell-session
|
||
$ curl \
|
||
--header "X-Vault-Token: ..." \
|
||
--request POST \
|
||
--data @payload.json \
|
||
http://127.0.0.1:8200/v1/sys/audit/example-audit
|
||
```
|
||
|
||
## Disable audit device
|
||
|
||
This endpoint disables the audit device at the given path.
|
||
|
||
~> Note: Once an audit device is disabled, you will no longer be able to HMAC values
|
||
for comparison with entries in the audit logs. This is true even if you re-enable
|
||
the audit device at the same path, as a new salt will be created for hashing.
|
||
|
||
- **`sudo` required** – This endpoint requires `sudo` capability in addition to
|
||
any path-specific capabilities.
|
||
|
||
| Method | Path |
|
||
|:---------|:-------------------|
|
||
| `DELETE` | `/sys/audit/:path` |
|
||
|
||
### Parameters
|
||
|
||
- `path` `(string: <required>)` – Specifies the path of the audit device to
|
||
delete. This is part of the request URL.
|
||
|
||
### Sample request
|
||
|
||
```shell-session
|
||
$ curl \
|
||
--header "X-Vault-Token: ..." \
|
||
--request DELETE \
|
||
http://127.0.0.1:8200/v1/sys/audit/example-audit
|
||
```
|