Select any two versions of this STIG to compare the individual requirements
Select any old version/release of this STIG to view the previous requirements
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the directives "KeepAlive" and "MaxKeepAliveRequests" in the "httpd.conf" file: # cat /<path_to_file>/httpd.conf | grep -i "keepalive" KeepAlive On MaxKeepAliveRequests 100 If the value of "KeepAlive" is set to "off" or does not exist, this is a finding. If the value of "MaxKeepAliveRequests" is set to a value less than "100" or does not exist, this is a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Set the "KeepAlive" directive to a value of "on"; add the directive if it does not exist. Set the "MaxKeepAliveRequests" directive to a value of "100" or greater; add the directive if it does not exist. Restart Apache: apachectl restart
Issue the following command: httpd -M |grep -E 'session_module|usertrack' Expected output: usertrack_module (shared) session_module (shared) If results do not return both "usertrack_module (shared)" and "session_module (shared)", this is a finding. Alternatively, determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the "session_module" and "usertrack_module" directives: # cat /<path_to_file>/httpd.conf | grep -i "session_module" # cat /<path_to_file>/httpd.conf | grep -i "usertrack_module" If "session_module" and "usertrack_module" are not enabled or do not exist, this is a finding.
If the modules are not installed, install any missing packages. Add the following lines to the "httpd.conf" file: LoadModule usertrack_module modules/mod_usertrack.so LoadModule session_module modules/mod_session.so Additional documentation can be found at: https://httpd.apache.org/docs/2.4/mod/mod_usertrack.html https://httpd.apache.org/docs/2.4/mod/mod_session.html Restart Apache: apachectl restart
Verify the "ssl module" module is loaded # httpd -M | grep -i ssl_module Output: ssl_module (shared) If the "ssl_module" is not found, this is a finding. Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the directive "SSLProtocol" in the "httpd.conf" file: # cat /<path_to_file>/httpd.conf | grep -i "SSLProtocol" If the "SSLProtocol" directive is missing or does not look like the following, this is a finding: SSLProtocol -ALL +TLSv1.2 If the TLS version is not TLS 1.2 or higher, according to NIST SP 800-52 Rev 2, or if non-FIPS-approved algorithms are enabled, this is a finding.
# cat /etc/httpd/conf.d/ssl.conf | grep "SSLProtocol - ALL +TLSv1.2" Ensure the "SSLProtocol" is added to the ssl.conf file and looks like the following: SSLProtocol -ALL +TLSv1.2 Restart Apache: apachectl restart
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the directive "CustomLog" in the "httpd.conf" file: # cat /<path_to_file>/httpd.conf | grep -i "CustomLog" If the "CustomLog" directive is missing, this is a finding: An example CustomLog directive would be as follows: CustomLog "logs/access_log" common or CustomLog “log/access_log” combined (May also be "Logs/access_log")
Edit the "httpd.conf" file and enter the name, path and level for the CustomLog.
Verify the Log Configuration Module is loaded: # httpd -M | grep -i log_config_module Output: log_config_module (shared) If the "log_config_module" is not enabled, this is a finding. Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the directive "LogFormat" in the "httpd.conf" file: # cat /<path_to_file>/httpd.conf | grep -i "LogFormat" If the "LogFormat" directive is missing, this is a finding: An example is: LogFormat "%a %A %h %H %l %m %s %t %u %U \"%{Referer}i\" " common
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Uncomment the "log_config_module" module line. Configure the "LogFormat" in the "httpd.conf" file to look like the following: LogFormat "%a %A %h %H %l %m %s %t %u %U \"%{Referer}i\" " common Restart Apache: apachectl restart Note: The log format could be using different variables based on the environment; however it should be verified to ensure it is producing the same end result of logged elements. The logging elements required breakdown as follows: %a remote IP address %A local IP address %h IP address of requesting client %H the request protocol %l user ID of the requesting client %m request method %s status %t time the request was received %u user ID of the remote user %U URL path requested
If Apache server is not behind a load balancer or proxy server, this check is Not Applicable. Interview the System Administrator to review the configuration of the Apache web server architecture and determine if inbound web traffic is passed through a proxy. If the Apache web server is receiving inbound web traffic through a proxy, the audit logs must be reviewed to determine if correct source information is being passed through by the proxy server. Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Review the location of the log files. When the log file is displayed, review the source IP information in the log entries and verify the entries do not reflect the IP address of the proxy server. If the log entries in the log file(s) reflect the IP address of the client in addition to the proxy address, this is not a finding. If the log entries in the log file(s) reflect the IP address of the proxy server as the source, this is a finding. If logs containing source/destination IPs can be obtained at the load balancer/proxy server, this is not a finding.
Access the proxy server through which inbound web traffic is passed and configure settings to pass web traffic to the Apache web server transparently. Refer to https://httpd.apache.org/docs/2.4/mod/mod_remoteip.html for additional information on logging options based on your proxy/load balancing setup.
Work with the SIEM administrator to determine if an alert is configured when audit data is no longer received as expected. If there is no alert configured, this is a finding.
Work with the SIEM administrator to configure an alert when no audit data is received from Apache based on the defined schedule of connections.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Work with the Administrator to locate the log files: Example: /etc/httpd/logs List the POSIX permission set and owner/group of the log files: # ls -laH /etc/httpd/logs/*log* Output Example: -rw-r------. 1 apache root 0 Sep 27 2020 /etc/httpd/logs/access_log -rw-r------. 1 apache root 1235 Sep 23 2020 /etc/httpd/logs/access_log-20200927 -rw-r------. 1 apache root 332 Sep 26 03:40 /etc/httpd/logs/error_log Only system administrators and service accounts running the server should have permissions to the files and the POSIX permissions should be set to 640 or more restrictive If any users other than those authorized have read access to the log files, this is a finding.
To protect the integrity of the data that is being captured in the log files, ensure that only the members of the Auditors group, Administrators, and the user assigned to run the web server software is granted permissions to read the log files.
Verify the log information from the web server must be protected from unauthorized modification. Review the web server documentation and deployed configuration settings to determine if the web server logging features protect log information from unauthorized modification. Review file system settings to verify the log files have secure file permissions. Run the following command: ls -l <'INSTALL PATH'>/logs If the web server log files present are owned by anyone other than an administrative service account this is a finding.
Determine the location of the "ErrorLog" directory in the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Open the "httpd.conf" file. Look for the "ErrorLog" directive. Ensure the permissions and ownership of all files in the Apache log directory are correct by executing the following commands as an administrative service account: # chown <'service account'> <'ErrorLog directive PATH'>/*
Interview the Information System Security Officer, System Administrator, Web Manager, Webmaster, or developers as necessary to determine whether a tested and verifiable backup strategy has been implemented for web server software and all web server data files. Proposed questions: - Who maintains the backup and recovery procedures? - Do you have a copy of the backup and recovery procedures? - Where is the off-site backup location? - Is the contingency plan documented? - When was the last time the contingency plan was tested? - Are the test dates and results documented? If there is not a backup and recovery process for the web server, this is a finding.
Document the web server backup procedures.
Enter the following command: "httpd -M" This will provide a list of the loaded modules. Validate that all displayed modules are required for operations. If any module is not required for operation, this is a finding. Note: The following modules are needed for basic web function and do not need to be reviewed: core_module http_module so_module mpm_prefork_module For a complete list of signed Apache Modules, review https://httpd.apache.org/docs/2.4/mod/.
Remove any unsigned modules.
Review the web server documentation and configuration to determine if the web server is being used as a user management application. Search for "AuthUserFile" in the configuration files in the installed Apache Path. Example: grep -rin AuthUserFile * If there are uncommented lines pointing to files on disk using the above configuration option, this is a finding.
Comment out the "AuthUserFile" lines found in the Apache configuration.
If the site requires the use of a particular piece of software, verify that the Information System Security Officer (ISSO) maintains documentation identifying this software as necessary for operations. The software must be operated at the vendor’s current patch level and must be a supported vendor release. If programs or utilities that meet the above criteria are installed on the web server and appropriate documentation and signatures are in evidence, this is not a finding. Determine whether the web server is configured with unnecessary software. Determine whether processes other than those that support the web server are loaded and/or run on the web server. Examples of software that should not be on the web server are all web development tools, office suites (unless the web server is a private web development server), compilers, and other utilities that are not part of the web server suite or the basic operating system. Check the directory structure of the server and verify that additional, unintended, or unneeded applications are not loaded on the system. If, after review of the application on the system, there is no justification for the identified software, this is a finding.
Remove any unnecessary applications per ISSO documentation.
In a command line, run "httpd -M | sort" to view a list of installed modules. If any of the following modules are present, this is a finding: proxy_module proxy_ajp_module proxy_balancer_module proxy_ftp_module proxy_http_module proxy_connect_module Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the directive "ProxyRequest" in the "httpd.conf" file. If the ProxyRequest directive is set to "On", this is a finding.
Determine where the proxy modules are located by running the following command: grep -rl "proxy_module" <'INSTALL PATH'> Edit the file and comment out the following modules: proxy_module proxy_ajp_module proxy_balancer_module proxy_ftp_module proxy_http_module proxy_connect_module Comment out the ProxyRequext directive in the httpd.conf file. Restart Apache: apachectl restart
Verify the document root directory and the configuration files do not provide for default index.html or welcome page. Verify the Apache User Manual content is not installed by checking the configuration files for manual location directives. Verify the Apache configuration files do not have the Server Status handler configured. Verify the Server Information handler is not configured. Verify that any other handler configurations such as perl-status are not enabled. If any of these are present, this is a finding.
Review all pre-installed content and remove content that is not required. In particular, look for the unnecessary content that may be found in the document root directory, a configuration directory such as conf/extra directory, or as a UNIX/Linux package. Remove the default index.html or welcome page if it is a separate package. If the default welcome page is part of the main Apache httpd package as it is on Red Hat Linux, then comment out the configuration as shown below. Removing a file such as "welcome.conf" is not recommended as it may be replaced if the package is updated. # # This configuration file enables the default "Welcome" # page if there is no default index page present for # the root URL. To disable the Welcome page, comment # out all the lines below. # ##<LocationMatch "^/+$"> ## Options -Indexes ## ErrorDocument 403 /error/noindex.html ##</LocationMatch> Remove the Apache User Manual content or comment out configurations referencing the manual. Example: # yum erase httpd-manual Remove or comment out any Server Status handler configuration: # # Allow server status reports generated by mod_status, # with the URL of http://servername/server-status # Change the ".example.com" to match your domain to enable. # ##<Location /server-status> ## SetHandler server-status ## Order deny,allow ## Deny from all ## Allow from .example.com ##</Location> Remove or comment out any Server Information handler configuration: # # Allow remote server configuration reports, with the URL of # http://servername/server-info (requires that mod_info.c be loaded). # Change the ".example.com" to match your domain to enable. # ##<Location /server-info> ## SetHandler server-info ## Order deny,allow ## Deny from all ## Allow from .example.com ##</Location> Remove or comment out any other handler configuration such as perl-status: # This will allow remote server configuration reports, with the URL of # http://servername/perl-status # Change the ".example.com" to match your domain to enable. # ##<Location /perl-status> ## SetHandler perl-script ## PerlResponseHandler Apache2::Status ## Order deny,allow ## Deny from all ## Allow from .example.com ##</Location> The default source build provides extra content available in the <'INSTALLED PATH'>/conf/extra/ directory, but the configuration of most of the extra content is commented out by default. In particular, the inclusion of conf/extra/proxyhtml.conf is not commented out in "httpd.conf": # Server-pool management (MPM specific) #Include conf/extra/httpd-mpm.conf # Multi-language error messages #Include conf/extra/httpd-multilang-errordoc.conf # Fancy directory listings #Include conf/extra/httpd-autoindex.conf # Language settings #Include conf/extra/httpd-languages.conf # User home directories #Include conf/extra/httpd-userdir.conf # Real-time info on requests and configuration #Include conf/extra/httpd-info.conf # Virtual hosts #Include conf/extra/httpd-vhosts.conf # Local access to the Apache HTTP Server Manual #Include conf/extra/httpd-manual.conf # Distributed authoring and versioning (WebDAV) #Include conf/extra/httpd-dav.conf # Various default settings #Include conf/extra/httpd-default.conf # Configure mod_proxy_html to understand HTML4/XHTML1 <IfModule proxy_html_module> Include conf/extra/proxy-html.conf </IfModule> # Secure (SSL/TLS) connections #Include conf/extra/httpd-ssl.conf For applications developed in-house, ensure that development artifacts (sample data and scripts; unused libraries, components, debug code; or tools) are not included in the deployed software or accessible in the production environment.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Review any "Action" or "AddHandler" directives: # cat /<path_to_file>/httpd.conf | grep -i "Action" # cat /<path_to_file>/httpd.conf | grep -i "AddHandler" If "Action" or "AddHandler" exist and they configure .exe, .dll, .com, .bat, or .csh, or any other shell as a viewer for documents, this is a finding. If this is not documented and approved by the Information System Security Officer (ISSO), this is a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Disable MIME types for .exe, .dll, .com, .bat, and .csh programs. If "Action" or "AddHandler" exist within the "httpd.conf" file and they configure .exe, .dll, .com, .bat, or .csh, remove those references. Restart Apache: apachectl restart Ensure this process is documented and approved by the ISSO.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Locate "cgi-bin" files and directories enabled in the Apache configuration via "Script", "ScriptAlias" or "ScriptAliasMatch", and "ScriptInterpreterSource" directives: # cat /<path_to_file>/httpd.conf | grep -i "Script" If any scripts are present that are not needed for application operation, this is a finding. If this is not documented and approved by the Information System Security Officer (ISSO), this is a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Review "Script", "ScriptAlias" or "ScriptAliasMatch", and "ScriptInterpreterSource" directives. Go into each directory and locate "cgi-bin" files. Remove any script that is not needed for application operation. Ensure this process is documented and approved by the ISSO.
In a command line, run "httpd -M | sort" to view a list of installed modules. If any of the following modules are present, this is a finding: dav_module dav_fs_module dav_lock_module
Determine where the "dav" modules are located by running the following command: grep -rl "dav_module" <'INSTALL PATH'> Edit the file and comment out the following modules: dav_module dav_fs_module dav_lock_module Restart Apache: apachectl restart
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the "Listen" directive: # cat /<path_to_file>/httpd.conf | grep -i "Listen" Verify that any enabled "Listen" directives specify both an IP address and port number. If the "Listen" directive is found with only an IP address or only a port number specified, this is finding. If the IP address is all zeros (i.e., 0.0.0.0:80 or [::ffff:0.0.0.0]:80), this is a finding. If the "Listen" directive does not exist, this is a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Set the "Listen" directive to listen on a specific IP address and port. Restart Apache: apachectl restart
Review the web server documentation and configuration to determine what web server accounts are available on the server. Any directories or files owned by anyone other than an administrative service account is a finding. If non-privileged web server accounts are available with access to functions, directories, or files not needed for the role of the account, this is a finding.
Limit the functions, directories, and files that are accessible by each account and role to administrative service accounts and remove or modify non-privileged account access.
Obtain a list of the user accounts for the system, noting the privileges for each account. Verify with the SA or the Information System Security Officer (ISSO) that all privileged accounts are mission essential and documented. Verify with the SA or the ISSO that all non-administrator access to shell scripts and operating system functions are mission essential and documented. If undocumented privileged accounts are present, this is a finding. If undocumented access to shell scripts or operating system functions is present, this is a finding.
Ensure non-administrators are not allowed access to the directory tree, the shell, or other operating system functions and utilities.
Review the web server documentation and deployed configuration to determine whether hosted application functionality is separated from web server management functions. If the functions are not separated, this is a finding.
Configure Apache to separate the hosted applications from web server management functionality.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the following directive: "SessionMaxAge" # cat /<path_to_file>/httpd.conf | grep -i "SessionMaxAge" Verify the value of "SessionMaxAge" is set to "600" or less. If the "SessionMaxAge" does not exist or is set to more than "600", this is a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Add the following line to the "httpd.conf" file: SessionMaxAge 600 Restart Apache: apachectl restart
Note: For web servers acting as a public facing with static content that do not require authentication, this is Not Applicable. Review the web server documentation and configuration to determine if cookies between the web server and client are accessible by applications or web servers other than the originating pair. grep SessionCookieName <'INSTALL LOCATION'>/mod_session.conf Confirm that the "HttpOnly" and "Secure" settings are present in the line returned. Confirm that the line does not contain the "Domain" cookie setting. Verify the "headers_module (shared)" module is loaded in the web server: "# httpd -M Verify " headers_module (shared)" is returned in the list of Loaded Modules from the above command." If the "headers_module (shared)" is not loaded, this is a finding.
Edit the "mod_session.conf" file and find the "SessionCookieName" directive. Set the "SessionCookieName" to "session path=/; HttpOnly; Secure; " Example: SessionCookieName session path=/; HttpOnly; Secure; Restart Apache: apachectl restart
Review the web server documentation and deployed configuration to determine the length of the generated session identifiers. First ensure that "session_crypto" is enabled: httpd -M |grep session_crypto If the above command returns "session_crypto_module", the module is enabled in the running server. Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Review the "httpd.conf" file. If the "SessionCryptoCipher" is not used or "SessionCryptoCipher" is not set to "aes256", this is a finding.
Configure the web server to generate session identifiers that are at least 128 bits in length. Ensure that "session_crypto_module" is enabled. Determine the location of the "httpd.conf" file by running the following command: httpd -V Review the "HTTPD_ROOT" path. Navigate to the "HTTPD_ROOT"/conf directory. Edit the "httpd.conf" file. SessionCryptoCipher aes256 Restart Apache: apachectl restart
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Verify the "unique_id_module" is loaded: run httpd -M | grep unique_id If no unique_id is returned, this is a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Load the "unique_id_module". Example: LoadModule unique_id_module modules/mod_unique_id.so Restart Apache: apachectl restart
Interview the System Administrator for the Apache 2.4 web server. Ask for documentation on the disaster recovery methods tested and planned for the Apache 2.4 web server in the event of the necessity for rollback. If documentation for a disaster recovery has not been established, this is a finding.
Prepare documentation for disaster recovery methods for the Apache 2.4 web server in the event of the necessity for rollback. Document and test the disaster recovery methods designed.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Verify that the "Timeout" directive is specified to have a value of "10" seconds or less. # cat /<path_to_file>/httpd.conf | grep -i "Timeout" If the "Timeout" directive is not configured or is set for more than "10" seconds, this is a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Add or modify the "Timeout" directive to have a value of "10" seconds or less: "Timeout 10"
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. # cat /<path_to_file>/httpd.conf | grep -i "ErrorDocument" If the "ErrorDocument" directive is not being used for custom error pages for "4xx" or "5xx" HTTP status codes, this is a finding. Note: Using a "sites-available" method for error messages is also acceptable; this would involve the use of /etc/apache2/sites-available and /etc/apache2/sites-enabled. As long as warning and error messages have been sanitized, this is not a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Use the "ErrorDocument" directive to enable custom error pages for 4xx or 5xx HTTP status codes. ErrorDocument 500 "Sorry, our script crashed. Oh dear" ErrorDocument 500 /cgi-bin/crash-recover ErrorDocument 500 http://error.example.com/server_error.html ErrorDocument 404 /errors/not_found.html ErrorDocument 401 /subscription/how_to_subscribe.html The syntax of the ErrorDocument directive is: ErrorDocument <3-digit-code> <action> Additional information: https://httpd.apache.org/docs/2.4/custom-error.html
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. For any enabled "TraceEnable" directives, verify they are part of the server-level configuration (i.e., not nested in a "Directory" or "Location" directive). Verify that the "TraceEnable" directive is set to "Off": # cat /<path_to_file>/httpd.conf | grep -i "TraceEnable" If the "TraceEnable" directive is not part of the server-level configuration and/or is not set to "Off", this is a finding. If the directive does not exist in the "conf" file, this is a finding because the default value is "On". If the "LogLevel" directive is not being used, this is a finding: # cat /<path_to_file>/httpd.conf | grep -i "LogLevel"
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Add or set the value of "TraceEnable" to "Off". Set the "LogLevel" directive to "info" or below.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Verify the "reqtimeout_module" is loaded: Change to the root directory of Apache and run the following command to verify the "reqtimeout_module" is loaded: # httpd -M | grep reqtimeout_module Outout: reqtimeout_module (shared) If the "reqtimeout_module" is not loaded, this is a finding. Verify the "RequestReadTimeout" directive is configured. Example: RequestReadTimeout handshake=5 header=10 body=30 Allows for 5 seconds to complete the TLS handshake, 10 seconds to receive the request headers, and 30 seconds for receiving the request body. The values will depend upon the website. The intent of this requirement is to ensure the RequestReadTimeout is explicitly configured. If the "reqtimeout_module" is loaded and the "RequestReadTimeout" directive is not configured, this is a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Load the "reqtimeout_module". Set the "RequestReadTimeout" directive to specific values applicable to the website.
If external controls such as host-based firewalls are used to restrict this access, this check is Not Applicable. Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the "RequireAll" directive: # cat /<path_to_file>/httpd.conf | grep -i "RequireAll" If "RequireAll" is not configured, or IP ranges configured to allow are not restrictive enough to prevent connections from nonsecure zones, this is a finding.
Configure the "http.conf" file to include restrictions. Example: <RequireAll> Require not ip 192.168.205 Require not host phishers.example.com </RequireAll>
Interview the SA and Web Manager. Ask for documentation for the Apache web server administration. Verify there are documented procedures for shutting down an Apache website in the event of an attack. The procedure must, at a minimum, provide the following steps: 1. Determine the respective website for the application at risk of an attack. 2. Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file|pidlog' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" -D DEFAULT_PIDLOG=”/run/httpd/httpd.pid” 3. Search for the PidFile runtime directive. (This example uses the combined results of HTTPD_ROOT and SERVER_CONFIG_FILE, above.) # grep -i pidfile /etc/httpd/conf/httpd.conf 4. If this command returns a result, use this value in the kill command, otherwise, use the DEFAULT_PIDLOG value, above. # kill -TERM `cat <FULLY-QUALIFIED_PIDFILE_FILENAME>` Note: These should be documented steps, validators should not run kill commands while reviewing production systems. If the web server is not capable of or cannot be configured to disconnect or disable remote access to the hosted applications when necessary, this is a finding.
Prepare documented procedures for shutting down an Apache website in the event of an attack. The procedure should, at a minimum, provide the following steps: Search for the PidFile runtime directive. (This example uses the combined results of HTTPD_ROOT and SERVER_CONFIG_FILE, above.) If this command returns a result, use this value in the kill command, otherwise, use the DEFAULT_PIDLOG value, above. In a command line, enter the following command: # grep -i pidfile /etc/httpd/conf/httpd.conf # kill -TERM 'cat <FULLY-QUALIFIED_PIDFILE_FILENAME>'
Determine which tool or control file is used to control the configuration of the web server. If the control of the web server is done via control files, verify who has update access to them. If tools are being used to configure the web server, determine who has access to execute the tools. If accounts other than the System Administrator (SA), the Web Manager, or the Web Manager designees have access to the web administration tool or control files, this is a finding.
Restrict access to the web administration tool to only the System Administrator, Web Manager, or the Web Manager designees.
Work with SIEM administrator to determine log storage capacity. If there is no setting within a SIEM to accommodate enough a large logging capacity, this is a finding.
Work with the SIEM administrator to determine if the SIEM is configured to allocate log record storage capacity large enough to accommodate the logging requirements of the Apache web server.
Work with SIEM administrator to determine audit configurations. If there is a setting within the SIEM that could impede the ability to write specific log record content, this is a finding.
Work with the SIEM administrator to allow the ability to write specified log record content to an audit log server.
Work with the SIEM administrator to determine current security integrations. If the SIEM is not integrated with security, this is a finding.
Work with the SIEM administrator to integrate with an organizations security infrastructure.
Review the web server documentation and configuration to determine the time stamp format for log data. Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the "log_config_module" directive: # cat /<path_to_file>/httpd.conf | grep -i "LogFormat" Verify the "LogFormat" directive exists. If the "LogFormat" directive does not exist, this is a finding. Verify the "LogFormat" line contains the "%t" flag. If "%t" flag is not present, time is not mapped to UTC or GMT time, this is a finding.
In a command line, run "httpd -M" to view a list of installed modules. If "log_config_module" is not listed, enable this module. Review the "httpd.conf" file. Determine if the "LogFormat" directive exists. If it does not exist, ensure the "LogFormat" line contains the %t flag.
Review the website to determine if HTTP and HTTPs are used in accordance with well known ports (e.g., 80 and 443) or those ports and services as registered and approved for use by the DoD PPSM. Any variation in PPS will be documented, registered, and approved by the PPSM. If not, this is a finding.
Ensure the website enforces the use of IANA well-known ports for HTTP and HTTPS.
Review the web server documentation and deployed configuration to determine where the process ID is stored and which utilities are used to start/stop the web server. Locate the httpd.pid file and list its permission set and owner/group # find / -name “httpd.pid Output should be similar to: /run/httpd/httpd.pid # ls -laH /run/httpd/httpd.pid Output should be similar -rw-r--r--. 1 root root 5 Jun 13 03:18 /run/httpd/httpd.pid If the file owner/group is not an administrative service account, this is a finding. If permission set is not 644 or more restrictive, this is a finding. Verify the Apache service utilities (binaries) have the correct permission set and are user/group owned by an administrator account # ls -laH /usr/sbin/service Output should be similar: -rwxr-xr-x. 1 root root 3.2K Aug 19, 2019 /usr/sbin/service # ls -laH /usr/sbin/apachectl Output should be similar: -rwxr-xr-x. 1 root root 4.2K Oct 8, 2019 /usr/sbin/apachectl If the service utilities owner/group is not an administrative service account, this is a finding. If permission set is not 755 or more restrictive, this is a finding.
Review the web server documentation and deployed configuration to determine where the process ID is stored and which utilities are used to start/stop the web server. Determine where the "httpd.pid" file is located by running the following command: find / -name "httpd.pid" Run the following commands: # cd <'httpd.pid location'>/ # chown <'service account'> httpd.pid # chmod 644 httpd.pid # cd /usr/sbin # chown <'service account'> service apachectl # chmod 755 service apachectl
Verify the session cookie module is loaded # httpd -M | grep -i session_cookie_module Output should look similar to: session_cookie_module (shared) Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" Note: The apachectl front end is the preferred method for locating the Apache httpd file. For some Linux distributions, "apache2ctl -V" or "httpd -V" can also be used. Search for the directive "Session" in the "httpd.conf" file: # cat httpd.conf | grep -i "Session" Output should be similar to: Session on SessionCookieName httpOnly Secure SessionCryptoCipher aes256 SessionMaxAge 600 Note: SSL directives can also be located in /etc/httpd/conf.d/ssl.conf. If the "Session" and "SessionCookieName" directives are not present, this is a finding. If "Session" is not set to "on" and "SessionCookieName" does not contain "httpOnly" and "secure", this is a finding.
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" file: # apachectl -V | egrep -i 'httpd_root|server_config_file' -D HTTPD_ROOT="/etc/httpd" -D SERVER_CONFIG_FILE="conf/httpd.conf" NOTE: SSL directives may also be located in /etc/httpd/conf.d/ssl.conf. Set "Session" to "on". Ensure the "SessionCookieName" directive includes "httpOnly" and "secure".
Determine the location of the "HTTPD_ROOT" directory and the "httpd.conf" and "ssl.conf" files: Search the httpd.conf and ssl.conf file for the following uncommented directive: SSLCipherSuite # cat httpd.conf | grep -i SSLCipherSuite Output: None # cat /etc/httpd/conf.d/ssl.conf | grep -i SSLCipherSuite Output: SSLCipherSuite HIGH:3DES:!NULL:!MD5:!SEED:!IDEA:!EXPORT For all enabled SSLCipherSuite directives, ensure the cipher specification string contains the kill cipher from list option for all export cipher suites, i.e., !EXPORT, which may be abbreviated !EXP as in the following example: Example: SSLCipherSuite="HIGH:MEDIUM:!MD5!EXP:!NULL:!LOW:!ADH If the SSLCipherSuite directive does not contain !EXPORT or !EXP or there are no enabled SSLCipherSuite directives, this is a finding.
Update the cipher specification string for all enabled SSLCipherSuite directives to include !EXPORT.
Determine the most recent patch level of the Apache Web Server 2.4 software, as posted on the Apache HTTP Server Project website. If the Apache installation is a proprietary installation supporting an application and is supported by a vendor, determine the most recent patch level of the vendor’s installation. In a command line, type "httpd -v". If the version is more than one version behind the most recent patch level, this is a finding.
Install the current version of the web server software and maintain appropriate service packs and patches.
Identify the account that is running the "httpd" process: # ps -ef | grep -i httpd | grep -v grep apache 29613 996 0 Feb17 ? 00:00:00 /usr/sbin/httpd apache 29614 996 0 Feb17 ? 00:00:00 /usr/sbin/httpd Check to see if the account has a valid login shell: # cut -d: -f1,7 /etc/passwd | grep -i <service_account> apache:/sbin/nologin If the service account has a valid login shell, verify that no password is configured for the account: # cut -d: -f1,2 /etc/shadow | grep -i <service_account> apache:!! If the account has a valid login shell and a password defined, this is a finding.
Update the /etc/passwd file to assign the account used to run the "httpd" process an invalid login shell such as "/sbin/nologin". Lock the account used to run the "httpd" process: # passwd -l <account> Locking password for user <account> passwd: Success
Review the website to determine if "HTTP" and "HTTPS" are used in accordance with well-known ports (e.g., 80 and 443) or those ports and services as registered and approved for use by the DoD Ports, Protocols, and Services Management (PPSM). Verify that any variation in PPS is documented, registered, and approved by the PPSM. If well-known ports and services are not approved for used by PPSM, this is a finding.
Ensure the website enforces the use of IANA well-known ports for "HTTP" and "HTTPS".
Determine the version of the Apache software that is running on the system by entering the following command: httpd -v If the version of Apache is not at the following version or higher, this is a finding: Apache 2.4 (February 2012) NOTE: In some situations, the Apache software that is being used is supported by another vendor, such as Oracle in the case of the Oracle Application Server or IBM's HTTP Server. The versions of the software in these cases may not match the version number noted above. If the site can provide vendor documentation showing the version of the web server is supported, this would not be a finding.
Install the current version of the web server software and maintain appropriate service packs and patches.
Locate the htpasswd file by entering the following command: find / -name htpasswd Navigate to that directory. Run: ls -l htpasswd Permissions should be: r-x r - x - - - (550) If permissions on "htpasswd" are greater than "550", this is a finding. Verify the owner is the SA or Web Manager account. If another account has access to this file, this is a finding.
Ensure the SA or Web Manager account owns the "htpasswd" file. Ensure permissions are set to "550".