Set Permissions on All Configuration Files Inside /etc/httpd/conf/
An XCCDF Rule
Description
To properly set the permissions of /etc/http/conf/*
, run the command:
$ sudo chmod 0640 /etc/http/conf/*
Rationale
Access to the web server's configuration files may allow an unauthorized user or attacker to access information about the web server or to alter the server's configuration files.
- ID
- xccdf_org.ssgproject.content_rule_file_permissions_httpd_server_conf_files
- Severity
- Unknown
- References
- Updated
Remediation - Shell Script
find -H /etc/httpd/conf/ -maxdepth 1 -perm /u+xs,g+xws,o+xwrt -type f -regex '^.*$' -exec chmod u-xs,g-xws,o-xwrt {} \;
Remediation - Ansible
- name: Find /etc/httpd/conf/ file(s)
command: find -H /etc/httpd/conf/ -maxdepth 1 -perm /u+xs,g+xws,o+xwrt -type f
-regex "^.*$"
register: files_found
changed_when: false
failed_when: false