Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCP4: Filter out new 4.11 SCCs that allow capabilites in addition to the privileged SCC #8996

Merged
merged 1 commit into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,18 @@ ocil: |-
completely added as a list entry under <tt>allowedCapabilities</tt>,
or that all the un-required capabilities are dropped for containers and SCCs.

{{% set jqfilter = '[.items[] | select(.metadata.name | test("{{.var_sccs_with_allowed_capabilities_regex}}"; "") | not)] | map(.allowedCapabilities == null)' %}}


warnings:
- general: |-
{{{ openshift_filtered_cluster_setting({'/apis/security.openshift.io/v1/securitycontextconstraints': '[.items[] | select(.metadata.name != "privileged")] | map(.allowedCapabilities == null)'}) | indent(4) }}}
{{{ openshift_filtered_cluster_setting({'/apis/security.openshift.io/v1/securitycontextconstraints': jqfilter}) | indent(4) }}}

template:
name: yamlfile_value
vars:
ocp_data: "true"
filepath: "{{{ openshift_filtered_path('/apis/security.openshift.io/v1/securitycontextconstraints', '[.items[] | select(.metadata.name != \"privileged\")] | map(.allowedCapabilities == null)') }}}"
filepath: "{{{ openshift_filtered_path('/apis/security.openshift.io/v1/securitycontextconstraints', jqfilter) }}}"
yamlpath: "[:]"
check_existence: "all_exist"
entity_check: "all"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
documentation_complete: true

title: 'Permitted SCCs with allowedCapabilities'

description: 'A regular expression that lists all SCCs that are permitted to set the allowedCapabilities attribute'

type: string

operator: equals

interactive: false

options:
default: "^privileged$|^hostnetwork-v2$|^restricted-v2$|^nonroot-v2$"