diff --git a/applications/openshift/logging/audit_log_forwarding_uses_tls/rule.yml b/applications/openshift/logging/audit_log_forwarding_uses_tls/rule.yml index c29973daf6de..a1ad655d3f5d 100644 --- a/applications/openshift/logging/audit_log_forwarding_uses_tls/rule.yml +++ b/applications/openshift/logging/audit_log_forwarding_uses_tls/rule.yml @@ -37,7 +37,8 @@ ocil: |- warnings: - general: |- - {{{ openshift_cluster_setting() | indent(4) }}} + {{{ openshift_cluster_setting( + "/apis/observability.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders") | indent(4) }}} {{{ openshift_filtered_cluster_setting_suppressed({ "/apis/logging.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders/instance": 'try [.spec.outputs[].url] catch []', "/apis/observability.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders": 'try [.items[].spec.outputs[][]|objects|select(.url != null).url] catch []', diff --git a/applications/openshift/logging/audit_log_forwarding_uses_tls_observability_api/oval/shared.xml b/applications/openshift/logging/audit_log_forwarding_uses_tls_observability_api/oval/shared.xml new file mode 100644 index 000000000000..2e4b95ce3ad6 --- /dev/null +++ b/applications/openshift/logging/audit_log_forwarding_uses_tls_observability_api/oval/shared.xml @@ -0,0 +1,75 @@ +{{% set clf_path = '/apis/observability.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders' %}} +{{% set clf_filter = 'try [.items[].spec.outputs[][]|objects|select(.url != null).url] catch []' %}} + + + + {{{ oval_metadata("Ensure that Autidt Log Forwarding Uses TLS", rule_title=rule_title) }}} + + + + + + + + + + + + {{{ clf_path }}} + + + + + + + {{{ openshift_filtered_path(clf_path, clf_filter) }}} + + + + + + + + + + + .items[].spec.outputs[].name + + + + + + + + + + + [:] + + + + + ^(http|tcp|udp)://.*$ + + + + + + + + + + + + + + + diff --git a/applications/openshift/logging/audit_log_forwarding_uses_tls_observability_api/rule.yml b/applications/openshift/logging/audit_log_forwarding_uses_tls_observability_api/rule.yml index a66009133a76..1266faf222df 100644 --- a/applications/openshift/logging/audit_log_forwarding_uses_tls_observability_api/rule.yml +++ b/applications/openshift/logging/audit_log_forwarding_uses_tls_observability_api/rule.yml @@ -37,23 +37,26 @@ ocil: |- warnings: - general: |- - {{{ openshift_cluster_setting() | indent(4) }}} + {{{ openshift_cluster_setting( + "/apis/observability.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders" + ) | indent(4) }}} {{{ openshift_filtered_cluster_setting_suppressed({ "/apis/observability.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders": 'try [.items[].spec.outputs[][]|objects|(select(.url != null).url] catch []', }) | indent(4) }}} -template: - name: yamlfile_value - vars: - ocp_data: "true" - # A list of clusterlogforwarders is available at https://docs.openshift.com/container-platform/4.16/observability/logging/logging-6.0/log6x-clf.html#outputs - # The log forwarder outputs consist of an object and two strings (name and type). - # The url is part of the object and its name will vary depending on its type. - # By using the objects filter we ensure we are getting the object to query for its url. - filepath: "{{{ openshift_filtered_path('/apis/observability.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders', 'try [.items[].spec.outputs[][]|objects|select(.url != null).url] catch []') }}}" - yamlpath: "[:]" - entity_check: "all" - values: - - value: "^(https|tls)://.*$" - entity_check: "all" - operation: "pattern match" +# template: +# name: yamlfile_value +# vars: +# ocp_data: "true" +# # A list of clusterlogforwarders is available at https://docs.openshift.com/container-platform/4.16/observability/logging/logging-6.0/log6x-clf.html#outputs +# # The log forwarder outputs consist of an object and two strings (name and type). +# # The url is part of the object and its name will vary depending on its type. +# # By using the objects filter we ensure we are getting the object to query for its url. +# filepath: "{{{ openshift_filtered_path('/apis/observability.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders', 'try [.items[].spec.outputs[][]|objects|select(.url != null).url] catch []') }}}" +# yamlpath: "[:]" +# check_existence: any_exist +# entity_check: "all" +# values: +# - value: "^(https|tls)://.*$" +# entity_check: "all" +# operation: "pattern match"