Skip to content

Commit

Permalink
Merge pull request #388 from mbaldessari/common-automatic-update
Browse files Browse the repository at this point in the history
common automatic update
  • Loading branch information
mbaldessari authored Jun 10, 2024
2 parents c58189f + 5af7cc7 commit 039e748
Show file tree
Hide file tree
Showing 12 changed files with 937 additions and 104 deletions.
99 changes: 86 additions & 13 deletions common/acm/templates/policies/ocp-gitops-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ spec:
include:
- default
object-templates:
- complianceType: mustonlyhave
objectDefinition:
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-ca-bundle
namespace: openshift-gitops
labels:
config.openshift.io/inject-trusted-cabundle: 'true'
- complianceType: mustonlyhave
objectDefinition:
# This is an auto-generated file. DO NOT EDIT
Expand All @@ -53,6 +44,88 @@ spec:
env:
- name: ARGOCD_CLUSTER_CONFIG_NAMESPACES
value: "*"
- complianceType: mustonlyhave
objectDefinition:
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-ca-bundle
namespace: openshift-gitops
labels:
config.openshift.io/inject-trusted-cabundle: 'true'
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: openshift-gitops-placement-binding
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
placementRef:
name: openshift-gitops-placement
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: openshift-gitops-policy
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: openshift-gitops-placement
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
clusterConditions:
- status: 'True'
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- key: vendor
operator: In
values:
- OpenShift
- key: local-cluster
operator: NotIn
values:
- 'true'
---
# This policy depends on openshift-gitops-policy and the reason is that we need to be
# certain that the trusted-ca-bundle exists before spawning the clusterwide argocd instance
# because the initcontainer references the trusted-ca-bundle and if it starts without the
# configmap being there we risk running an argo instances that won't trust public CAs
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: openshift-gitops-policy-argocd
annotations:
policy.open-cluster-management.io/standards: NIST-CSF
policy.open-cluster-management.io/categories: PR.DS Data Security
policy.open-cluster-management.io/controls: PR.DS-1 Data-at-rest
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
remediationAction: enforce
disabled: false
dependencies:
- apiVersion: policy.open-cluster-management.io/v1
compliance: Compliant
kind: Policy
name: openshift-gitops-policy
namespace: open-cluster-management
policy-templates:
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: openshift-gitops-config-argocd
spec:
remediationAction: enforce
severity: medium
namespaceSelector:
include:
- default
object-templates:
- complianceType: mustonlyhave
objectDefinition:
apiVersion: argoproj.io/v1beta1
Expand Down Expand Up @@ -217,22 +290,22 @@ spec:
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: openshift-gitops-placement-binding
name: openshift-gitops-placement-binding-argocd
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
placementRef:
name: openshift-gitops-placement
name: openshift-gitops-placement-argocd
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: openshift-gitops-policy
- name: openshift-gitops-policy-argocd
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: openshift-gitops-placement
name: openshift-gitops-placement-argocd
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
Expand Down
2 changes: 1 addition & 1 deletion common/clustergroup/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ description: A Helm chart to create per-clustergroup ArgoCD applications and any
keywords:
- pattern
name: clustergroup
version: 0.8.7
version: 0.8.8
94 changes: 85 additions & 9 deletions common/tests/acm-industrial-edge-factory.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ subjects:
apiGroup: policy.open-cluster-management.io
---
# Source: acm/templates/policies/ocp-gitops-policy.yaml
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: openshift-gitops-placement-binding-argocd
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
placementRef:
name: openshift-gitops-placement-argocd
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: openshift-gitops-policy-argocd
kind: Policy
apiGroup: policy.open-cluster-management.io
---
# Source: acm/templates/policies/ocp-gitops-policy.yaml
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
Expand All @@ -64,6 +80,28 @@ spec:
- 'true'
---
# Source: acm/templates/policies/ocp-gitops-policy.yaml
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: openshift-gitops-placement-argocd
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
clusterConditions:
- status: 'True'
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- key: vendor
operator: In
values:
- OpenShift
- key: local-cluster
operator: NotIn
values:
- 'true'
---
# Source: acm/templates/policies/ocp-gitops-policy.yaml
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
Expand All @@ -90,15 +128,6 @@ spec:
include:
- default
object-templates:
- complianceType: mustonlyhave
objectDefinition:
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-ca-bundle
namespace: openshift-gitops
labels:
config.openshift.io/inject-trusted-cabundle: 'true'
- complianceType: mustonlyhave
objectDefinition:
# This is an auto-generated file. DO NOT EDIT
Expand All @@ -119,6 +148,53 @@ spec:
env:
- name: ARGOCD_CLUSTER_CONFIG_NAMESPACES
value: "*"
- complianceType: mustonlyhave
objectDefinition:
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-ca-bundle
namespace: openshift-gitops
labels:
config.openshift.io/inject-trusted-cabundle: 'true'
---
# Source: acm/templates/policies/ocp-gitops-policy.yaml
# This policy depends on openshift-gitops-policy and the reason is that we need to be
# certain that the trusted-ca-bundle exists before spawning the clusterwide argocd instance
# because the initcontainer references the trusted-ca-bundle and if it starts without the
# configmap being there we risk running an argo instances that won't trust public CAs
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: openshift-gitops-policy-argocd
annotations:
policy.open-cluster-management.io/standards: NIST-CSF
policy.open-cluster-management.io/categories: PR.DS Data Security
policy.open-cluster-management.io/controls: PR.DS-1 Data-at-rest
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
remediationAction: enforce
disabled: false
dependencies:
- apiVersion: policy.open-cluster-management.io/v1
compliance: Compliant
kind: Policy
name: openshift-gitops-policy
namespace: open-cluster-management
policy-templates:
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: openshift-gitops-config-argocd
spec:
remediationAction: enforce
severity: medium
namespaceSelector:
include:
- default
object-templates:
- complianceType: mustonlyhave
objectDefinition:
apiVersion: argoproj.io/v1beta1
Expand Down
94 changes: 85 additions & 9 deletions common/tests/acm-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ subjects:
kind: Policy
apiGroup: policy.open-cluster-management.io
---
# Source: acm/templates/policies/ocp-gitops-policy.yaml
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: openshift-gitops-placement-binding-argocd
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
placementRef:
name: openshift-gitops-placement-argocd
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: openshift-gitops-policy-argocd
kind: Policy
apiGroup: policy.open-cluster-management.io
---
# Source: acm/templates/policies/acm-hub-ca-policy.yaml
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
Expand Down Expand Up @@ -136,6 +152,28 @@ spec:
values:
- 'true'
---
# Source: acm/templates/policies/ocp-gitops-policy.yaml
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: openshift-gitops-placement-argocd
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
clusterConditions:
- status: 'True'
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- key: vendor
operator: In
values:
- OpenShift
- key: local-cluster
operator: NotIn
values:
- 'true'
---
# Source: acm/templates/policies/acm-hub-ca-policy.yaml
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
Expand Down Expand Up @@ -298,15 +336,6 @@ spec:
include:
- default
object-templates:
- complianceType: mustonlyhave
objectDefinition:
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-ca-bundle
namespace: openshift-gitops
labels:
config.openshift.io/inject-trusted-cabundle: 'true'
- complianceType: mustonlyhave
objectDefinition:
# This is an auto-generated file. DO NOT EDIT
Expand All @@ -327,6 +356,53 @@ spec:
env:
- name: ARGOCD_CLUSTER_CONFIG_NAMESPACES
value: "*"
- complianceType: mustonlyhave
objectDefinition:
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-ca-bundle
namespace: openshift-gitops
labels:
config.openshift.io/inject-trusted-cabundle: 'true'
---
# Source: acm/templates/policies/ocp-gitops-policy.yaml
# This policy depends on openshift-gitops-policy and the reason is that we need to be
# certain that the trusted-ca-bundle exists before spawning the clusterwide argocd instance
# because the initcontainer references the trusted-ca-bundle and if it starts without the
# configmap being there we risk running an argo instances that won't trust public CAs
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: openshift-gitops-policy-argocd
annotations:
policy.open-cluster-management.io/standards: NIST-CSF
policy.open-cluster-management.io/categories: PR.DS Data Security
policy.open-cluster-management.io/controls: PR.DS-1 Data-at-rest
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
remediationAction: enforce
disabled: false
dependencies:
- apiVersion: policy.open-cluster-management.io/v1
compliance: Compliant
kind: Policy
name: openshift-gitops-policy
namespace: open-cluster-management
policy-templates:
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: openshift-gitops-config-argocd
spec:
remediationAction: enforce
severity: medium
namespaceSelector:
include:
- default
object-templates:
- complianceType: mustonlyhave
objectDefinition:
apiVersion: argoproj.io/v1beta1
Expand Down
Loading

0 comments on commit 039e748

Please sign in to comment.