From 9bfe45f7cf6e63881dd88ff32b309a7fa91c6f01 Mon Sep 17 00:00:00 2001 From: Matt Fuller Date: Thu, 20 Jun 2019 13:21:37 +0300 Subject: [PATCH] updating enforcer net pol --- aqua-ethos-setup/aqua_ethos.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aqua-ethos-setup/aqua_ethos.sh b/aqua-ethos-setup/aqua_ethos.sh index b250bc8..c6bd6c1 100755 --- a/aqua-ethos-setup/aqua_ethos.sh +++ b/aqua-ethos-setup/aqua_ethos.sh @@ -168,6 +168,15 @@ function makePost { fi } +function makePut { + curl --silent -H "Content-Type: application/json" -H "$HEADER: Bearer $TOKEN" -X PUT -d "$2" "$WEB_URL/$1" + + if [[ "$?" != "0" ]]; then + log "Error sending PUT to Aqua" + exit 1 + fi +} + function getExistingImages { EXISTING_IMAGES=$(curl --silent -H "$HEADER: Bearer $TOKEN" "$WEB_URL/settings/export" --data-binary '["images"]') } @@ -325,6 +334,9 @@ fi } +# Update the enforcers +makePut "hostsbatch?update_enforcers=true" '{"network_protection": "true"}' + if [[ ! -z "$DATADOG_PASSWORD" ]]; then createUser "datadog" "datadog" "Datadog" "$DATADOG_PASSWORD" "administrator" fi