Skip to content

Commit

Permalink
swapped source url, double checked generate command reference fix tsw…
Browse files Browse the repository at this point in the history
…ift blank spaces
  • Loading branch information
CloudBeard committed Sep 25, 2024
1 parent 9bdebee commit 742c8e6
Show file tree
Hide file tree
Showing 35 changed files with 105 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ pass:
validation: validation.yaml
resources: resources.json
permutation: '.namespaces |= map(if .metadata.name == "grafana" then del(.metadata.labels["istio-injection"]) else . end)'
expected-validation: false
expected-validation: false

Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ provider:
validation: validate.validate
observations:
- validate.msg
- validate.msg_exempt_namespaces
- validate.msg_exempt_namespaces
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ pass:
validation: validation.yaml
resources: resources.json
permutation: '.pods |= map(if .metadata.namespace == "grafana" then .metadata.annotations = {} else . end)'
expected-validation: false
expected-validation: false
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ provider:
validation: validate.validate
observations:
- validate.msg
- validate.msg_exempt_namespaces
- validate.msg_exempt_namespaces
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ pass:
- test: remove-auth-rules
validation: validation.yaml
resources: resources.json
permutation: 'del(.authorizationPolicy.spec.rules)'
permutation: "del(.authorizationPolicy.spec.rules)"
expected-validation: false
- test: add-not-namespaces
validation: validation.yaml
resources: resources.json
permutation: '(.authorizationPolicy.spec.rules[] | .from[] | .source.notNamespaces) |= . + ["test-ns"]'
expected-validation: false
expected-validation: false
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ provider:
output:
validation: validate.validate
observations:
- validate.msg
- validate.msg
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ metadata:
uuid: 7455f86d-b79c-4226-9ce3-f3fb7d9348c8
domain:
type: kubernetes
kubernetes-spec:
kubernetes-spec:
resources: []
provider:
type: opa
opa-spec:
opa-spec:
rego: |
package validate
default validate := false
default validate := false
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pass:
- test: no-gateway
validation: validation.yaml
resources: resources.json
permutation: 'del(.adminGateway)'
permutation: "del(.adminGateway)"
expected-validation: false
- test: admin-vs-not-using-admin-gw
validation: validation.yaml
Expand All @@ -17,4 +17,4 @@ pass:
validation: validation.yaml
resources: resources.json
permutation: '.virtualServices |= map(if .metadata.name == "keycloak-tenant-public-auth-access-with-optional-client-certificate" then .spec.gateways = ["istio-admin-gateway/admin-gateway"] else . end)'
expected-validation: false
expected-validation: false
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ provider:
output:
validation: validate.validate
observations:
- validate.msg
- validate.msg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pass:
- test: change-accessLogFile-to-different-dir
validation: validation.yaml
resources: resources.json
permutation: ".istioMeshConfig.accessLogFile = \"/log/test\""
permutation: '.istioMeshConfig.accessLogFile = "/log/test"'
expected-validation: false
- test: remove-accessLogFile
validation: validation.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ domain:
type: kubernetes
kubernetes-spec:
resources:
- name: istioMeshConfig
resource-rule:
field:
jsonpath: .data.mesh
type: yaml
namespaces:
- istio-system
resource: configmaps
version: v1
name: istio
- name: istioMeshConfig
resource-rule:
field:
jsonpath: .data.mesh
type: yaml
namespaces:
- istio-system
resource: configmaps
version: v1
name: istio
provider:
type: opa
opa-spec:
output:
observations:
- validate.msg
- validate.msg
validation: validate.validate
rego: |
package validate
Expand All @@ -43,4 +43,4 @@ provider:
msg := "Istio is logging all traffic."
} else = {"result": false, "msg": msg} if {
msg := "Istio is not logging all traffic."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ metadata:
uuid: 663f5e92-6db4-4042-8b5a-eba3ebe5a622
domain:
type: kubernetes
kubernetes-spec:
kubernetes-spec:
resources: []
provider:
type: opa
opa-spec:
rego: |
package validate
validate := false
# Check on destination rule, outlier detection?
# -> Doesn't appear that UDS is configured to create destination rules.
# -> Doesn't appear that UDS is configured to create destination rules.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ metadata:
uuid: c3b022eb-19a5-4711-8099-da4a90c9dd5d
domain:
type: kubernetes
kubernetes-spec:
kubernetes-spec:
resources: []
provider:
type: opa
opa-spec:
opa-spec:
rego: |
package validate
default validate := false
default validate := false
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ metadata:
uuid: 19faf69a-de74-4b78-a628-64a9f244ae13
domain:
type: kubernetes
kubernetes-spec:
kubernetes-spec:
resources: []
provider:
type: opa
Expand All @@ -12,7 +12,7 @@ provider:
package validate
default validate := false
# This policy could check meshConfig.outboundTrafficPolicy.mode (default is ALLOW_ANY)
# Possibly would need a ServiceEntry(?)
# (https://istio.io/latest/docs/tasks/traffic-management/egress/egress-control/#envoy-passthrough-to-external-services)
# (https://istio.io/latest/docs/tasks/traffic-management/egress/egress-control/#envoy-passthrough-to-external-services)
6 changes: 3 additions & 3 deletions compliance/validations/istio/fips-evaluation/validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ metadata:
uuid: 73434890-2751-4894-b7b2-7e583b4a8977
domain:
type: kubernetes
kubernetes-spec:
kubernetes-spec:
resources: []
provider:
type: opa
opa-spec:
opa-spec:
rego: |
package validate
default validate := false
default validate := false
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ pass:
- test: add_new_gateway
validation: validation.yaml
resources: resources.json
permutation: ".gateways += [{\"apiVersion\": \"networking.istio.io/v1beta1\", \"kind\": \"Gateway\", \"metadata\": {\"name\": \"new-gateway\", \"namespace\": \"new-namespace\"}}]"
expected-validation: false
permutation: '.gateways += [{"apiVersion": "networking.istio.io/v1beta1", "kind": "Gateway", "metadata": {"name": "new-gateway", "namespace": "new-namespace"}}]'
expected-validation: false
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ provider:
observations:
- validate.msg
- validate.msg_existing_gateways
- validate.msg_allowed_gateways
- validate.msg_allowed_gateways
6 changes: 3 additions & 3 deletions compliance/validations/istio/healthcheck/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ pass:
- test: hpa_zero_replicas
validation: validation.yaml
resources: resources.json
permutation: '.istiodhpa.status.currentReplicas = 0'
permutation: ".istiodhpa.status.currentReplicas = 0"
expected-validation: false
- test: deployment_condition_false
validation: validation.yaml
resources: resources.json
permutation: '.istioddeployment.status.availableReplicas = 0'
expected-validation: false
permutation: ".istioddeployment.status.availableReplicas = 0"
expected-validation: false
34 changes: 17 additions & 17 deletions compliance/validations/istio/healthcheck/validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ domain:
type: kubernetes
kubernetes-spec:
resources:
- name: istioddeployment
resource-rule:
group: apps
name: istiod
namespaces:
- istio-system
resource: deployments
version: v1
- name: istiodhpa
resource-rule:
group: autoscaling
name: istiod
namespaces:
- istio-system
resource: horizontalpodautoscalers
version: v2
- name: istioddeployment
resource-rule:
group: apps
name: istiod
namespaces:
- istio-system
resource: deployments
version: v1
- name: istiodhpa
resource-rule:
group: autoscaling
name: istiod
namespaces:
- istio-system
resource: horizontalpodautoscalers
version: v2
provider:
type: opa
opa-spec:
Expand Down Expand Up @@ -59,4 +59,4 @@ provider:
msg := "HPA has sufficient replicas."
} else = {"result": false, "msg": msg} if {
msg := "HPA does not have sufficient replicas."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pass:
validation: validation.yaml
resources: resources.json
permutation: '.gateways |= map(if .metadata.name == "admin-gateway" then .spec.servers[0].tls.httpsRedirect = false else . end)'
expected-validation: false
expected-validation: false
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ provider:
}
msg = check_gateways_allowed.msg
msg_exempted_gateways = concat(", ", exempt_gateways)
# Collect gateways that do not encrypt ingress traffic
gateways_disallowed = {sprintf("%s/%s", [gateway.metadata.namespace, gateway.metadata.name]) |
gateway := input.gateways[_];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ pass:
- test: change_enablePrometheusMerge_to_false
validation: validation.yaml
resources: resources.json
permutation: '.istioConfig.enablePrometheusMerge = false'
permutation: ".istioConfig.enablePrometheusMerge = false"
expected-validation: false
- test: change_enablePrometheusMerge_to_false
validation: validation.yaml
resources: resources.json
permutation: 'del(.istioConfig.enablePrometheusMerge)'
expected-validation: true
permutation: "del(.istioConfig.enablePrometheusMerge)"
expected-validation: true
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ domain:
type: kubernetes
kubernetes-spec:
resources:
- name: istioConfig
resource-rule:
resource: configmaps
namespaces:
- istio-system
version: v1
name: istio
field:
jsonpath: .data.mesh
type: yaml
- name: istioConfig
resource-rule:
resource: configmaps
namespaces:
- istio-system
version: v1
name: istio
field:
jsonpath: .data.mesh
type: yaml
provider:
type: opa
opa-spec:
Expand All @@ -41,4 +41,4 @@ provider:
output:
validation: validate.validate
observations:
- validate.msg
- validate.msg
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ pass:
validation: validation.yaml
resources: resources.json
permutation: '.pods |= map(if .metadata.namespace == "grafana" then .metadata.annotations["prometheus.io/scrape"] = false else . end)'
expected-validation: false
expected-validation: false
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ provider:
validation: validate.validate
observations:
- validate.msg
- validate.msg_exempted_namespaces
- validate.msg_exempted_namespaces
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ pass:
validation: validation.yaml
resources: resources.json
permutation: ".authorizationPolicies = []"
expected-validation: false
expected-validation: false
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ metadata:
uuid: 9b361d7b-4e07-40db-8b86-3854ed499a4b
domain:
type: kubernetes
kubernetes-spec:
kubernetes-spec:
resources: []
provider:
type: opa
opa-spec:
opa-spec:
rego: |
package validate
default validate := false
default validate := false
Loading

0 comments on commit 742c8e6

Please sign in to comment.