Conversation
Bumps golang from 1.25.5-alpine to 1.25.6-alpine. --- updated-dependencies: - dependency-name: golang dependency-version: 1.25.6-alpine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Official Prometheus images include a shell and utilities like curl that expand
the tools available for exploitation in container escape or privilege escalation
attacks in the event of a compromise. This change bundles the Prometheus binary
directly into the CloudZero Agent image, which uses a minimal scratch base with
no shell, to provide a bit of defense in depth.
Functional Change:
Before: The Prometheus container used the official `quay.io/prometheus/prometheus`
image, which includes a shell and utilities that could be leveraged by an attacker.
After: The Prometheus container uses the CloudZero Agent image with the Prometheus
binary bundled at `/app/prometheus`. The image has no shell and minimal attack
surface. Users can still override to use the official image if needed.
Solution:
1. Modified docker/Dockerfile to extract and bundle the Prometheus binary:
- Added `prometheus-source` build stage from official Prometheus image
- Copy `/bin/prometheus` to `/app/prometheus` in final scratch-based image
- Prometheus version pinned via `PROMETHEUS_VERSION` ARG for Renovate updates
2. Updated helm/values.yaml to use bundled binary by default:
- Set `components.prometheus.image.repository` to null (falls back to agent image)
- Added `components.prometheus.command` field with three-way behavior:
- null (default): Uses `/app/prometheus` for bundled binary
- []: Uses image default entrypoint (for official Prometheus image)
- ["/custom/path"]: Uses specified command
3. Added `generateContainerCommand` helper to helm/templates/\_helpers.tpl:
- Accepts dict with `command` and `default` (array) parameters
- Reusable for other containers (e.g., Alloy in future PR)
4. Updated agent-deploy.yaml and agent-daemonset.yaml to use new helper
5. Added schema validation for command field in helm/values.schema.yaml:
- Uses oneOf to allow null or array of strings
- References Kubernetes Container command definition
6. Updated helm/tests/README.md with correct instructions for running tests
Validation:
- Added helm/tests/prometheus_command_test.yaml with 7 unit tests covering:
- Default command (/app/prometheus)
- Empty array (no command, uses image entrypoint)
- Custom command with multiple elements
- Federated mode (daemonset) behavior
- Args not affected by command changes
- Added 6 schema validation tests in tests/helm/schema/prometheus.command.\*.yaml
- All helm test suites pass
- Deployed and verified on EKS (arm64) / GKE (amd64) clusters:
- Pod running successfully with CloudZero agent image
- Command correctly set to ["/app/prometheus"]
- Prometheus scraping and forwarding cAdvisor metrics normally
- Official image override: Verified backward compatibility with
quay.io/prometheus/prometheus using command: [] override
Base automatically changed from
dependabot/docker/docker/golang-1.25.6-alpine
to
develop
February 3, 2026 18:09
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Official Prometheus images include a shell and utilities like curl that expand the tools available for exploitation in container escape or privilege escalation attacks in the event of a compromise. This change bundles the Prometheus binary directly into the CloudZero Agent image, which uses a minimal scratch base with no shell, to provide a bit of defense in depth.
Functional Change:
Before: The Prometheus container used the official
quay.io/prometheus/prometheusimage, which includes a shell and utilities that could be leveraged by an attacker.After: The Prometheus container uses the CloudZero Agent image with the Prometheus binary bundled at
/app/prometheus. The image has no shell and minimal attack surface. Users can still override to use the official image if needed.Solution:
Modified docker/Dockerfile to extract and bundle the Prometheus binary:
prometheus-sourcebuild stage from official Prometheus image/bin/prometheusto/app/prometheusin final scratch-based imagePROMETHEUS_VERSIONARG for Renovate updatesUpdated helm/values.yaml to use bundled binary by default:
components.prometheus.image.repositoryto null (falls back to agent image)components.prometheus.commandfield with three-way behavior:/app/prometheusfor bundled binaryAdded
generateContainerCommandhelper to helm/templates/_helpers.tpl:commandanddefault(array) parametersUpdated agent-deploy.yaml and agent-daemonset.yaml to use new helper
Added schema validation for command field in helm/values.schema.yaml:
Updated helm/tests/README.md with correct instructions for running tests
Validation:
Added helm/tests/prometheus_command_test.yaml with 7 unit tests covering:
Added 6 schema validation tests in tests/helm/schema/prometheus.command.*.yaml
All helm test suites pass
Deployed and verified on EKS (arm64) / GKE (amd64) clusters:
quay.io/prometheus/prometheus using command: [] override