Uploaded image for project: 'Cloud Infrastructure Security & Compliance'
  1. Cloud Infrastructure Security & Compliance
  2. CMP-4042

The Directory Access related rules fail after auto remediation applied on a RHCOS10 based cluster

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Compliance Operator
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Moderate

      Description of problem:

       

      The Directory access permissions for audit logs related rules(/var/log/oauth-audit, /var/log/ocp-audit, /var/log/kube-audit) fail after auto remediation applied on a RHCOS10 based cluster. Through detailed scanner logs, the rules failed due to both audit_rules_augenrules and audit_rules_auditctl disabled on the master nodes.
      oval:ssg-audit_rules_augenrules:def:1 → false ✗                                                                                                                                                        
      oval:ssg-audit_rules_auditctl:def:1 → false ✗                                                                                                                                                          
      Overall definition → false
      $ oc get ccr | grep directory-access-var-log-
      ocp4-moderate-node-master-directory-access-var-log-kube-audit                      FAIL     medium
      ocp4-moderate-node-master-directory-access-var-log-oauth-audit                     FAIL     medium
      ocp4-moderate-node-master-directory-access-var-log-ocp-audit                       FAIL     medium                
      $ oc get clusterversion
      NAME      VERSION       AVAILABLE   PROGRESSING   SINCE   STATUS
      version   4.21.0-ec.3   True        False         146m    Cluster version is 4.21.0-ec.3
      $ oc debug node/ip-10-0-18-49.us-east-2.compute.internal -- chroot /host cat /etc/redhat-release
      Starting pod/ip-10-0-18-49us-east-2computeinternal-debug ...
      To use host binaries, run `chroot /host`
      Red Hat Enterprise Linux release 10.1 (Coughlan)
      Removing debug pod ...
      $ oc logs pod/openscap-pod-xx -c scanner
      ...
      I: oscap: Evaluating definition 'oval:ssg-directory_access_var_log_ocp_audit:def:1': Record Access Events to OpenShift Audit Log Directory.
      I: oscap: Criteria are extended by definition 'oval:ssg-audit_rules_augenrules:def:1'.
      I: oscap: Evaluating definition 'oval:ssg-audit_rules_augenrules:def:1': Test if augenrules is enabled for audit rules.
      I: oscap: Definition 'oval:ssg-audit_rules_augenrules:def:1' evaluated as false.
      I: oscap: Evaluating textfilecontent54 test 'oval:ssg-test_directory_acccess_var_log_ocp_audit_augenrules:tst:1': defined audit rule must exist.
      I: oscap: Querying textfilecontent54 object 'oval:ssg-object_directory_acccess_var_log_ocp_audit_augenrules:obj:1', flags: 0.
      I: oscap: Creating new syschar for textfilecontent54_object 'oval:ssg-object_directory_acccess_var_log_ocp_audit_augenrules:obj:1'.
      I: oscap: Object 'oval:ssg-object_directory_acccess_var_log_ocp_audit_augenrules:obj:1' references variable 'oval:ssg-var_audit_rule_access_var_log_ocp_audit_regex:var:1' in 'pattern' field.
      I: oscap: Querying variable 'oval:ssg-var_audit_rule_access_var_log_ocp_audit_regex:var:1'.
      I: oscap: Variable 'oval:ssg-var_audit_rule_access_var_log_ocp_audit_regex:var:1' is not local, skipping.
      I: oscap: Variable 'oval:ssg-var_audit_rule_access_var_log_ocp_audit_regex:var:1' has values "^[\s]*-a[\s]+always,exit[\s]+(?:-F[\s]+dir=/var/log/openshift-apiserver/)[\s]+(?:-F[\s]+perm=r)[\s]+(?:-F\s+auid>=1000[\s]+)(?:-F\s+auid!=(unset|4294967295)[\s]+)(?:-k[\s]+|-F[\s]+key=)[\S]+[\s]*$".
      I: oscap: Switching probe to PROBE_OFFLINE_OWN mode.
      I: oscap: I will run textfilecontent54_probe_main:
      I: oscap: Opening file '/host/etc/audit/rules.d'.
      I: oscap: Test 'oval:ssg-test_directory_acccess_var_log_ocp_audit_augenrules:tst:1' requires that only one object defined by 'oval:ssg-object_directory_acccess_var_log_ocp_audit_augenrules:obj:1' exists on the system.
      I: oscap: 1 objects defined by 'oval:ssg-object_directory_acccess_var_log_ocp_audit_augenrules:obj:1' exist on the system.
      I: oscap: Test 'oval:ssg-test_directory_acccess_var_log_ocp_audit_augenrules:tst:1' does not contain any state to compare object with.
      I: oscap: All items matching object 'oval:ssg-object_directory_acccess_var_log_ocp_audit_augenrules:obj:1' were collected. (flag=complete)
      I: oscap: Test 'oval:ssg-test_directory_acccess_var_log_ocp_audit_augenrules:tst:1' evaluated as true.
      I: oscap: Criteria are extended by definition 'oval:ssg-audit_rules_auditctl:def:1'.
      I: oscap: Evaluating definition 'oval:ssg-audit_rules_auditctl:def:1': Test if auditctl is in use for audit rules.
      I: oscap: Definition 'oval:ssg-audit_rules_auditctl:def:1' evaluated as false.
      I: oscap: Evaluating textfilecontent54 test 'oval:ssg-test_directory_acccess_var_log_ocp_audit_auditctl:tst:1': defined audit rule must exist.
      I: oscap: Querying textfilecontent54 object 'oval:ssg-object_directory_acccess_var_log_ocp_audit_auditctl:obj:1', flags: 0.
      I: oscap: Creating new syschar for textfilecontent54_object 'oval:ssg-object_directory_acccess_var_log_ocp_audit_auditctl:obj:1'.
      I: oscap: Object 'oval:ssg-object_directory_acccess_var_log_ocp_audit_auditctl:obj:1' references variable 'oval:ssg-var_audit_rule_access_var_log_ocp_audit_regex:var:1' in 'pattern' field.
      I: oscap: Querying variable 'oval:ssg-var_audit_rule_access_var_log_ocp_audit_regex:var:1'.
      I: oscap: Variable 'oval:ssg-var_audit_rule_access_var_log_ocp_audit_regex:var:1' is not local, skipping.
      I: oscap: Variable 'oval:ssg-var_audit_rule_access_var_log_ocp_audit_regex:var:1' has values "^[\s]*-a[\s]+always,exit[\s]+(?:-F[\s]+dir=/var/log/openshift-apiserver/)[\s]+(?:-F[\s]+perm=r)[\s]+(?:-F\s+auid>=1000[\s]+)(?:-F\s+auid!=(unset|4294967295)[\s]+)(?:-k[\s]+|-F[\s]+key=)[\S]+[\s]*$".
      I: oscap: Switching probe to PROBE_OFFLINE_OWN mode.
      I: oscap: I will run textfilecontent54_probe_main:
      I: oscap: Opening file '/host/etc/audit/audit.rules'.
      I: oscap: Test 'oval:ssg-test_directory_acccess_var_log_ocp_audit_auditctl:tst:1' requires that only one object defined by 'oval:ssg-object_directory_acccess_var_log_ocp_audit_auditctl:obj:1' exists on the system.
      I: oscap: 1 objects defined by 'oval:ssg-object_directory_acccess_var_log_ocp_audit_auditctl:obj:1' exist on the system.
      I: oscap: Test 'oval:ssg-test_directory_acccess_var_log_ocp_audit_auditctl:tst:1' does not contain any state to compare object with.
      I: oscap: All items matching object 'oval:ssg-object_directory_acccess_var_log_ocp_audit_auditctl:obj:1' were collected. (flag=complete)
      I: oscap: Test 'oval:ssg-test_directory_acccess_var_log_ocp_audit_auditctl:tst:1' evaluated as true.
      I: oscap: Definition 'oval:ssg-directory_access_var_log_ocp_audit:def:1' evaluated as false.
      Result^M        fail
      ...
      

       

      Version-Release number of selected component (if applicable):

      4.21.0-ec.3 + cov1.8.0

       

      How reproducible:

      Always

       

      Steps to Reproduce:

      1. Install cluster with payload RHCOS10 payload 4.21.0-ec.3
      2. Install Compliance Operatorv1.8.0
      3. Create a ssb with ocp4-moderate-node profile

      Actual results:

       

      The Directory Access related rules fail after auto remediation applied on a RHCOS10 based cluster. More details seen from the description

       

      Expected results:

              Unassigned Unassigned
              xiyuan@redhat.com Xiaojie Yuan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: