fix: keep cscli RBAC when online API is disabled#353
Conversation
|
@julien-redel: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the forked project rr404/oss-governance-bot repository. |
|
@julien-redel: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the forked project rr404/oss-governance-bot repository. |
|
/kind fix |
Description
What
Render the
configmap-updaterRole and RoleBinding whenever the LAPI csclicredentials are stored in a Secret, even when the online API is disabled.
Fixes #319.
Why
The
lapi-cscli-register-jobis rendered whenever cscli credentials are storedin a Secret (
StoreLAPICscliCredentialsInSecret), independently of the onlineAPI setting. It runs under the
*-configmap-updater-saServiceAccount and needsget/createpermissions on the credentials Secret.However, #347 gated the Role/RoleBinding behind
not IsOnlineAPIDisabled. As aresult, with:
the register job is still created but its ServiceAccount has no permissions, so
the job fails:
(the secret-existence guard
kubectl get secret ...is silently denied by RBAC,so the job falls through to
kubectl create secretand fails).How
role.yamlandrolebinding.yamlnow render when the online API is enabledOR when cscli credentials are stored in a Secret:
The inner
if or (StoreCAPI...) (StoreLAPICscli...)condition is unchanged, sothe CAPI register job behavior introduced by #347 is preserved (no CAPI RBAC when
the online API is disabled).
Testing
helm templateagainstci/crowdsec-values.yaml:DISABLE_ONLINE_API=true+ cscli secrethelm lint ./charts/crowdsec -f ./charts/crowdsec/ci/crowdsec-values.yaml: passes.Chart version bumped
0.24.0→0.24.1.