Skip to content

TLS Secret name are hard coded and tls.<component>.secret are unused #312

@Darkness4

Description

@Darkness4

Hello, I found many issues when manipulating TLS. The secret fields in

tls:
## @param tls.enabled Is tls enabled ?
enabled: false
## @param tls.caBundle pem format CA collection
caBundle: true
## @param tls.insecureSkipVerify
insecureSkipVerify: false
## @param tls.certManager [object] Use of a cluster certManager configuration
certManager:
## @param tls.certManager.enabled [default: true] Use of a cluster cert manager
enabled: true
# -- Use existing issuer to sign certificates. Leave empty to generate a self-signed issuer
issuerRef: {}
# name: ""
# kind: "ClusterIssuer"
# -- Add annotations and/or labels to generated secret
## @param tls.certManager.secretTemplate [object] secret configuration
secretTemplate:
## @param tls.certManager.secretTemplate.annotations [object] add annotation to generated secret
annotations: {}
## @param tls.certManager.secretTemplate.labels [object] add annotation to generated labels
labels: {}
# -- duration for Certificate resources
## @param tls.certManager.duration [string] validity duration of certificate (golang duration string)
duration: 2160h # 90d
# -- renewBefore for Certificate resources
## @param tls.certManager.renewBefore [string] duration before a certificate’s expiry when cert-manager should start renewing it.
renewBefore: 720h # 30d
bouncer:
## @param tls.bouncer.secret [string] Name of the Kubernetes Secret containing TLS materials for the bouncer
secret: "{{ .Release.Name }}-bouncer-tls"
reflector:
## @param tls.bouncer.reflector.namespaces [array] List of namespaces from which the bouncer will watch and sync Secrets/ConfigMaps.
namespaces: []
agent:
## @param tls.agent.tlsClientAuth [default: true] Enables mutual TLS authentication for the agent when connecting to LAPI.
tlsClientAuth: true
## @param tls.agent.secret [string] Name of the Secret holding the agent’s TLS certificate and key.
secret: "{{ .Release.Name }}-agent-tls"
reflector:
## @param tls.agent.reflector.namespaces [array] Namespaces where the agent’s TLS Secret can be reflected/synced.
namespaces: []
appsec:
## @param tls.appsec.tlsClientAuth [default: true] Enables mutual TLS authentication for the agent when connecting to LAPI.
tlsClientAuth: true
## @param tls.appsec.secret [string] Name of the Secret holding the agent’s TLS certificate and key.
secret: "{{ .Release.Name }}-agent-tls"
reflector:
## @param tls.appsec.reflector.namespaces [array] Namespaces where the agent’s TLS Secret can be reflected/synced.
namespaces: []
lapi:
## @param tls.lapi.secret [string] Name of the Secret holding the lapidary's’s TLS certificate and key.
secret: "{{ .Release.Name }}-lapi-tls"
reflector:
## @param tls.lapi.reflector.namespaces [array] Namespaces where the LAPI TLS Secret can be reflected/synced.
namespaces: []
# If you want to specify secrets that will be used for all your crowdsec-agents

are unused.

The secret names are also hardcoded:

It should be {{ tpl .Values.tls.<component>.secret $ }} in the secretName.

Additionally, when enabling tls and disabling agent, the lapi is still looking for an agent certificate. It should be wrapped between {{ if .Values.agent.enabled }}:

- name: crowdsec-agent-tls
secret:
secretName: {{ .Release.Name }}-agent-tls
{{- end }}

NB: I'm also using Appsec, I would probably like to also select the Appsec client tls certificate to be mounted on lapi instead of the agent tls certificate which doesn't exist.

I found this other issue about the different allowed OU which was already reported #239

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions