<def-group>
  <definition class="compliance" id="auditd_data_retention_audit_storage_failure" version="1">
    <metadata>
      <title>Auditd Email Account to Notify Upon Action</title>
      <affected family="unix">
        <platform>CentOS 4</platform>
		<platform>CentOS 5</platform>
		<platform>Red Hat Enterprise Linux 4</platform>
		<platform>Red Hat Enterprise Linux 5</platform>
      </affected>
      <description>action_mail_acct setting in /etc/audit/auditd.conf is set to a certain account</description>
    </metadata>

    <criteria operator="OR">
      <criteria>
        <criteria operator="OR">
	      <extend_definition comment="CentOS 4 is installed" definition_ref="installed_OS_is_centos4" />
	      <extend_definition comment="RedHat 4 is installed" definition_ref="installed_OS_is_rhel4" />
        </criteria>
        <criteria operator="OR">
	      <criterion comment="action_mail_acct setting in /etc/auditd.conf is set to syslog or exec" test_ref="test_auditd_data_retention_space_left_action_exec_syslog_el4" />
		  <criteria operator="AND">
			<criterion comment="action_mail_acct setting in /etc/auditd.conf is set to email" test_ref="test_auditd_data_retention_space_left_action_email_el4" />
			<criteria operator="OR">
			  <criterion comment="action_mail_acct setting in /etc/auditd.conf" test_ref="test_auditd_data_retention_action_mail_acct_root_el4" />
              <criteria operator="AND">
                <criterion comment="action_mail_acct setting in /etc/auditd.conf" test_ref="test_auditd_data_retention_action_mail_acct_external_el4" />
				<criterion comment="package sendmail is installed" test_ref="test_auditd_data_retention_audit_storage_failure_package_sendmail_installed" />
              </criteria>
			</criteria>
          </criteria>
        </criteria>
      </criteria>
      <criteria>
        <criteria operator="OR">
	      <extend_definition comment="CentOS 5 is installed" definition_ref="installed_OS_is_centos5" />
	      <extend_definition comment="RedHat 5 is installed" definition_ref="installed_OS_is_rhel5" />
        </criteria>
        <criteria operator="OR">
	      <criterion comment="action_mail_acct setting in /etc/audit/auditd.conf is set to syslog or exec" test_ref="test_auditd_data_retention_space_left_action_exec_syslog_el5" />
		  <criteria operator="AND">
			<criterion comment="action_mail_acct setting in /etc/audit/auditd.conf is set to email" test_ref="test_auditd_data_retention_space_left_action_email_el5" />
			<criteria operator="OR">
			  <criterion comment="action_mail_acct setting in /etc/audit/auditd.conf" test_ref="test_auditd_data_retention_action_mail_acct_root_el5" />
              <criteria operator="AND">
                <criterion comment="action_mail_acct setting in /etc/audit/auditd.conf" test_ref="test_auditd_data_retention_action_mail_acct_external_el5" />
				<criterion comment="package sendmail is installed" test_ref="test_auditd_data_retention_audit_storage_failure_package_sendmail_installed" />
              </criteria>
			</criteria>
          </criteria>
        </criteria>
      </criteria>
    </criteria>
  </definition>
  
  <ind:textfilecontent54_test check="all" comment="space left action - exec,syslog" id="test_auditd_data_retention_space_left_action_exec_syslog_el4" version="1">
    <ind:object object_ref="object_auditd_data_retention_space_left_action_exec_syslog_el4" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_auditd_data_retention_space_left_action_exec_syslog_el4" version="1">
    <ind:filepath>/etc/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^space_left_action\s*=\s*(exec|syslog)</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="space left action - email" id="test_auditd_data_retention_space_left_action_email_el4" version="1">
    <ind:object object_ref="object_auditd_data_retention_space_left_action_email_el4" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_auditd_data_retention_space_left_action_email_el4" version="1">
    <ind:filepath>/etc/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^space_left_action\s*=\s*(email)</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="email account for actions" id="test_auditd_data_retention_action_mail_acct_root_el4" version="1">
    <ind:object object_ref="object_auditd_data_retention_action_mail_acct_root_el4" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_auditd_data_retention_action_mail_acct_root_el4" version="1">
    <ind:filepath>/etc/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^action_mail_acct\s*=\s*(root)</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="email account for actions" id="test_auditd_data_retention_action_mail_acct_external_el4" version="1">
    <ind:object object_ref="object_auditd_data_retention_action_mail_acct_external_el4" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_auditd_data_retention_action_mail_acct_external_el4" version="1">
    <ind:filepath>/etc/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^action_mail_acct\s*=\s*(\S+@\S+\.\S+)</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="space left action - exec,syslog" id="test_auditd_data_retention_space_left_action_exec_syslog_el5" version="1">
    <ind:object object_ref="object_auditd_data_retention_space_left_action_exec_syslog_el5" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_auditd_data_retention_space_left_action_exec_syslog_el5" version="1">
    <ind:filepath>/etc/audit/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^space_left_action\s*=\s*(exec|syslog)</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="space left action - email" id="test_auditd_data_retention_space_left_action_email_el5" version="1">
    <ind:object object_ref="object_auditd_data_retention_space_left_action_email_el5" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_auditd_data_retention_space_left_action_email_el5" version="1">
    <ind:filepath>/etc/audit/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^space_left_action\s*=\s*(email)</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="email account for actions" id="test_auditd_data_retention_action_mail_acct_root_el5" version="1">
    <ind:object object_ref="object_auditd_data_retention_action_mail_acct_root_el5" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_auditd_data_retention_action_mail_acct_root_el5" version="1">
    <ind:filepath>/etc/audit/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^action_mail_acct\s*=\s*(root)</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="email account for actions" id="test_auditd_data_retention_action_mail_acct_external_el5" version="1">
    <ind:object object_ref="object_auditd_data_retention_action_mail_acct_external_el5" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_auditd_data_retention_action_mail_acct_external_el5" version="1">
    <ind:filepath>/etc/audit/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^action_mail_acct\s*=\s*(\S+@\S+\.\S+)</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <linux:rpminfo_test check="all" check_existence="all_exist" id="test_auditd_data_retention_audit_storage_failure_package_sendmail_installed" version="1" comment="package sendmail is installed">
    <linux:object object_ref="obj_auditd_data_retention_audit_storage_failure_package_sendmail_installed" />
  </linux:rpminfo_test>
  <linux:rpminfo_object id="obj_auditd_data_retention_audit_storage_failure_package_sendmail_installed" version="1">
    <linux:name>sendmail</linux:name>
  </linux:rpminfo_object>

</def-group>
