Skip to content

Set Permissions on All Configuration Files Inside /etc/httpd/conf.d/

An XCCDF Rule

Description

To properly set the permissions of /etc/http/conf.d/*, run the command:

$ sudo chmod 0640 /etc/http/conf.d/*

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_d_files
Severity
Unknown
References
Updated



Remediation - Ansible

- name: Find /etc/httpd/conf.d/ file(s)
  command: find -H /etc/httpd/conf.d/ -maxdepth 1 -perm /u+xs,g+xws,o+xwrt  -type
    f -regex "^.*$"
  register: files_found
  changed_when: false
  failed_when: false

Remediation - Shell Script






find -H /etc/httpd/conf.d/ -maxdepth 1 -perm /u+xs,g+xws,o+xwrt  -type f -regex '^.*$' -exec chmod u-xs,g-xws,o-xwrt {} \;