Files
cozystack/packages/system/monitoring/Makefile
T
Andrei Kvapil 8942c7dfcc security(monitoring): keep Alerta credentials out of its container log
The upstream Alerta entrypoint prints the whole environment, including
the admin password and API key, and echoes the admin API keys it
creates, while nginx logs the request line where Alertmanager passes
the key as a query parameter. Pod logs are readable at lower tenant
tiers than the credentials themselves.

The respin drops the environment dump, silences key creation and masks
the api-key parameter in the access log. Each edit is checked during
the build, so an upstream change to either file fails the image build
rather than bringing the output back.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-27 04:49:30 +01:00

49 lines
1.9 KiB
Makefile

NAME=monitoring
NAMESPACE=cozy-$(NAME)
include ../../../hack/common-envs.mk
include ../../../hack/package.mk
test:
helm unittest .
.PHONY: image image-otelcol-tracing image-alerta
# The collector is versioned by its upstream release, pinned in the
# Containerfile; bump COZYSTACK_REV for a respin on the same release (a new
# component in builder-config.yaml, a Go toolchain bump).
OTELCOL_VERSION = $(shell awk -F= '/^ARG VERSION=/{print $$2}' images/otelcol-tracing/Containerfile)
COZYSTACK_REV = 0
COMPONENT_VERSION = v$(OTELCOL_VERSION)-cozystack.$(COZYSTACK_REV)
# Alerta is versioned by the upstream release it respins, pinned in the
# Containerfile; bump ALERTA_COZYSTACK_REV for a respin on the same release.
ALERTA_VERSION = $(shell awk -F= '/^ARG VERSION=/{print $$2}' images/alerta/Containerfile)
ALERTA_COZYSTACK_REV = 1
ALERTA_COMPONENT_VERSION = v$(ALERTA_VERSION)-cozystack.$(ALERTA_COZYSTACK_REV)
image: image-otelcol-tracing image-alerta
.NOTPARALLEL: image
image-otelcol-tracing:
docker buildx build images/otelcol-tracing \
--file images/otelcol-tracing/Containerfile \
$(call image-tags,otelcol-tracing,$(COMPONENT_VERSION)) \
$(call cache-args,otelcol-tracing) \
--metadata-file images/otelcol-tracing.json \
$(BUILDX_ARGS)
IMAGE="$(REGISTRY)/otelcol-tracing:$(COMPONENT_VERSION)@$$(yq e '."containerimage.digest"' images/otelcol-tracing.json -o json -r)" \
yq -i '.tracingCollector.image = strenv(IMAGE)' values.yaml
rm -f images/otelcol-tracing.json
image-alerta:
docker buildx build images/alerta \
--file images/alerta/Containerfile \
$(call image-tags,alerta,$(ALERTA_COMPONENT_VERSION)) \
$(call cache-args,alerta) \
--metadata-file images/alerta.json \
$(BUILDX_ARGS)
IMAGE="$(REGISTRY)/alerta:$(ALERTA_COMPONENT_VERSION)@$$(yq e '."containerimage.digest"' images/alerta.json -o json -r)" \
yq -i '.alerta.image = strenv(IMAGE)' values.yaml
rm -f images/alerta.json