How do I enable OpenSearch audit logging?

Steps
 
1 

Open a terminal session.


2 

Log in as the root or NSP admin user on the NSP deployer VM.


3 

Open the following file using a plain-text editor such as vi:

/opt/nsp/NSP-CN-DEP-release-ID/NSP-CN-release-ID/config/nsp-config.yml


Enable and configure OpenSearch audit logging
 
4 

Enable audit logging as follows:

  logging:

    opensearchSecurityAuditLogs:

      enabled: true


5 

By default, READ and GET API requests are excluded from the audit logs.

Include these requests as follows:

  logging:

    opensearchSecurityAuditLogs:

      includeReadOperations: true


6 

The default retentionPeriodInDaysOverride for OpenSearch audit is zero (0).

Zero (0) means no explicit override, so the system uses the deployment profile default audit retention (typically five days for internal/lab profiles and 30 days for other profiles respectively).

You can override the retention period as follows:

  logging:

    opensearchSecurityAuditLogs:

      retentionPeriodInDaysOverride: days

where days is retention period in days.

Example:

  logging:

    opensearchSecurityAuditLogs:

      enabled: true

      includeReadOperations: true

      retentionPeriodInDaysOverride: 30


Save and deploy updated configuration
 
7 

Save and close the nsp-config.yml file.


8 

Enter the following to start the NSP cluster:

Note: If the NSP cluster VMs do not have the required SSH key, you must include the --ask-pass argument in the nspdeployerctl command, as shown in the following example, and are subsequently prompted for the root password of each cluster member:

nspdeployerctl --ask-pass install --config --deploy

# ./nspdeployerctl install --config --deploy ↵

The NSP cluster starts, and the configuration update is put into effect.


9 

Close the console window.

End of steps