UPD: Various additions
This commit is contained in:
parent
1afeac32f0
commit
863b5c7480
6
aws/ec2-with-public-ip.sh
Executable file
6
aws/ec2-with-public-ip.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
aws sts get-caller-identity --query Account
|
||||
aws ec2 describe-instances --query 'Reservations[].Instances[?PublicIpAddress != `null`].[InstanceId, PublicIpAddress]' --output text
|
||||
echo "= = ="
|
||||
|
6
aws/export-iam-policies.sh
Normal file
6
aws/export-iam-policies.sh
Normal file
@ -0,0 +1,6 @@
|
||||
aws iam list-policies --scope Local | jq -cr '.Policies[].Arn' | while read i; do
|
||||
VER=$(aws iam get-policy --policy-arn $i | jq -cr .Policy.DefaultVersionId)
|
||||
POLNAME=$(echo $i | awk -F/ '{print $NF}')
|
||||
aws iam get-policy-version --policy-arn $i --version-id $VER > iam-policies/$POLNAME.json
|
||||
done
|
||||
|
6
aws/s3-deep-archive-restore.sh
Normal file
6
aws/s3-deep-archive-restore.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
BUCKET=$1
|
||||
aws s3 ls s3://$BUCKET --recursive | awk '{print $NF}' | while read i; do
|
||||
aws s3api restore-object --bucket $BUCKET --key $i --restore-request Days=20
|
||||
done
|
1
aws/sso-login-events.sh
Normal file
1
aws/sso-login-events.sh
Normal file
@ -0,0 +1 @@
|
||||
aws cloudtrail lookup-events --start-time $(date -d '48 hour ago' +%s) --lookup-attributes AttributeKey=Username,AttributeValue=LEDP636 | jq -cr '.Events[] | .CloudTrailEvent' | jq -cr '[.eventTime, .eventName, .userIdentity.userName, .sourceIPAddress, .additionalEventData.CredentialType, .serviceEventDetails.CredentialVerification] | @tsv'
|
Loading…
Reference in New Issue
Block a user