
<def-group>
  <definition class="compliance" id="coredump_disable_backtraces" version="1">
    <metadata>
        <title>Disable core dump backtraces</title>
        
    <affected family="unix">
    <platform>Ubuntu 22.04</platform>
    </affected>
        <description>Ensure 'ProcessSizeMax' is configured with value '0' in section 'Coredump' in /etc/systemd/coredump.conf</description>
    </metadata>
    <criteria comment="systemd-coredump is configured correctly"
    operator="OR"><criterion comment="Check the ProcessSizeMax in /etc/systemd/coredump.conf"
  test_ref="test_coredump_disable_backtraces" />
        <criterion comment="Check the ProcessSizeMax in /etc/systemd/coredump.conf.d"
  test_ref="test_coredump_disable_backtraces_config_dir" />
    </criteria>
  </definition>

  
<ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="tests the value of ProcessSizeMax setting in the /etc/systemd/coredump.conf file"
  id="test_coredump_disable_backtraces" version="1">
  <ind:object object_ref="obj_coredump_disable_backtraces" />
  <ind:state state_ref="state_coredump_disable_backtraces" />
</ind:textfilecontent54_test>
  
<ind:textfilecontent54_object id="obj_coredump_disable_backtraces" version="1">
  <ind:filepath>/etc/systemd/coredump.conf</ind:filepath>
  <ind:pattern operation="pattern match">^\s*\[Coredump\].*(?:\n\s*[^[\s].*)*\n^[ \t]*ProcessSizeMax\h*=\h*(.+?)[ \t]*(?:$|#)</ind:pattern>
  <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
</ind:textfilecontent54_object>
  
<ind:textfilecontent54_state id="state_coredump_disable_backtraces" version="1">
  <ind:subexpression datatype="string" operation="pattern match">^0$</ind:subexpression>
</ind:textfilecontent54_state>
  
<ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="tests the value of ProcessSizeMax setting in the /etc/systemd/coredump.conf.d file"
  id="test_coredump_disable_backtraces_config_dir" version="1">
  <ind:object object_ref="obj_coredump_disable_backtraces_config_dir" />
  <ind:state state_ref="state_coredump_disable_backtraces_config_dir" />
</ind:textfilecontent54_test>
  
<ind:textfilecontent54_object id="obj_coredump_disable_backtraces_config_dir" version="1">
  <ind:path>/etc/systemd/coredump.conf.d</ind:path>
  <ind:filename operation="pattern match">.*\.conf$</ind:filename>
  <ind:pattern operation="pattern match">^\s*\[Coredump\].*(?:\n\s*[^[\s].*)*\n^[ \t]*ProcessSizeMax\h*=\h*(.+?)[ \t]*(?:$|#)</ind:pattern>
  <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
</ind:textfilecontent54_object>
  
<ind:textfilecontent54_state id="state_coredump_disable_backtraces_config_dir" version="1">
  <ind:subexpression datatype="string" operation="pattern match">^0$</ind:subexpression>
</ind:textfilecontent54_state>


</def-group>