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

[release-2.10] 🤖 Sync from open-cluster-management-io/policy-collection: #465 #59

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
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ From within this directory in terminal, run `cd deploy` to access the deployment
command can be viewed in its [README](deploy/README.md).)

The policies are applied to all managed clusters that are available, and have the `environment` set
to `dev`. Specifically, an available managed cluster has the `status` parameter set to `true` by the
system, for the `ManagedClusterConditionAvailable` condition. If policies need to be applied to
another set of clusters, update the `PlacementRule.spec.clusterSelector.matchExpressions` section in
the policies.
to `dev`. If policies need to be applied to another set of clusters, update the
`PlacementRule.spec.clusterSelector.matchExpressions` section in the policies.

**Note**: As new clusters are added that fit the criteria previously mentioned, the policies are
applied automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,15 @@ placementRef:
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: policy-configure-appworkloads-rbac
kind: Policy
apiGroup: policy.open-cluster-management.io
- name: policy-configure-appworkloads-rbac
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: placement-policy-configure-appworkloads-rbac
spec:
clusterConditions:
- status: "True"
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- {key: environment, operator: In, values: ["dev"]}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin
name: admin
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
Expand All @@ -108,9 +108,6 @@ kind: PlacementRule
metadata:
name: placement-policy-configure-clusterlevel-rbac
spec:
clusterConditions:
- status: "True"
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- {key: local-cluster, operator: In, values: ['true']}
- {key: local-cluster, operator: In, values: ['true']}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
policy.open-cluster-management.io/categories: AC Access Control
policy.open-cluster-management.io/controls: AC-2 Account Management
spec:
remediationAction: enforce
remediationAction: enforce
disabled: false
policy-templates:
- objectDefinition:
Expand All @@ -18,7 +18,7 @@ spec:
spec:
remediationAction: enforce
severity: low
object-templates:
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: templates.gatekeeper.sh/v1beta1
Expand Down Expand Up @@ -47,7 +47,7 @@ spec:

review(subject) = true {
subject.name == "system:anonymous"
}
}
- complianceType: musthave
objectDefinition:
apiVersion: constraints.gatekeeper.sh/v1beta1
Expand Down Expand Up @@ -98,7 +98,7 @@ spec:
constraint_action: deny
constraint_kind: K8sDisallowAnonymous
constraint_name: no-anonymous
event_type: violation
event_type: violation
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
Expand All @@ -118,9 +118,6 @@ kind: PlacementRule
metadata:
name: placement-policy-gatekeeper-disallow-anonymous
spec:
clusterConditions:
- status: "True"
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- { key: environment, operator: In, values: ["dev"] }
- {key: environment, operator: In, values: ["dev"]}
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,15 @@ placementRef:
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: policy-rbac-adminiterpolicies
kind: Policy
apiGroup: policy.open-cluster-management.io
- name: policy-rbac-adminiterpolicies
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: placement-policy-rbac-adminiterpolicies
spec:
clusterConditions:
- status: 'True'
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- key: local-cluster
Expand Down
9 changes: 3 additions & 6 deletions community/AC-Access-Control/policy-roles-no-wildcards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,15 @@ placementRef:
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: policy-disallowed-roles
kind: Policy
apiGroup: policy.open-cluster-management.io
- name: policy-disallowed-roles
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: placement-policy-disallowed-roles
spec:
clusterConditions:
- status: "True"
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- {key: environment, operator: In, values: ["dev"]}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ spec:
name: cluster
spec:
audit:
customRules:
- group: system:authenticated:oauth
profile: WriteRequestBodies
- group: system:authenticated
profile: AllRequestBodies
profile: Default

customRules:
- group: system:authenticated:oauth
profile: WriteRequestBodies
- group: system:authenticated
profile: AllRequestBodies
profile: Default
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
Expand All @@ -53,13 +52,9 @@ kind: PlacementRule
metadata:
name: placement-config-audit
spec:
clusterConditions:
- status: 'True'
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- key: environment
operator: In
values:
- dev

Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ spec:
remediationAction: inform
disabled: false
policy-templates:
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: 'checkfipscompliance'
spec:
remediationAction: inform
severity: low
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: 99-worker-fips
spec:
fips: true
- complianceType: musthave
objectDefinition:
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 99-master-fips
spec:
fips: true
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: 'checkfipscompliance'
spec:
remediationAction: inform
severity: low
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: 99-worker-fips
spec:
fips: true
- complianceType: musthave
objectDefinition:
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 99-master-fips
spec:
fips: true
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
Expand All @@ -49,18 +49,15 @@ placementRef:
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: checkfipscompliance
kind: Policy
apiGroup: policy.open-cluster-management.io
- name: checkfipscompliance
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: placement-checkfipscompliance
spec:
clusterConditions:
- status: "True"
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- {key: environment, operator: In, values: ["dev"]}
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,15 @@ placementRef:
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: policy-comp-operator
kind: Policy
apiGroup: policy.open-cluster-management.io
- name: policy-comp-operator
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: placement-policy-comp-operator
spec:
clusterConditions:
- status: "True"
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- {key: vendor, operator: In, values: ["OpenShift"]}
Loading