Ensure that /etc/at.deny does not exist

Classification:

compliance

Framework:

Control:

Description

The file /etc/at.deny should not exist. Use /etc/at.allow instead.

Rationale

Access to at should be restricted. It is easier to manage an allow list than a deny list.

Remediation

Shell script

The following script can be run on the host to remediate the issue.

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then

#!/bin/bash



 if [[ -f /etc/at.deny ]]; then
 rm /etc/at.deny
 fi

else
 >&2 echo 'Remediation is not applicable, nothing was done'
fi

Ansible playbook

The following playbook can be run with Ansible to remediate the issue.

- name: Remove /etc/at.deny
 file:
 path: /etc/at.deny
 state: absent
 when: ansible\_virtualization\_type not in ["docker", "lxc", "openvz", "podman", "container"]
 tags:
 - PCI-DSSv4-2.2.6
 - disable\_strategy
 - file\_at\_deny\_not\_exist
 - low\_complexity
 - low\_disruption
 - medium\_severity
 - no\_reboot\_needed