Is there anyway that I can retrieved my config file content and display the necessary content in a logical format using for
loop?
[_1_ubu]
control_name = 1.1 Ensure AppArmor is installed
outcome = PASS
sys_out = Status: install ok installed
expected_out = AppArmor is installed
remediation = apt install apparmor
severity = MEDIUM
[_2_ubu]
control_name = 1.2 Ensure Avahi Server is not installed
outcome = FAIL
sys_out = Status: install ok installed
expected_out = avahi-daemon is installed
remediation = apt purge avahi-daemon
severity = MEDIUM
[_3_ubu]
control_name = 1.3 Ensure CUPS is not installed
outcome = PASS
sys_out = not installed
expected_out = cups is not installed
remediation = apt purge cups
severity = MEDIUM
In a structure like this: