Skip to content

Conversation

@kiblik
Copy link
Contributor

@kiblik kiblik commented Oct 10, 2025

If initialDelaySeconds, the default k8s MutationWebhooks drops the whole field, which isa reasonable decision.
However, charts generated via Argo are trying to enforce the existence of this field, resulting in a never-ending "OutOfSync" status.
This PR drops the whole field if it is "empty" (equal to zero).

@dryrunsecurity
Copy link

dryrunsecurity bot commented Oct 10, 2025

DryRun Security

This pull request conditionally omits initialDelaySeconds for liveness and readiness probes in helm/defectdojo/templates/django-deployment.yaml, which can let Kubernetes default them to 0 and cause immediate probe failures that repeatedly restart pods or keep them unready (DoS risk) if values.yaml leaves those fields unset or set to 0. These changes are flagged as risky but non-blocking.

DoS due to premature liveness probe in helm/defectdojo/templates/django-deployment.yaml
Vulnerability DoS due to premature liveness probe
Description The Helm chart modification conditionally renders initialDelaySeconds for the liveness probe. If initialDelaySeconds is not explicitly set or is set to 0 in values.yaml, the field will be omitted from the generated Kubernetes manifest. Kubernetes defaults an omitted initialDelaySeconds to 0. For a complex application like Django, a 0-second initial delay for a liveness probe is highly likely to result in the probe failing immediately upon container startup, causing Kubernetes to repeatedly restart the pod and leading to a Denial of Service.

{{- if .Values.django.uwsgi.livenessProbe.initialDelaySeconds }}
initialDelaySeconds: {{ .Values.django.uwsgi.livenessProbe.initialDelaySeconds }}
{{- end }}
periodSeconds: {{ .Values.django.uwsgi.livenessProbe.periodSeconds }}

DoS due to premature readiness probe in helm/defectdojo/templates/django-deployment.yaml
Vulnerability DoS due to premature readiness probe
Description The change conditionally renders the initialDelaySeconds field for the readiness probe. If .Values.django.uwsgi.readinessProbe.initialDelaySeconds is 0 or not explicitly set in the Helm values.yaml, the initialDelaySeconds field will be omitted from the Kubernetes probe definition. Kubernetes defaults an omitted initialDelaySeconds to 0. For a complex application like DefectDojo (a Django application), a 0-second initial delay is insufficient for the application to fully start and become ready to serve traffic. This will cause the readiness probe to fail immediately and continuously, preventing the pod from ever being marked as 'Ready' and thus not receiving traffic, leading to service unavailability.

{{- if .Values.django.uwsgi.readinessProbe.initialDelaySeconds }}
initialDelaySeconds: {{ .Values.django.uwsgi.readinessProbe.initialDelaySeconds }}
{{- end }}
periodSeconds: {{ .Values.django.uwsgi.readinessProbe.periodSeconds }}


All finding details can be found in the DryRun Security Dashboard.

Copy link
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@mtesauro mtesauro requested a review from rossops October 10, 2025 15:49
@valentijnscholten valentijnscholten added this to the 2.51.1 milestone Oct 11, 2025
@mtesauro mtesauro merged commit c3eae34 into DefectDojo:bugfix Oct 14, 2025
148 checks passed
@valentijnscholten valentijnscholten modified the milestones: 2.51.1, 2.51.2 Oct 14, 2025
@kiblik kiblik deleted the helm_zero_initialDelaySeconds branch October 14, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants