HashiCorp Vault
HashiCorp Vault secures, stores, and tightly controls access to tokens, passwords, certificates, API keys, and other secrets in modern computing. This integration allows you to send HashiCorp Vault logs to your Logz.io SIEM account.
Before you begin, you'll need:
- Filebeat installed
- Root access
Configure Vault to output raw logs
Configure Vault to enable raw log output to the default location. After making the change, start or restart Vault for the changes to take effect.
Disabling log hashing means that Vault will send logs in clear text. This is required at this time, because Vault supports decryption for only a limited number of fields that don’t match the fields required by Logz.io Cloud SIEM. When this limitation is resolved, the requirement to send raw logs will be lifted.
For more information on logging and enabling audit devices, see File Audit Device from HashiCorp.
Download the Logz.io public certificate
For HTTPS shipping, download the Logz.io public certificate to your certificate authority folder.
sudo curl https://raw.githubusercontent.com/logzio/public-certificates/master/AAACertificateServices.crt --create-dirs -o /etc/pki/tls/certs/COMODORSADomainValidationSecureServerCA.crt
Create your configuration file for Vault
The Filebeat configuration file is at /etc/filebeat/filebeat.yml
by default.
To avoid conflicts with fields from other log sources, you'll need to run a dedicated Filebeat instance for Vault logs. This allows Filebeat to rename some fields to keep Vault logs compatible with Logz.io.
Replace <<LOG-SHIPPING-TOKEN>>
with the token of the account you want to ship to.
Replace <<LISTENER-HOST>>
with the host for your region.
Filebeat requires a file extension specified for the log input.
# ...
filebeat.inputs:
- type: filestream
paths:
- /var/log/vault_audit.log
# Your Logz.io account token. You can find your token at
# https://app.logz.io/#/dashboard/settings/manage-accounts
token: <<LOG-SHIPPING-TOKEN>>
logzio_type: vault
fields_under_root: true
json.keys_under_root: true
encoding: utf-8
ignore_older: 3h
filebeat.registry.path: /var/lib/filebeat
processors:
- rename:
fields:
- from: "agent"
to: "filebeat_agent"
ignore_missing: true
- rename:
fields:
- from: "log.file.path"
to: "source"
ignore_missing: true
- rename:
fields:
- from: "type"
to: "hashi_type"
ignore_missing: true
- rename:
fields:
- from: "logzio_type"
to: "type"
ignore_missing: true
# ...
output.logstash:
hosts: ["<<LISTENER-HOST>>:5015"]
ssl:
certificate_authorities: ['/etc/pki/tls/certs/COMODORSADomainValidationSecureServerCA.crt']
If you're running Filebeat 7 to 8.1, paste the code block below instead:
# ...
filebeat.inputs:
- type: log
paths:
- /var/log/vault_audit.log
# Your Logz.io account token. You can find your token at
# https://app.logz.io/#/dashboard/settings/manage-accounts
token: <<LOG-SHIPPING-TOKEN>>
logzio_type: vault
fields_under_root: true
json.keys_under_root: true
encoding: utf-8
ignore_older: 3h
filebeat.registry.path: /var/lib/filebeat
processors:
- rename:
fields:
- from: "agent"
to: "filebeat_agent"
ignore_missing: true
- rename:
fields:
- from: "log.file.path"
to: "source"
ignore_missing: true
- rename:
fields:
- from: "type"
to: "hashi_type"
ignore_missing: true
- rename:
fields:
- from: "logzio_type"
to: "type"
ignore_missing: true
# ...
output.logstash:
hosts: ["<<LISTENER-HOST>>:5015"]
ssl:
certificate_authorities: ['/etc/pki/tls/certs/COMODORSADomainValidationSecureServerCA.crt']
Start Filebeat
Start or restart Filebeat for the changes to take effect.
Check Logz.io for your logs
Give your logs some time to get from your system to ours, and then open Open Search Dashboards.
If you still don't see your logs, see Filebeat troubleshooting.