Skip to content
Closed
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions v2/setup/twistlock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

source /etc/environment

HOMEDIR=$(eval echo "~`whoami`")

sudo docker run --rm \
-v ${HOMEDIR}:/data/ behance/docker-aws-s3-downloader \
us-east-1 $CONTROL_TIER_S3SECURE_BUCKET .twistlock


while read line; do
etcdctl set $line
done < ${HOMEDIR}/.twistlock



twistlockusername=$(etcdctl get /twistlockusername)
twistlockpassword=$(etcdctl get /twistlockpassword)

curl -sSL -k --header "authorization:Bearer $(eval echo $(echo $(curl -s -H "Content-Type: application/json" -d '{"username":"'$(eval echo $twistlockusername)'", "password":"'$(eval echo $twistlockpassword)'"}' https://adobe.console.twistlock.com:443/api/v1/authenticate) | sed -ne 's/.*"token":"\([^,]*\)".*/\1/p'))" https://adobe.console.twistlock.com/api/v1/cert/client-certs.sh | sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split out separate sections of this command using \ to make it readable (multiline)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still needs adobe twistlock URL parameterized (this is a public repo!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanlatten this is temporary URL given by twistlock but yes I will parameterize it



curl -sSL -k --header "authorization:Bearer $(eval echo $(echo $(curl -s -H "Content-Type: application/json" -d '{"username":"'$(eval echo $twistlockusername)'", "password":"'$(eval echo $twistlockpassword)'"}' https://adobe.console.twistlock.com:443/api/v1/authenticate) | sed -ne 's/.*"token":"\([^,]*\)".*/\1/p'))" https://adobe.console.twistlock.com/api/v1/scripts/defender.sh -o defender.sh && chmod a+x defender.sh && sudo ./defender.sh