Skip to content

Enforce read-only valid volume rules - #49

Merged
kdumontnu merged 1 commit into
mainfrom
kd/valid-volumes-readonly
Aug 31, 2026
Merged

kdumontnu merged 1 commit into
mainfrom
kd/valid-volumes-readonly

Conversation

@kdumontnu

Copy link
Copy Markdown
Contributor

Summary

  • support an opt-in :ro marker on valid_volumes entries
  • force matching short-form binds and long-form mounts read-only while preserving existing bind modifiers
  • apply matching rules in configuration order with the last match winning
  • preserve writable behavior for unmarked and internally appended runner-owned volume rules
  • handle Windows drive-path binds using Docker-parsed source and target boundaries

Security impact

This prevents workflows from requesting writable access to operator-allowlisted shared paths that are intended to be read-only, reducing the risk of cross-workflow cache, configuration, and trust-store tampering. This remains defense in depth when workflow containers can access the Docker daemon socket.

Testing

  • go test ./pkg/container -run "^(TestCheckVolumes|TestOptionsMountSurvivesSanitize)$" -count=1
  • go vet ./pkg/container
  • go build ./...
  • regression coverage for Windows drive paths, bind modifiers, overlapping rules, runner-owned mounts, and long-form mounts

References Notion ticket ID-5346.

@kdumontnu
kdumontnu merged commit f4e494a into main Aug 31, 2026
2 checks passed
@kdumontnu
kdumontnu deleted the kd/valid-volumes-readonly branch August 31, 2026 18:38
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.

2 participants