Splunk app
The Bitwarden Splunk app fetches event log data from the Bitwarden Public API and makes it available in Splunk.
Requirements
- Docker. If you're using an Apple Silicon Mac, enable Docker Desktop -> Settings -> General -> Use Rosetta for x86_64/amd64 emulation on Apple Silicon
- Python 3.7 - 3.10
- Poetry
- Also install Poetry export plugin with
poetry self add poetry-plugin-export
- Also install Poetry export plugin with
- libmagic (macOS only), available via homebrew:
brew install libmagic
- A Bitwarden Teams or Enterprise organization
- If using a local development server - make sure the Events and EventsProcessor projects are running and Event Logging is working
Set up and configuration
Configure your environment
-
Clone the Github repository:
git clone https://github.com/bitwarden/splunk.git
-
Navigate to the root of the repository:
cd splunk
-
Tell poetry to use the required Python version:
poetry env use <executable>
Where
<executable>
is the executable for Python. If this is in your PATH variable then you do not need to specify the full path. e.g.poetry env use python3.9
. -
Install dependencies:
poetry install --with dev
Set up Splunk Enterprise
-
Run Splunk Enterprise:
docker run --rm --platform linux/amd64 --name splunk -d -p 8001:8000 -p 8089:8089 -e SPLUNK_START_ARGS='--accept-license' -e SPLUNK_PASSWORD='password' splunk/splunk:9.3
If you are using an Apple Silicon Mac, you must use up to version 9.3 of Splunk. As of version 9.4, Splunk depends on the use of the AVX instruction set for its KVStore, which is not supported by Apple Silicon.
Please note this will set the admin password to password
. This is for development purposes only.
- Confirm that Splunk is running by navigating to http://localhost:8001
Deploy the app
-
Package the app:
./package.sh
This will produce a packaged Splunk app in
output/bitwarden_event_logs.tar.gz
. -
Deploy the app to Splunk:
./deploy.sh
This will restart Splunk and it may take a few seconds to become available again after the script is finished
-
(optional) Check the logs for errors or for debugging purposes later:
docker exec -u splunk -it splunk tail -f /opt/splunk/var/log/splunk/bitwarden_event_logs.log
Configure the app in Splunk
-
Navigate to the Splunk web app: http://localhost:8001.
-
Log in with the username
admin
and the passwordpassword
. -
Click on the Apps -> Bitwarden Event Logs.
-
Complete the setup. Refer to the Bitwarden Help Center for more information about configuration.
Splunk uses https and requires additional configuration to work with your local dev server. We don't have instructions for this yet. In the meantime, we recommend configuring Splunk to use a Bitwarden cloud deployment (such as production or an internal QA environment).
You should now see your organization events in Apps -> Bitwarden Event Logs -> Dashboards. If no event logs appear, check the Splunk logs (see above).