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
| CREDS=$(aws sts assume-role --role-arn "arn:aws:iam::${ACCOUNT}:role/${ROLE}" --role-session-name="${USER}") | |
| docker run -ti --rm --name prowler --env "AWS_ACCESS_KEY_ID=$(echo $CREDS | jq -r .Credentials.AccessKeyId)" --env "AWS_SECRET_ACCESS_KEY=$(echo $CREDS | jq -r .Credentials.SecretAccessKey)" --env "AWS_SESSION_TOKEN=$(echo $CREDS | jq -r .Credentials.SessionToken)" toniblyx/prowler:latest -f us-west-2 |
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
| git fetch | |
| for deployment in $(kubectl get deployment -o name) ; do | |
| local sha=$(kubectl get “$deployment” -o json |jq -r '.spec.template.spec.containers[].image | capture(".*:(?<sha>.*)")| .sha’); | |
| count=$(git rev-list --count “${SHA}..origin/master”) ; | |
| echo $deployment is $count revisions behind master (at $sha) | |
| done |
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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: init-demo | |
| spec: | |
| template: | |
| spec: | |
| hostNetwork: true | |
| containers: | |
| - name: nginx |
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
| ### What version of rules_go are you using? | |
| 0.18.1 | |
| ### What version of gazelle are you using? | |
| 0.15.0 | |
| ### What version of Bazel are you using? |
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
| #!/bin/bash | |
| # Script to | |
| # Relies on non-standard programs - ts(moreutils) | |
| set -eux -o pipefail | |
| labels="${1:-}" | |
| if [[ $labels = "-h" ]] || [[ $labels = "--help" ]] | |
| then |
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
| go list -f "{{range .Deps}}{{.}} {{end}}" | xargs go list -f "{{if not .Standard}}{{.ImportPath}} {{end}}" | xargs bazel run //:gazelle -- update-repos |
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
| # List current version of a go get installed package | |
| # For bazel, I need the munged name, it's github location, and current HEAD. | |
| git -C "$(go list -f '{{.Dir}}' gopkg.in/yaml.v2)" rev-parse HEAD | |
| git -C "$(go list -f '{{.Dir}}' gopkg.in/yaml.v2)" remote get-url origin |
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
| // Wall Drawing 273 is an art piece by Sol LeWitt. | |
| // This open source implementation is by Ted Hahn. | |
| // This is generative art - Your viewing of it will be different than mine. I have included the positions of the walls because I am lazy and have not gotten around to making those random too, but the art on those walls is unique - You will not see the same image I did. | |
| // draftlines is the number of lines to draw from each side. | |
| draftlines = 10; | |
| // The line module draws a 2d line from start to end, where start and end are [x, y] pairs. | |
| module line (start, end, width=.1) { | |
| echo("start=", start, "end=", end); |
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
| # Notes on connecting | |
| # Trust the k8s root certificate | |
| security -v add-trusted-cert -k "${HOME}/Library/Keychains/login.keychain-db" -r trustRoot "${KUBE_CERT}" | |
| # Generate a user key and `security import` it | |
| openssl genrsa -out "${CLIENTCERTKEY}" 4096 | |
| security import "${CLIENTCERTKEY}" | |
| # Set for OSX | |
| # Get the sha | |
| # security find-cert -a -c ted -Z |
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
| set -eux -o pipefail | |
| IAMUSER="$1" | |
| aws iam create-user --user-name "${IAMUSER}" | |
| POLICY="$(aws iam create-policy --policy-name "${IAMUSER}" --policy-document file://policy.json)" # "file://${IAMUSER}.policy" | |
| ARN="$(echo $POLICY |jq -r .Policy.Arn)" | |
| aws iam attach-user-policy --user-name "${IAMUSER}" --policy-arn="${ARN}" | |
| # Create the access-key and parse the response to the ID and Secret | |
| KEY="$(aws iam create-access-key --user-name "${IAMUSER}")" | |
| KEYID="$(echo "${KEY}" |jq -r .AccessKey.AccessKeyId)" | |
| KEYSECRET="$(echo "${KEY}" |jq -r .AccessKey.SecretAccessKey)" |