-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a delete all api keys to the hard reset script
- Loading branch information
1 parent
7c861bb
commit 2ddf09e
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_api_keys.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
# or more contributor license agreements. Licensed under the Elastic License; | ||
# you may not use this file except in compliance with the Elastic License. | ||
# | ||
|
||
set -e | ||
./check_env_variables.sh | ||
|
||
# Example: ./delete_all_api_keys.sh | ||
# https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html | ||
curl -s -k \ | ||
-H "Content-Type: application/json" \ | ||
-u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ | ||
-X DELETE ${ELASTICSEARCH_URL}/_security/api_key \ | ||
--data "{ | ||
\"username\": \"${ELASTICSEARCH_USERNAME}\" | ||
}" \ | ||
| jq . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ set -e | |
./delete_all_alert_tasks.sh | ||
./delete_signal_index.sh | ||
./put_signal_index.sh | ||
./delete_all_api_keys.sh |