Microsoft Defender for IoT
General

Configure Pluggable Authentication Modules (PAM) to Audit Sign-in Events (Preview)

In brief

The guide updates metadata, wording, capitalization, and references to examples. It also renames “Next steps” to “Related content” and adjusts the Micro agent event collection link presentation.

What Defender admins need to know

Administrators reviewing the PAM audit procedure will see updated caveats and section labeling when using the guide.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Configure Pluggable Authentication Modules (PAM) to audit sign-in events

This article provides a sample process for configuring Pluggable Authentication Modules (PAM) to audit SSH, Telnet, and terminal sign-in events on an unmodified Ubuntu 20.04 or 18.04 installation.

PAM configurations maymight vary between devices and Linux distributions.

For more information, see Login collector (event-based collector).

This procedure provides a sample process for configuring the collection of successful sign-in events.

Our example is based on an unmodified Ubuntu 20.04 or 18.04 installation, and the steps in this process maymight differ for your system.

  1. Locate the following files:

This procedure provides a sample process for configuring the collection of failed sign-in attempts.

This example in this procedure is based on an unmodified Ubuntu 18.04 or 20.04 installation. The following files and commands listed below maymight differ per configuration or as a result of modifications.

  1. Locate the /etc/pam.d/common-auth file and look for the following lines:

    auth    requisite           pam_deny.so

    
    The `common-auth` configuration shown abovehere authenticates via the `pam_unix.so` module. In case of authentication failure, the configuration continues to the `pam_deny.so` module to prevent access.
    
  2. Replace the indicated lines of code with the following:

    auth requisite pam_deny.so

    
    In the modified `/etc/pam.d/common-auth` configuration shown above,here, PAM skips one module to the `pam_echo.so` module, and then skips the `pam_deny.so` module and authenticates successfully.
    
    In case of failure, PAM continues to report the sign-in failure to the agent log file, and then skips one module to the `pam_deny.so` module, which blocks access.
    
  3. Repeat the verification procedure with Telnet and terminal connections.

Next stepsRelated content

For more information, see Micro agent event collection.