vault_client_audit | R Documentation |
Vault Audit Devices
Vault Audit Devices
Interact with vault's audit devices. For more details, see https://developer.hashicorp.com/vault/docs/audit
vaultr::vault_client_object
-> vault_client_audit
new()
Create an audit object
vault_client_audit$new(api_client)
api_client
a vault_api_client object
list()
List active audit devices. Returns a data.frame of names, paths and descriptions of active audit devices.
vault_client_audit$list()
enable()
This endpoint enables a new audit device at the supplied path.
vault_client_audit$enable( type, description = NULL, options = NULL, path = NULL )
type
Name of the audit device to enable
description
Human readable description for this audit device
options
Options to configure the device with. These vary by device. This must be a named list of strings.
path
Path to mount the audit device. By default, type
is used
as the path.
disable()
Disable an audit device
vault_client_audit$disable(path)
path
Path of the audit device to remove
hash()
The hash
method is used to calculate the hash of the
data used by an audit device's hash function and salt. This can be
used to search audit logs for a hashed value when the original
value is known.
vault_client_audit$hash(input, device)
input
The input string to hash
device
The path of the audit device
server <- vaultr::vault_test_server(if_disabled = message)
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.