Manage secret storage using the Splunk REST API
You can securely store, update, retrieve, and delete secrets using the Splunk REST API. When you use the REST API, use the splunkd management port, 8089, and the secure HTTPS protocol.
Use these endpoints to manage secrets:
storage/passwords
Method | Description |
|---|---|
GET | List secrets for all users. |
POST | Create a new secret. |
storage/passwords/name
Method | Description |
|---|---|
GET | List the secrets for a specified username. |
POST | Update a secret for a specified username. |
DELETE | Delete a secret for a specified username. |
Examples
The following examples show how to manage secret storage in an app using the storage/passwords and storage/passwords/name REST API endpoints.
List all secrets stored in the secret_storage_test app:
curl -k -u <username>:<password> \https://localhost:8089/servicesNS/nobody/secret_storage_test/storage/passwords/
Store a new secret for the user1 user in the secret_storage_test app:
curl -k -u <username>:<password> \https://localhost:8089/servicesNS/nobody/secret_storage_test/storage/passwords \-d name=user1 -d password=password1 -d realm=realm1
List the secrets stored for the user1 user in the secret_storage_test app:
curl -k -u <username>:<password> \https://localhost:8089/servicesNS/nobody/secret_storage_test/storage/passwords/user1
Update a secret for the user1 user in the secret_storage_test app:
curl -k -u <username>:<password> \https://localhost:8089/servicesNS/nobody/secret_storage_test/storage/passwords/realm1:user1 \-d password=password2
Delete a secret for the user1 user from the secret_storage_test app:
curl -k -u <username>:<password> \--request DELETE https://localhost:8089/servicesNS/nobody/secret_storage_test/storage/passwords/realm1:user1:
See also
storage/passwords(Opens new window) in the Splunk Enterprise REST API Reference Manual