Utilise ADFS to authenticate against AWS and use CLI or SDK.
2.0K
This script is intended to facilitate Active Directory Federated Sign On to AWS. Upon successful authentication, temporary keys are written to a 'SAML' profile in C:\Users\<your_username>\.aws\credentials (Windows) or ~/.aws/credentials (Mac). These keys are used as valid credentials for authenticating to AWS CLI and API.
~/.aws/credentials (Mac) or C:\Users\<your_username>\.aws\credentials (Windows) file with at least this much contents:[default]
output = json
region = eu-west-1
aws_access_key_id =
aws_secret_access_key =
Note: An AWS access key pair is not configured in the above structure because the initial AWS STS call is authenticated by the SAML assertion returned by the trusted IdP. All subsequent API/CLI calls are authenticated by the key pair contained within the returned AWS STS token.
docker run -it --rm -v $Env:USERPROFILE/.aws/credentials:/root/.aws/credentials --name aws-saml-auth sclausson/aws-saml-authdocker run -it --rm -v ~/.aws/credentials:/root/.aws/credentials --name aws-saml-auth sclausson/aws-saml-auth[email protected]aws --profile saml s3 ls--profile switch everytime you run the awscli, you can set AWS_DEFAULT_PROFILE=samlIf you need to set up Docker Shared Drive, follow these steps:


Shayne Clausson [email protected]
Content type
Image
Digest
Size
262.8 MB
Last updated
over 7 years ago
docker pull sclausson/aws-saml-auth