Pcornel
Automation · Compliance Automation

Auto-remediation

Cheat sheet · https://pcornel.dk/topic.php?topic=6022

Back to the Topic

Answer

Auto-remediation in compliance automation fixes non-compliant settings automatically when a check fails, such as re-enabling a firewall or resetting a weak SSH setting, with approval rules for risky changes.

Remember

  • Auto-fix only well-understood, low-risk settings.
  • Log every automatic change.
  • Use alert-only mode for risky settings.

First checks

  • Auto-remediation playbooks for failed controls — fixing
  • Safe-to-fix list — scope
  • Remediation logs — evidence

Commands

ansible-playbook --check --diff <playbook.yml>
Read-only/validation observation for Ansible's predicted change set and diff for modules that support check mode.

Verify in this order

failed control → remediation → rescan

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6022

Confirmation

Confirm action

Continue?