Vault Audit Devices
Vault Audit Devices
Details
Interact with vault's audit devices. For more details, see https://developer.hashicorp.com/vault/docs/audit
Super class
vaultr::vault_client_object
-> vault_client_audit
Methods
Inherited methods
Method new()
Create an audit object
Usage
vault_client_audit$new(api_client)
Arguments
api_client
a vault_api_client object
Method list()
List active audit devices. Returns a data.frame of names, paths and descriptions of active audit devices.
Examples
server <- vaultr::vault_test_server(if_disabled = message)
#> ...waiting for Vault to start
#> ...waiting for Vault to start
if (!is.null(server)) {
client <- server$client()
# By default no audit engines are enabled with the testing server
client$audit$list()
# Create a file-based audit device on a temporary file:
path <- tempfile()
client$audit$enable("file", options = list(file_path = path))
client$audit$list()
# Generate some activity on the server:
client$write("/secret/mysecret", list(key = "value"))
# The audit logs contain details about the activity - see the
# vault documentation for details in interpreting this
readLines(path)
# cleanup
server$kill()
unlink(path)
}