gcloud
Security-hardened Google Cloud SDK for cloud operations
1.1K
Security-hardened Google Cloud CLI container images implementing enterprise security best practices for cloud operations and CI/CD pipelines.
# Use latest version
docker pull ataidesorg/gcloud:latest
docker run --rm -it ataidesorg/gcloud:latest version
# Use with service account key
docker run --rm -it \
-v ~/.config/gcloud:/home/appuser/.config/gcloud:ro \
ataidesorg/gcloud:latest auth list
# Use in CI/CD pipeline
docker run --rm \
-v $PWD:/workspace \
-w /workspace \
-e GOOGLE_APPLICATION_CREDENTIALS=/workspace/service-account.json \
ataidesorg/gcloud:latest \
storage cp ./build/* gs://my-bucket/
# Interactive gcloud shell
docker run --rm -it \
-v ~/.config/gcloud:/home/appuser/.config/gcloud:ro \
--entrypoint sh ataidesorg/gcloud: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 Google Cloud CLI hardened images meet:
# GitHub Actions example
- name: Deploy to Google Cloud Storage
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-e GOOGLE_APPLICATION_CREDENTIALS=/workspace/service-account.json \
-w /workspace \
ataidesorg/gcloud:latest \
storage cp -r ./build/* gs://my-bucket/
# GitLab CI example
deploy:
image: ataidesorg/gcloud:latest
script:
- gcloud version
- gcloud storage cp -r ./dist/* gs://my-bucket/
only:
- main
# Secure Cloud Storage operations
docker run --rm -it \
-v ~/.config/gcloud:/home/appuser/.config/gcloud:ro \
--user 1001:1001 \
--read-only \
--security-opt no-new-privileges \
ataidesorg/gcloud:latest \
storage ls gs://my-bucket/
# Compute Engine management
docker run --rm \
-v $PWD/configs:/configs:ro \
-e GOOGLE_APPLICATION_CREDENTIALS=/configs/service-account.json \
--user 1001:1001 \
--read-only \
ataidesorg/gcloud:latest \
compute instances list --project=my-project
# BigQuery operations
docker run --rm \
-v ~/.config/gcloud:/home/appuser/.config/gcloud:ro \
--user 1001:1001 \
--read-only \
--security-opt no-new-privileges \
ataidesorg/gcloud:latest \
bq query "SELECT * FROM dataset.table LIMIT 10"
# Secure debugging session
docker run --rm -it \
-v ~/.config/gcloud:/home/appuser/.config/gcloud:ro \
--user 1001:1001 \
--read-only \
--security-opt no-new-privileges \
ataidesorg/gcloud:latest \
logging logs list
# Configuration validation
docker run --rm \
-v ~/.config/gcloud:/home/appuser/.config/gcloud:ro \
--user 1001:1001 \
--read-only \
ataidesorg/gcloud:latest \
auth list
# Switch between projects securely
docker run --rm -it \
-v ~/.config/gcloud:/home/appuser/.config/gcloud:ro \
--user 1001:1001 \
ataidesorg/gcloud:latest \
config set project production-project
# Cross-project resource management
docker run --rm \
-v ~/.config/gcloud:/home/appuser/.config/gcloud:ro \
--user 1001:1001 \
--read-only \
ataidesorg/gcloud:latest \
--project=staging-project compute instances list
# Clone repository
git clone https://github.com/ataidesorg/container-images.git
cd container-images
# Build specific version
python scripts/build.py --filter gcloud --version latest
# Build all gcloud versions
python scripts/build.py --filter gcloud
# Run security validation
docker run --rm ataidesorg/gcloud:latest version
docker run --rm ataidesorg/gcloud:latest id
| Variable | Default | Description |
|---|---|---|
HOME | /home/appuser | User home directory |
CLOUDSDK_CONFIG | $HOME/.config/gcloud | Google Cloud config directory |
GOOGLE_APPLICATION_CREDENTIALS | (none) | Service account key file path |
CLOUDSDK_PYTHON | /usr/bin/python3 | Python interpreter for gcloud |
PATH | /usr/local/bin:/usr/bin:/bin | Executable search path |
SHELL | /bin/bash | Default shell |
# Recommended volume mounts
docker run --rm -it \
-v ~/.config/gcloud:/home/appuser/.config/gcloud:ro \ # gcloud config (read-only)
-v $PWD:/workspace:ro \ # Workspace files (read-only)
-v /tmp:/tmp \ # Temporary files
--user 1001:1001 \
ataidesorg/gcloud:latest
# Recommended security context for Kubernetes Jobs
apiVersion: batch/v1
kind: Job
metadata:
name: gcloud-job
spec:
template:
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
containers:
- name: gcloud
image: ataidesorg/gcloud:latest
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/secrets/service-account.json
volumeMounts:
- name: service-account
mountPath: /var/secrets
readOnly: true
- name: tmp
mountPath: /tmp
volumes:
- name: service-account
secret:
secretName: gcloud-service-account
- 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 GOOGLE_APPLICATION_CREDENTIALS=/workspace/service-account.json \
-v $PWD:/workspace:ro \
ataidesorg/gcloud: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:1eaa955cf…
Size
918.4 kB
Last updated
5 months ago
docker pull ataidesorg/gcloud:sha256-2a37e8cd76ae2e78272352c8e3c5df2d64ccea671d4cd221eb18888a6fcec4c8.att