Best practices for setting up secure logging
Visibility and analytics are important pillars of Enterprise Security and Zero Trust architectures. Logging is key to capturing actions and auditing.
You can manage logging and auditing by using the built-in audit support described in the Auditing the suystem section of the Security hardening for Red Hat Enterprise Linux guide. Ansible Automation Platform’s built-in logging and activity stream logs all change within Red Hat Ansible Automation Platform and automation logs for auditing purposes.
Ansible Automation Platform and the underlying Red Hat Enterprise Linux systems should be configured to collect logging and auditing centrally, rather than reviewing it on the local system. Configure Ansible Automation Platform to use external logging to compile log records from multiple components within the Ansible Automation Platform server. The events occurring must be time-correlated to conduct accurate forensic analysis.
Another critical capability of logging is the ability to use cryptography to protect the integrity of log tools. Log data includes all information (for example, log records, log settings, and log reports) needed to successfully log information system activity. It is common for attackers to replace the log tools or inject code into the existing tools to hide or erase system activity from the logs. To address this risk, log tools must be cryptographically signed so that you can identify when the log tools have been modified, manipulated, or replaced. For example, one way to validate that the log tool(s) have not been modified, manipulated or replaced is to use a checksum hash against the tool file(s). This ensures the integrity of the tool(s) has not been compromised.
Configure centralized logging Copy linkLink copied!
Configure centralized logging to collect all Ansible Automation Platform logs in a single location. Consolidating this data makes it easier to troubleshoot issues, detect tampering, and helps ensure the overall security and stability of your environment.
There are several additional benefits including:
- The data is sent in JSON format over a HTTP connection using minimal service-specific tweaks engineered in a custom handler or through an imported library. The types of data that are most useful to the controller are job fact data, job events/job runs, activity stream data, and log messages.
- Deeper insights into the automation process by analyzing logs from different parts of the infrastructure, including playbook execution details, task outcomes, and system events.
- Identifying performance bottlenecks and optimizing the Ansible playbooks by analyzing execution times and resource usage from the logs.
- Centralized logging helps meet compliance mandates by providing a single source of truth for auditing purposes.
- Third Party integration with a centralized log management platform like Splunk, Logstash, ElasticSearch, or Loggly to collect and analyze logs.
The logging aggregator service works with the following monitoring and data analysis systems:
- Splunk
- Loggly
- Sumologic
- Elastic stack (formerly ELK stack)
Set up logging Copy linkLink copied!
To set up logging to any of the aggregator types for centralized logging follow these steps:
Procedure Copy linkLink copied!
Configure LDAP logging Copy linkLink copied!
Enable debug logging for LDAP in the platform gateway settings to capture detailed authentication messages. Reviewing these logs ensures that you can effectively troubleshoot and resolve LDAP connection issues.
Procedure Copy linkLink copied!
- Edit the gateway settings file:
- Restart the platform gateway service or container:
Implement security control Copy linkLink copied!
Some of the following examples of meeting compliance requirements come from the US DoD Security Technical Implementation Guide, but go back to integrity and security best practices.
About this task Copy linkLink copied!
Automation controller must use external log providers that can collect user activity logs in independent, protected repositories to prevent modification or repudiation. Automation controller must be configured to use external logging to compile log records from multiple components within the server. The events occurring must be time-correlated in order to conduct accurate forensic analysis. In addition, the correlation must meet certain tolerance criteria.
The following steps implement the security control:
Procedure Copy linkLink copied!
Implement security control for each host Copy linkLink copied!
Restrict access to automation controller log files using explicitly defined privileges. Protecting log confidentiality prevents attackers from gathering sensitive system details and helps ensure your environment is safe from privilege escalation or lateral movement.
About this task Copy linkLink copied!
To implement the security control, use the following procedure:
Procedure Copy linkLink copied!
Implement security control for system administrators Copy linkLink copied!
Configure your automation controller web server to log detailed user session records. Capturing this data supports troubleshooting, debugging, and forensic analysis, and helps ensure you retain essential auditing tools for event investigations.
About this task Copy linkLink copied!
Use the following procedure to implement the security control as a System Administrator for each automation controller host: