Skip to content

Commit

Permalink
Added a delete all api keys to the hard reset script
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Nov 8, 2019
1 parent 7c861bb commit 2ddf09e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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 .
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ set -e
./delete_all_alert_tasks.sh
./delete_signal_index.sh
./put_signal_index.sh
./delete_all_api_keys.sh

0 comments on commit 2ddf09e

Please sign in to comment.