This file contains 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 | |
repos=$(gh repo list hoge_org \ | |
--no-archived \ | |
--limit 1000 \ | |
--json name \ | |
--jq '.[].name') | |
for repo in $repos; | |
do |
This file contains 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 | |
regions=( \ | |
us-east-1 \ | |
us-east-2 \ | |
us-west-1 \ | |
us-west-2 \ | |
ap-south-1 \ | |
ap-northeast-3 \ | |
ap-northeast-2 \ |
This file contains 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 | |
aws s3api list-buckets | \ | |
jq '.Buckets[].Name' -r | \ | |
AWS_PAGER="" xargs -IXXX aws s3api put-public-access-block \ | |
--bucket XXX \ | |
--public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true |
This file contains 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 | |
# * EC2.2 The VPC default security group should not allow inbound and outbound traffic | |
# * https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-fsbp-controls.html#ec2-2-remediation | |
# * 4.3 Ensure the default security group of every VPC restricts all traffic | |
# * https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-cis-controls.html#cis-4.3-remediation | |
regions=$(aws ec2 describe-regions --query Regions[*].RegionName --output text) | |
for region in ${regions[@]} | |
do |
This file contains 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 | |
users=$(aws iam list-users --query 'Users[].UserName' --output text) | |
for user in $users; do | |
mkdir -p "$user" | |
policyNames=$(aws iam list-user-policies --user-name "$user" --query 'PolicyNames[]' --output text) | |
for policyName in $policyNames; do | |
aws iam get-user-policy --user-name "$user" --policy-name "$policyName" --output json > "${user}/${policyName}" |
This file contains 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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
for i := 1000; i <= 100000; i += 1000 { | |
n := scramble(uint32(i)) | |
rn := scramble(n) |
This file contains 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
package main | |
import ( | |
"encoding/base32" | |
"fmt" | |
"github.com/google/uuid" | |
) | |
func main() { |
This file contains 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 test -v ./tests/example/ | |
=== RUN TestExampleTestSuite | |
TestExampleTestSuite: example_test.go:14: SetupSuite | |
=== RUN TestExampleTestSuite/TestExample1 | |
TestExampleTestSuite/TestExample1: example_test.go:18: SetupTest | |
TestExampleTestSuite/TestExample1: example_test.go:22: BeforeTest suiteName=ExampleTestSuite testName=TestExample1 | |
TestExampleTestSuite/TestExample1: example_test.go:26: TestExample1 | |
TestExampleTestSuite/TestExample1: example_test.go:34: AfterTest suiteName=ExampleTestSuite testName=TestExample1 | |
TestExampleTestSuite/TestExample1: example_test.go:38: TearDownTest | |
=== RUN TestExampleTestSuite/TestExample2 |
This file contains 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
$ aws ec2 describe-vpcs | jq '.Vpcs[] | { CidrBlock: .CidrBlock, Name: .Tags[] | select(.Key == "Name").Value }' |
This file contains 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 | |
# Required | |
# - awscli | |
# - jq | |
PROGNAME=$(basename $0) | |
export IDENTIFYING_TAG_NAME='Name' |
NewerOlder