-
Notifications
You must be signed in to change notification settings - Fork 16
script to install twistlock defender and client certs #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
1643e56
script to install twistlock defender and client certs
anshupande 728d067
updated .twistlock in while loop
anshupande 2259a46
updated the logic
anshupande f97b83e
also added twistlock.service
anshupande e621dfa
corrected typo
anshupande 90958e4
removed twistlock.service to get all the logic in twistlock.sh
anshupande f4a97f0
URL parameterized
anshupande 614f229
parameterized URL
anshupande 9472e21
hiding password
anshupande 1362a9b
split out separate sections of the command using \ to make it readabl…
anshupande 58964df
moved logic to install client certs in separate file so that each use…
anshupande de10aa0
updated logic to run twistlock as proxy server
anshupande 6fffd01
add twistlock clientcerts for each user
anshupande fe0c3b0
created a fleet unit for twistlock
anshupande 1d2be00
created fleet unit to install client certs for each ssh hosts
anshupande 71df700
reverted changes to add_users.sh
anshupande b26db38
reverted changes to add_users.sh
anshupande 18ce3ec
update twistlock defender
anshupande 993180b
made chage to twistlock.sh
anshupande ae48936
updated environment for fleet
anshupande File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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 | ||
|
|
||
|
|
||
| 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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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)There was a problem hiding this comment.
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!)
There was a problem hiding this comment.
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