Red Hat Bugzilla – Bug 1406887
auditd validate_email uses incorrect/obsolete gethostbyname
Last modified: 2018-04-10 08:20:11 EDT
Description of problem: auditd fails to start with: auditd[3156]: validate_email: failed looking up host for nsoc.health.mil Version-Release number of selected component (if applicable): # auditctl -v auditctl version 2.6.5 How reproducible: Setup auditd with a action_mail_acct to domain without A record Steps to Reproduce: 1. "action_mail_acct = user@example.com" in /etc/audit/auditd.conf 2. start auditd Actual results: auditd fails to start Expected results: auditd starts Additional info:
For me, auditd starts, but issues warning message when running aureport.
Added option to disable domain name checking in upstream commit 95d8141.
Built audit-2.7.8 to address this issue.
Successfully reproduced and verified on all supported architectures (x86_64, ppc64, ppc64le and s390x for RHEL and ppc64le and aarch64 for RHEL-ALT). OLD (audit-2.7.6-3.el7) ======================= * No verify-email option in config. * action_mail_acct = a@redhat.xxxxx # service auditd restart # systemctl status auditd -f -n 100 ... Nov 30 15:58:15 XXX auditd[10800]: validate_email: failed looking up host for redhat.xxxxx Auditd service running, only warning message. NEW (audit-2.8.1-2.el7) ======================= * verify-email = no * action_mail_acct = a@redhat.xxxxx # service auditd restart # systemctl status auditd -f -n 100 Nov 30 16:03:06 XXX systemd[1]: Starting Security Auditing Service... ... <no warning message> ... Nov 30 16:03:06 XXX systemd[1]: Started Security Auditing Service. Moreover I have verified that all setting of verify_email option (including default) work as expected. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: verify_email unspecified (default = yes) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: Non-existing domain :: [ PASS ] :: Command 'sed -i '/verify_email/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'sed -i '/action_mail_acct/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'action_mail_acct = a@redhat.xxxxx' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'service auditd start && sleep 10' (Expected 0, got 0) :: [ PASS ] :: Command 'systemctl status auditd -f -n 100' (Expected 0, got 0) :: [ PASS ] :: File '/var/tmp/rlRun_LOG.1x5C4J1W' should contain 'validate_email: failed' :: [ PASS ] :: Command 'service auditd stop && sleep 10' (Expected 0, got 0) :: [ LOG ] :: Existing domain :: [ PASS ] :: Command 'sed -i '/verify_email/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'sed -i '/action_mail_acct/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'action_mail_acct = a@redhat.com' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'service auditd start && sleep 10' (Expected 0, got 0) :: [ PASS ] :: Command 'systemctl status auditd -f -n 100' (Expected 0, got 0) :: [ PASS ] :: File '/var/tmp/rlRun_LOG.oinwnm7i' should not contain 'validate_email: failed' :: [ PASS ] :: Command 'service auditd stop && sleep 10' (Expected 0, got 0) :: [ LOG ] :: Duration: 42s :: [ LOG ] :: Assertions: 15 good, 0 bad :: [ PASS ] :: RESULT: verify_email unspecified (default = yes) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: verify_email = no :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: Non-existing domain :: [ PASS ] :: Command 'sed -i '/verify_email/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'sed -i '/action_mail_acct/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'verify_email = no' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'action_mail_acct = a@redhat.xxxxx' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'service auditd start && sleep 10' (Expected 0, got 0) :: [ PASS ] :: Command 'systemctl status auditd -f -n 100' (Expected 0, got 0) :: [ PASS ] :: File '/var/tmp/rlRun_LOG.qpL7j0Zz' should not contain 'validate_email: failed' :: [ PASS ] :: Command 'service auditd stop && sleep 10' (Expected 0, got 0) :: [ LOG ] :: Existing domain :: [ PASS ] :: Command 'sed -i '/verify_email/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'sed -i '/action_mail_acct/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'verify_email = no' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'action_mail_acct = a@redhat.com' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'service auditd start && sleep 10' (Expected 0, got 0) :: [ PASS ] :: Command 'systemctl status auditd -f -n 100' (Expected 0, got 0) :: [ PASS ] :: File '/var/tmp/rlRun_LOG.NDyvVBDt' should not contain 'validate_email: failed' :: [ PASS ] :: Command 'service auditd stop && sleep 10' (Expected 0, got 0) :: [ LOG ] :: Duration: 42s :: [ LOG ] :: Assertions: 16 good, 0 bad :: [ PASS ] :: RESULT: verify_email = no :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: verify_email = yes :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: Non-existing domain :: [ PASS ] :: Command 'sed -i '/verify_email/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'sed -i '/action_mail_acct/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'verify_email = yes' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'action_mail_acct = a@redhat.xxxxx' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'service auditd start && sleep 10' (Expected 0, got 0) :: [ PASS ] :: Command 'systemctl status auditd -f -n 100' (Expected 0, got 0) :: [ PASS ] :: File '/var/tmp/rlRun_LOG.bBTyXsJK' should contain 'validate_email: failed' :: [ PASS ] :: Command 'service auditd stop && sleep 10' (Expected 0, got 0) :: [ LOG ] :: Existing domain :: [ PASS ] :: Command 'sed -i '/verify_email/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'sed -i '/action_mail_acct/d' /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'verify_email = yes' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'echo 'action_mail_acct = a@redhat.com' >> /etc/audit/auditd.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'service auditd start && sleep 10' (Expected 0, got 0) :: [ PASS ] :: Command 'systemctl status auditd -f -n 100' (Expected 0, got 0) :: [ PASS ] :: File '/var/tmp/rlRun_LOG.xsPOUOTU' should not contain 'validate_email: failed' :: [ PASS ] :: Command 'service auditd stop && sleep 10' (Expected 0, got 0) :: [ LOG ] :: Duration: 42s :: [ LOG ] :: Assertions: 16 good, 0 bad :: [ PASS ] :: RESULT: verify_email = yes
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0760