Skip to content

PINF-989 fill k8s security testing gaps - #761

Merged
danielhoherd merged 3 commits into
masterfrom
danielhoherd/pinf986-service-mountpropagation
Aug 3, 2026
Merged

PINF-989 fill k8s security testing gaps#761
danielhoherd merged 3 commits into
masterfrom
danielhoherd/pinf986-service-mountpropagation

Conversation

@danielhoherd

@danielhoherd danielhoherd commented Jul 31, 2026

Copy link
Copy Markdown
Member

Description

  • Neither the dag-server nor git-sync-relay Service template sets spec.type at all, so both already default to ClusterIP -- just untested. Added an assertion to each existing "enabled" test confirming type stays absent from the rendered spec.
  • Added a chart-wide sweep asserting no volumeMount sets mountPropagation to HostToContainer or Bidirectional, following the same render-everything-and-report-offenders pattern as the existing hardened-securityContext sweep in the same file.

Closes PINF-986's ServiceOnlyAllowClusterIP Airflow-Deployment-tier leg and MountPropagation checklist rows for this chart.

Related Issues

https://linear.app/astronomer/issue/PINF-986

Testing

No special testing needed. These are all test changes, filling gaps in our test coverage to validate features.

Merging

release-1.18

…ountPropagation non-regression test

Neither Service template sets spec.type at all, so both already default to
ClusterIP -- just untested. Added an assertion to each existing "enabled"
test confirming "type" stays absent from the rendered spec.

Also added a chart-wide sweep asserting no volumeMount sets mountPropagation
to HostToContainer or Bidirectional, following the same render-everything-
and-report-offenders pattern as the existing hardened-securityContext sweep
in the same file.

Group C of the PINF-986 remaining-work grouping plan (ServiceOnlyAllowClusterIP
Airflow-Deployment-tier leg + MountPropagation).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds test coverage to close Kubernetes security policy gaps for the umbrella airflow Helm chart, focusing on Service type defaults and disallowed volumeMount.mountPropagation values.

Changes:

  • Assert that the dag-server and git-sync-relay Services do not set spec.type (so Kubernetes defaults to ClusterIP).
  • Add a chart-wide render sweep asserting no container uses unsafe mountPropagation values (HostToContainer, Bidirectional) on any volumeMount.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/chart/test_git_sync_relay_service.py Adds assertions that spec.type is absent from the rendered git-sync-relay Service.
tests/chart/test_dag_server_service.py Adds an assertion that spec.type is absent from the rendered dag-server Service.
tests/chart/test_container_security_context.py Adds a full-chart sweep test to detect unsafe volumeMount.mountPropagation settings across all containers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/chart/test_container_security_context.py Outdated

@edmund-astronomer edmund-astronomer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

seems good to me

danielhoherd and others added 2 commits August 3, 2026 09:31
Copilot flagged that the comment said Restricted PSA "forbids" the unsafe
mountPropagation values, then also said it's "not currently a PSA control
itself" -- contradictory. Reworded to state plainly that PSA doesn't
validate mountPropagation at all; this is a Kyverno/OPA-style customer
policy control instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@danielhoherd
danielhoherd merged commit 8a1e16e into master Aug 3, 2026
12 of 14 checks passed
@danielhoherd
danielhoherd deleted the danielhoherd/pinf986-service-mountpropagation branch August 3, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants