IBM Support

AIX AUDIT: Using PROC_Execute to identify failed login sources

How To


Summary

A user ID has repeated failed logins after a password change. The who command does not identify the device, but the administrator suspects a failed database connection. This document demonstrates how to audit the PROC_Execute events to get more details.

Steps

The test example
  • Logs the following predefined file system events:
    • PROC_Execute, USER_Login
  • Adds /etc/security/failedlogin to the objects file
     
Read IBM Documentation:
The example does not cover log management, or other audit configuration details. The example assumes the "/audit" file system exists, and uses stream mode for the examples. Read the "Support" section in this note for more technical references.
1) Go to the audit configuration directory:
# cd /etc/security/audit

2) Modify config:start options:
# vi /etc/security/audit/config
start:
    binmode = off
    streammode = on
    ignorenonexistentity = no
3) Modify config:class: (Add new failCheck stanza to classes)
classes: <...>    
failCheck = USER_Login,PROC_Execute
4) Add 'failCheck' class to config:users:
users:
     default = failCheck
**If you only want to audit a specific user, you can specify a user ID. Or, use 'default' to log the defined events for all users.
   
5) Add the 'failedlogin' file to objects:
/etc/security/failedlogin:
        w = "S_FAILED_WRITE"
 
6) Add the "S_FAILED_WRITE" event to the events file:
S_FAILED_WRITE = printf "%s"
 
7) Configure the stream mode commands:
# vi /etc/security/audit/streamcmds:
/usr/sbin/auditstream | auditpr -htpPrceR -w > /audit/stream.out &

8) Stop and restart audit:
# audit shutdown
# audit start
9) Now test some simple file system operations:
# Test steps:

6.1 Test an ssh login with an incorrect password.
6.2 Test a db2 connection with an incorrect password
. /home/ldapdb2/sqllib/db2profile
db2 connect to ldapdb2 user ldapdb2 using badPassword


 
10) Check the audit stream log
# cat /audit/stream.out
(Note: The "time" column was removed from this example)
process  parent   real  command  event          status    
-------- -------- ---- --------- ------- --------------- -----------
11993496 14090580 root  sshd    USER_Login      FAIL_AUTH    user: ldapdb2 tty: ssh
 
11993496 14090580 root  sshd    S_FAILED_WRITE  OK           audit object write event detected
                  /etc/security/failedlogin

11993500 13959552 root  db2     PROC_Execute    OK           euid: 0 egid: 0 epriv:
                 ffffffff:ffffffff name db2 connect to ldapdb2 user ldapdb2 using badPassword

7078192  8519956  root  db2sysc S_PASSWD_READ   OK           audit object read event detected 
                 /etc/security/passwd
 
7078192  8519956  root  db2sysc USER_Login      FAIL_AUTH    user: ldapdb2 tty:
 
7078192  8519956  root  db2sysc S_FAILED_WRITE  OK           audit object write event detected
                /etc/security/failedlogin
The sshd and db2sysc daemons log a FAIL_AUTH Entry for USER_Login. The PROC_Execute gives details about the db2 connection command.

Additional Information

SUPPORT

Security configuration involves comprehensive features. Most of these features require advanced review and planning by administrators who are familiar with all of their system requirements. AIX Support does not make specific recommendations to harden your system. Customization is out of the scope of AIX Support, but if you have specific questions about documented usage, our support experts are happy to assist.

You can learn more about the audit functions on AIX and best practices through the following resources:
 

If you have specific questions about usage after reviewing the recommended documentation, IBM AIX Support will be happy to assist.

If you require consulting services, there are more fee-based services available.

If you require usage assistance, use the following step-by-step instructions to contact IBM to open a case for software with an active and valid support contract.  
 

1.  Document (or collect screen captures of) all symptoms, errors, and messages related to your issue.

2.  Capture any logs or data relevant to the situation.

3.  Contact IBM to open a case:

   -For electronic support, see the IBM Support Community:
     https://www.ibm.com/mysupport
   -If you require telephone support, see the web page:
      https://www.ibm.com/planetwide/

4.  Provide a clear, concise description of the issue.

 

5.  If the system is accessible, collect a system snap, and upload all of the details and data for your case.

  - For guidance, see: Working with IBM AIX Support: Collecting snap data

[{"Type":"MASTER","Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"a8m0z000000cw2BAAQ","label":"Security-\u003EAudit"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions"}]

Document Information

Modified date:
18 September 2023

UID

ibm17034043