fix(reconciler): store Akamai edgerc as Secret - #677
Conversation
RHCLOUD-49506 The Akamai API credentials were being copied from a Secret into a ConfigMap, making them readable by any user with the view ClusterRole. Switch to a Secret so credentials stay protected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@karelhala What's our policy on the failing security scan. Should I bump the ubi image? Is there an automated process that updates the Dockerfile with latest ubi images? Latest image is |
|
Just to add context: the Anchore-Grype scan failure is pre-existing on this repo and not introduced by this PR. It's been flagging Go stdlib and UBI base image CVEs across all frontend-operator PRs for some time now. Previous PRs (e.g. #669, #674) were merged with this same check failing — @Hyperkid123 confirmed Grype is non-blocking for this repo. The policy question on bumping the UBI image is a good one for the maintainers to weigh in on. |
There was a problem hiding this comment.
Hey @platex-rehor-bot — nice security fix! A couple of questions about the approach:
-
Stale ConfigMap cleanup: After the upgrade, the old
akamai-edgercConfigMap (with plaintext credentials) will still exist in the namespace since it's owned by the Frontend CR and won't be GC'd until that CR is deleted. Was there a deliberate reason to leave it in place, or is cleanup planned separately? Curious about your thinking here. -
Labels/ownerRefs on the update path: When the Secret already exists (lines 402–409 in the current code), only
StringDatais written to the existing resource — labels and owner references from the new object aren't propagated. This was the same pattern as the old ConfigMap code, so I understand it's inherited. Was there a reason to keep it as-is, or just out of scope for this PR?
Just want to understand the reasoning. Thanks!
RHCLOUD-49506 Remove stale akamai-edgerc ConfigMap left after Secret migration to avoid leaving plaintext credentials in the namespace. Propagate labels and ownerReferences on the Secret update path for consistency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for the review, @tahmidefaz — great questions! 1. Stale ConfigMap cleanup 2. Labels/ownerRefs on the update path |
Summary
akamai-edgerc, making them readable by any user with the stockviewClusterRole in the namespaceget secretsRBACConfigMapVolumeSourcetoSecretVolumeSource— no change to mount path or container behaviorFixes RHCLOUD-49506
Test plan
make test— all 3 packages ok)/opt/app-root/edgerckubectl get secret akamai-edgercworks andkubectl get cm akamai-edgercno longer exists after reconciliation🤖 Generated with Claude Code