aws-cli
Security-hardened AWS CLI v2 for cloud operations
1.6K
Security-hardened AWS CLI container images implementing enterprise security best practices for cloud operations and CI/CD pipelines.
# Use latest version
docker pull ataidesorg/aws-cli:latest
docker run --rm -it -v ~/.aws:/home/appuser/.aws:ro ataidesorg/aws-cli:latest --version
# Use with AWS credentials
docker run --rm -it \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_DEFAULT_REGION \
ataidesorg/aws-cli:latest s3 ls
# Use in CI/CD pipeline
docker run --rm \
-v $PWD:/workspace \
-w /workspace \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_DEFAULT_REGION \
ataidesorg/aws-cli:latest \
s3 sync ./dist/ s3://my-bucket/
# Interactive AWS CLI shell
docker run --rm -it \
-v ~/.aws:/home/appuser/.aws:ro \
--entrypoint sh ataidesorg/aws-cli:latest
File Operations: Standard Linux file utilities for configuration processing
Text Processing: grep, sed, sort, cut, awk for JSON/YAML manipulation
Archive Tools: tar, gzip for backup and deployment operations
Shell Environment: bash, sh for scripting and automation
Development Tools: Compilers, interpreters, package managers
Network Debugging: ping, telnet, netstat, ss
System Administration: su, sudo, systemctl
Dangerous Tools: System modification utilities
All AWS CLI hardened images meet:
# GitHub Actions example
- name: Deploy to S3
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
-e AWS_DEFAULT_REGION=us-east-1 \
-w /workspace \
ataidesorg/aws-cli:latest \
s3 sync ./build/ s3://my-bucket/
# GitLab CI example
deploy:
image: ataidesorg/aws-cli:latest
script:
- aws --version
- aws s3 sync ./dist/ s3://my-bucket/
only:
- main
# Secure S3 operations
docker run --rm -it \
-v ~/.aws:/home/appuser/.aws:ro \
--user 1001:1001 \
--read-only \
--security-opt no-new-privileges \
ataidesorg/aws-cli:latest \
s3 ls s3://my-bucket/
# Resource management
docker run --rm \
-v $PWD/configs:/configs:ro \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_DEFAULT_REGION \
--user 1001:1001 \
--read-only \
ataidesorg/aws-cli:latest \
cloudformation deploy --template-file /configs/template.yaml
# EC2 instance management
docker run --rm \
-v ~/.aws:/home/appuser/.aws:ro \
--user 1001:1001 \
--read-only \
--security-opt no-new-privileges \
ataidesorg/aws-cli:latest \
ec2 describe-instances --region us-east-1
# Secure debugging session
docker run --rm -it \
-v ~/.aws:/home/appuser/.aws:ro \
--user 1001:1001 \
--read-only \
--security-opt no-new-privileges \
ataidesorg/aws-cli:latest \
logs describe-log-groups
# Configuration validation
docker run --rm \
-v ~/.aws:/home/appuser/.aws:ro \
--user 1001:1001 \
--read-only \
ataidesorg/aws-cli:latest \
sts get-caller-identity
# Switch between AWS profiles securely
docker run --rm -it \
-v ~/.aws:/home/appuser/.aws:ro \
--user 1001:1001 \
ataidesorg/aws-cli:latest \
--profile production sts get-caller-identity
# Cross-account resource management
docker run --rm \
-v ~/.aws:/home/appuser/.aws:ro \
--user 1001:1001 \
--read-only \
ataidesorg/aws-cli:latest \
--profile staging s3 ls
# Clone repository
git clone https://github.com/ataidesorg/container-images.git
cd container-images
# Build specific version
python scripts/build.py --filter aws-cli --version latest
# Build all aws-cli versions
python scripts/build.py --filter aws-cli
# Run security validation
docker run --rm ataidesorg/aws-cli:latest --version
docker run --rm ataidesorg/aws-cli:latest id
| Variable | Default | Description |
|---|---|---|
HOME | /home/appuser | User home directory |
AWS_CONFIG_FILE | $HOME/.aws/config | AWS config file path |
AWS_SHARED_CREDENTIALS_FILE | $HOME/.aws/credentials | AWS credentials file path |
PATH | /usr/local/bin:/usr/bin:/bin | Executable search path |
SHELL | /bin/bash | Default shell |
# Recommended volume mounts
docker run --rm -it \
-v ~/.aws:/home/appuser/.aws:ro \ # AWS config (read-only)
-v $PWD:/workspace:ro \ # Workspace files (read-only)
-v /tmp:/tmp \ # Temporary files
--user 1001:1001 \
ataidesorg/aws-cli:latest
# Recommended security context for Kubernetes Jobs
apiVersion: batch/v1
kind: Job
metadata:
name: aws-cli-job
spec:
template:
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
containers:
- name: aws-cli
image: ataidesorg/aws-cli:latest
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
env:
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: aws-credentials
key: access-key-id
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: aws-credentials
key: secret-access-key
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir: {}
# Recommended Docker security options
docker run --rm \
--user 1001:1001 \
--read-only \
--tmpfs /tmp:noexec,nosuid,nodev \
--security-opt no-new-privileges \
--cap-drop ALL \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_DEFAULT_REGION \
ataidesorg/aws-cli:latest
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
If you discover a security vulnerability do not open a public issue, instead send an email to [email protected]
For enterprise support, training, and custom hardening requirements, contact [email protected]
Ataides - Forging the future of cybersecurity through open-source innovation.
Content type
Image
Digest
sha256:15ad7cff6…
Size
537.3 kB
Last updated
5 months ago
docker pull ataidesorg/aws-cli:sha256-dc207f02384813a5202508b6171393e064a264f83b55c961fa1c6a77c2273afe.att