Compare commits

...

2 Commits

Author SHA1 Message Date
35935db963 feat: manage openbao audit devices
- manage openbao audit devices in the configuration file
- enable audit and audit_raw logs
- enable api access to creating audit devices
- restart vault service when changing the configuration file
2025-11-22 13:27:40 +11:00
a5b9850e82 feat: add audit log for openbao
- openbao requires audit-log configured in config file
2025-11-22 11:57:15 +11:00
2 changed files with 20 additions and 10 deletions

View File

@ -4,6 +4,21 @@ profiles::vault::server::members_lookup: true
profiles::vault::server::data_dir: /data/vault
profiles::vault::server::manage_storage_dir: true
profiles::vault::server::tls_disable: false
profiles::vault::server::audit_devices:
- file:
audit_raw:
options:
path: audit_raw
type: file
file_path: /data/vault/audit_raw.log
log_raw: "true"
- file:
audit_file:
options:
path: audit_file
type: file
file_path: /data/vault/audit.log
log_raw: "false"
vault::package_name: openbao
vault::package_ensure: latest

View File

@ -15,7 +15,7 @@ class profiles::vault::server (
Stdlib::Absolutepath $ssl_crt = '/etc/pki/tls/vault/certificate.crt',
Stdlib::Absolutepath $ssl_key = '/etc/pki/tls/vault/private.key',
Stdlib::Absolutepath $ssl_ca = '/etc/pki/tls/certs/ca-bundle.crt',
Stdlib::Absolutepath $audit_log = '/var/log/vault_audit.log',
Optional[Array[Hash]] $audit_devices = undef,
){
# set a datacentre/cluster name
@ -64,7 +64,9 @@ class profiles::vault::server (
},
api_addr => "${http_scheme}://${::facts['networking']['fqdn']}:${client_port}",
extra_config => {
cluster_addr => "${http_scheme}://${::facts['networking']['fqdn']}:${cluster_port}",
cluster_addr => "${http_scheme}://${::facts['networking']['fqdn']}:${cluster_port}",
audit => $audit_devices,
unsafe_allow_api_audit_creation => true,
},
listener => [
{
@ -86,18 +88,11 @@ class profiles::vault::server (
]
}
# ensure the vault audit log exists
file { $audit_log:
ensure => 'file',
owner => 'vault',
group => 'vault',
mode => '0600',
}
service { 'vault':
ensure => true,
enable => true,
subscribe => [File[$ssl_crt], File[$ssl_key]],
subscribe => [File[$ssl_crt], File[$ssl_key], File['/etc/vault/config.json']],
}
# include classes to manage vault