Repository navigation
[dmt] chore: sync PSS policies from deckhouse 3230c33d89 - #494
Merged
Merged
Conversation
Syncs internal/pss/policies with deckhouse main @ 3230c33d89.
Upstream changes:
- !993: D8AllowedHostPaths allows paths nested under an SPE hostPath entry, matched by path
components (added as allowSubPaths); the SPE CRD documents the `*` suffix of seccomp profiles
and sysctl names.
- !1054: allowSubPaths is replaced with
spec.volumes.hostPath.allowedValues[].pathType: Exact (the default) or Prefix.
- !383: the Pod Security Standards are described as SecurityPolicy rules and their constraints
are rendered through security_policy_constraints; D8AllowedCapabilities gets
skipControllerChecks. templates/policies/pod-security-standards/{baseline,restricted}/
constraint.yaml are replaced by templates/policies/{pod-security-standards.yaml,
_pod-security-standards.tpl,_helpers.tpl,security-policy.yaml}.
dmt changes:
- internal/pss/pss.go: the parameters are rendered from pod-security-standards.yaml, the other
files of templates/policies are added as partials, and the kind and parameters are taken from
the d8-pod-security-<standard>-system constraints, the ones of the d8-* and kube-* namespaces.
- internal/pss/stub.tpl: stubs system_namespaces, system_namespaces_action and
helm_lib_module_labels instead of pod_security_standard_baseline|restricted.
- Tests: pathType in the schema and in the hostPath check; DefaultSPE sets pathType: Exact.
Signed-off-by: v.oleynikov <vasily.oleynikov@flant.com>
AlwxSin
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Syncs
internal/pss/policieswith deckhouse main @3230c33d89, so that dmt knows the newpathTypefield ofspec.volumes.hostPath.allowedValues[]in SecurityPolicyException. Without itsecurity-policy-exception-schemarejects every SPE that usespathType: Prefixwithunknown field, which blocks modules adopting it (e.g. sds-elastic).Upstream changes (
git log 2942ea4200..3230c33d89 -- modules/015-admission-policy-engine, the ones that touch the synced files):D8AllowedHostPathsallows paths nested under an SPE hostPath entry, compared by path components (introduced asallowSubPaths); the SPE CRD documents the*suffix of seccomp profiles and sysctl names.allowSubPathsis replaced withpathType:Exact(the default, only the exact path) orPrefix(the path and every path nested under it;/var/liballows/var/lib/docker, not/var/libvirt).security_policy_constraints).templates/policies/pod-security-standards/{baseline,restricted}/constraint.yamlare gone; the standards now live intemplates/policies/{pod-security-standards.yaml,_pod-security-standards.tpl,_helpers.tpl,security-policy.yaml}.D8AllowedCapabilitiesgets theskipControllerChecksparameter.The other commits in the range (!769, !943, !1011, !1052) touch nothing dmt syncs.
GATEKEEPER_VERSIONstays 3.23.1.dmt changes:
internal/pss/pss.go: the PSS parameters are rendered frompod-security-standards.yaml; the other files oftemplates/policiesonly provide defines and are added as partials. The kind and parameters are taken from thed8-pod-security-<standard>-systemconstraints, the ones for thed8-*andkube-*namespaces dmt checks. The rendered checks are the same as before: the same kinds in both standards with the same parameters, except that restrictedD8AllowPrivilegeEscalationno longer getsallowPrivilegeEscalation: false, which its rego never read.internal/pss/stub.tpl: stubssystem_namespaces,system_namespaces_action(moduletemplates/_helpers.tpl) andhelm_lib_module_labels(helm_lib), which the new templates call and which are not synced; thepod_security_standard_baseline|restrictedstubs are dropped, nothing calls them anymore.ape.only_ready_constraintsstays a pass-through.pathTypein the schema (Prefixpasses, an unknown value fails withUnsupported value), in the hostPath check (Prefixcovers a nested path,Exactand an omittedpathTyperequire the exact path,Prefix/var/libdoes not cover/var/libvirt), andDefaultSPEnow setspathType: Exact, as the apiserver does.The policies sync script still copies the two removed
constraint.yamlfiles and takes the PSS kinds from them; it needs the new file list before its next run.Testing
go test ./...and golangci-lint v2.15.0 pass (0 issues).main.dmt linton sds-elastic with SPEs usingpathType: Prefix: the twosecurity-policy-exception-schemaerrors (spec.volumes.hostPath.allowedValues[N].pathType: unknown field) are gone, the module passes with 0 errors.modules/, without the edition overlays) the findings of this branch andmainare the same (247; 3 of thempod-security-standards), apart from the random name of the etcd-backup CronJob.