diff --git a/sca/applications/cis_apache_24.yml b/sca/applications/cis_apache_24.yml index 23382ca47..521f8f785 100644 --- a/sca/applications/cis_apache_24.yml +++ b/sca/applications/cis_apache_24.yml @@ -49,7 +49,7 @@ variables: #2.3 Disable WebDAV Modules checks: - - id: 9000 + - id: 10000 title: "Ensure the WebDAV Modules Are Disabled" description: "The Apache mod_dav and mod_dav_fs modules support WebDAV (Web-based Distributed Authoring and Versioning) functionality for Apache. WebDAV is an extension to the HTTP protocol which allows clients to create, move, and delete files and resources on the web server." rationale: "Disabling WebDAV modules will improve the security posture of the web server by reducing the amount of potentially vulnerable code paths exposed to the network and reducing potential for unauthorized access to files via misconfigured WebDAV access controls." @@ -64,7 +64,7 @@ checks: - 'c:$enabled-modules -> r:dav_\.+module' #2.4 Disable Status Module - - id: 9001 + - id: 10001 title: "Ensure the Status Module Is Disabled" description: "The Apache mod_status module provides current server performance statistics." rationale: "When mod_status is loaded into the server, its handler capability is available in all configuration files, including per-directory files (e.g., .htaccess). The mod_status module may provide an adversary with information that can be used to refine exploits that depend on measuring server load." @@ -79,7 +79,7 @@ checks: - 'c:$enabled-modules -> r:status_module' #2.5 Disable Autoindex Module - - id: 9002 + - id: 10002 title: "Ensure the Autoindex Module Is Disabled" description: "The Apache mod_autoindex module automatically generates a web page listing the contents of directories on the server, typically used so an index.html does not have to be generated." rationale: "Automated directory listings should not be enabled because they will reveal information helpful to an attacker such as naming conventions and directory paths. They may also reveal files that were not intended to be revealed." @@ -94,7 +94,7 @@ checks: - 'c:$enabled-modules -> r:autoindex_module' #2.6 Disable Proxy Modules - - id: 9003 + - id: 10003 title: "Ensure the Proxy Modules Are Disabled" description: "The Apache proxy modules allow the server to act as a proxy (either forward or reverse proxy) of HTTP and other protocols with additional proxy modules loaded. If the Apache installation is not intended to proxy requests to or from another network then the proxy module should not be loaded." rationale: "Proxy servers can act as an important security control when properly configured, however a secure proxy server is not within the scope of this benchmark. A web server should be primarily a web server or a proxy server but not both, for the same reasons that other multi-use servers are not recommended. Scanning for web servers that will also proxy requests is a very common attack, as proxy servers are useful for anonymizing attacks on other servers, or possibly proxying requests into an otherwise protected network." @@ -109,7 +109,7 @@ checks: - 'c:$enabled-modules -> r:proxy_' #2.7 Disable User Directories Modules - - id: 9004 + - id: 10004 title: "Ensure the User Directories Module Is Disabled" description: "The UserDir directive must be disabled so that user home directories are not accessed via the web site with a tilde (~) preceding the username. The directive also sets the path name of the directory that will be accessed." rationale: "The user directories should not be globally enabled since that allows anonymous access to anything users may want to share with other users on the network. Also consider that every time a new account is created on the system, there is potentially new content available via the web site." @@ -124,7 +124,7 @@ checks: - 'c:$enabled-modules -> userdir_' #2.8 Disable Info Module - - id: 9005 + - id: 10005 title: "Ensure the Info Module Is Disabled" description: "The Apache mod_info module provides information on the server configuration via access to a /server-info URL location." rationale: "While having server configuration information available as a web page may be convenient it is recommended that this module NOT be enabled. Once mod_info is loaded into the server, its handler capability is available in per-directory .htaccess files and can leak sensitive information from the configuration directives of other Apache modules such as system paths, usernames/passwords, database names, etc." @@ -139,7 +139,7 @@ checks: - 'c:$enabled-modules -> r:info_module' #3.2 Give the Apache User Account an Invalid Shell - - id: 9006 + - id: 10006 title: "Ensure the Apache User Account Has an Invalid Shell" description: "The apache account must not be used as a regular login account, so it should be assigned an invalid or nologin shell to ensure it cannot be used to login." rationale: "Service accounts such as the apache account are a risk if they can be used to get a login shell to the system." @@ -152,7 +152,7 @@ checks: - 'f:/etc/passwd -> r:apache && r:/sbin/nologin$|/dev/null$' #3.3 Lock the Apache User Account - - id: 9007 + - id: 10007 title: "Ensure the Apache User Account Is Locked" description: "The user account under which Apache runs should not have a valid password, but should be locked." rationale: "As a defense-in-depth measure the Apache user account should be locked to prevent logins, and to prevent a user from suing to apache using the password. In general, there should not be a need for anyone to have to su as apache, and when there is a need, then sudo should be used instead, which would not require the apache account password." @@ -166,7 +166,7 @@ checks: - 'c:passwd -S apache -> r:apache && r:Password locked' #4.4 Restrict Override for All Directories - - id: 9008 + - id: 10008 title: "Ensure OverRide Is Disabled for All Directories" description: "The Apache AllowOverride directive and the new AllowOverrideList directive allow for .htaccess files to be used to override much of the configuration, including authentication, handling of document types, auto generated indexes, access control, and options. When the server finds an .htaccess file (as specified by AccessFileName) it needs to know which directives declared in that file can override earlier access information. When this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem. When this directive is set to All, then any directive which has the .htaccess context is allowed in .htaccess files." rationale: ".htaccess files decentralizes access control and increases the risk of server configuration being changed inappropriately." @@ -185,7 +185,7 @@ checks: - 'f:$main-conf -> r:allowoverridelist|AllowOverrideList' #5.3 Minimize Options for Other Directories - - id: 9009 + - id: 10009 title: "Ensure Options for Other Directories Are Minimized" description: "The Apache Options directive allows for specific configuration of options, including execution of CGI, following symbolic links, server side includes, and content negotiation." rationale: "Likewise, the options for other directories and hosts needs to be restricted to the minimal options required. A setting of None is recommended, however it is recognized that other options may be needed in some cases: Multiviews, FollowSymbolicLinks & SymLinksIfOwnerMatch, ExecCGI, Includes & IncludesNOEXEC, & Indexes." @@ -202,7 +202,7 @@ checks: - 'f:$main-conf -> !r:^# && r:options && r:includes|Includes' #5.4.2 Remove the Apache user manual - - id: 9010 + - id: 10010 title: "Ensure Default HTML Content Is Removed" description: "Apache installations have default content that is not needed or appropriate for production use. The primary function for the sample content is to provide a default web site, provide user manuals, or demonstrate special features of the web server. All content that is not needed should be removed." rationale: "Historically, sample content and features have been remotely exploited and can provide different levels of access to the server. Usually these routines are not written for production use and consequently little thought was given to security in their development." @@ -221,7 +221,7 @@ checks: - 'f:$main-conf -> !r:^# && r:sethandler|SetHandler && r:perl' #5.5 Remove default CGI content printenv - - id: 9011 + - id: 10011 title: "Ensure the Default CGI Content printenv Script Is Removed" description: "Most Web Servers, including Apache installations have default CGI content which is not needed or appropriate for production use. The primary function for these sample programs is to demonstrate the capabilities of the web server. One common default CGI content for Apache installations is the script printenv. This script will print back to the requester all of the CGI environment variables which includes many server configuration details and system paths." rationale: "CGI programs have a long history of security bugs and problems associated with improperly accepting user-input. Since these programs are often targets of attackers, we need to make sure that there are no unnecessary CGI programs that could potentially be used for malicious purposes. Usually these programs are not written for production use and consequently little thought was given to security in their development. The printenv script in particular will disclose inappropriate information about the web server including directory paths and detailed version and configuration information." @@ -235,7 +235,7 @@ checks: - 'd:/usr/lib/cgi-bin -> printenv' #5.6 Remove default CGI content test-cgi - - id: 9012 + - id: 10012 title: "Ensure the Default CGI Content test-cgi Script Is Removed" description: "Most Web Servers, including Apache installations have default CGI content which is not needed or appropriate for production use. The primary function for these sample programs is to demonstrate the capabilities of the web server. A common default CGI content for Apache installations is the script test-cgi. This script will print back to the requester CGI environment variables which includes many server configuration details." rationale: "CGI programs have a long history of security bugs and problems associated with improperly accepting user-input. Since these programs are often targets of attackers, we need to make sure that there are no unnecessary CGI programs that could potentially be used for malicious purposes. Usually these programs are not written for production use and consequently little thought was given to security in their development. The test-cgi script in particular will disclose inappropriate information about the web server including directory paths and detailed version and configuration information." @@ -249,7 +249,7 @@ checks: - 'd:/usr/lib/cgi-bin -> test-cgi' #5.8 Disable HTTP Trace Method - - id: 9013 + - id: 10013 title: "Ensure the HTTP TRACE Method Is Disabled" description: "Use the Apache TraceEnable directive to disable the HTTP TRACE request method." rationale: "The HTTP 1.1 protocol requires support for the TRACE request method which reflects the request back as a response and was intended for diagnostics purposes. The TRACE method is not needed and is easily subjected to abuse and should be disabled." @@ -265,7 +265,7 @@ checks: - 'f:$traceen -> !r:^# && r:TraceEnable && r:off' #5.13 Restrict Listen Directive - - id: 9014 + - id: 10014 title: "Ensure the IP Addresses for Listening for Requests Are Specified" description: "The Apache Listen directive specifies the IP addresses and port numbers the Apache web server will listen for requests. Rather than be unrestricted to listen on all IP addresses available to the system, the specific IP address or addresses intended should be explicitly specified. Specifically, a Listen directive with no IP address specified, or with an IP address of zeros should not be used." rationale: "Having multiple interfaces on web servers is fairly common, and without explicit Listen directives, the web server is likely to be listening on an inappropriate IP address / interface that was not intended for the web server. Single homed system with a single IP addressed are also required to have an explicit IP address in the Listen directive, in case additional interfaces are added to the system at a later date." @@ -283,7 +283,7 @@ checks: - 'f:$main-conf -> !r:^# && r:listen|Listen && r:0.0.0.0' #5.14 Restrict Browser Frame Options - - id: 9015 + - id: 10015 title: "Ensure Browser Framing Is Restricted" description: "The Header directive allows server HTTP response headers to be added, replaced or merged. We will use the directive to add a server HTTP response header to tell browsers to restrict all of the web pages from being framed by other web sites." rationale: "Using iframes and regular web frames to embed malicious content along with expected web content has been a favored attack vector for attacking web clients for a long time. This can happen when the attacker lures the victim to a malicious web site, which using frames to include the expected content from the legitimate site. The attack can also be performed via XSS (either reflected, DOM or stored XSS) to add the malicious content to the legitimate web site. To combat this vector, an HTTP Response header, X-Frame-Options, has been introduced that allows a server to specify whether a web page may be loaded in any frame (DENY) or those frames that share the pages origin (SAMEORIGIN)." @@ -300,7 +300,7 @@ checks: - 'f:$main-conf -> r:Header && r:always && r:append && r:X-Frame-Options && r:SAMEORIGIN|DENY' #7.6 Disable SSL Insecure Renegotiation - - id: 9016 + - id: 10016 title: "Ensure Insecure SSL Renegotiation Is Not Enabled" description: "A man-in-the-middle renegotiation attack was discovered in SSLv3 and TLSv1 in November, 2009 (CVE-2009-3555). First, a work around and then a fix was approved as an Internet Standard as RFC 574, Feb 2010. The work around, which removes the renegotiation, is available from OpenSSL as of version 0.9.8l and newer versions. For details: https://www.openssl.org/news/secadv_20091111.txt The SSLInsecureRenegotiation directive was added in Apache 2.2.15, for web servers linked with OpenSSL version 0.9.8m or later, to provide backward compatibility to clients with the older, unpatched SSL implementations." rationale: "Enabling the SSLInsecureRenegotiation directive leaves the server vulnerable to man-in- the-middle renegotiation attack. Therefore, the SSLInsecureRenegotiation directive should not be enabled." @@ -317,7 +317,7 @@ checks: - 'f:$ssl-confs -> !r:^# && r:sslinsecurerenegotiation|SSLInsecureRenegotiation && r:\s+on$' #7.7 Ensure SSL Compression is not enabled - - id: 9017 + - id: 10017 title: "Ensure SSL Compression is Not Enabled" description: "The SSLCompression directive controls whether SSL compression is used by Apache when serving content over HTTPS. It is recommended that the SSLCompression directive be set to off." rationale: "If SSL compression is enabled, HTTPS communication between the client and the server may be at increased risk to the CRIME attack. The CRIME attack increases a malicious actor's ability to derive the value of a session cookie, which commonly contains an authenticator. If the authenticator in a session cookie is derived, it can be used to impersonate the account associated with the authenticator." @@ -334,7 +334,7 @@ checks: - 'f:$ssl-confs -> !r:^# && r:sslcompression|SSLCompression && r:\s+on$' #8.1 Set ServerToken to Prod or ProductOnly - - id: 9018 + - id: 10018 title: "Ensure ServerTokens is Set to 'Prod' or 'ProductOnly'" description: "Configure the Apache ServerTokens directive to provide minimal information. By setting the value to Prod or ProductOnly. The only version information given in the server HTTP response header will be Apache rather than details on modules and versions installed." rationale: "Information is power and identifying web server details greatly increases the efficiency of any attack, as security vulnerabilities are extremely dependent upon specific software versions and configurations. Excessive probing and requests may cause too much 'noise' being generated and may tip off an administrator. If an attacker can accurately target their exploits, the chances of successful compromise prior to detection increase dramatically. Script Kiddies are constantly scanning the Internet and documenting the version information openly provided by web servers. The purpose of this scanning is to accumulate a database of software installed on those hosts, which can then be used when new vulnerabilities are released." @@ -349,7 +349,7 @@ checks: - 'd:$conf-dirs -> conf -> !r:^# && r:servertokens|ServerTokens && r:\s+Prod|\s+ProductOnly' #8.2: Set ServerSignature to Off - - id: 9019 + - id: 10019 title: "Ensure ServerSignature Is Not Enabled" description: "Disable the server signatures which generates a signature line as a trailing footer at the bottom of server generated documents such as error pages." rationale: "Server signatures are helpful when the server is acting as a proxy, since it helps the user distinguish errors from the proxy rather than the destination server, however in this context there is no need for the additional information." @@ -364,7 +364,7 @@ checks: - 'd:$conf-dirs -> conf -> !r:^# && r:serversignature|ServerSignature && r:\s+on|\s+On' #9.1:Set TimeOut to 10 or less - - id: 9020 + - id: 10020 title: "Ensure the TimeOut Is Set to 10 or Less" description: "Denial of Service (DoS) is an attack technique with the intent of preventing a web site from serving normal user activity. DoS attacks, which are normally applied to the network layer, are also possible at the application layer. These malicious attacks can succeed by starving a system of critical resources, vulnerability exploit, or abuse of functionality. Although there is no 100% solution for preventing DoS attacks, the following recommendation uses the Timeout directive to mitigate some of the risk, by requiring more effort for a successful DoS attack. Of course, DoS attacks can happen in rather unintentional ways as well as intentional and these directives will help in many of those situations as well." rationale: "One common technique for DoS is to initiate many connections to the server. By decreasing the timeout for old connections and we allow the server to free up resources more quickly and be more responsive. By making the server more efficient, it will be more resilient to DoS conditions. The Timeout directive affects several timeout values for Apache, so review the Apache document carefully." @@ -379,7 +379,7 @@ checks: - 'f:$main-conf -> !r:^# && && r:timeout|Timeout && n:\s+(\d+) compare <= 10' #9.2:Set the KeepAlive directive to On - - id: 9021 + - id: 10021 title: "Ensure KeepAlive Is Enabled" description: "The KeepAlive directive controls whether Apache will reuse the same TCP connection per client to process subsequent HTTP requests from that client. It is recommended that the KeepAlive directive be set to On." rationale: "Allowing per-client reuse of TCP sockets reduces the amount of system and network resources required to serve requests. This efficiency gain may improve a server resiliency to DoS attacks." @@ -394,7 +394,7 @@ checks: - 'f:$main-conf -> !r:^# && r:keepalive|KeepAlive && r:\s+off|\s+Off' #9.3:Set MaxKeepAliveRequests to 100 or greater - - id: 9022 + - id: 10022 title: "Ensure MaxKeepAliveRequests is Set to a Value of 100 or Greater" description: "The MaxKeepAliveRequests directive limits the number of requests allowed per connection when KeepAlive is on. If it is set to 0, unlimited requests will be allowed." rationale: "The MaxKeepAliveRequests directive is important to be used to mitigate the risk of Denial of Service (DoS) attack technique by reducing the overhead imposed on the server. The KeepAlive directive must be enabled before it is effective. Enabling KeepAlives allows for multiple HTTP requests to be sent while keeping the same TCP connection alive. This reduces the overhead of having to setup and tear down TCP connections for each request. By making the server more efficient, it will be more resilient to DoS conditions." @@ -409,7 +409,7 @@ checks: - 'f:$main-conf -> !r:^# && r:maxkeepaliverequests|MaxKeepAliveRequests && n:\s+(\d+) compare < 100' #9.4: Set KeepAliveTimeout Low to Mitigate Denial of Service - - id: 9023 + - id: 10023 title: "Ensure KeepAliveTimeout is Set to a Value of 15 or Less" description: "The KeepAliveTimeout directive specifies the number of seconds Apache will wait for a subsequent request before closing a connection that is being kept alive." rationale: "The KeepAliveTimeout directive is used mitigate some of the risk, by requiring more effort for a successful DoS attack. By enabling KeepAlive and keeping the timeout relatively low for old connections and we allow the server to free up resources more quickly and be more responsive." @@ -424,7 +424,7 @@ checks: - 'f:$main-conf -> !r:^# && r:keepalivetimeout|KeepAliveTimeout && n:\s+(\d+) compare <= 15' #9.5 Set Timeout Limits for Request Headers - - id: 9024 + - id: 10024 title: "Ensure the Timeout Limits for Request Headers is Set to 40 or Less" description: "The RequestReadTimeout directive allows configuration of timeout limits for client requests. The header portion of the directive provides for an initial timeout value, a maximum timeout and a minimum rate. The minimum rate specifies that after the initial timeout, the server will wait an additional 1 second for each N bytes received. The recommended setting is to have a maximum timeout of 40 seconds or less. Keep in mind that for SSL/TLS virtual hosts the time for the TLS handshake must fit within the timeout." rationale: "Setting a request header timeout is vital for mitigating Denial of Service attacks based on slow requests. The slow request attacks are particularly lethal and relative easy to perform, because they require very little bandwidth and can easily be done through anonymous proxies. Starting in June 2009 with the Slow Loris DoS attack, which used a slow GET request as published by Robert Hansen (RSnake) on his blog http://ha.ckers.org/slowloris/. Later in November 2010 at the OWASP App Sec DC conference Wong Onn Chee demonstrated a slow POST request attack which was even more effective." @@ -442,7 +442,7 @@ checks: - 'f:$request-confs -> !r:^# && r:requestreadtimeout|RequestReadTimeout && n:header=\d+\p(\d+) compare <= 40' #9.6 Set Timeout Limits for Request Body - - id: 9025 + - id: 10025 title: "Ensure Timeout Limits for the Request Body is Set to 20 or Less" description: "The RequestReadTimeout directive also allows setting timeout values for the body portion of a request. The directive provides for an initial timeout value, and a maximum timeout and minimum rate. The minimum rate specifies that after the initial timeout, the server will wait an additional 1 second for each N bytes are received. The recommended setting is to have a maximum timeout of 20 seconds or less. The default value is body=20,MinRate=500." rationale: "It is not sufficient to timeout only on the header portion of the request, as the server will still be vulnerable to attacks like the OWASP Slow POST attack, which provide the body of the request very slowly. Therefore, the body portion of the request must have a timeout as well. A timeout of 20 seconds or less is recommended." @@ -458,7 +458,7 @@ checks: - 'f:$request-confs -> !r:^# && r:requestreadtimeout|RequestReadTimeout && n:body=(\d+) compare <= 20' #10.1 Set the LimitRequestLine directive to 512 or less - - id: 9026 + - id: 10026 title: "Ensure the LimitRequestLine directive is Set to 512 or less" description: "Buffer Overflow attacks attempt to exploit an application by providing more data than the application buffer can contain. If the application allows copying data to the buffer to overflow the boundaries of the buffer, then the application is vulnerable to a buffer overflow. The results of Buffer overflow vulnerabilities vary, and may result in the application crashing, or may allow the attacker to execute instructions provided in the data. The Apache LimitRequest* directives allow the Apache web server to limit the sizes of requests and request fields and can be used to help protect programs and applications processing those requests. Specifically, the LimitRequestLine directive limits the allowed size of a client's HTTP request-line, which consists of the HTTP method, URI, and protocol version." rationale: "The limiting of the size of the request line is helpful so that the web server can prevent an unexpectedly long or large request from being passed to a potentially vulnerable CGI program, module or application that would have attempted to process the request. Of course, the underlying dependency is that we need to set the limits high enough to not interfere with any one application on the server, while setting them low enough to be of value in protecting the applications. Since the configuration directive is available only at the server configuration level, it is not possible to tune the value for different portions of the same web server. Please read the Apache documentation carefully, as these requests may interfere with the expected functionality of some web applications." @@ -473,7 +473,7 @@ checks: - 'f:$main-conf -> !r:^# && r:limitrequestline|LimitRequestLine && n:\s(\d+) compare <= 512' #10.2 Set the LimitRequestFields directive to 100 or less - - id: 9027 + - id: 10027 title: "Ensure the LimitRequestFields Directive is Set to 100 or Less" description: "The LimitRequestFields directive limits the number of fields allowed in an HTTP request." rationale: "The limiting of the number of fields is helpful so that the web server can prevent an unexpectedly high number of fields from being passed to a potentially vulnerable CGI program, module or application that would have attempted to process the request. Of course, the underlying dependency is that we need to set the limits high enough to not interfere with any one application on the server, while setting them low enough to be of value in protecting the applications. Since the configuration directives are available only at the server configuration level, it is not possible to tune the value for different portions of the same web server. Please read the Apache documentation carefully, as these requests may interfere with the expected functionality of some web applications." @@ -488,7 +488,7 @@ checks: - 'f:$main-conf -> !r:^# && r:limitrequestfields|LimitRequestFields && n:\s(\d+) compare <= 100' #10.3 Set the LimitRequestFieldsize directive to 1024 or less - - id: 9028 + - id: 10028 title: "Ensure the LimitRequestFieldsize Directive is Set to 1024 or Less" description: "The LimitRequestFieldSize limits the number of bytes that will be allowed in an HTTP request header. It is recommended that the LimitRequestFieldSize directive be set to 1024 or less." rationale: "By limiting of the size of request headers is helpful so that the web server can prevent an unexpectedly long or large value from being passed to exploit a potentially vulnerable program. Of course, the underlying dependency is that we need to set the limits high enough to not interfere with any one application on the server, while setting them low enough to be of value in protecting the applications. Since the configuration directives are available only at the server configuration level, it is not possible to tune the value for different portions of the same web server. Please read the Apache documentation carefully, as these requests may interfere with the expected functionality of some web applications." @@ -503,7 +503,7 @@ checks: - 'f:$main-conf -> !r:^# && r:limitrequestfieldsize|LimitRequestFieldSize && n:\s(\d+) compare <= 1024' #10.4 Set the LimitRequestBody directive to 102400 or less - - id: 9029 + - id: 10029 title: "Ensure the LimitRequestBody Directive is Set to 102400 or Less" description: "The LimitRequestBody directive limits the number of bytes that are allowed in a request body. Size of requests may vary greatly; for example, during a file upload the size of the file must fit within this limit." rationale: "The limiting of the size of the request body is helpful so that the web server can prevent an unexpectedly long or large request from being passed to a potentially vulnerable program. Of course, the underlying dependency is that we need to set the limits high enough to not interfere with any one application on the server, while setting them low enough to be of value in protecting the applications. The LimitRequestBody may be configured on a per directory, or per location context. Please read the Apache documentation carefully, as these requests may interfere with the expected functionality of some web applications." diff --git a/sca/applications/cis_mysql5-6_community.yml b/sca/applications/cis_mysql5-6_community.yml index 02a4c106c..e8b1bfd99 100644 --- a/sca/applications/cis_mysql5-6_community.yml +++ b/sca/applications/cis_mysql5-6_community.yml @@ -13,7 +13,7 @@ policy: id: "cis_mysql_community" file: "cis_mysql5-6_community.yml" - name: "CIS benchmark for Oracle MySQL Community Server 5.6" + name: "CIS Benchmark for Oracle MySQL Community Server 5.6" description: "This document, CIS Oracle MySQL Community Server 5.6 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for MySQL Community Server 5.6. This guide was tested against MySQL Community Server 5.6 running on Ubuntu Linux 14.04, but applies to other linux distributions as well." references: - https://www.cisecurity.org/cis-benchmarks/ @@ -21,13 +21,14 @@ policy: requirements: title: "Check that MySQL is installed on the system" description: "Requirements for running the SCA scan against the MySQL policy." - condition: all + condition: any rules: - 'd:/etc/mysql' + - 'd:/var/lib/mysql' checks: #1 Operating System Level Configuration - - id: 9500 + - id: 10500 title: "Disable MySQL Command History" description: "On Linux/UNIX, the MySQL client logs statements executed interactively to a history file. By default, this file is named .mysql_history in the user's home directory. Most interactive commands run in the MySQL client application are saved to a history file. The MySQL command history should be disabled." rationale: "Disabling the MySQL command history reduces the probability of exposing sensitive information, such as passwords and encryption keys." @@ -42,7 +43,7 @@ checks: - 'd:/home -> ^.mysql_history$' - 'd:/root -> ^.mysql_history$' - - id: 9501 + - id: 10501 title: "Disable Interactive Login" description: "When created, the MySQL user may have interactive access to the operating system, which means that the MySQL user could login to the host as any other user would." rationale: "Preventing the MySQL user from logging in interactively may reduce the impact of a compromised MySQL account. There is also more accountability as accessing the operating system where the MySQL server lies will require the user's own account. Interactive access by the MySQL user is unnecessary and should be disabled." @@ -53,7 +54,7 @@ checks: rules: - 'c:getent passwd mysql -> r:/bin/false|/sbin/nologin' - - id: 9502 + - id: 10502 title: "Verify That 'MYSQL_PWD' Is Not Set In Users' Profiles" description: "MySQL can read a default database password from an environment variable called MYSQL_PWD." rationale: "The use of the MYSQL_PWD environment variable implies the clear text storage of MySQL credentials. Avoiding this may increase assurance that the confidentiality of MySQL credentials is preserved." @@ -67,7 +68,7 @@ checks: - 'c:find /home -maxdepth 2 -type f -exec grep MYSQL_PWD {} + -> r:.profile|.bashrc|.bash_profile && r:$MYSQL_PWD' #4 General - - id: 9503 + - id: 10503 title: "Ensure 'allow-suspicious-udfs' Is Set to 'FALSE'" description: "This option prevents attaching arbitrary shared library functions as user-defined functions by checking for at least one corresponding method named _init, _deinit, _reset, _clear, or _add." rationale: "Preventing shared libraries that do not contain user-defined functions from loading will reduce the attack surface of the server." @@ -81,7 +82,7 @@ checks: rules: - 'c:my_print_defaults mysqld -> r:allow-suspicious-udfs' - - id: 9504 + - id: 10504 title: "Ensure 'local_infile' is Disabled" description: "The 'local_infile' parameter dictates whether files located on the MySQL client's computer can be loaded or selected via 'LOAD DATA INFILE' or 'SELECT local_file'." rationale: "Disabling 'local_infile' reduces an attacker's ability to read sensitive files off the affected server via a SQL injection vulnerability." @@ -95,7 +96,7 @@ checks: rules: - 'c:grep -Rh local-infile /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:local-infile\s*=\s*0' - - id: 9505 + - id: 10505 title: "Ensure 'mysqld' Is Not Started with '--skip-grant-tables'" description: "This option causes mysqld to start without using the privilege system." rationale: "If this option is used, all clients of the affected server will have unrestricted access to all databases." @@ -108,11 +109,11 @@ checks: rules: - 'c:grep -Rh skip-grant-tables /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:skip-grant-tables\s*=\s*FALSE|skip-grant-tables\s*=\s*false' - - id: 9506 + - id: 10506 title: "Ensure '--skip-symbolic-links' Is Enabled" description: "The symbolic-links and skip-symbolic-links options for MySQL determine whether symbolic link support is available. When use of symbolic links are enabled, they have different effects depending on the host platform. When symbolic links are disabled, then symbolic links stored in files or entries in tables are not used by the database. " rationale: "Prevents sym links being used for data base files. This is especially important when MySQL is executing as root as arbitrary files may be overwritten. The symbolic-links option might allow someone to direct actions by to MySQL server to other files and/or directories." - remediation: "Open the MySQL configuration file (my.cnf), locate 'skip_symbolic_links' and set it to YES. If the option does not existe, create it in the 'mysqld' section." + remediation: "Open the MySQL configuration file (my.cnf), locate 'skip_symbolic_links' and set it to YES. If the option does not exist, create it in the 'mysqld' section." compliance: - cis: ["4.6"] references: @@ -122,7 +123,7 @@ checks: rules: - 'c:grep -Rh skip_symbolic_links /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:skip_symbolic_links\s*=\s*YES|skip_symbolic_links\s*=\s*yes' - - id: 9507 + - id: 10507 title: "Ensure 'secure_file_priv' is not empty" description: "The secure_file_priv option restricts to paths used by LOAD DATA INFILE or SELECT local_file. It is recommended that this option be set to a file system location that contains only resources expected to be loaded by MySQL." rationale: "Setting secure_file_priv reduces an attacker's ability to read sensitive files off the affected server via a SQL injection vulnerability. " @@ -135,7 +136,7 @@ checks: rules: - 'c:grep -Rh secure_file_priv /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:secure_file_priv\s*=\s*\.' - - id: 9508 + - id: 10508 title: "Ensure 'sql_mode' Contains 'STRICT_ALL_TABLES'" description: "When data changing statements are made (i.e. INSERT, UPDATE), MySQL can handle invalid or missing values differently depending on whether strict SQL mode is enabled. When strict SQL mode is enabled, data may not be truncated or otherwise 'adjusted' to make the data changing statement work." rationale: "Without strict mode the server tries to do proceed with the action when an error might have been a more secure choice. For example, by default MySQL will truncate data if it does not fit in a field, which can lead to unknown behavior, or be leveraged by an attacker to circumvent data validation. " @@ -147,10 +148,10 @@ checks: - 'c:grep -Rh strict_all_tables /etc/mysql/my.cnf /etc/mysql/my.ini /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:strict_all_tables' #6 Auditing and Logging - - id: 9509 + - id: 10509 title: "Ensure 'log_error' is not empty" description: "The error log contains information about events such as mysqld starting and stopping, when a table needs to be checked or repaired, and, depending on the host operating system, stack traces when mysqld fails" - rationale: "nabling error logging may increase the ability to detect malicious attempts against MySQL, and other critical messages, such as if the error log is not enabled then connection error might go unnoticed." + rationale: "Enabling error logging may increase the ability to detect malicious attempts against MySQL, and other critical messages, such as if the error log is not enabled then connection error might go unnoticed." remediation: "Set the log-error option to the path for the error log in the MySQL configuration file (my.cnf or my.ini)." compliance: - cis: ["6.1"] @@ -160,7 +161,7 @@ checks: rules: - 'c:grep -Rh log_error /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:log_error\s*=\s*\S+\s*' - - id: 9510 + - id: 10510 title: "Ensure Log Files are not Stored on a non-system partition" description: "MySQL log files can be set in the MySQL configuration to exist anywhere on the filesystem. It is common practice to ensure that the system filesystem is left uncluttered by application logs. System filesystems include the root, /var, or /usr." rationale: "Moving the MySQL logs off the system partition will reduce the probability of denial of service via the exhaustion of available disk space to the operating system." @@ -174,7 +175,7 @@ checks: rules: - 'c:grep -Rh log_bin /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:log_bin\s*\t*/+$|log_bin\s*\t*/+var/*$|log_bin\s*\t*/+usr/*$' - - id: 9511 + - id: 10511 title: "Ensure 'log_warning' is set to 2" description: "The log_warnings system variable, enabled by default, provides additional information to the MySQL log. A value of 1 enables logging of warning messages, and higher integer values tend to enable more logging." rationale: "This might help to detect malicious behavior by logging communication errors and aborted connections." @@ -187,7 +188,7 @@ checks: rules: - 'c:grep -Rh log_warnings /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:log_warnings\s*=\s*2' - - id: 9512 + - id: 10512 title: "Ensure 'log_raw' is set to 'OFF'" description: "The log-raw MySQL option determines whether passwords are rewritten by the server so as not to appear in log files as plain text. If log-raw is enabled, then passwords are written to the various log files (general query log, slow query log, and binary log) in plain text. " rationale: "With raw logging of passwords enabled someone with access to the log files might see plain text passwords." @@ -202,7 +203,7 @@ checks: - 'c:grep -Rh log-raw /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:log-raw\s*OFF$|log-raw\s*off$' #7 Authentication - - id: 9513 + - id: 10513 title: "Ensure 'old_passwords' Is Not Set to '1' or 'ON'" description: "This variable controls the password hashing method used by the PASSWORD() function and for the IDENTIFIED BY clause of the CREATE USER and GRANT statements. Before 5.6.6, the value can be 0 (or OFF), or 1 (or ON). As of 5.6.6, the following value can be one of the following: 0 - authenticate with the mysql_native_password plugin; 1 - authenticate with the mysql_old_password plugin; 2 - authenticate with the sha256_password plugin" rationale: "The mysql_old_password plugin leverages an algorithm that can be quickly brute forced using an offline dictionary attack. See CVE-2003-1480 for additional details." @@ -219,7 +220,7 @@ checks: - 'c:grep -Rh old_passwords /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:old_passwords\s*=\s*1' - 'c:grep -Rh old_passwords /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:old_passwords\s*=\s*ON|old_passwords\s*=\s*on' - - id: 9514 + - id: 10514 title: "Ensure 'secure_auth' is set to 'ON'" description: "This option dictates whether the server will deny connections by clients that attempt to use accounts that have their password stored in the mysql_old_password format." rationale: "Enabling this option will prevent all use of passwords employing the old format (and hence insecure communication over the network)." @@ -232,7 +233,7 @@ checks: rules: - 'c:grep -Rh secure_auth /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:secure_auth\s*=\s*ON|secure_auth\s*=\s*on' - - id: 9515 + - id: 10515 title: "Ensure Passwords Are Not Stored in the Global Configuration" description: "The [client] section of the MySQL configuration file allows setting a user and password to be used. Verify the password option is not used in the global configuration file (my.cnf)." rationale: "The use of the password parameter may negatively impact the confidentiality of the user's password." @@ -245,7 +246,7 @@ checks: rules: - 'c:grep -Rh password /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:^\s*password\.*' - - id: 9516 + - id: 10516 title: "Ensure 'sql_mode' Contains 'NO_AUTO_CREATE_USER'" description: "NO_AUTO_CREATE_USER is an option for sql_mode that prevents a GRANT statement from automatically creating a user when authentication information is not provided." rationale: "Blank passwords negate the benefits provided by authentication mechanisms. Without this setting an administrative user might accidentally create a user without a password." @@ -256,7 +257,7 @@ checks: rules: - 'c:grep -Rh no_auto_create_user /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:\s*no_auto_create_user\s*$' - - id: 9517 + - id: 10517 title: "Ensure Password Policy is in Place" description: "Password complexity includes password characteristics such as length, case, length, and character sets." rationale: "Complex passwords help mitigate dictionary, brute forcing, and other password attacks. This recommendation prevents users from choosing weak passwords which can easily be guessed." @@ -276,8 +277,8 @@ checks: - 'c:grep -Rh validate_password_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:validate_password_policy\s*=\s*MEDIUM\s*|validate_password_policy\s*=\s*STRONG\s*|validate_password_policy\s*=\s*medium\s*|validate_password_policy\s*=\s*strong\s*' #9 Replication - - id: 9518 - title: "Ensure 'master_info_repositrory' is set to 'TABLE'" + - id: 10518 + title: "Ensure 'master_info_repository' is set to 'TABLE'" description: "The master_info_repository setting determines to where a slave logs master status and connection information. The options are FILE or TABLE. Note also that this setting is associated with the sync_master_info setting as well." rationale: "The password which the client uses is stored in the master info repository, which by default is a plaintext file. The TABLE master info repository is a bit safer, but with filesystem access it's still possible to gain access to the password the slave is using." remediation: "Open the MySQL configuration file (my.cnf); locate master_info_repository; set the master_info_repository value to TABLE. Add the option if it does not exist." diff --git a/sca/applications/cis_mysql5-6_enterprise.yml b/sca/applications/cis_mysql5-6_enterprise.yml index 8b7edbd99..d5ee27686 100644 --- a/sca/applications/cis_mysql5-6_enterprise.yml +++ b/sca/applications/cis_mysql5-6_enterprise.yml @@ -13,7 +13,7 @@ policy: id: "cis_mysql_enterprise" file: "cis_mysql5-6_enterprise.yml" - name: "CIS benchmark for Oracle MySQL Enterprise 5.6" + name: "CIS Benchmark for Oracle MySQL Enterprise 5.6" description: "This document, CIS Oracle MySQL Enterprise Edition 5.6 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for MySQL Enterprise Edition 5.6. The tests were carried out against MySQL Enterprise Edition 5.6 running on Ubuntu Linux 14.04, but applies to other linux distributions as well." references: - https://www.cisecurity.org/cis-benchmarks/ @@ -21,13 +21,14 @@ policy: requirements: title: "Check that MySQL is installed on the system" description: "Requirements for running the SCA scan against the MySQL policy." - condition: all + condition: any rules: - 'd:/etc/mysql' + - 'd:/var/lib/mysql' checks: #1 Operating System Level Configuration - - id: 10000 + - id: 11000 title: "Disable MySQL Command History" description: "On Linux/UNIX, the MySQL client logs statements executed interactively to a history file. By default, this file is named .mysql_history in the user's home directory. Most interactive commands run in the MySQL client application are saved to a history file. The MySQL command history should be disabled." rationale: "Disabling the MySQL command history reduces the probability of exposing sensitive information, such as passwords and encryption keys." @@ -42,7 +43,7 @@ checks: - 'd:/home -> ^.mysql_history$' - 'd:/root -> ^.mysql_history$' - - id: 10001 + - id: 11001 title: "Disable Interactive Login" description: "When created, the MySQL user may have interactive access to the operating system, which means that the MySQL user could login to the host as any other user would." rationale: "Preventing the MySQL user from logging in interactively may reduce the impact of a compromised MySQL account. There is also more accountability as accessing the operating system where the MySQL server lies will require the user's own account. Interactive access by the MySQL user is unnecessary and should be disabled." @@ -53,7 +54,7 @@ checks: rules: - 'c:getent passwd mysql -> r:/bin/false|/sbin/nologin' - - id: 10002 + - id: 11002 title: "Verify That 'MYSQL_PWD' Is Not Set In Users' Profiles" description: "MySQL can read a default database password from an environment variable called MYSQL_PWD." rationale: "The use of the MYSQL_PWD environment variable implies the clear text storage of MySQL credentials. Avoiding this may increase assurance that the confidentiality of MySQL credentials is preserved." @@ -67,7 +68,7 @@ checks: - 'c:find /home -maxdepth 2 -type f -exec grep MYSQL_PWD {} + -> r:.profile|.bashrc|.bash_profile && r:$MYSQL_PWD' #4 General - - id: 10003 + - id: 11003 title: "Ensure 'allow-suspicious-udfs' Is Set to 'FALSE'" description: "This option prevents attaching arbitrary shared library functions as user-defined functions by checking for at least one corresponding method named _init, _deinit, _reset, _clear, or _add." rationale: "Preventing shared libraries that do not contain user-defined functions from loading will reduce the attack surface of the server." @@ -81,7 +82,7 @@ checks: rules: - 'c:my_print_defaults mysqld -> r:allow-suspicious-udfs' - - id: 10004 + - id: 11004 title: "Ensure 'local_infile' is Disabled" description: "The 'local_infile' parameter dictates whether files located on the MySQL client's computer can be loaded or selected via 'LOAD DATA INFILE' or 'SELECT local_file'." rationale: "Disabling 'local_infile' reduces an attacker's ability to read sensitive files off the affected server via a SQL injection vulnerability." @@ -95,7 +96,7 @@ checks: rules: - 'c:grep -Rh local-infile /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:local-infile\s*=\s*0' - - id: 10005 + - id: 11005 title: "Ensure 'mysqld' Is Not Started with '--skip-grant-tables'" description: "This option causes mysqld to start without using the privilege system." rationale: "If this option is used, all clients of the affected server will have unrestricted access to all databases." @@ -108,11 +109,11 @@ checks: rules: - 'c:grep -Rh skip-grant-tables /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:skip-grant-tables\s*=\s*FALSE|skip-grant-tables\s*=\s*false' - - id: 10006 + - id: 11006 title: "Ensure '--skip-symbolic-links' Is Enabled" description: "The symbolic-links and skip-symbolic-links options for MySQL determine whether symbolic link support is available. When use of symbolic links are enabled, they have different effects depending on the host platform. When symbolic links are disabled, then symbolic links stored in files or entries in tables are not used by the database. " rationale: "Prevents sym links being used for data base files. This is especially important when MySQL is executing as root as arbitrary files may be overwritten. The symbolic-links option might allow someone to direct actions by to MySQL server to other files and/or directories." - remediation: "Open the MySQL configuration file (my.cnf), locate 'skip_symbolic_links' and set it to YES. If the option does not existe, create it in the 'mysqld' section." + remediation: "Open the MySQL configuration file (my.cnf), locate 'skip_symbolic_links' and set it to YES. If the option does not exist, create it in the 'mysqld' section." compliance: - cis: ["4.6"] references: @@ -122,7 +123,7 @@ checks: rules: - 'c:grep -Rh skip_symbolic_links /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:skip_symbolic_links\s*=\s*YES|skip_symbolic_links\s*=\s*yes' - - id: 10007 + - id: 11007 title: "Ensure 'secure_file_priv' is not empty" description: "The secure_file_priv option restricts to paths used by LOAD DATA INFILE or SELECT local_file. It is recommended that this option be set to a file system location that contains only resources expected to be loaded by MySQL." rationale: "Setting secure_file_priv reduces an attacker's ability to read sensitive files off the affected server via a SQL injection vulnerability. " @@ -135,7 +136,7 @@ checks: rules: - 'c:grep -Rh secure_file_priv /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:secure_file_priv\s*=\s*\.' - - id: 10008 + - id: 11008 title: "Ensure 'sql_mode' Contains 'STRICT_ALL_TABLES'" description: "When data changing statements are made (i.e. INSERT, UPDATE), MySQL can handle invalid or missing values differently depending on whether strict SQL mode is enabled. When strict SQL mode is enabled, data may not be truncated or otherwise 'adjusted' to make the data changing statement work." rationale: "Without strict mode the server tries to do proceed with the action when an error might have been a more secure choice. For example, by default MySQL will truncate data if it does not fit in a field, which can lead to unknown behavior, or be leveraged by an attacker to circumvent data validation. " @@ -147,10 +148,10 @@ checks: - 'c:grep -Rh strict_all_tables /etc/mysql/my.cnf /etc/mysql/my.ini /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:strict_all_tables' #6 Auditing and Logging - - id: 10009 + - id: 11009 title: "Ensure 'log_error' is not empty" description: "The error log contains information about events such as mysqld starting and stopping, when a table needs to be checked or repaired, and, depending on the host operating system, stack traces when mysqld fails" - rationale: "nabling error logging may increase the ability to detect malicious attempts against MySQL, and other critical messages, such as if the error log is not enabled then connection error might go unnoticed." + rationale: "Enabling error logging may increase the ability to detect malicious attempts against MySQL, and other critical messages, such as if the error log is not enabled then connection error might go unnoticed." remediation: "Set the log-error option to the path for the error log in the MySQL configuration file (my.cnf or my.ini)." compliance: - cis: ["6.1"] @@ -160,7 +161,7 @@ checks: rules: - 'c:grep -Rh log_error /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:log_error\s*=\s*\S+\s*' - - id: 10010 + - id: 11010 title: "Ensure Log Files are not Stored on a non-system partition" description: "MySQL log files can be set in the MySQL configuration to exist anywhere on the filesystem. It is common practice to ensure that the system filesystem is left uncluttered by application logs. System filesystems include the root, /var, or /usr." rationale: "Moving the MySQL logs off the system partition will reduce the probability of denial of service via the exhaustion of available disk space to the operating system." @@ -174,7 +175,7 @@ checks: rules: - 'c:grep -Rh log_bin /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:log_bin\s*\t*/+$|log_bin\s*\t*/+var/*$|log_bin\s*\t*/+usr/*$' - - id: 10011 + - id: 11011 title: "Ensure 'log_warning' is set to 2" description: "The log_warnings system variable, enabled by default, provides additional information to the MySQL log. A value of 1 enables logging of warning messages, and higher integer values tend to enable more logging." rationale: "This might help to detect malicious behavior by logging communication errors and aborted connections." @@ -187,7 +188,7 @@ checks: rules: - 'c:grep -Rh log_warnings /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:log_warnings\s*=\s*2' - - id: 10012 + - id: 11012 title: "Ensure 'log_raw' is set to 'OFF'" description: "The log-raw MySQL option determines whether passwords are rewritten by the server so as not to appear in log files as plain text. If log-raw is enabled, then passwords are written to the various log files (general query log, slow query log, and binary log) in plain text. " rationale: "With raw logging of passwords enabled someone with access to the log files might see plain text passwords." @@ -202,7 +203,7 @@ checks: - 'c:grep -Rh log-raw /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:log-raw\s*OFF$|log-raw\s*off$' #7 Authentication - - id: 10013 + - id: 11013 title: "Ensure 'old_passwords' Is Not Set to '1' or 'ON'" description: "This variable controls the password hashing method used by the PASSWORD() function and for the IDENTIFIED BY clause of the CREATE USER and GRANT statements. Before 5.6.6, the value can be 0 (or OFF), or 1 (or ON). As of 5.6.6, the following value can be one of the following: 0 - authenticate with the mysql_native_password plugin; 1 - authenticate with the mysql_old_password plugin; 2 - authenticate with the sha256_password plugin" rationale: "The mysql_old_password plugin leverages an algorithm that can be quickly brute forced using an offline dictionary attack. See CVE-2003-1480 for additional details." @@ -219,7 +220,7 @@ checks: - 'c:grep -Rh old_passwords /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:old_passwords\s*=\s*1' - 'c:grep -Rh old_passwords /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:old_passwords\s*=\s*ON|old_passwords\s*=\s*on' - - id: 10014 + - id: 11014 title: "Ensure 'secure_auth' is set to 'ON'" description: "This option dictates whether the server will deny connections by clients that attempt to use accounts that have their password stored in the mysql_old_password format." rationale: "Enabling this option will prevent all use of passwords employing the old format (and hence insecure communication over the network)." @@ -232,7 +233,7 @@ checks: rules: - 'c:grep -Rh secure_auth /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:secure_auth\s*=\s*ON|secure_auth\s*=\s*on' - - id: 10015 + - id: 11015 title: "Ensure Passwords Are Not Stored in the Global Configuration" description: "The [client] section of the MySQL configuration file allows setting a user and password to be used. Verify the password option is not used in the global configuration file (my.cnf)." rationale: "The use of the password parameter may negatively impact the confidentiality of the user's password." @@ -245,7 +246,7 @@ checks: rules: - 'c:grep -Rh password /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:^\s*password\.*' - - id: 10016 + - id: 11016 title: "Ensure 'sql_mode' Contains 'NO_AUTO_CREATE_USER'" description: "NO_AUTO_CREATE_USER is an option for sql_mode that prevents a GRANT statement from automatically creating a user when authentication information is not provided." rationale: "Blank passwords negate the benefits provided by authentication mechanisms. Without this setting an administrative user might accidentally create a user without a password." @@ -256,7 +257,7 @@ checks: rules: - 'c:grep -Rh no_auto_create_user /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:\s*no_auto_create_user\s*$' - - id: 10017 + - id: 11017 title: "Ensure Password Policy is in Place" description: "Password complexity includes password characteristics such as length, case, length, and character sets." rationale: "Complex passwords help mitigate dictionary, brute forcing, and other password attacks. This recommendation prevents users from choosing weak passwords which can easily be guessed." @@ -276,8 +277,8 @@ checks: - 'c:grep -Rh validate_password_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:validate_password_policy\s*=\s*MEDIUM\s*|validate_password_policy\s*=\s*STRONG\s*|validate_password_policy\s*=\s*medium\s*|validate_password_policy\s*=\s*strong\s*' #9 Replication - - id: 10018 - title: "Ensure 'master_info_repositrory' is set to 'TABLE'" + - id: 11018 + title: "Ensure 'master_info_repository' is set to 'TABLE'" description: "The master_info_repository setting determines to where a slave logs master status and connection information. The options are FILE or TABLE. Note also that this setting is associated with the sync_master_info setting as well." rationale: "The password which the client uses is stored in the master info repository, which by default is a plaintext file. The TABLE master info repository is a bit safer, but with filesystem access it's still possible to gain access to the password the slave is using." remediation: "Open the MySQL configuration file (my.cnf); locate master_info_repository; set the master_info_repository value to TABLE. Add the option if it does not exist." @@ -290,7 +291,7 @@ checks: - 'c:grep -Rh master_info_repository /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:master_info_repository\s*=\s*TABLE|master_info_repository\s*=\s*table' #10 Enterprise rules - - id: 10019 + - id: 11019 title: "Ensure audit_log_connection_policy is not set to 'NONE'" description: "The audit_log_connection_policy variable controls how the audit plugin writes connection events to the audit log file. " rationale: "The audit_log_connection_policy offers three options: NONE, ERRORS, and ALL. Each option determines whether connection events are logged and the type of connection events that are logged. Setting a non 'NONE' value for audit_log_connection_policy ensures at a minimum, failed connection events are being logged. The ERRORS setting will log failed connection events and the ALL setting will log all connection events. For MySQL versions => 5.6.20, the audit_log_policy variable can override the audit_log_connection_policy, potentially invalidating this benchmark recommendation, therefore enforcing a setting for audit_log_connection_policy ensures the integrity of this recommendation." @@ -301,7 +302,7 @@ checks: rules: - 'c:grep -Rh audit_log_connection_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:audit_log_connection_policy\s*=\s* && r:none|NONE' - - id: 10020 + - id: 11020 title: "Ensure audit_log_exclude_account is set to NULL" description: "The audit_log_exclude_accounts variable enables the administrator to set accounts for which events will not be logged in the audit log." rationale: "The audit_log_exclude_accounts variable has two permitted values, either NULL or a list of MySQL accounts. Setting this variable correctly ensures no single user is able to unintentionally evade being logged. Particular attention should be made to privileged accounts, as such accounts will generally be bestowed with more privileges than normal users, and should not be listed against this variable." @@ -312,7 +313,7 @@ checks: rules: - 'c:grep -Rh audit_log_exclude_accounts /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:audit_log_exclude_accounts\s*=\s* && r:null\s*$|NULL\s*$' - - id: 10021 + - id: 11021 title: "Ensure audit_log_include_accounts is set to NULL" description: "The audit_log_include_accounts variable enables the administrator to set accounts for which events should be logged in the audit log." rationale: "The audit_log_include_accounts variable has two permitted values, either NULL or a list of MySQL accounts. Setting this variable correctly ensures all MySQL users are being logged in the audit log." @@ -323,7 +324,7 @@ checks: rules: - 'c:grep -Rh audit_log_include_accounts /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:audit_log_include_accounts\s*=\s* && r:null\s*$|NULL\s*$' - - id: 10022 + - id: 11022 title: "Ensure audit_log_policy is set to log logins and connections" description: "With the audit_log_policy setting the amount of information which is sent to the audit log is controlled. It must be set to log logins and connections." rationale: "If this setting is set to QUERIES, CONNECTIONS or NONE then either connections or queries are not written to the audit log file." @@ -334,7 +335,7 @@ checks: rules: - 'c:grep -Rh audit_log_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:audit_log_policy\s*=\s* && r:ALL|LOGINS|all|logins' - - id: 10023 + - id: 11023 title: "Ensure audit_log_statement_policy is set to ALL" description: "This setting controls whether statements are written to the audit log." rationale: "This setting must be set to ALL to ensure all statement information is written to the audit log." @@ -345,7 +346,7 @@ checks: rules: - 'c:grep -Rh audit_log_statement_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:audit_log_statement_policy\s*=\s* && r:all$|ALL$' - - id: 10024 + - id: 11024 title: "Set audit_log_strategy to SYNCHRONOUS or SEMISYNCRONOUS" description: "The audit_log_strategy must be set to SYNCHRONOUS or SEMISYNCHRONOUS." rationale: "This setting controls how information is written to the audit log. It can be set to SYNCHRONOUS to make it fully durable or other settings which are less durable but have less performance overhead." @@ -356,7 +357,7 @@ checks: rules: - 'c:grep -Rh audit_log_strategy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:audit_log_strategy\s*=\s* && r:semisynchronous|synchronous|SEMISYNCHRONOUS|SYNCHRONOUS' - - id: 10025 + - id: 11025 title: "Make sure the audit plugin can't be unloaded" description: "Set audit_log to FORCE_PLUS_PERMANENT." rationale: "This makes disables unloading on the plugin." diff --git a/sca/applications/cis_sqlserver_2012.yml b/sca/applications/cis_sqlserver_2012.yml new file mode 100644 index 000000000..846f9438e --- /dev/null +++ b/sca/applications/cis_sqlserver_2012.yml @@ -0,0 +1,466 @@ +# Security Configuration Assessment +# CIS Microsoft SQL Server 2012 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on Center for Internet Security Benchmark for Microsoft SQL Server 2012 v1.5.0 - 05-31-2019 + +policy: + id: "cis_sqlserver_2012" + file: "cis_sqlserver_2012.yml" + name: "CIS Microsoft SQL Server 2012" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft SQL Server 2012." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform has Microsoft SQL Server 2012" + description: "Requirements for running the CIS Microsoft SQL Server 2012 Benchmark" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows' + +variables: + $User: + +checks: + +###################################################### +# 2 Surface Area Reduction +###################################################### +# 2.1 Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' (Scored) + - id: 11500 + title: "Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0'" + description: "Enabling Ad Hoc Distributed Queries allows users to query data and execute statements on external data sources. This functionality should be disabled." + rationale: "This feature can be used to remotely access and exploit vulnerabilities on remote SQL Server instances and to run unsafe Visual Basic for Application functions." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ad Hoc Distributed Queries' ;\" -> r:Ad Hoc Distributed Queries\\s+0\\s+0" + +# 2.2 Ensure 'CLR Enabled' Server Configuration Option is set to '0' (Scored) + - id: 11501 + title: "Ensure 'CLR Enabled' Server Configuration Option is set to '0'" + description: "The clr enabled option specifies whether user assemblies can be run by SQL Server." + rationale: "Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk from both inadvertent and malicious assemblies." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'clr enabled', 0; RECONFIGURE;" + compliance: + - cis: ["2.2"] + - cis_csc: ["18.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/t-sql/statements/create-assembly-transact-sql' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'clr enabled';\" -> r:0\\s+0" + + +# 2.3 Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + - id: 11502 + title: "Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0'" + description: "The cross db ownership chaining option controls cross-database ownership chaining across all databases at the instance (or server) level." + rationale: "When enabled, this option allows a member of the db_owner role in a database to gain access to objects owned by a login in any other database, causing an unnecessary information disclosure. When required, cross-database ownership chaining should only be enabled for the specific databases requiring it instead of at the instance level for all databases by using the ALTER DATABASE SET DB_CHAINING ON command. This database option may not be changed on the master , model , or tempdb system databases." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'cross db ownership chaining', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'cross db ownership chaining';\" -> r:0\\s+0" + + +# 2.4 Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + - id: 11503 + title: "Ensure 'Database Mail XPs' Server Configuration Option is set to '0'" + description: "The Database Mail XPs option controls the ability to generate and transmit email messages from SQL Server." + rationale: "Disabling the Database Mail XPs option reduces the SQL Server surface, eliminates a DOS attack vector and channel to exfiltrate data from the database server to a remote host." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Database Mail XPs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/database-mail/database-mail' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Database Mail XPs';\" -> r:0\\s+0" + +# 2.5 Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + - id: 11504 + title: "Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0'" + description: "The Ole Automation Procedures option controls whether OLE Automation objects can be instantiated within Transact-SQL batches. These are extended stored procedures that allow SQL Server users to execute functions external to SQL Server." + rationale: "Enabling this option will increase the attack surface of SQL Server and allow users to execute functions in the security context of SQL Server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ole Automation Procedures', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.5"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ole Automation Procedures';\" -> r:0\\s+0" + +# 2.6 Ensure 'Remote Access' Server Configuration Option is set to '0' + - id: 11505 + title: "Ensure 'Remote Access' Server Configuration Option is set to '0'" + description: "The remote access option controls the execution of local stored procedures on remote servers or remote stored procedures on local server." + rationale: "Functionality can be abused to launch a Denial-of-Service (DoS) attack on remote servers by off-loading query processing to a target." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'remote access', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-remote-access-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote access';\" -> r:0\\s+0" + +# 2.7 Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' (Scored) + - id: 11506 + title: "Ensure 'Remote Admin Connections' Server Configuration Option is set to '0'" + description: "The remote admin connections option controls whether a client application on a remote computer can use the Dedicated Administrator Connection (DAC)." + rationale: "The Dedicated Administrator Connection (DAC) lets an administrator access a running server to execute diagnostic functions or Transact-SQL statements, or to troubleshoot problems on the server, even when the server is locked or running in an abnormal state and not responding to a SQL Server Database Engine connection. In a cluster scenario, the administrator may not actually be logged on to the same node that is currently hosting the SQL Server instance and thus is considered \"remote\". Therefore, this setting should usually be enabled ( 1 ) for SQL Server failover clusters; otherwise it should be disabled ( 0 ) which is the default." + remediation: "Run the following T-SQL command on non-clustered installations: EXECUTE sp_configure 'remote admin connections', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"USE master; SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote admin connections' AND SERVERPROPERTY('IsClustered') = 0;\" -> r:0\\s*\\t*0|0 rows affected" + +# 2.8 Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' (Scored) + - id: 11507 + title: "Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0'" + description: "The scan for startup procs option, if enabled, causes SQL Server to scan for and automatically run all stored procedures that are set to execute upon service startup." + rationale: "Enforcing this control reduces the threat of an entity leveraging these facilities for malicious purposes." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'scan for startup procs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.8"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-scan-for-startup-procs-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'scan for startup procs';\" -> r:0\\s+0" + +# 2.9 Ensure 'Trustworthy' Database Property is set to 'Off' (Scored) + - id: 11508 + title: "Ensure 'Trustworthy' Database Property is set to 'Off'" + description: "The TRUSTWORTHY database option allows database objects to access objects in other databases under certain circumstances." + rationale: "Provides protection from malicious CLR assemblies or extended procedures." + remediation: "Execute the following T-SQL statement against the databases (replace below) returned by the Audit Procedure: ALTER DATABASE [] SET TRUSTWORTHY OFF;" + compliance: + - cis: ["2.9"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/trustworthy-database-property' + - 'https://support.microsoft.com/it-it/help/2183687/guidelines-for-using-the-trustworthy-database-setting-in-sql-server' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name FROM sys.databases WHERE is_trustworthy_on = 1 AND name != 'msdb';\" -> r:0 rows affected" + +# 2.11 Ensure SQL Server is configured to use non-standard ports (Not Scored) + - id: 11509 + title: "Ensure SQL Server is configured to use non-standard ports" + description: "If enabled, the default SQL Server instance will be assigned a default port of TCP:1433 for TCP/IP communication. Administrators can also configure named instances to use TCP:1433 for communication. TCP:1433 is a widely known SQL Server port and this port assignment should be changed." + rationale: "Using a non-default port helps protect the database from attacks directed to the default port." + remediation: "1: In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for , and then double-click the TCP/IP or VIA protocol. 2: In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1 , IP2 , up to IPAll . One of these is for the IP address of the loopback adapter, 127.0.0.1 . Additional IP addresses appear for each IP Address on the computer. 3: Change the TCP Port field from 1433 to another non-standard port or leave the TCP Port field empty and set the TCP Dynamic Ports value to 0 to enable dynamic port assignment and then click OK. 4: In the console pane, click SQL Server Services. 5: In the details pane, right-click SQL Server () and then click Restart, to stop and restart SQL Server." + compliance: + - cis: ["2.11"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port' + condition: none + rules: + - "c:sqlcmd -Q \"DECLARE @value nvarchar(256); EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll', N'TcpPort', @value OUTPUT, N'no_output'; SELECT @value AS TCP_Port WHERE @value = '1433'; \" -> r:1433" + +# 2.13 Ensure 'sa' Login Account is set to 'Disabled' (Scored) + - id: 11510 + title: "Ensure 'sa' Login Account is set to 'Disabled'" + description: "The sa account is a widely known and often widely used SQL Server account with sysadmin privileges. This is the original login created during installation and always has the principal_id=1 and sid=0x01 ." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal." + remediation: "Execute the following T-SQL query: USE [master] GO DECLARE @tsql nvarchar(max) SET @tsql = 'ALTER LOGIN ' + SUSER_NAME(0x01) + ' DISABLE' EXEC (@tsql) GO" + compliance: + - cis: ["2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-principals-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, is_disabled FROM sys.server_principals WHERE sid = 0x01 AND is_disabled = 0;\" -> r:0 rows affected" + +# 2.14 Ensure 'sa' Login Account has been renamed (Scored) + - id: 11511 + title: "Ensure 'sa' Login Account has been renamed" + description: "The sa account is a widely known and often widely used SQL Server login with sysadmin privileges. The sa login is the original login created during installation and always has principal_id=1 and sid=0x01 ." + rationale: "It is more difficult to launch password-guessing and brute-force attacks against the sa login if the name is not known." + remediation: "Replace the value within the below syntax and execute to rename the sa login. ALTER LOGIN sa WITH NAME = ;" + compliance: + - cis: ["2.14"] + - cis_csc: ["5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode' + condition: none + rules: + - "c:sqlcmd -Q \"SELECT name FROM sys.server_principals WHERE sid = 0x01;\" -> r:sa" + +# 2.15 Ensure 'xp_cmdshell' Server Configuration Option is set to '0' + - id: 11512 + title: "Ensure 'xp_cmdshell' Server Configuration Option is set to '0'" + description: "The xp_cmdshell option controls whether the xp_cmdshell extended stored procedure can be used by an authenticated SQL Server user to execute operating-system command shell commands and return results as rows within the SQL client." + rationale: "The xp_cmdshell procedure is commonly used by attackers to read or write data to/from the underlying Operating System of a database server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'xp_cmdshell', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.15"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/xp-cmdshell-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'xp_cmdshell';\" -> r:0\\s+0" + +# 2.16 Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + - id: 11513 + title: "Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases" + description: "AUTO_CLOSE determines if a given database is closed or not after a connection terminates. If enabled, subsequent connections to the given database will require the database to be reopened and relevant procedure caches to be rebuilt." + rationale: "Because authentication of users for contained databases occurs within the database not at the server\\instance level, the database must be opened every time to authenticate a user. The frequent opening/closing of the database consumes additional server resources and may contribute to a denial of service." + remediation: "Execute the following T-SQL, replacing with each database name found by the Audit Procedure: ALTER DATABASE SET AUTO_CLOSE OFF;" + compliance: + - cis: ["2.16"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/databases/security-best-practices-with-contained-databases' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0 and is_auto_close_on = 1;\" -> r:0 rows affected" + +# 2.17 Ensure no login exists with the name 'sa' (Scored) + - id: 11514 + title: "Ensure no login exists with the name 'sa'" + description: "The sa login (e.g. principal) is a widely known and often widely used SQL Server account. Therefore, there should not be a login called sa even when the original sa login ( principal_id = 1 ) has been renamed." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal name." + remediation: "Execute the appropriate ALTER or DROP statement below based on the principal_id returned for the login named sa . Replace the value within the below syntax and execute to rename the sa login. USE [master] GO -- If principal_id = 1 or the login owns database objects, rename the sa login ALTER LOGIN [sa] WITH NAME = ; GO -- If the login owns no database objects, then drop it -- Do NOT drop the login if it is principal_id = 1 DROP LOGIN sa" + compliance: + - cis: ["2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:sqlcmd -Q \"SELECT principal_id, name FROM sys.server_principals WHERE name = 'sa';\" -> r:0 rows affected" + +########################################################### +# 3 Authentication and Authorization +########################################################### +# 3.1 Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' (Scored) + - id: 11515 + title: "Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode'" + description: "Uses Windows Authentication to validate attempted connections." + rationale: "Windows provides a more robust authentication mechanism than SQL Server authentication." + remediation: "Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open the Object Explorer tab and connect to the target database instance. 3. Right click the instance name and select Properties. 4. Select the Security page from the left menu. 5. Set the Server authentication setting to Windows Authentication Mode. or T-SQL Method: Run the following T-SQL in a Query Window: USE [master] GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'LoginMode', REG_DWORD, 1 GO Restart the SQL Server service for the change to take effect." + compliance: + - cis: ["3.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-properties-security-page' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT SERVERPROPERTY('IsIntegratedSecurityOnly') as [login_mode];\" -> r:^1" + +# 3.8 Ensure only the default permissions specified by Microsoft are granted to the public server role (Scored) + - id: 11516 + title: "Ensure only the default permissions specified by Microsoft are granted to the public server role" + description: "public is a special fixed server role containing all logins. Unlike other fixed server roles, permissions can be changed for the public role. In keeping with the principle of least privileges, the public server role should not be used to grant permissions at the server scope as these would be inherited by all users." + rationale: "Every SQL Server login belongs to the public role and cannot be removed from this role. Therefore, any permissions granted to this role will be available to all logins unless they have been explicitly denied to specific logins or user-defined server roles." + remediation: "Add the extraneous permissions found in the Audit query results to the specific logins to user-defined server roles which require the access. Revoke the from the public role as shown below USE [master] GO REVOKE FROM public; GO" + compliance: + - cis: ["3.8"] + - cis_csc: ["5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles' + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles#permissions-of-fixed-server-roles' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT * FROM master.sys.server_permissions WHERE (grantee_principal_id = SUSER_SID(N'public') and state_desc LIKE 'GRANT%') AND NOT (state_desc = 'GRANT' and [permission_name] = 'VIEW ANY DATABASE' and class_desc = 'SERVER') AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 2) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 3) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 4) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 5); \" -> r:0 rows affected" + + +# 3.10 Ensure Windows local groups are not SQL Logins (Scored) + - id: 11517 + title: "Ensure Windows local groups are not SQL Logins" + description: "Local Windows groups should not be used as logins for SQL Server instances." + rationale: "Allowing local Windows groups as SQL Logins provides a loophole whereby anyone with OS level administrator rights (and no SQL Server rights) could add users to the local Windows groups and thereby give themselves or others access to the SQL Server instance." + remediation: "1. For each LocalGroupName login, if needed create an equivalent AD group containing only the required user accounts. 2. Add the AD group or individual Windows accounts as a SQL Server login and grant it the permissions required. 3. Drop the LocalGroupName login using the syntax below after replacing . USE [master] GO DROP LOGIN [] GO" + compliance: + - cis: ["3.10"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + condition: all + rules: + - "c:sqlcmd -Q \"USE [master] SELECT pr.[name] AS LocalGroupName, pe.[permission_name], pe.[state_desc] FROM sys.server_principals pr JOIN sys.server_permissions pe ON pr.[principal_id] = pe.[grantee_principal_id] WHERE pr.[type_desc] = 'WINDOWS_GROUP' AND pr.[name] like CAST(SERVERPROPERTY('MachineName') AS nvarchar) + '%';\" -> r:0 rows affected" + + +########################################################### +# 4 Password Policies +########################################################### + +# 4.2 Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role (Scored) + - id: 11518 + title: "Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role" + description: "Applies the same password expiration policy used in Windows to passwords used inside SQL Server." + rationale: "Ensuring SQL logins comply with the secure password policy applied by the Windows Server Benchmark will ensure the passwords for SQL logins with sysadmin privileges are changed on a frequent basis to help prevent compromise via a brute force attack. CONTROL SERVER is an equivalent permission to sysadmin and logins with that permission should also be required to have expiring passwords." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_EXPIRATION = ON;" + compliance: + - cis: ["4.2"] + - cis_csc: ["16.2, 16.10"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'http://msdn.microsoft.com/en-us/library/ms161959(v=sql.110).aspx' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT l.[name], 'sysadmin membership' AS 'Access_Method' FROM sys.sql_logins AS l WHERE IS_SRVROLEMEMBER('sysadmin',name) = 1 AND l.is_expiration_checked <> 1 UNION ALL SELECT l.[name], 'CONTROL SERVER' AS 'Access_Method' FROM sys.sql_logins AS l JOIN sys.server_permissions AS p ON l.principal_id = p.grantee_principal_id WHERE p.type = 'CL' AND p.state IN ('G', 'W') AND l.is_expiration_checked <> 1;\" -> r:0 rows affected" + +# 4.3 Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins (Scored) + - id: 11519 + title: "Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins" + description: "Applies the same password complexity policy used in Windows to passwords used insideSQL Server." + rationale: "Ensure SQL authenticated login passwords comply with the secure password policy applied by the Windows Server Benchmark so that they cannot be easily compromised via brute force attack." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_POLICY = ON; Note: In the case of AWS RDS do not perform this remediation for the Master account." + compliance: + - cis: ["4.3"] + - cis_csc: ["16, 4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'http://msdn.microsoft.com/en-us/library/ms161959(v=sql.110).aspx' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, is_disabled FROM sys.sql_logins WHERE is_policy_checked = 0;\" -> r:0 rows affected" + +########################################################## +# 5 Auditing and Logging +########################################################## +# 5.1 Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + - id: 11520 + title: "Ensure 'Maximum number of error log files' is set to greater than or equal to '12'" + description: "SQL Server error log files must be protected from loss. The log files must be backed up before they are overwritten. Retaining more error logs helps prevent loss from frequent recycling before backups can occur." + rationale: "The SQL Server error log contains important information about major server events and login attempt information as well." + remediation: "Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient for a production environment. Perform either the GUI or T-SQL method shown: GUI Method 1. Open SQL Server Management Studio. 2. Open Object Explorer and connect to the target instance. 3. Navigate to the Management tab in Object Explorer and expand. Right click on the SQL Server Logs file and select Configure 4. Check the Limit the number of error log files before they are recycled 5. Set the Maximum number of error log files to greater than or equal to 12 T-SQL Method Run the following T-SQL to change the number of error log files, replace with your desired number of error log files: EXEC master.sys.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', REG_DWORD, ;" + compliance: + - cis: ["5.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + references: + - 'http://msdn.microsoft.com/en-us/library/ms177285(v=sql.110).aspx' + condition: all + rules: + - "c:sqlcmd -Q \"DECLARE @NumErrorLogs int; EXEC master.sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', @NumErrorLogs OUTPUT; SELECT ISNULL(@NumErrorLogs, -1) AS [NumberOfLogFiles];\" -> n:^\\s*(\\d+) compare >= 12" + +# 5.2 Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' (Scored) + - id: 11521 + title: "Ensure 'Default Trace Enabled' Server Configuration Option is set to '1'" + description: "The default trace provides audit logging of database activity including account creations, privilege elevation and execution of DBCC commands." + rationale: "Default trace provides valuable audit information regarding security-related activities on the server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'default trace enabled', 1; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/default-trace-enabled-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'default trace enabled';\" -> r:1\\s+1" + + + +########################################################### +# 6 Application Development +########################################################### +# 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies (Scored) + - id: 11522 + title: "Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies" + description: "Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies from accessing external system resources such as files, the network, environment variables, or the registry." + rationale: "Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access sensitive areas of the operating system, steal and/or transmit data and alter the state and other protection measures of the underlying Windows Operating System. Assemblies which are Microsoft-created ( is_user_defined = 0 ) are excluded from this check as they are required for overall system functionality." + remediation: "ALTER ASSEMBLY WITH PERMISSION_SET = SAFE;" + compliance: + - cis: ["6.2"] + - cis_csc: ["18"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - 'http://msdn.microsoft.com/en-us/library/ms345101(v=sql.110).aspx' + - 'http://msdn.microsoft.com/en-us/library/ms189790(v=sql.110).aspx' + - 'http://msdn.microsoft.com/en-us/library/ms186711(v=sql.110).aspx' + condition: none + rules: + - "c:sqlcmd -Q \"SELECT name, permission_set_desc FROM sys.assemblies WHERE is_user_defined = 1;\" -> r:EXTERNAL_ACCESS|UNSAFE" diff --git a/sca/applications/cis_sqlserver_2014.yml b/sca/applications/cis_sqlserver_2014.yml new file mode 100644 index 000000000..70926809f --- /dev/null +++ b/sca/applications/cis_sqlserver_2014.yml @@ -0,0 +1,464 @@ +# Security Configuration Assessment +# CIS Microsoft SQL Server 2014 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on Center for Internet Security Benchmark for Microsoft SQL Server 2014 v1.4.0 - 05-31-2019 + +policy: + id: "cis_sqlserver_2014" + file: "cis_sqlserver_2014" + name: "CIS Microsoft SQL Server 2014" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft SQL Server 2014." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform has Microsoft SQL Server 2014" + description: "Requirements for running the CIS Microsoft SQL Server 2014 Benchmark" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows' + +variables: + $User: + +checks: + +###################################################### +# 2 Surface Area Reduction +###################################################### +# 2.1 Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' (Scored) + - id: 12000 + title: "Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0'" + description: "Enabling Ad Hoc Distributed Queries allows users to query data and execute statements on external data sources. This functionality should be disabled." + rationale: "This feature can be used to remotely access and exploit vulnerabilities on remote SQL Server instances and to run unsafe Visual Basic for Application functions." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ad Hoc Distributed Queries' ;\" -> r:Ad Hoc Distributed Queries\\s+0\\s+0" + +# 2.2 Ensure 'CLR Enabled' Server Configuration Option is set to '0' (Scored) + - id: 12001 + title: "Ensure 'CLR Enabled' Server Configuration Option is set to '0'" + description: "The clr enabled option specifies whether user assemblies can be run by SQL Server." + rationale: "Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk from both inadvertent and malicious assemblies." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'clr enabled', 0; RECONFIGURE;" + compliance: + - cis: ["2.2"] + - cis_csc: ["18.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/t-sql/statements/create-assembly-transact-sql' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'clr enabled';\" -> r:0\\s+0" + + +# 2.3 Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + - id: 12002 + title: "Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0'" + description: "The cross db ownership chaining option controls cross-database ownership chaining across all databases at the instance (or server) level." + rationale: "When enabled, this option allows a member of the db_owner role in a database to gain access to objects owned by a login in any other database, causing an unnecessary information disclosure. When required, cross-database ownership chaining should only be enabled for the specific databases requiring it instead of at the instance level for all databases by using the ALTER DATABASE SET DB_CHAINING ON command. This database option may not be changed on the master , model , or tempdb system databases." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'cross db ownership chaining', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'cross db ownership chaining';\" -> r:0\\s+0" + + +# 2.4 Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + - id: 12003 + title: "Ensure 'Database Mail XPs' Server Configuration Option is set to '0'" + description: "The Database Mail XPs option controls the ability to generate and transmit email messages from SQL Server." + rationale: "Disabling the Database Mail XPs option reduces the SQL Server surface, eliminates a DOS attack vector and channel to exfiltrate data from the database server to a remote host." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Database Mail XPs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/database-mail/database-mail' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Database Mail XPs';\" -> r:0\\s+0" + +# 2.5 Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + - id: 12004 + title: "Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0'" + description: "The Ole Automation Procedures option controls whether OLE Automation objects can be instantiated within Transact-SQL batches. These are extended stored procedures that allow SQL Server users to execute functions external to SQL Server." + rationale: "Enabling this option will increase the attack surface of SQL Server and allow users to execute functions in the security context of SQL Server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ole Automation Procedures', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.5"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ole Automation Procedures';\" -> r:0\\s+0" + +# 2.6 Ensure 'Remote Access' Server Configuration Option is set to '0' + - id: 12005 + title: "Ensure 'Remote Access' Server Configuration Option is set to '0'" + description: "The remote access option controls the execution of local stored procedures on remote servers or remote stored procedures on local server." + rationale: "Functionality can be abused to launch a Denial-of-Service (DoS) attack on remote servers by off-loading query processing to a target." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'remote access', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-remote-access-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote access';\" -> r:0\\s+0" + +# 2.7 Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' (Scored) + - id: 12006 + title: "Ensure 'Remote Admin Connections' Server Configuration Option is set to '0'" + description: "The remote admin connections option controls whether a client application on a remote computer can use the Dedicated Administrator Connection (DAC)." + rationale: "The Dedicated Administrator Connection (DAC) lets an administrator access a running server to execute diagnostic functions or Transact-SQL statements, or to troubleshoot problems on the server, even when the server is locked or running in an abnormal state and not responding to a SQL Server Database Engine connection. In a cluster scenario, the administrator may not actually be logged on to the same node that is currently hosting the SQL Server instance and thus is considered \"remote\". Therefore, this setting should usually be enabled ( 1 ) for SQL Server failover clusters; otherwise it should be disabled ( 0 ) which is the default." + remediation: "Run the following T-SQL command on non-clustered installations: EXECUTE sp_configure 'remote admin connections', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"USE master; SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote admin connections' AND SERVERPROPERTY('IsClustered') = 0;\" -> r:0\\s*\\t*0|0 rows affected" + +# 2.8 Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' (Scored) + - id: 12007 + title: "Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0'" + description: "The scan for startup procs option, if enabled, causes SQL Server to scan for and automatically run all stored procedures that are set to execute upon service startup." + rationale: "Enforcing this control reduces the threat of an entity leveraging these facilities for malicious purposes." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'scan for startup procs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.8"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-scan-for-startup-procs-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'scan for startup procs';\" -> r:0\\s+0" + +# 2.9 Ensure 'Trustworthy' Database Property is set to 'Off' (Scored) + - id: 12008 + title: "Ensure 'Trustworthy' Database Property is set to 'Off'" + description: "The TRUSTWORTHY database option allows database objects to access objects in other databases under certain circumstances." + rationale: "Provides protection from malicious CLR assemblies or extended procedures." + remediation: "Execute the following T-SQL statement against the databases (replace below) returned by the Audit Procedure: ALTER DATABASE [] SET TRUSTWORTHY OFF;" + compliance: + - cis: ["2.9"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/trustworthy-database-property' + - 'https://support.microsoft.com/it-it/help/2183687/guidelines-for-using-the-trustworthy-database-setting-in-sql-server' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name FROM sys.databases WHERE is_trustworthy_on = 1 AND name != 'msdb';\" -> r:0 rows affected" + +# 2.11 Ensure SQL Server is configured to use non-standard ports (Not Scored) + - id: 12009 + title: "Ensure SQL Server is configured to use non-standard ports" + description: "If enabled, the default SQL Server instance will be assigned a default port of TCP:1433 for TCP/IP communication. Administrators can also configure named instances to use TCP:1433 for communication. TCP:1433 is a widely known SQL Server port and this port assignment should be changed." + rationale: "Using a non-default port helps protect the database from attacks directed to the default port." + remediation: "1: In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for , and then double-click the TCP/IP or VIA protocol. 2: In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1 , IP2 , up to IPAll . One of these is for the IP address of the loopback adapter, 127.0.0.1 . Additional IP addresses appear for each IP Address on the computer. 3: Change the TCP Port field from 1433 to another non-standard port or leave the TCP Port field empty and set the TCP Dynamic Ports value to 0 to enable dynamic port assignment and then click OK. 4: In the console pane, click SQL Server Services. 5: In the details pane, right-click SQL Server () and then click Restart, to stop and restart SQL Server." + compliance: + - cis: ["2.11"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port' + condition: none + rules: + - "c:sqlcmd -Q \"DECLARE @value nvarchar(256); EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll', N'TcpPort', @value OUTPUT, N'no_output'; SELECT @value AS TCP_Port WHERE @value = '1433'; \" -> r:1433" + +# 2.13 Ensure 'sa' Login Account is set to 'Disabled' (Scored) + - id: 12010 + title: "Ensure 'sa' Login Account is set to 'Disabled'" + description: "The sa account is a widely known and often widely used SQL Server account with sysadmin privileges. This is the original login created during installation and always has the principal_id=1 and sid=0x01 ." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal." + remediation: "Execute the following T-SQL query: USE [master] GO DECLARE @tsql nvarchar(max) SET @tsql = 'ALTER LOGIN ' + SUSER_NAME(0x01) + ' DISABLE' EXEC (@tsql) GO" + compliance: + - cis: ["2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-principals-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, is_disabled FROM sys.server_principals WHERE sid = 0x01 AND is_disabled = 0;\" -> r:0 rows affected" + +# 2.14 Ensure 'sa' Login Account has been renamed (Scored) + - id: 12011 + title: "Ensure 'sa' Login Account has been renamed" + description: "The sa account is a widely known and often widely used SQL Server login with sysadmin privileges. The sa login is the original login created during installation and always has principal_id=1 and sid=0x01 ." + rationale: "It is more difficult to launch password-guessing and brute-force attacks against the sa login if the name is not known." + remediation: "Replace the value within the below syntax and execute to rename the sa login. ALTER LOGIN sa WITH NAME = ;" + compliance: + - cis: ["2.14"] + - cis_csc: ["5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode' + condition: none + rules: + - "c:sqlcmd -Q \"SELECT name FROM sys.server_principals WHERE sid = 0x01;\" -> r:sa" + +# 2.15 Ensure 'xp_cmdshell' Server Configuration Option is set to '0' + - id: 12012 + title: "Ensure 'xp_cmdshell' Server Configuration Option is set to '0'" + description: "The xp_cmdshell option controls whether the xp_cmdshell extended stored procedure can be used by an authenticated SQL Server user to execute operating-system command shell commands and return results as rows within the SQL client." + rationale: "The xp_cmdshell procedure is commonly used by attackers to read or write data to/from the underlying Operating System of a database server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'xp_cmdshell', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.15"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/xp-cmdshell-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'xp_cmdshell';\" -> r:0\\s+0" + +# 2.16 Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + - id: 12013 + title: "Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases" + description: "AUTO_CLOSE determines if a given database is closed or not after a connection terminates. If enabled, subsequent connections to the given database will require the database to be reopened and relevant procedure caches to be rebuilt." + rationale: "Because authentication of users for contained databases occurs within the database not at the server\\instance level, the database must be opened every time to authenticate a user. The frequent opening/closing of the database consumes additional server resources and may contribute to a denial of service." + remediation: "Execute the following T-SQL, replacing with each database name found by the Audit Procedure: ALTER DATABASE SET AUTO_CLOSE OFF;" + compliance: + - cis: ["2.16"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/databases/security-best-practices-with-contained-databases' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0 and is_auto_close_on = 1;\" -> r:0 rows affected" + +# 2.17 Ensure no login exists with the name 'sa' (Scored) + - id: 12014 + title: "Ensure no login exists with the name 'sa'" + description: "The sa login (e.g. principal) is a widely known and often widely used SQL Server account. Therefore, there should not be a login called sa even when the original sa login ( principal_id = 0x01 ) has been renamed." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal name." + remediation: "Execute the appropriate ALTER or DROP statement below based on the principal_id returned for the login named sa . Replace the value within the below syntax and execute to rename the sa login. USE [master] GO -- If principal_id = 1 or the login owns database objects, rename the sa login ALTER LOGIN [sa] WITH NAME = ; GO -- If the login owns no database objects, then drop it -- Do NOT drop the login if it is principal_id = 1 DROP LOGIN sa" + compliance: + - cis: ["2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:sqlcmd -Q \"SELECT principal_id, name FROM sys.server_principals WHERE name = 'sa';\" -> r:0 rows affected" + +########################################################### +# 3 Authentication and Authorization +########################################################### +# 3.1 Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' (Scored) + - id: 12015 + title: "Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode'" + description: "Uses Windows Authentication to validate attempted connections." + rationale: "Windows provides a more robust authentication mechanism than SQL Server authentication." + remediation: "Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open the Object Explorer tab and connect to the target database instance. 3. Right click the instance name and select Properties. 4. Select the Security page from the left menu. 5. Set the Server authentication setting to Windows Authentication Mode. or T-SQL Method: Run the following T-SQL in a Query Window: USE [master] GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'LoginMode', REG_DWORD, 1 GO Restart the SQL Server service for the change to take effect." + compliance: + - cis: ["3.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-properties-security-page' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT SERVERPROPERTY('IsIntegratedSecurityOnly') as [login_mode];\" -> r:^1" + +# 3.8 Ensure only the default permissions specified by Microsoft are granted to the public server role (Scored) + - id: 12016 + title: "Ensure only the default permissions specified by Microsoft are granted to the public server role" + description: "public is a special fixed server role containing all logins. Unlike other fixed server roles, permissions can be changed for the public role. In keeping with the principle of least privileges, the public server role should not be used to grant permissions at the server scope as these would be inherited by all users." + rationale: "Every SQL Server login belongs to the public role and cannot be removed from this role. Therefore, any permissions granted to this role will be available to all logins unless they have been explicitly denied to specific logins or user-defined server roles." + remediation: "Add the extraneous permissions found in the Audit query results to the specific logins to user-defined server roles which require the access. Revoke the from the public role as shown below USE [master] GO REVOKE FROM public; GO" + compliance: + - cis: ["3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles' + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles#permissions-of-fixed-server-roles' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT * FROM master.sys.server_permissions WHERE (grantee_principal_id = SUSER_SID(N'public') and state_desc LIKE 'GRANT%') AND NOT (state_desc = 'GRANT' and [permission_name] = 'VIEW ANY DATABASE' and class_desc = 'SERVER') AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 2) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 3) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 4) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 5); \" -> r:0 rows affected" + + +# 3.10 Ensure Windows local groups are not SQL Logins (Scored) + - id: 12017 + title: "Ensure Windows local groups are not SQL Logins" + description: "Local Windows groups should not be used as logins for SQL Server instances." + rationale: "Allowing local Windows groups as SQL Logins provides a loophole whereby anyone with OS level administrator rights (and no SQL Server rights) could add users to the local Windows groups and thereby give themselves or others access to the SQL Server instance." + remediation: "1. For each LocalGroupName login, if needed create an equivalent AD group containing only the required user accounts. 2. Add the AD group or individual Windows accounts as a SQL Server login and grant it the permissions required. 3. Drop the LocalGroupName login using the syntax below after replacing . USE [master] GO DROP LOGIN [] GO" + compliance: + - cis: ["3.10"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + condition: all + rules: + - "c:sqlcmd -Q \"USE [master] SELECT pr.[name] AS LocalGroupName, pe.[permission_name], pe.[state_desc] FROM sys.server_principals pr JOIN sys.server_permissions pe ON pr.[principal_id] = pe.[grantee_principal_id] WHERE pr.[type_desc] = 'WINDOWS_GROUP' AND pr.[name] like CAST(SERVERPROPERTY('MachineName') AS nvarchar) + '%';\" -> r:0 rows affected" + + +########################################################### +# 4 Password Policies +########################################################### +# 4.2 Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role (Scored) + - id: 12018 + title: "Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role" + description: "Applies the same password expiration policy used in Windows to passwords used inside SQL Server." + rationale: "Ensuring SQL logins comply with the secure password policy applied by the Windows Server Benchmark will ensure the passwords for SQL logins with sysadmin privileges are changed on a frequent basis to help prevent compromise via a brute force attack. CONTROL SERVER is an equivalent permission to sysadmin and logins with that permission should also be required to have expiring passwords." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_EXPIRATION = ON;" + compliance: + - cis: ["4.2"] + - cis_csc: ["16.2, 16.10"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'http://msdn.microsoft.com/en-us/library/ms161959(v=sql.120).aspx' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT l.[name], 'sysadmin membership' AS 'Access_Method' FROM sys.sql_logins AS l WHERE IS_SRVROLEMEMBER('sysadmin',name) = 1 AND l.is_expiration_checked <> 1 UNION ALL SELECT l.[name], 'CONTROL SERVER' AS 'Access_Method' FROM sys.sql_logins AS l JOIN sys.server_permissions AS p ON l.principal_id = p.grantee_principal_id WHERE p.type = 'CL' AND p.state IN ('G', 'W') AND l.is_expiration_checked <> 1;\" -> r:0 rows affected" + +# 4.3 Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins (Scored) + - id: 12019 + title: "Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins" + description: "Applies the same password complexity policy used in Windows to passwords used insideSQL Server." + rationale: "Ensure SQL authenticated login passwords comply with the secure password policy applied by the Windows Server Benchmark so that they cannot be easily compromised via brute force attack." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_POLICY = ON; Note: In the case of AWS RDS do not perform this remediation for the Master account." + compliance: + - cis: ["4.3"] + - cis_csc: ["16, 4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'http://msdn.microsoft.com/en-us/library/ms161959(v=sql.120).aspx' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, is_disabled FROM sys.sql_logins WHERE is_policy_checked = 0;\" -> r:0 rows affected" + +########################################################## +# 5 Auditing and Logging +########################################################## +# 5.1 Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + - id: 12020 + title: "Ensure 'Maximum number of error log files' is set to greater than or equal to '12'" + description: "SQL Server error log files must be protected from loss. The log files must be backed up before they are overwritten. Retaining more error logs helps prevent loss from frequent recycling before backups can occur." + rationale: "The SQL Server error log contains important information about major server events and login attempt information as well." + remediation: "Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient for a production environment. Perform either the GUI or T-SQL method shown: GUI Method 1. Open SQL Server Management Studio. 2. Open Object Explorer and connect to the target instance. 3. Navigate to the Management tab in Object Explorer and expand. Right click on the SQL Server Logs file and select Configure 4. Check the Limit the number of error log files before they are recycled 5. Set the Maximum number of error log files to greater than or equal to 12 T-SQL Method Run the following T-SQL to change the number of error log files, replace with your desired number of error log files: EXEC master.sys.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', REG_DWORD, ;" + compliance: + - cis: ["5.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + references: + - 'http://msdn.microsoft.com/en-us/library/ms177285(v=sql.120).aspx' + condition: all + rules: + - "c:sqlcmd -Q \"DECLARE @NumErrorLogs int; EXEC master.sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', @NumErrorLogs OUTPUT; SELECT ISNULL(@NumErrorLogs, -1) AS [NumberOfLogFiles];\" -> n:^\\s*(\\d+) compare >= 12" + +# 5.2 Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' (Scored) + - id: 12021 + title: "Ensure 'Default Trace Enabled' Server Configuration Option is set to '1'" + description: "The default trace provides audit logging of database activity including account creations, privilege elevation and execution of DBCC commands." + rationale: "Default trace provides valuable audit information regarding security-related activities on the server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'default trace enabled', 1; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/default-trace-enabled-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'default trace enabled';\" -> r:1\\s+1" + + + +########################################################### +# 6 Application Development +########################################################### +# 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies (Scored) + - id: 12022 + title: "Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies" + description: "Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies from accessing external system resources such as files, the network, environment variables, or the registry." + rationale: "Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access sensitive areas of the operating system, steal and/or transmit data and alter the state and other protection measures of the underlying Windows Operating System. Assemblies which are Microsoft-created ( is_user_defined = 0 ) are excluded from this check as they are required for overall system functionality." + remediation: "ALTER ASSEMBLY WITH PERMISSION_SET = SAFE;" + compliance: + - cis: ["6.2"] + - cis_csc: ["18"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - 'http://msdn.microsoft.com/en-us/library/ms345101(v=sql.120).aspx' + - 'http://msdn.microsoft.com/en-us/library/ms189790(v=sql.120).aspx' + - 'http://msdn.microsoft.com/en-us/library/ms186711(v=sql.120).aspx' + condition: none + rules: + - "c:sqlcmd -Q \"SELECT name, permission_set_desc FROM sys.assemblies WHERE is_user_defined = 1;\" -> r:EXTERNAL_ACCESS|UNSAFE" diff --git a/sca/applications/cis_sqlserver_2017.yml b/sca/applications/cis_sqlserver_2017.yml new file mode 100644 index 000000000..3b290ab51 --- /dev/null +++ b/sca/applications/cis_sqlserver_2017.yml @@ -0,0 +1,462 @@ +# Security Configuration Assessment +# CIS Microsoft SQL Server 2017 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on Center for Internet Security Benchmark for Microsoft SQL Server 2017 v1.1.0 - 05-31-2019 + +policy: + id: "cis_sqlserver_2017" + file: "cis_sqlserver_2017.yml" + name: "CIS Microsoft SQL Server 2017" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft SQL Server 2017." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform has Microsoft SQL Server 2017" + description: "Requirements for running the CIS Microsoft SQL Server 2017 Benchmark" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows' + + +checks: + +###################################################### +# 2 Surface Area Reduction +###################################################### +# 2.1 Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' (Scored) + - id: 13000 + title: "Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0'" + description: "Enabling Ad Hoc Distributed Queries allows users to query data and execute statements on external data sources. This functionality should be disabled." + rationale: "This feature can be used to remotely access and exploit vulnerabilities on remote SQL Server instances and to run unsafe Visual Basic for Application functions." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ad Hoc Distributed Queries' ;\" -> r:Ad Hoc Distributed Queries\\s+0\\s+0" + +# 2.2 Ensure 'CLR Enabled' Server Configuration Option is set to '0' (Scored) + - id: 13001 + title: "Ensure 'CLR Enabled' Server Configuration Option is set to '0'" + description: "The clr enabled option specifies whether user assemblies can be run by SQL Server." + rationale: "Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk from both inadvertent and malicious assemblies." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'clr enabled', 0; RECONFIGURE;" + compliance: + - cis: ["2.2"] + - cis_csc: ["18.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/t-sql/statements/create-assembly-transact-sql' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'clr enabled';\" -> r:0\\s+0" + + +# 2.3 Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + - id: 13002 + title: "Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0'" + description: "The cross db ownership chaining option controls cross-database ownership chaining across all databases at the instance (or server) level." + rationale: "When enabled, this option allows a member of the db_owner role in a database to gain access to objects owned by a login in any other database, causing an unnecessary information disclosure. When required, cross-database ownership chaining should only be enabled for the specific databases requiring it instead of at the instance level for all databases by using the ALTER DATABASE SET DB_CHAINING ON command. This database option may not be changed on the master , model , or tempdb system databases." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'cross db ownership chaining', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'cross db ownership chaining';\" -> r:0\\s+0" + + +# 2.4 Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + - id: 13003 + title: "Ensure 'Database Mail XPs' Server Configuration Option is set to '0'" + description: "The Database Mail XPs option controls the ability to generate and transmit email messages from SQL Server." + rationale: "Disabling the Database Mail XPs option reduces the SQL Server surface, eliminates a DOS attack vector and channel to exfiltrate data from the database server to a remote host." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Database Mail XPs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/database-mail/database-mail' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Database Mail XPs';\" -> r:0\\s+0" + +# 2.5 Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + - id: 13004 + title: "Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0'" + description: "The Ole Automation Procedures option controls whether OLE Automation objects can be instantiated within Transact-SQL batches. These are extended stored procedures that allow SQL Server users to execute functions external to SQL Server." + rationale: "Enabling this option will increase the attack surface of SQL Server and allow users to execute functions in the security context of SQL Server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ole Automation Procedures', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.5"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ole Automation Procedures';\" -> r:0\\s+0" + +# 2.6 Ensure 'Remote Access' Server Configuration Option is set to '0' + - id: 13005 + title: "Ensure 'Remote Access' Server Configuration Option is set to '0'" + description: "The remote access option controls the execution of local stored procedures on remote servers or remote stored procedures on local server." + rationale: "Functionality can be abused to launch a Denial-of-Service (DoS) attack on remote servers by off-loading query processing to a target." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'remote access', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-remote-access-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote access';\" -> r:0\\s+0" + +# 2.7 Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' (Scored) + - id: 13006 + title: "Ensure 'Remote Admin Connections' Server Configuration Option is set to '0'" + description: "The remote admin connections option controls whether a client application on a remote computer can use the Dedicated Administrator Connection (DAC)." + rationale: "The Dedicated Administrator Connection (DAC) lets an administrator access a running server to execute diagnostic functions or Transact-SQL statements, or to troubleshoot problems on the server, even when the server is locked or running in an abnormal state and not responding to a SQL Server Database Engine connection. In a cluster scenario, the administrator may not actually be logged on to the same node that is currently hosting the SQL Server instance and thus is considered \"remote\". Therefore, this setting should usually be enabled ( 1 ) for SQL Server failover clusters; otherwise it should be disabled ( 0 ) which is the default." + remediation: "Run the following T-SQL command on non-clustered installations: EXECUTE sp_configure 'remote admin connections', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"USE master; SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote admin connections' AND SERVERPROPERTY('IsClustered') = 0;\" -> r:0\\s*\\t*0|0 rows affected" + +# 2.8 Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' (Scored) + - id: 13007 + title: "Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0'" + description: "The scan for startup procs option, if enabled, causes SQL Server to scan for and automatically run all stored procedures that are set to execute upon service startup." + rationale: "Enforcing this control reduces the threat of an entity leveraging these facilities for malicious purposes." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'scan for startup procs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.8"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-scan-for-startup-procs-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'scan for startup procs';\" -> r:0\\s+0" + +# 2.9 Ensure 'Trustworthy' Database Property is set to 'Off' (Scored) + - id: 13008 + title: "Ensure 'Trustworthy' Database Property is set to 'Off'" + description: "The TRUSTWORTHY database option allows database objects to access objects in other databases under certain circumstances." + rationale: "Provides protection from malicious CLR assemblies or extended procedures." + remediation: "Execute the following T-SQL statement against the databases (replace below) returned by the Audit Procedure: ALTER DATABASE [] SET TRUSTWORTHY OFF;" + compliance: + - cis: ["2.9"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/trustworthy-database-property' + - 'https://support.microsoft.com/it-it/help/2183687/guidelines-for-using-the-trustworthy-database-setting-in-sql-server' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name FROM sys.databases WHERE is_trustworthy_on = 1 AND name != 'msdb';\" -> r:0 rows affected" + +# 2.11 Ensure SQL Server is configured to use non-standard ports (Not Scored) + - id: 13009 + title: "Ensure SQL Server is configured to use non-standard ports" + description: "If installed, a default SQL Server instance will be assigned a default port of TCP:1433 for TCP/IP communication. Administrators can also configure named instances to use TCP:1433 for communication TCP:1433 is a widely known SQL Server port and this port assignment should be changed. In a multi-instance scenario, each instance must be assigned its own dedicated TCP/IP port." + rationale: "Using a non-default port helps protect the database from attacks directed to the default port." + remediation: "1: In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for , and then double-click the TCP/IP protocol. 2: In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1 , IP2 , up to IPAll . One of these is for the IP address of the loopback adapter, 127.0.0.1 . Additional IP addresses appear for each IP Address on the computer. 3: Under IPALL, change the TCP Port field from 1433 to a non-standard port or leave the TCP Port field empty and set the TCP Dynamic Ports value to 0 to enable dynamic port assignment and then click OK. 4: In the console pane, click SQL Server Services. 5: In the details pane, right-click SQL Server () and then click Restart, to stop and restart SQL Server." + compliance: + - cis: ["2.11"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port' + condition: none + rules: + - "c:sqlcmd -Q \"DECLARE @value nvarchar(256); EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll', N'TcpPort', @value OUTPUT, N'no_output'; SELECT @value AS TCP_Port WHERE @value = '1433'; \" -> r:1433" + +# 2.13 Ensure the 'sa' Login Account is set to 'Disabled' (Scored) + - id: 13010 + title: "Ensure the 'sa' Login Account is set to 'Disabled'" + description: "The sa account is a widely known and often widely used SQL Server account with sysadmin privileges. This is the original login created during installation and always has the principal_id=1 and sid=0x01 ." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal." + remediation: "Execute the following T-SQL query: USE [master] GO DECLARE @tsql nvarchar(max) SET @tsql = 'ALTER LOGIN ' + SUSER_NAME(0x01) + ' DISABLE' EXEC (@tsql) GO" + compliance: + - cis: ["2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-principals-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, is_disabled FROM sys.server_principals WHERE sid = 0x01 AND is_disabled = 0;\" -> r:0 rows affected" + +# 2.14 Ensure the 'sa' Login Account has been renamed (Scored) + - id: 13011 + title: "Ensure the 'sa' Login Account has been renamed" + description: "The sa account is a widely known and often widely used SQL Server login with sysadmin privileges. The sa login is the original login created during installation and always has principal_id=1 and sid=0x01 ." + rationale: "It is more difficult to launch password-guessing and brute-force attacks against the sa login if the name is not known." + remediation: "Replace the value within the below syntax and execute to rename the sa login. ALTER LOGIN sa WITH NAME = ;" + compliance: + - cis: ["2.14"] + - cis_csc: ["5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode' + condition: none + rules: + - "c:sqlcmd -Q \"SELECT name FROM sys.server_principals WHERE sid = 0x01;\" -> r:sa" + +# 2.15 Ensure 'xp_cmdshell' Server Configuration Option is set to '0' + - id: 13012 + title: "Ensure 'xp_cmdshell' Server Configuration Option is set to '0'" + description: "The xp_cmdshell option controls whether the xp_cmdshell extended stored procedure can be used by an authenticated SQL Server user to execute operating-system command shell commands and return results as rows within the SQL client." + rationale: "The xp_cmdshell procedure is commonly used by attackers to read or write data to/from the underlying Operating System of a database server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'xp_cmdshell', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.15"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/xp-cmdshell-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'xp_cmdshell';\" -> r:0\\s+0" + +# 2.16 Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + - id: 13013 + title: "Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases" + description: "AUTO_CLOSE determines if a given database is closed or not after a connection terminates. If enabled, subsequent connections to the given database will require the database to be reopened and relevant procedure caches to be rebuilt." + rationale: "Because authentication of users for contained databases occurs within the database not at the server\\instance level, the database must be opened every time to authenticate a user. The frequent opening/closing of the database consumes additional server resources and may contribute to a denial of service." + remediation: "Execute the following T-SQL, replacing with each database name found by the Audit Procedure: ALTER DATABASE SET AUTO_CLOSE OFF;" + compliance: + - cis: ["2.16"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/databases/security-best-practices-with-contained-databases' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0 and is_auto_close_on = 1;\" -> r:0 rows affected" + +# 2.17 Ensure no login exists with the name 'sa' (Scored) + - id: 13014 + title: "Ensure no login exists with the name 'sa'" + description: "The sa login (e.g. principal) is a widely known and often widely used SQL Server account. Therefore, there should not be a login called sa even when the original sa login ( principal_id = 1 ) has been renamed." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal name." + remediation: "Execute the appropriate ALTER or DROP statement below based on the principal_id returned for the login named sa . Replace the value within the below syntax and execute to rename the sa login. USE [master] GO -- If principal_id = 1 or the login owns database objects, rename the sa login ALTER LOGIN [sa] WITH NAME = ; GO -- If the login owns no database objects, then drop it -- Do NOT drop the login if it is principal_id = 1 DROP LOGIN sa" + compliance: + - cis: ["2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:sqlcmd -Q \"SELECT principal_id, name FROM sys.server_principals WHERE name = 'sa';\" -> r:0 rows affected" + +########################################################### +# 3 Authentication and Authorization +########################################################### +# 3.1 Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' (Scored) + - id: 13015 + title: "Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode'" + description: "Uses Windows Authentication to validate attempted connections." + rationale: "Windows provides a more robust authentication mechanism than SQL Server authentication." + remediation: "Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open the Object Explorer tab and connect to the target database instance. 3. Right click the instance name and select Properties. 4. Select the Security page from the left menu. 5. Set the Server authentication setting to Windows Authentication Mode. or T-SQL Method: Run the following T-SQL in a Query Window: USE [master] GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'LoginMode', REG_DWORD, 1 GO Restart the SQL Server service for the change to take effect." + compliance: + - cis: ["3.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-properties-security-page' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT SERVERPROPERTY('IsIntegratedSecurityOnly') as [login_mode];\" -> r:^1" + +# 3.8 Ensure only the default permissions specified by Microsoft are granted to the public server role (Scored) + - id: 13016 + title: "Ensure only the default permissions specified by Microsoft are granted to the public server role" + description: "public is a special fixed server role containing all logins. Unlike other fixed server roles, permissions can be changed for the public role. In keeping with the principle of least privileges, the public server role should not be used to grant permissions at the server scope as these would be inherited by all users." + rationale: "Every SQL Server login belongs to the public role and cannot be removed from this role. Therefore, any permissions granted to this role will be available to all logins unless they have been explicitly denied to specific logins or user-defined server roles." + remediation: "Add the extraneous permissions found in the Audit query results to the specific logins to user-defined server roles which require the access. Revoke the __ from the public role as shown below USE [master] GO REVOKE FROM public; GO" + compliance: + - cis: ["3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles' + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles#permissions-of-fixed-server-roles' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT * FROM master.sys.server_permissions WHERE (grantee_principal_id = SUSER_SID(N'public') and state_desc LIKE 'GRANT%') AND NOT (state_desc = 'GRANT' and [permission_name] = 'VIEW ANY DATABASE' and class_desc = 'SERVER') AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 2) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 3) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 4) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 5); \" -> r:0 rows affected" + + +# 3.10 Ensure Windows local groups are not SQL Logins (Scored) + - id: 13017 + title: "Ensure Windows local groups are not SQL Logins" + description: "Local Windows groups should not be used as logins for SQL Server instances." + rationale: "Allowing local Windows groups as SQL Logins provides a loophole whereby anyone with OS level administrator rights (and no SQL Server rights) could add users to the local Windows groups and thereby give themselves or others access to the SQL Server instance." + remediation: "1. For each LocalGroupName login, if needed create an equivalent AD group containing only the required user accounts. 2. Add the AD group or individual Windows accounts as a SQL Server login and grant it the permissions required. 3. Drop the LocalGroupName login using the syntax below after replacing . USE [master] GO DROP LOGIN [] GO" + compliance: + - cis: ["3.10"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + condition: all + rules: + - "c:sqlcmd -Q \"USE [master] SELECT pr.[name] AS LocalGroupName, pe.[permission_name], pe.[state_desc] FROM sys.server_principals pr JOIN sys.server_permissions pe ON pr.[principal_id] = pe.[grantee_principal_id] WHERE pr.[type_desc] = 'WINDOWS_GROUP' AND pr.[name] like CAST(SERVERPROPERTY('MachineName') AS nvarchar) + '%';\" -> r:0 rows affected" + + +########################################################### +# 4 Password Policies +########################################################### +# 4.2 Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role (Scored) + - id: 13018 + title: "Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role" + description: "Applies the same password expiration policy used in Windows to passwords used inside SQL Server." + rationale: "Ensuring SQL logins comply with the secure password policy applied by the Windows Server Benchmark will ensure the passwords for SQL logins with sysadmin privileges are changed on a frequent basis to help prevent compromise via a brute force attack. CONTROL SERVER is an equivalent permission to sysadmin and logins with that permission should also be required to have expiring passwords." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_EXPIRATION = ON;" + compliance: + - cis: ["4.2"] + - cis_csc: ["16.2, 16.10"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT l.[name], 'sysadmin membership' AS 'Access_Method' FROM sys.sql_logins AS l WHERE IS_SRVROLEMEMBER('sysadmin',name) = 1 AND l.is_expiration_checked <> 1 UNION ALL SELECT l.[name], 'CONTROL SERVER' AS 'Access_Method' FROM sys.sql_logins AS l JOIN sys.server_permissions AS p ON l.principal_id = p.grantee_principal_id WHERE p.type = 'CL' AND p.state IN ('G', 'W') AND l.is_expiration_checked <> 1;\" -> r:0 rows affected" + +# 4.3 Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins (Scored) + - id: 13019 + title: "Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins" + description: "Applies the same password complexity policy used in Windows to passwords used insideSQL Server." + rationale: "Ensure SQL authenticated login passwords comply with the secure password policy applied by the Windows Server Benchmark so that they cannot be easily compromised via brute force attack." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_POLICY = ON; Note: In the case of AWS RDS do not perform this remediation for the Master account." + compliance: + - cis: ["4.3"] + - cis_csc: ["16, 4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, is_disabled FROM sys.sql_logins WHERE is_policy_checked = 0;\" -> r:0 rows affected" + +########################################################## +# 5 Auditing and Logging +########################################################## +# 5.1 Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + - id: 13020 + title: "Ensure 'Maximum number of error log files' is set to greater than or equal to '12'" + description: "SQL Server error log files must be protected from loss. The log files must be backed up before they are overwritten. Retaining more error logs helps prevent loss from frequent recycling before backups can occur." + rationale: "The SQL Server error log contains important information about major server events and login attempt information as well." + remediation: "Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient for a production environment. Perform either the GUI or T-SQL method shown: GUI Method 1. Open SQL Server Management Studio. 2. Open Object Explorer and connect to the target instance. 3. Navigate to the Management tab in Object Explorer and expand. Right click on the SQL Server Logs file and select Configure 4. Check the Limit the number of error log files before they are recycled 5. Set the Maximum number of error log files to greater than or equal to 12 T-SQL Method Run the following T-SQL to change the number of error log files, replace with your desired number of error log files: EXEC master.sys.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', REG_DWORD, ;" + compliance: + - cis: ["5.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/scm-services-configure-sql-server-error-logs' + condition: all + rules: + - "c:sqlcmd -Q \"DECLARE @NumErrorLogs int; EXEC master.sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', @NumErrorLogs OUTPUT; SELECT ISNULL(@NumErrorLogs, -1) AS [NumberOfLogFiles];\" -> n:^\\s*(\\d+) compare >= 12" + +# 5.2 Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' (Scored) + - id: 13021 + title: "Ensure 'Default Trace Enabled' Server Configuration Option is set to '1'" + description: "The default trace provides audit logging of database activity including account creations, privilege elevation and execution of DBCC commands." + rationale: "Default trace provides valuable audit information regarding security-related activities on the server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'default trace enabled', 1; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/default-trace-enabled-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'default trace enabled';\" -> r:1\\s+1" + + + +########################################################### +# 6 Application Development +########################################################### +# 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies (Scored) + - id: 13022 + title: "Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies" + description: "Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies from accessing external system resources such as files, the network, environment variables, or the registry." + rationale: "Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access sensitive areas of the operating system, steal and/or transmit data and alter the state and other protection measures of the underlying Windows Operating System. Assemblies which are Microsoft-created ( is_user_defined = 0 ) are excluded from this check as they are required for overall system functionality." + remediation: "ALTER ASSEMBLY WITH PERMISSION_SET = SAFE;" + compliance: + - cis: ["6.2"] + - cis_csc: ["18"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/security/clr-integration-code-access-security' + - 'https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-assemblies-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-assembly-transact-sql' + condition: none + rules: + - "c:sqlcmd -Q \"SELECT name, permission_set_desc FROM sys.assemblies WHERE is_user_defined = 1;\" -> r:EXTERNAL_ACCESS|UNSAFE" diff --git a/sca/applications/cis_sqlserver_2019.yml b/sca/applications/cis_sqlserver_2019.yml new file mode 100644 index 000000000..977d7526c --- /dev/null +++ b/sca/applications/cis_sqlserver_2019.yml @@ -0,0 +1,444 @@ +# Security Configuration Assessment +# CIS Microsoft SQL Server 2019 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on Center for Internet Security Benchmark for Microsoft SQL Server 2019 v1.4.0 - 05-31-2019 + +policy: + id: "cis_sqlserver_2019" + file: "cis_sqlserver_2019" + name: "CIS Microsoft SQL Server 2019" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft SQL Server 2019." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform has Microsoft SQL Server 2019" + description: "Requirements for running the CIS Microsoft SQL Server 2019 Benchmark" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows' + +variables: + $User: + +checks: + +###################################################### +# 2 Surface Area Reduction +###################################################### +# 2.1 Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' (Scored) + - id: 13500 + title: "Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0'" + description: "Enabling Ad Hoc Distributed Queries allows users to query data and execute statements on external data sources. This functionality should be disabled." + rationale: "This feature can be used to remotely access and exploit vulnerabilities on remote SQL Server instances and to run unsafe Visual Basic for Application functions." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ad Hoc Distributed Queries' ;\" -> r:Ad Hoc Distributed Queries\\s+0\\s+0" + +# 2.2 Ensure 'CLR Enabled' Server Configuration Option is set to '0' (Scored) + - id: 13501 + title: "Ensure 'CLR Enabled' Server Configuration Option is set to '0'" + description: "The clr enabled option specifies whether user assemblies can be run by SQL Server." + rationale: "Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk from both inadvertent and malicious assemblies." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'clr enabled', 0; RECONFIGURE;" + compliance: + - cis: ["2.2"] + - cis_csc: ["18.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/t-sql/statements/create-assembly-transact-sql' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'clr enabled';\" -> r:0\\s+0" + + +# 2.3 Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + - id: 13502 + title: "Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0'" + description: "The cross db ownership chaining option controls cross-database ownership chaining across all databases at the instance (or server) level." + rationale: "When enabled, this option allows a member of the db_owner role in a database to gain access to objects owned by a login in any other database, causing an unnecessary information disclosure. When required, cross-database ownership chaining should only be enabled for the specific databases requiring it instead of at the instance level for all databases by using the ALTER DATABASE SET DB_CHAINING ON command. This database option may not be changed on the master , model , or tempdb system databases." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'cross db ownership chaining', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'cross db ownership chaining';\" -> r:0\\s+0" + + +# 2.4 Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + - id: 13503 + title: "Ensure 'Database Mail XPs' Server Configuration Option is set to '0'" + description: "The Database Mail XPs option controls the ability to generate and transmit email messages from SQL Server." + rationale: "Disabling the Database Mail XPs option reduces the SQL Server surface, eliminates a DOS attack vector and channel to exfiltrate data from the database server to a remote host." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Database Mail XPs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/database-mail/database-mail' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Database Mail XPs';\" -> r:0\\s+0" + +# 2.5 Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + - id: 13504 + title: "Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0'" + description: "The Ole Automation Procedures option controls whether OLE Automation objects can be instantiated within Transact-SQL batches. These are extended stored procedures that allow SQL Server users to execute functions external to SQL Server." + rationale: "Enabling this option will increase the attack surface of SQL Server and allow users to execute functions in the security context of SQL Server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ole Automation Procedures', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.5"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ole Automation Procedures';\" -> r:0\\s+0" + +# 2.6 Ensure 'Remote Access' Server Configuration Option is set to '0' + - id: 13505 + title: "Ensure 'Remote Access' Server Configuration Option is set to '0'" + description: "The remote access option controls the execution of local stored procedures on remote servers or remote stored procedures on local server." + rationale: "Functionality can be abused to launch a Denial-of-Service (DoS) attack on remote servers by off-loading query processing to a target." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'remote access', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-remote-access-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote access';\" -> r:0\\s+0" + +# 2.7 Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' (Scored) + - id: 13506 + title: "Ensure 'Remote Admin Connections' Server Configuration Option is set to '0'" + description: "The remote admin connections option controls whether a client application on a remote computer can use the Dedicated Administrator Connection (DAC)." + rationale: "The Dedicated Administrator Connection (DAC) lets an administrator access a running server to execute diagnostic functions or Transact-SQL statements, or to troubleshoot problems on the server, even when the server is locked or running in an abnormal state and not responding to a SQL Server Database Engine connection. In a cluster scenario, the administrator may not actually be logged on to the same node that is currently hosting the SQL Server instance and thus is considered \"remote\". Therefore, this setting should usually be enabled ( 1 ) for SQL Server failover clusters; otherwise it should be disabled ( 0 ) which is the default." + remediation: "Run the following T-SQL command on non-clustered installations: EXECUTE sp_configure 'remote admin connections', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"USE master; SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote admin connections' AND SERVERPROPERTY('IsClustered') = 0;\" -> r:0\\s*\\t*0|0 rows affected" + +# 2.8 Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' (Scored) + - id: 13507 + title: "Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0'" + description: "The scan for startup procs option, if enabled, causes SQL Server to scan for and automatically run all stored procedures that are set to execute upon service startup." + rationale: "Enforcing this control reduces the threat of an entity leveraging these facilities for malicious purposes." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'scan for startup procs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.8"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-scan-for-startup-procs-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'scan for startup procs';\" -> r:0\\s+0" + +# 2.9 Ensure 'Trustworthy' Database Property is set to 'Off' (Scored) + - id: 13508 + title: "Ensure 'Trustworthy' Database Property is set to 'Off'" + description: "The TRUSTWORTHY database option allows database objects to access objects in other databases under certain circumstances." + rationale: "Provides protection from malicious CLR assemblies or extended procedures." + remediation: "Execute the following T-SQL statement against the databases (replace below) returned by the Audit Procedure: ALTER DATABASE [] SET TRUSTWORTHY OFF;" + compliance: + - cis: ["2.9"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/trustworthy-database-property' + - 'https://support.microsoft.com/it-it/help/2183687/guidelines-for-using-the-trustworthy-database-setting-in-sql-server' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name FROM sys.databases WHERE is_trustworthy_on = 1 AND name != 'msdb';\" -> r:0 rows affected" + +# 2.11 Ensure SQL Server is configured to use non-standard ports (Not Scored) + - id: 13509 + title: "Ensure SQL Server is configured to use non-standard ports" + description: "If installed, the default SQL Server instance will be assigned a default port of TCP:1433 for TCP/IP communication. Administrators can also manually configure named instances to use TCP:1433 for communication. TCP:1433 is a widely known SQL Server port and this port assignment should be changed. In a multi-instance scenario, each instance must be assigned its own TCP/IP port." + rationale: "Using a non-default port helps protect the database from attacks directed to the default port." + remediation: "1: In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for , and then double-click the TCP/IP protocol. 2: In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1 , IP2 , up to IPAll . One of these is for the IP address of the loopback adapter, 127.0.0.1 . Additional IP addresses appear for each IP Address on the computer. 3: Under IPALL, change the TCP Port field from 1433 to another non-standard port or leave the TCP Port field empty and set the TCP Dynamic Ports value to 0 to enable dynamic port assignment and then click OK. 4: In the console pane, click SQL Server Services. 5: In the details pane, right-click SQL Server () and then click Restart, to stop and restart SQL Server." + compliance: + - cis: ["2.11"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port' + condition: none + rules: + - "c:sqlcmd -Q \"DECLARE @value nvarchar(256); EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll', N'TcpPort', @value OUTPUT, N'no_output'; SELECT @value AS TCP_Port WHERE @value = '1433'; \" -> r:1433" + +# 2.13 Ensure the 'sa' Login Account is set to 'Disabled' (Scored) + - id: 13510 + title: "Ensure the 'sa' Login Account is set to 'Disabled'" + description: "The sa account is a widely known and often widely used SQL Server account with sysadmin privileges. This is the original login created during installation and always has the principal_id=1 and sid=0x01 ." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal." + remediation: "Execute the following T-SQL query: USE [master] GO DECLARE @tsql nvarchar(max) SET @tsql = 'ALTER LOGIN ' + SUSER_NAME(0x01) + ' DISABLE' EXEC (@tsql) GO" + compliance: + - cis: ["2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-principals-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql' + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, is_disabled FROM sys.server_principals WHERE sid = 0x01 AND is_disabled = 0;\" -> r:0 rows affected" + +# 2.14 Ensure the 'sa' Login Account has been renamed (Scored) + - id: 13511 + title: "Ensure the 'sa' Login Account has been renamed" + description: "The sa account is a widely known and often widely used SQL Server login with sysadmin privileges. The sa login is the original login created during installation and always has principal_id=1 and sid=0x01 ." + rationale: "It is more difficult to launch password-guessing and brute-force attacks against the sa login if the name is not known." + remediation: "Replace the value within the below syntax and execute to rename the sa login. ALTER LOGIN sa WITH NAME = ;" + compliance: + - cis: ["2.14"] + - cis_csc: ["5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode' + condition: none + rules: + - "c:sqlcmd -Q \"SELECT name FROM sys.server_principals WHERE sid = 0x01;\" -> r:^sa" + +# 2.15 Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + - id: 13512 + title: "Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases" + description: "AUTO_CLOSE determines if a given database is closed or not after a connection terminates. If enabled, subsequent connections to the given database will require the database to be reopened and relevant procedure caches to be rebuilt." + rationale: "Because authentication of users for contained databases occurs within the database not at the server\\instance level, the database must be opened every time to authenticate a user. The frequent opening/closing of the database consumes additional server resources and may contribute to a denial of service." + remediation: "Execute the following T-SQL, replacing with each database name found by the Audit Procedure: ALTER DATABASE SET AUTO_CLOSE OFF;" + compliance: + - cis: ["2.15"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/databases/security-best-practices-with-contained-databases' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0 and is_auto_close_on = 1;\" -> r:0 rows affected" + +# 2.16 Ensure no login exists with the name 'sa' (Scored) + - id: 13513 + title: "Ensure no login exists with the name 'sa'" + description: "The sa login (e.g. principal) is a widely known and often widely used SQL Server account. Therefore, there should not be a login called sa even when the original sa login ( principal_id = 1 ) has been renamed." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal name." + remediation: "Execute the appropriate ALTER or DROP statement below based on the principal_id returned for the login named sa . Replace the value within the below syntax and execute to rename the sa login. USE [master] GO -- If principal_id = 1 or the login owns database objects, rename the sa login ALTER LOGIN [sa] WITH NAME = ; GO -- If the login owns no database objects, then drop it -- Do NOT drop the login if it is principal_id = 1 DROP LOGIN sa" + compliance: + - cis: ["2.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6","CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:sqlcmd -Q \"SELECT principal_id, name FROM sys.server_principals WHERE name = 'sa';\" -> r:0 rows affected" + +########################################################### +# 3 Authentication and Authorization +########################################################### +# 3.1 Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' (Scored) + - id: 13514 + title: "Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode'" + description: "Uses Windows Authentication to validate attempted connections." + rationale: "Windows provides a more robust authentication mechanism than SQL Server authentication." + remediation: "Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open the Object Explorer tab and connect to the target database instance. 3. Right click the instance name and select Properties. 4. Select the Security page from the left menu. 5. Set the Server authentication setting to Windows Authentication Mode. or T-SQL Method: Run the following T-SQL in a Query Window: USE [master] GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'LoginMode', REG_DWORD, 1 GO Restart the SQL Server service for the change to take effect." + compliance: + - cis: ["3.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-properties-security-page' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT SERVERPROPERTY('IsIntegratedSecurityOnly') as [login_mode];\" -> r:^1" + +# 3.8 Ensure only the default permissions specified by Microsoft are granted to the public server role (Scored) + - id: 13515 + title: "Ensure only the default permissions specified by Microsoft are granted to the public server role" + description: "public is a special fixed server role containing all logins. Unlike other fixed server roles, permissions can be changed for the public role. In keeping with the principle of least privileges, the public server role should not be used to grant permissions at the server scope as these would be inherited by all users." + rationale: "Every SQL Server login belongs to the public role and cannot be removed from this role. Therefore, any permissions granted to this role will be available to all logins unless they have been explicitly denied to specific logins or user-defined server roles." + remediation: "Add the extraneous permissions found in the Audit query results to the specific logins to user-defined server roles which require the access. Revoke the from the public role as shown below USE [master] GO REVOKE FROM public; GO" + compliance: + - cis: ["3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles' + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles#permissions-of-fixed-server-roles' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT * FROM master.sys.server_permissions WHERE (grantee_principal_id = SUSER_SID(N'public') and state_desc LIKE 'GRANT%') AND NOT (state_desc = 'GRANT' and [permission_name] = 'VIEW ANY DATABASE' and class_desc = 'SERVER') AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 2) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 3) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 4) AND NOT (state_desc = 'GRANT' and [permission_name] = 'CONNECT' and class_desc = 'ENDPOINT' and major_id = 5); \" -> r:0 rows affected" + + +# 3.10 Ensure Windows local groups are not SQL Logins (Scored) + - id: 13516 + title: "Ensure Windows local groups are not SQL Logins" + description: "Local Windows groups should not be used as logins for SQL Server instances." + rationale: "Allowing local Windows groups as SQL Logins provides a loophole whereby anyone with OS level administrator rights (and no SQL Server rights) could add users to the local Windows groups and thereby give themselves or others access to the SQL Server instance." + remediation: "1. For each LocalGroupName login, if needed create an equivalent AD group containing only the required user accounts. 2. Add the AD group or individual Windows accounts as a SQL Server login and grant it the permissions required. 3. Drop the LocalGroupName login using the syntax below after replacing . USE [master] GO DROP LOGIN [] GO" + compliance: + - cis: ["3.10"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + condition: all + rules: + - "c:sqlcmd -Q \"USE [master] SELECT pr.[name] AS LocalGroupName, pe.[permission_name], pe.[state_desc] FROM sys.server_principals pr JOIN sys.server_permissions pe ON pr.[principal_id] = pe.[grantee_principal_id] WHERE pr.[type_desc] = 'WINDOWS_GROUP' AND pr.[name] like CAST(SERVERPROPERTY('MachineName') AS nvarchar) + '%';\" -> r:0 rows affected" + +########################################################### +# 4 Password Policies +########################################################### +# 4.2 Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role (Scored) + - id: 13517 + title: "Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role" + description: "Applies the same password expiration policy used in Windows to passwords used inside SQL Server." + rationale: "Ensuring SQL logins comply with the secure password policy applied by the Windows Server Benchmark will ensure the passwords for SQL logins with sysadmin privileges are changed on a frequent basis to help prevent compromise via a brute force attack. CONTROL SERVER is an equivalent permission to sysadmin and logins with that permission should also be required to have expiring passwords." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_EXPIRATION = ON;" + compliance: + - cis: ["4.2"] + - cis_csc: ["16.2, 16.10"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT l.[name], 'sysadmin membership' AS 'Access_Method' FROM sys.sql_logins AS l WHERE IS_SRVROLEMEMBER('sysadmin',name) = 1 AND l.is_expiration_checked <> 1 UNION ALL SELECT l.[name], 'CONTROL SERVER' AS 'Access_Method' FROM sys.sql_logins AS l JOIN sys.server_permissions AS p ON l.principal_id = p.grantee_principal_id WHERE p.type = 'CL' AND p.state IN ('G', 'W') AND l.is_expiration_checked <> 1;\" -> r:0 rows affected" + +# 4.3 Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins (Scored) + - id: 13518 + title: "Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins" + description: "Applies the same password complexity policy used in Windows to passwords used insideSQL Server." + rationale: "Ensure SQL authenticated login passwords comply with the secure password policy applied by the Windows Server Benchmark so that they cannot be easily compromised via brute force attack." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_POLICY = ON; Note: In the case of AWS RDS do not perform this remediation for the Master account." + compliance: + - cis: ["4.3"] + - cis_csc: ["16, 4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, is_disabled FROM sys.sql_logins WHERE is_policy_checked = 0;\" -> r:0 rows affected" + +########################################################## +# 5 Auditing and Logging +########################################################## +# 5.1 Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + - id: 13519 + title: "Ensure 'Maximum number of error log files' is set to greater than or equal to '12'" + description: "SQL Server error log files must be protected from loss. The log files must be backed up before they are overwritten. Retaining more error logs helps prevent loss from frequent recycling before backups can occur." + rationale: "The SQL Server error log contains important information about major server events and login attempt information as well." + remediation: "Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient for a production environment. Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open Object Explorer and connect to the target instance. 3. Navigate to the Management tab in Object Explorer and expand. Right click on the SQL Server Logs file and select Configure 4. Check the Limit the number of error log files before they are recycled 5. Set the Maximum number of error log files to greater than or equal to 12. T-SQL Method: Run the following T-SQL to change the number of error log files, replace with your desired number of error log files: EXEC master.sys.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', REG_DWORD, ;" + compliance: + - cis: ["5.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + references: + - 'http://msdn.microsoft.com/en-us/library/ms177285(v=sql.120).aspx' + condition: all + rules: + - "c:sqlcmd -Q \"DECLARE @NumErrorLogs int; EXEC master.sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', @NumErrorLogs OUTPUT; SELECT ISNULL(@NumErrorLogs, -1) AS [NumberOfLogFiles];\" -> n:^\\s*(\\d+) compare >= 12" + +# 5.2 Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' (Scored) + - id: 13520 + title: "Ensure 'Default Trace Enabled' Server Configuration Option is set to '1'" + description: "The default trace provides audit logging of database activity including account creations, privilege elevation and execution of DBCC commands." + rationale: "Default trace provides valuable audit information regarding security-related activities on the server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'default trace enabled', 1; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/default-trace-enabled-server-configuration-option' + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'default trace enabled';\" -> r:1\\s+1" + + + +########################################################### +# 6 Application Development +########################################################### +# 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies (Scored) + - id: 13521 + title: "Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies" + description: "Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies from accessing external system resources such as files, the network, environment variables, or the registry." + rationale: "Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access sensitive areas of the operating system, steal and/or transmit data and alter the state and other protection measures of the underlying Windows Operating System. Assemblies which are Microsoft-created ( is_user_defined = 0 ) are excluded from this check as they are required for overall system functionality." + remediation: "ALTER ASSEMBLY WITH PERMISSION_SET = SAFE;" + compliance: + - cis: ["6.2"] + - cis_csc: ["18"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/security/clr-integration-code-access-security" + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-assemblies-transact-sql" + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-assembly-transact-sql" + condition: none + rules: + - "c:sqlcmd -Q \"SELECT name, permission_set_desc FROM sys.assemblies WHERE is_user_defined = 1;\" -> r:EXTERNAL_ACCESS|UNSAFE" diff --git a/sca/applications/web_vulnerabilities.yml b/sca/applications/web_vulnerabilities.yml index 5e5ce201d..442f3f6a1 100644 --- a/sca/applications/web_vulnerabilities.yml +++ b/sca/applications/web_vulnerabilities.yml @@ -30,32 +30,32 @@ variables: # PHP checks checks: - - id: 10500 + - id: 14000 title: "PHP - Ensure 'Register globals' are not enabled" condition: all rules: - 'f:$php.ini -> r:^register_globals\s*\t*=\s*\t*Off|register_globals\s*\t*=\s*\t*off' - - id: 10501 + - id: 14001 title: "PHP - Ensure 'Expose PHP' is not enabled" condition: all rules: - 'f:$php.ini -> r:^expose_php\s*\t*=\s*\t*Off|^expose_php\s*\t*=\s*\t*off' - - id: 10502 + - id: 14002 title: "PHP - Ensure 'Allow URL fopen' is not enabled" condition: all rules: - 'f:$php.ini -> r:^allow_url_fopen\s*\t*=\s*\t*Off|^allow_url_fopen\s*\t*=\s*\t*off' - - id: 10503 + - id: 14003 title: "PHP - Ensure 'Displaying of errors' is not enabled" condition: all rules: - 'f:$php.ini -> r:^display_errors\s*\t*=\s*\t*Off|^display_errors\s*\t*=\s*\t*off' # WEB checks - - id: 10504 + - id: 14004 title: "Web exploits: '.yop' is an uncommon file name inside htdocs - Possible compromise" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -65,7 +65,7 @@ checks: rules: - 'd:$web_dirs -> ^.yop$' - - id: 10505 + - id: 14005 title: "Web exploits: 'id' is an uncommon file name inside htdocs - Possible compromise" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -75,7 +75,7 @@ checks: rules: - 'd:$web_dirs -> ^id$' - - id: 10506 + - id: 14006 title: "Web exploits: '.ssh' is an uncommon file name inside htdocs" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -85,7 +85,7 @@ checks: rules: - 'd:$web_dirs -> ^.ssh$' - - id: 10507 + - id: 14007 title: "Web exploits: '...' is an uncommon file name inside htdocs - Possible compromise" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -95,7 +95,7 @@ checks: rules: - 'd:$web_dirs -> ^...$' - - id: 10508 + - id: 14008 title: "Web exploits: '.shell' is an uncommon file name inside htdocs - Possible compromise" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -106,7 +106,7 @@ checks: - 'd:$web_dirs -> ^.shell$' # Outdated Web applications - - id: 10509 + - id: 14009 title: "Web vulnerability - Outdated WordPress installation" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -116,7 +116,7 @@ checks: rules: - 'd:$web_dirs -> ^version.php$ -> r:^\.wp_version && r:4.4.2' - - id: 10510 + - id: 14010 title: "Web vulnerability - Outdated Joomla installation" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -126,7 +126,7 @@ checks: rules: - 'd:$web_dirs -> ^version.php$ -> r:var \.RELEASE && r:3.4.8' - - id: 10511 + - id: 14011 title: "Web vulnerability - Outdated osCommerce (v2.2) installation" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -137,7 +137,7 @@ checks: - 'd:$web_dirs -> ^application_top.php$ -> r:osCommerce && r:2.2-' # Known backdoors - - id: 10512 + - id: 14012 title: "Web vulnerability - Backdoors / Web based malware found - eval(base64_decode)" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -147,7 +147,7 @@ checks: rules: - 'd:$web_dirs -> .php$ -> r:eval\(base64_decode\(\paWYo' - - id: 10513 + - id: 14013 title: "Web vulnerability - Backdoors / Web based malware found - eval(base64_decode(POST))" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -157,7 +157,7 @@ checks: rules: - 'd:$web_dirs -> .php$ -> r:eval\(base64_decode\(\S_POST' - - id: 10514 + - id: 14014 title: "Web vulnerability - .htaccess file compromised" compliance: - pci_dss: ["6.5", "6.6", "11.4"] @@ -169,7 +169,7 @@ checks: rules: - 'd:$web_dirs -> ^.htaccess$ -> r:RewriteCond\s+\S+HTTP_REFERERS\s+\S+google' - - id: 10515 + - id: 14015 title: "Web vulnerability - .htaccess file compromised - auto append" compliance: - pci_dss: ["6.5", "6.6", "11.4"] diff --git a/sca/centos/6/cis_centos6_linux.yml b/sca/centos/6/cis_centos6_linux.yml new file mode 100644 index 000000000..ff5ba6f12 --- /dev/null +++ b/sca/centos/6/cis_centos6_linux.yml @@ -0,0 +1,3267 @@ +# Security Configuration Assessment +# CIS Checks for CentOS 6 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for CentOS 6 v2.1.0 - 12-27-2017 + +policy: + id: "cis_centos6_linux" + file: "cis_centos6_linux.yml" + name: "CIS Benchmark for CentOS 6" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for CentOS 6 systems running on x86 and x64 platforms. This document was tested against CentOS 6." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check CentOS 6 version" + description: "Requirements for running the policy against CentOS 6." + condition: any + rules: + - 'f:/etc/redhat-release -> r:^CentOS && r:release 6' + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: +# 1.1.1.1 cramfs: filesystem + - id: 5500 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found' + - 'not c:lsmod -> r:cramfs' + +# 1.1.1.2 freevxfs: filesystem + - id: 5501 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install freevxfs /bin/true. Run the following command to unload the freevxfs module: rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v freevxfs -> r:install /bin/true|Module freevxfs not found' + - 'not c:lsmod -> r:freevxfs' + +# 1.1.1.3 jffs2: filesystem + - id: 5502 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install jffs2 /bin/true. Run the following command to unload the jffs2 module: rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v jffs2 -> r:install /bin/true|Module jffs2 not found' + - 'not c:lsmod -> r:jffs2' + +# 1.1.1.4 hfs: filesystem + - id: 5503 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfs /bin/true. Run the following command to unload the hfs module: rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v hfs -> r:install /bin/true|Module hfs not found' + - 'not c:lsmod -> r:hfs' +# 1.1.1.5 hfsplus: filesystem + - id: 5504 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfsplus /bin/true. Run the following command to unload the hfsplus module: rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v hfsplus -> r:install /bin/true|Module hfsplus not found' + - 'not c:lsmod -> r:hfsplus' +# 1.1.1.6 squashfs: filesystem + - id: 5505 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found' + - 'not c:lsmod -> r:squashfs' + +# 1.1.1.7 udfs: filesystem + - id: 5506 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: rmmod udf" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v udf -> r:install /bin/true|Module udf not found' + - 'not c:lsmod -> r:udf' + +# 1.1.1.8 FAT: filesystem + - id: 5507 + title: "Ensure mounting of FAT filesystems is disabled" + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install vfat /bin/true. Run the following command to unload the vfat module: rmmod vfat" + compliance: + - cis: ["1.1.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found' + - 'not c:lsmod -> r:vfat' + +# 1.1.2 /tmp: partition + - id: 5508 + title: "Ensure separate partition exists for /tmp" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + +# 1.1.3 /tmp: nodev + - id: 5509 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstabfile and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp:# mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + +# 1.1.4 /tmp: nosuid + - id: 5510 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + +# 1.1.5 /tmp: noexec + - id: 5511 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + +# 1.1.6 Build considerations - Partition scheme. + - id: 5512 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + +# 1.1.7 bind mount /var/tmp to /tmp + - id: 5513 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + + +# 1.1.8 nodev set on /var/tmp + - id: 5514 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + +# 1.1.9 nosuid set on /var/tmp + - id: 5515 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + +# 1.1.10 noexec set on /var/tmp + - id: 5516 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + + +# 1.1.11 /var/log: partition + - id: 5517 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data ." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + +# 1.1.12 /var/log/audit: partition + - id: 5518 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + +# 1.1.13 /home: partition + - id: 5519 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + +# 1.1.14 /home: nodev + - id: 5520 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + +# 1.1.15 /dev/shm: nodev + - id: 5521 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + +# 1.1.16 /dev/shm: nosuid + - id: 5522 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + +# 1.1.17 /dev/shm: noexec + - id: 5523 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + +# 1.1.22 Disable Automounting + - id: 5524 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: # chkconfig autofs off" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list autofs -> r:^\s*\t*autofs\.*on' + +############################################### +# 1.2 Configure Software Updates +############################################### + +# 1.2.2 Activate gpgcheck + - id: 5525 + title: "Ensure gpgcheck is globally activated" + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." + compliance: + - cis: ["1.2.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + condition: all + rules: + - 'f:/etc/yum.conf -> r:^gpgcheck=1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0' + + +############################################### +# 1.3 Filesystem Integrity Checking +############################################### + +# 1.3.1 install AIDE + - id: 5526 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install aide: yum install aide // Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + +# 1.3.2 AIDE regular checks + - id: 5527 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following command: crontab -u root -e // Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. " + compliance: + - cis: ["1.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'c:crontab -u root -l -> r:aide' + - 'c:grep -r aide /etc/cron.* /etc/crontab -> r:aide' + + +############################################### +# 1.4 Secure Boot Settings +############################################### +# 1.4.1 Configure bootloader + - id: 5528 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub/grub.conf and linked as /boot/grub/menu.lst and /etc/grub.conf ." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub/grub.conf # chmod og-rwx /boot/grub/grub.conf" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.conf -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.4.2 Set Boot Loader Password (Scored) + - id: 5529 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub-md5-crypt: # grub-md5-crypt Password: Retype Password: Copy and paste the into the global section of /boot/grub/grub.conf : password --md5 " + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.conf -> r:^password --md5\s\.+' + +# 1.4.3 Single user authentication + - id: 5530 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Edit /etc/sysconfig/init and set SINGLE to ' /sbin/sulogin': SINGLE=/sbin/sulogin" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/sysconfig/init -> r:SINGLE\s*=\s*/sbin/sulogin' + +# 1.4.4 Ensure interactive boot is not enabled (Scored) + - id: 5531 + title: "Ensure interactive boot is not enabled" + description: "Interactive boot allows console users to interactively select which services start on boot. The PROMPT option provides console users the ability to interactively boot the system and select which services to start on boot . " + rationale: "Turn off the PROMPT option on the console to prevent console users from potentially overriding established security settings. " + remediation: "Edit the /etc/sysconfig/init file and set PROMPT to ' no ': PROMPT=no" + compliance: + - cis: ["1.4.4"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'f:/etc/sysconfig/init -> r:PROMPT\s*=\s*no' + + +############################################### +# 1.5 Additional Process Hardening +############################################### +# 1.5.1 Restrict Core Dumps (Scored) + - id: 5532 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 and Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + +# 1.5.2 XD/NX enabled + - id: 5533 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + +# 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 5534 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + +# 1.5.4 Disable prelink + - id: 5535 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["3.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q prelink -> package prelink is not installed' + + +############################################### +# 1.6 Configure SELinux +############################################### + +# 1.6.1.1 SELinux not disabled + - id: 5536 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /boot/grub/grub.conf and remove all instances of selinux=0 and enforcing=0 on all kernel lines" + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel\.*selinux=0|^\s*\t*kernel\.*enforcing=0' + +# 1.6.1.2 Set selinux state + - id: 5537 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled' + - 'c:sestatus -> r:^Current mode:\s+enforcing' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing' + - 'f:/etc/selinux/config -> r:^SELINUX\s*=\s*enforcing' + +# 1.6.1.3 Set selinux policy + - id: 5538 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.6.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Policy from config file:\s+targeted|^Policy from config file:\s+mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + +# 1.6.1.4 Remove SETroubleshoot + - id: 5539 + title: "Ensure SETroubleshoot is not installed" + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # yum remove setroubleshoot" + compliance: + - cis: ["1.6.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa setroubleshoot -> r:setroubleshoot' + +# 1.6.1.5 Disable MCS Translation service mcstrans + - id: 5540 + title: "Ensure the MCS Translation Service (mcstrans) is not installed" + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" + compliance: + - cis: ["1.6.1.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa mcstrans -> r:mcstrans' + +# 1.6.1.6 Ensure no unconfined daemons exist + - id: 5541 + title: "Ensure no unconfined daemons exist" + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk' +# 1.6.2 Install SELinux + - id: 5542 + title: "Ensure SELinux is installed" + description: "SELinux provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install libselinux: yum install libselinux" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-\S+' + + +############################################### +# 1.7 Warning Banners +############################################### +# 1.7.1.1 Configure message of the day (Scored) + - id: 5543 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + +# 1.7.1.2 Configure local login warning banner (Not Scored) + - id: 5544 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + +# 1.7.1.3 Configure remote login warning banner (Not Scored) + - id: 5545 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + +# 1.7.1.4 Configure /etc/motd permissions (Not Scored) + - id: 5546 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.7.1.5 Configure /etc/issue permissions (Scored) + - id: 5547 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' +# 1.7.1.6 Configure /etc/issue.net permissions (Not Scored) + - id: 5548 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.7.2 Ensure GDM login banner is configured (Scored) + - id: 5549 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults || Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message : [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' || Run the following command to update the system databases: dconf update" + compliance: + - cis: ["1.7.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'f:/etc/dconf/profile/gdm -> r:user-db:user' + - 'f:/etc/dconf/profile/gdm -> r:system-db:gdm' + - 'f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults' + - 'f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-enable=true' + - 'f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-text=\.+' + + +# 1.8 Ensure updates, patches, and additional security software are installed (Not Scored) + - id: 5550 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Site policy may mandate a testing period before install onto production systems for available updates. The audit and remediation here only cover security updates. Non-security updates can be audited with and comparing against site policy: # yum check-update" + compliance: + - cis: ["1.8"] + - cis_csc: ["4.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6","SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - 'c:yum check-update --security -> r:No packages needed for security' + +############################################### +# 2 OS Services +############################################### +############################################### +# 2.1 inetd Services +############################################### +# 2.1.1 Disable chargen services (Scored) + + - id: 5551 + title: "Ensure chargen services are not enabled" + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable chargen-dgram and chargen-stream: # chkconfig chargen-dgram off; # chkconfig chargen-stream off" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list chargen-dgram -> r:^\s*\t*chargen-dgram:\s*\t*on' + - 'c:chkconfig --list chargen-stream-> r:^\s*\t*chargen-stream:\s*\t*on' + +# 2.1.2 Disable daytime services (Scored) + - id: 5552 + title: "Ensure daytime services are not enabled" + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable daytime-dgram and daytime-stream: # chkconfig daytime-dgram off; # chkconfig daytime-stream off" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list daytime-dgram -> r:^\s*\t*daytime-dgram:\s*\t*on' + - 'c:chkconfig --list daytime-stream -> r:^\s*\t*daytime-stream:\s*\t*on' + +# 2.1.3 Disable discard services (Scored) + - id: 5553 + title: "Ensure discard services are not enabled" + description: "discardis a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable discard-dgram and discard-stream: # chkconfig discard-dgram off; # chkconfig discard-stream off" + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list discard-dgram -> r:^\s*\t*discard-dgram:\s*\t*on' + - 'c:chkconfig --list discard-stream -> r:^\s*\t*discard-stream:\s*\t*on' + +# 2.1.4 Disable echo-dgram (Scored) + - id: 5554 + title: "Ensure echo services are not enabled" + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable echo-dgram and echo-stream: # chkconfig echo-dgram off; # chkconfig echo-stream off" + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list echo-dgram -> r:^\s*\t*echo-dgram:\s*\t*on' + - 'c:chkconfig --list echo-stream -> r:^\s*\t*echo-stream:\s*\t*on' + +# 2.1.5 Disable time-stream (Scored) + - id: 5555 + title: "Ensure time services are not enabled" + description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable time-dgram and time-stream: # chkconfig time-dgram off; # chkconfig time-stream off" + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list time-dgram -> r:^\s*\t*time-dgram:\s*\t*on' + - 'c:chkconfig --list time-stream -> r:^\s*\t*time-stream:\s*\t*on' + +# 2.1.6 Remove rsh-server (Scored) + - id: 5556 + title: "Ensure rsh server is not enabled" + description: "The Berkeley rsh-server ( rsh , rlogin , rexec ) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "Run the following commands to disable rsh, rlogin, and rexec: # chkconfig rsh off # chkconfig rlogin off # chkconfig rexec off" + compliance: + - cis: ["2.1.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rexec -> r:^\s*\t*rexec:\s*\t*on' + - 'c:chkconfig --list rlogin -> r:^\s*\t*rlogin:\s*\t*on' + - 'c:chkconfig --list rsh -> r:^\s*\t*rsh:\s*\t*on' + + +# 2.1.7 Remove talk server (Scored) + - id: 5557 + title: "Ensure talk server is not enabled" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable talk: # chkconfig talk off" + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list talk -> r:^\s*\t*talk:\s*\t*on' + +# 2.1.8 Remove telnet-server (Scored) + - id: 5558 + title: "Ensure telnet server is not enabled" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to disable telnet: # chkconfig telnet off" + compliance: + - cis: ["2.1.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list telnet -> r:^\s*\t*telnet:\s*\t*on' + +# 2.1.9 Ensure tftp server is not enabled (Scored) + - id: 5559 + title: "Ensure tftp server is not enabled" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Run the following command to disable tftp: # chkconfig tftp off" + compliance: + - cis: ["2.1.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list tftp -> r:^\s*\t*tftp:\s*\t*on' + +# 2.1.10 Remove rsync service (Scored) + - id: 5560 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # chkconfig rsyncd off" + compliance: + - cis: ["2.1.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rsync -> r:^\s*\t*rsync:\s*\t*on' + +# 2.1.11 Remove xinetd (Scored) + - id: 5561 + title: "Ensure xinetd is not enabled" + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to disable xinetd: # chkconfig xinetd off" + compliance: + - cis: ["2.1.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list xinetd -> r:^\s*\t*xinetd\.*on' + +############################################## +# 2.2 Remove Legacy Services +############################################### + +# 2.2.1.1 Ensure time synchronization is in use (Not Scored) + - id: 5562 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available run the following commands and verify either ntp or chrony is installed: # rpm -q ntp # rpm -q chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and verify that host based synchronization is in use." + compliance: + - cis: ["2.2.2.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'not c:rpm -q ntp -> r:^package ntp is not installed' + - 'not c:rpm -q chrony -> r:^package chrony is not installed' + +# 2.2.1.2 Configure Network Time Protocol (NTP) (Scored) + - id: 5563 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/ntp.conf to match the following: - restrict -4 default kod nomodify notrap nopeer noquery and - restrict -4 default kod nomodify notrap nopeer noquery. 2) Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': - OPTIONS='-u ntp:ntp'" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/ntpd -> r:^OPTIONS\s*=\s* && r:-u ntp:ntp' + +# 2.2.1.3 Configure Network Time Protocol (Chrony) (Scored) + - id: 5564 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/chrony.conf to match the following: - 1) Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/chronyd to include: - OPTIONS='-u chronyd'" + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' + +# 2.2.2 Remove X Windows (Scored) + - id: 5565 + title: "Ensure X Window System is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # yum remove xorg-x11*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa xorg-x11* -> r:^xorg-x11' + +# 2.2.3 Disable Avahi Server (Scored) + - id: 5566 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." + remediation: "Run the following command to disable avahi-daemon: # chkconfig avahi-daemon off" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list avahi-daemon -> r:^\s*\t*avahi-daemon\.*on' + +# 2.2.4 Ensure CUPS is not enabled (Scored) + - id: 5567 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups : # chkconfig cups off" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list cups -> r:^\s*\t*cups\.*on' + +# 2.2.5 Remove DHCP Server (Scored) + - id: 5568 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dhcpd: # chkconfig dhcpd off" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp + condition: none + rules: + - 'c:chkconfig --list dhcpd -> r:^\s*\t*dhcpd\.*on' + +# 2.2.6 Remove LDAP Server (Scored) + - id: 5569 + title: "Ensure LDAP Server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # chkconfig slapd off" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on OpenLDAP is available at https://www.openldap.org + condition: none + rules: + - 'c:chkconfig --list slapd -> r:^\s*\t*slapd\.*on' + + + +# 2.2.7 Disable NFS and RPC (Scored) + - id: 5570 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs, nfs-server and rpcbind: # chkconfig nfs off; # chkconfig rpcbind off" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list nfs -> r:^\s*\t*nfs\.*on' + - 'c:chkconfig --list rpcbind -> r:^\s*\t*rpcbind\.*on' + +# 2.2.8 Ensure DNS Server is not enabled (Scored) + - id: 5571 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named : # chkconfig named off" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list named -> r:^\s*\t*named\.*on' + +# 2.2.9 Remove FTP Server (Scored) + - id: 5572 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # chkconfig vsftpd off" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list vsftpd -> r:^\s*\t*vsftpd\.*on' + +# 2.2.10 Remove HTTP Server (Scored) + - id: 5573 + title: "Ensure HTTP server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable httpd: # chkconfig httpd off" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list httpd -> r:^\s*\t*httpd\.*on' + +# 2.2.11 Remove Dovecot (IMAP and POP3 services) (Scored) + - id: 5574 + title: "Ensure IMAP and POP3 server is not enabled" + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dovecot: # chkconfig dovecot off" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list dovecot -> r:^\s*\t*dovecot\.*on' + +# 2.2.12 Remove Samba (Scored) + - id: 5575 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable smb: # chkconfig smb off" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list smb -> r:^\s*\t*smb\.*on' + +# 2.2.13 Remove HTTP Proxy Server (Scored) + - id: 5576 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # chkconfig squid off" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list squid -> r:^\s*\t*squid\.*on' + +# 2.2.14 Remove SNMP Server (Not Scored) + - id: 5577 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # chkconfig snmpd off" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list snmpd -> r:^\s*\t*snmpd\.*on' + +# 2.2.15 Ensure mail transfer agent is configured for local-only mode (Scored) + - id: 5578 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Restart postfix: # service postfix restart" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.+LISTEN' + +# 2.2.16 Remove NIS Server (Scored) + - id: 5579 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable ypserv: # chkconfig ypserv off" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list ypserv -> r:^\s*\t*ypserv\.*on' + +############################################### +# 2.3 Service Clients +############################################### +# 2.3.1 Remove NIS Client (Scored) + - id: 5580 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # yum remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q ypbind -> package ypbind is not installed' + +# 2.3.2 Ensure rsh client is not installed (Scored) + - id: 5581 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Run the following command to uninstall rsh : # yum remove rsh" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q rsh -> package rsh is not installed' + +# 2.3.3 Ensure talk client is not installed (Scored) + - id: 5582 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk : # yum remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q talk -> package talk is not installed' + +# 2.3.4 Ensure telnet client is not installed (Scored) + - id: 5583 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet : # yum remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q telnet -> package telnet is not installed' + +# 2.3.5 Ensure LDAP client is not installed (Scored) + - id: 5584 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # yum remove openldap-clients" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q openldap-clients -> package openldap-clients is not installed' + +############################################### +# 3 Network Configuration and Firewalls +############################################### +############################################### +# 3.1 Modify Network Parameters (Host Only) +############################################### +# 3.1.1 Disable IP Forwarding (Scored) + - id: 5585 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + +# 3.1.2 Disable Send Packet Redirects (Scored) + - id: 5586 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + +############################################### +# 3.2 Modify Network Parameters (Host and Router) +############################################### +# 3.2.1 Disable Source Routed Packet Acceptance (Scored) + - id: 5587 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0; net.ipv4.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + +# 3.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 5588 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + +# 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 5589 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0; net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + +# 3.2.4 Log Suspicious Packets (Scored) + - id: 5590 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1; net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + +# 3.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 5591 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + +# 3.2.6 Enable Bad Error Message Protection (Scored) + - id: 5592 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + +# 3.2.7 Enable RFC-recommended Source Route Validation (Scored) + - id: 5593 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1; net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + +# 3.2.8 Enable TCP SYN Cookies (Scored) + - id: 5594 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + +############################################### +# 3.3 IPv6 +############################################### +# 3.3.1 Ensure IPv6 router advertisements are not accepted (Not Scored) + - id: 5595 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0' + + +# 3.3.2 Ensure IPv6 redirects are not accepted (Not Scored) + - id: 5596 + title: "Ensure IPv6 redirects are not accepted" + description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." + rationale: "It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 || net.ipv6.conf.default.accept_redirects = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0' + +# 3.3.3 Ensure IPv6 is disabled (Not Scored) + - id: 5597 + title: "Ensure IPv6 is disabled" + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: "Edit /boot/grub/grub.conf to include ipv6.disable=1 on all kernel lines." + compliance: + - cis: ["3.3.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel && !r:ipv6.disable=1' + + +############################################### +# 3.4 TCP Wrappers +############################################### +# 3.4.1 Ensure TCP Wrappers is installed (Scored) + - id: 5598 + title: "Ensure TCP Wrappers is installed" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Run the following command to install tcp_wrappers: yum install tcp_wrappers" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:rpm -q tcp_wrappers -> r:^tcp_wrappers-' + - 'c:rpm -q tcp_wrappers-libs -> r:^tcp_wrappers-libs-' + +# 3.4.3 Ensure /etc/hosts.deny is configured (Scored) + - id: 5599 + title: "Ensure /etc/hosts.deny is configured" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: "Run the following command to create /etc/hosts.deny: echo 'ALL: ALL' >> /etc/hosts.deny" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.deny -> r:^ALL\s*:\s*ALL' + +# 3.4.4 Ensure permissions on /etc/hosts.allow are configured (Scored) + - id: 5600 + title: "Ensure permissions on /etc/hosts.allow are configured." + description: "The /etc/hosts.allow file contains networking information that is used by many applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : chown root:root /etc/hosts.allow and chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:stat /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)' + + +# 3.4.5 Ensure permissions on /etc/hosts.deny are configured (Scored) + - id: 5601 + title: "Ensure permissions on /etc/hosts.deny are configured." + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : chown root:root /etc/hosts.deny and chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +############################################### +# 3.5 Uncommon Network Protocols +############################################### +# 3.5.1 Ensure DCCP is disabled (Not Scored) + - id: 5602 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce +the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.5.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:install /bin/true' + - 'not c:lsmod -> r:dccp' + + + +# 3.5.2 Ensure SCTP is disabled (Not Scored) + - id: 5603 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.5.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:install /bin/true' + - 'not c:lsmod -> r:sctp' + + +# 3.5.3 Ensure RDS is disabled (Not Scored) + - id: 5604 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v rds -> r:install /bin/true' + - 'not c:lsmod -> r:rds' + + +# 3.5.4 Ensure TIPC is disabled (Not Scored) + - id: 5605 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.5.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v tipc -> r:install /bin/true' + - 'not c:lsmod -> r:tipc' + +############################################### +# 3.6 Firewall Configuration +############################################### +# 3.6.1 Ensure iptables is installed (Scored) + - id: 5606 + title: "Ensure iptables is installed" + description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables ." + rationale: "iptables is required for firewall management and configuration." + remediation: "Run the following command to install iptables : yum install iptables" + compliance: + - cis: ["3.6.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.1"] + condition: all + rules: + - 'c:rpm -q iptables -> r:iptables-' + +# 3.6.2 Ensure default deny firewall policy (Scored) + - id: 5607 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: iptables -P INPUT DROP; iptables -P OUTPUT DROP and iptables -P FORWARD DROP" + compliance: + - cis: ["3.6.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + +# 3.6.3 Ensure loopback traffic is configured (Scored) + - id: 5608 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.6.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + +############################################### +# 4 Logging and Auditing +############################################### + + + + +############################################### +# 4 Logging and Auditing +############################################### +############################################### +# 4.1 Configure System Accounting (auditd) +############################################### + +# 4.1.1.1 Ensure audit log storage size is configured (Not Scored) + - id: 5609 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file\s*=\s*\d+' + +# 4.1.1.2 Ensure system is disabled when audit logs are full (Scored) + - id: 5610 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^admin_space_left_action\s*=\s*halt' + +# 4.1.1.3 Ensure audit logs are not automatically deleted (Scored) + - id: 5611 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file_action\s*=\s*keep_logs' + +# 4.1.2 Ensure auditd service is enabled (Scored) + - id: 5612 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd : # chkconfig auditd on" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1","10.7"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:chkconfig --list auditd -> r:2:on && r:3:on && r:4:on && r:5:on' + + +# 4.1.3 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 5613 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "Edit /boot/grub/grub.conf to include audit=1 on all kernel lines. Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.6","10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel && !r:audit=1' + +# 4.1.4 Ensure events that modify date and time information are collected (Scored) + - id: 5614 + title: "Ensure events that modify date and time information are collected" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"." + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:-w /etc/localtime && r:-p wa && r:-k time-change' + +# 4.1.5 Ensure events that modify user/group information are collected (Scored) + - id: 5615 + title: "Ensure events that modify user/group information are collected" + description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity" + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /etc/group && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:-w /etc/passwd && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:-w /etc/gshadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:-w /etc/shadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:-w /etc/security/opasswd && r:-p wa && r:-k identity' + +# 4.1.6 Ensure events that modify the system's network environment are collected (Scored) + - id: 5616 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale" + compliance: + - cis: ["4.1.6"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/issue && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/issue.net && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/hosts && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale' + +# 4.1.7 Ensure events that modify the system's Mandatory Access Controls are collected (Scored) + - id: 5617 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or directory." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /etc/selinux/ && r:-p wa && r:-k MAC-policy' + - 'f:/etc/audit/audit.rules -> r:-w /usr/share/selinux/ && r:-p wa && r:-k MAC-policy' + +# 4.1.8 Ensure login and logout events are collected (Scored) + - id: 5618 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The /var/run/failock directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/lastlog -p wa -k logins -w /var/run/faillock/ -p wa -k logins" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5","16.10","16.4"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /var/log/lastlog && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:-w /var/run/faillock/ && r:-p wa && r:-k logins' + +# 4.1.9 Ensure session initiation information is collected (Scored) + - id: 5619 + title: "Ensure session initiation information is collected" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"." + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins" + compliance: + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5","16.10","16.4"] + - pci_dss: ["10.3"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /var/run/utmp && r:-p wa && r:-k session' + - 'f:/etc/audit/audit.rules -> r:-w /var/log/wtmp && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:-w /var/log/btmp && r:-p wa && r:-k logins' + +# 4.1.10 Ensure discretionary access control permission modification events are collected (Scored) + - id: 5620 + title: "Ensure discretionary access control permission modification events are collected" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 500) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem" + compliance: + - cis: ["4.1.10"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod' + +# 4.1.11 Ensure unsuccessful unauthorized file access attempts are collected (Scored) + - id: 5621 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 500), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access" + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access' + +# 4.1.13 Ensure successful file system mounts are collected (Scored) + - id: 5622 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=500 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts" + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k mounts' + + +# 4.1.14 Ensure file deletion events by users are collected (Scored) + - id: 5623 + title: "Ensure file deletion events by users are collected" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete" + compliance: + - cis: ["4.1.14"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4","PI1.5","CC7.1","CC7.2","CC7.3","CC8.1"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k delete' + +# 4.1.15 Ensure changes to system administration scope (sudoers) is collected (Scored) + - id: 5624 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope" + compliance: + - cis: ["4.1.15"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope' + - 'f:/etc/audit/audit.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope' + +# 4.1.16 Ensure system administrator actions (sudolog) are collected (Scored) + - id: 5625 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1","5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /var/log/sudo.log && r:-p wa && r:-k actions' + +# 4.1.17 Ensure kernel module loading and unloading is collected (Scored) + - id: 5626 + title: "Ensure kernel module loading and unloading is collected" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + +# 4.1.18 Ensure the audit configuration is immutable (Scored) + - id: 5627 + title: "Ensure the audit configuration is immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl . Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file. -e 2" + compliance: + - cis: ["4.1.18"] + - cis_csc: ["3","6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:tail -1 /etc/audit/audit.rules -> r:^-e 2' + +############################################### +# 4.2 Configure Logging +############################################### + +# 4.2.1.1 Ensure rsyslog Service is enabled (Scored) + - id: 5628 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lackblogging instead." + remediation: "Run the following command to enable rsyslog : # chkconfig rsyslog on" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:chkconfig --list rsyslog -> r:2:on && r:3:on && r:4:on && r:5:on' +# 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 5629 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + +# 4.2.1.4 Ensure rsyslog is configured to send logs to a remote log host (Scored) + - id: 5630 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + + + +# 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 5631 + title: "Ensure syslog-ng service is enabled" + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable syslog-ng : # chkconfig syslog-ng on" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:chkconfig --list syslog-ng -> r:2:on && r:3:on && r:4:on && r:5:on' + +# 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 5632 + title: "Ensure syslog-ng default file permissions configured" + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(0600\)|perm\(0640\)|perm\(0440\)|perm\(0400\)|perm\(0000\)' + +# 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 5633 + title: "Ensure syslog-ng is configured to send logs to a remote log host" + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp(\"logfile.example.com\" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng" + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:destination logserver' + - 'f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:log\.+source\.+destination' + +# 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 5634 + title: "Ensure rsyslog or syslog-ng is installed" + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # yum install rsyslog # yum install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'not c:rpm -q rsyslog -> package rsyslog is not installed' + - 'not c:rpm -q syslog-ng -> package syslog-ng is not installed' + + # 4.2.4 Ensure permissions on all logfiles are configured (Scored) + - id: 5635 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx {} +" + compliance: + - cis: ["4.2.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + +############################################### +# 5 System Access, Authentication and Authorization +############################################### +############################################### +# 5.2 Configure SSH +############################################### + +# 5.1.1 Ensure cron daemon is enabled (Scored) + - id: 5636 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # chkconfig crond on" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:chkconfig --list crond -> r:2:on && r:3:on && r:4:on && r:5:on' + +# 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 5637 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 5638 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 5639 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 5640 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 5641 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\w00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 5642 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 5643 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.deny -> r:No such file or directory$' + - 'c:stat /etc/at.deny -> r:No such file or directory$' + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +############################################### +# 5.2 Configure SSH +############################################### +# 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Scored) + - id: 5644 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: chown root:root /etc/ssh/sshd_config and chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2.2 Set SSH Protocol to 2 (Scored) + - id: 5645 + title: "Ensure SSH Protocol is set to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:Protocol\s*\t*2' + +# 5.2.3 Set LogLevel to INFO (Scored) + - id: 5646 + title: "Ensure SSH LogLevel is set to INFO" + description: "The INFO parameter specifies that login and logout activity will be logged." + rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:LogLevel\s*\t*INFO' + +# 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) + - id: 5647 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + +# 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) + - id: 5648 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' + +# 5.2.7 Set SSH HostbasedAuthentication to No (Scored) + - id: 5649 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' + +# 5.2.8 Disable SSH Root Login (Scored) + - id: 5650 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["5.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' + +# 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) + - id: 5651 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + +# 5.2.10 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 5652 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitUserEnvironment\s*\t*no' + +# 5.2.12 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 5653 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + +# 5.2.13 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 5654 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.13"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + +# 5.2.14 Ensure SSH access is limited (Scored) + - id: 5655 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. AllowGroups The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. DenyUsers The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. DenyGroups The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers ; AllowGroups ; DenyUsers and DenyGroups " + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1", "5.8"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'f:$sshd_file -> r:^\s*AllowUsers' + - 'f:$sshd_file -> r:^\s*AllowGroups' + - 'f:$sshd_file -> r:^\s*DenyUsers' + - 'f:$sshd_file -> r:^\s*DenyGroups' + +# 5.2.15 Ensure SSH warning banner is configured (Scored) + - id: 5656 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*Banner\s*\t*/etc/issue.net' + +############################################### +# 5.3 Configure PAM +############################################### +# 5.3.1 Ensure password creation requirements are configured (Scored) + - id: 5657 + title: "Ensure password creation requirements are configured" + description: "The pam_cracklib.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_cracklib.so and to conform to site policy: password requisite pam_cracklib.so try_first_pass retry=3 minlen=14 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1" + compliance: + - cis: ["5.3.1"] + - cis_csc: ["5.7", "16.12"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:grep pam_cracklib.so /etc/pam.d/password-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'c:grep pam_cracklib.so /etc/pam.d/system-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + +# 5.3.3 Ensure password reuse is limited (Scored) + - id: 5658 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=5 or password required pam_pwhistory.so remember=5" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + +# 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 5659 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.14"] + - pci_dss: ["3.6.1","8.2.1"] + - tsc: ["CC6.1","CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + - 'f:/etc/pam.d/system-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' +############################################### +# 5.4 User Accounts and Environment +############################################### +############################################### +# 5.4.1 Set Shadow Password Suite Parameters +############################################### +# 5.4.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 5660 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + +# 5.4.1.2 Ensure minimum days between password changes is 7 or more (Scored) + - id: 5661 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 and modify user parameters for all users with a password set to match: chage --mindays 7 " + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + +# 5.4.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 5662 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + +# 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 5663 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + +# 5.4.3 Ensure default group for the root account is GID 0 (Scored) + - id: 5664 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + +# 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 5665 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + + +# 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 5666 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc and /etc/profile files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + +# 5.6 Ensure access to the su command is restricted (Scored) + - id: 5667 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo , which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + + +############################################### +# 6 System Maintenance +############################################### +############################################### +# 6.1 System File Permissions +############################################### + + +# 6.1.2 Configure /etc/passwd permissions (Scored) + - id: 5668 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + +# 6.1.3 Configure /etc/shadow permissions (Scored) + - id: 5669 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 000 /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.4 Configure /etc/group permissions (Scored) + - id: 5670 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.5 Configure /etc/gshadow permissions (Scored) + - id: 5671 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chmod 000 /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.6 Configure /etc/passwd- permissions (Scored) + - id: 5672 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.7 Configure /etc/shadow- permissions (Scored) + - id: 5673 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:root /etc/shadow- # chmod 000 /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.8 Configure /etc/group- permissions (Scored) + - id: 5674 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.9 Configure /etc/gshadow- permissions (Scored) + - id: 5675 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 000 /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +############################################### +# 6.2 Review User and Group Settings +############################################### +# 6.2.1 Check passwords fields (Scored) + - id: 5676 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + +# 6.2.2 Delete legacy entries in /etc/passwd (Scored) + - id: 5677 + title: "Ensure no legacy \"+\" entries exist in /etc/passwd" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && r:^+:' + +# 6.2.3 Delete legacy entries in /etc/shadow (Scored) + - id: 5678 + title: "Ensure no legacy \"+\" entries exist in /etc/shadow" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^+:' + +# 6.2.4 Delete legacy entries in /etc/group (Scored) + - id: 5679 + title: "Ensure no legacy \"+\" entries exist in /etc/group" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:^+:' + +# 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) + - id: 5680 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' diff --git a/sca/centos/7/cis_centos7_linux.yml b/sca/centos/7/cis_centos7_linux.yml new file mode 100644 index 000000000..e96df189b --- /dev/null +++ b/sca/centos/7/cis_centos7_linux.yml @@ -0,0 +1,3637 @@ +# Security Configuration Assessment +# CIS Checks for CentOS 7 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security CentOS 7 Benchmark v3.0.0 - 06-30-2020 + +policy: + id: "cis_centos7_linux" + file: "cis_centos7_linux.yml" + name: "CIS Benchmark for CentOS 7" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for CentOS 7 systems running on x86 and x64 platforms. This document was tested against CentOS 7." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check CentOS 7 platform" + description: "Requirements for running the policy against CentOS 7." + condition: any + rules: + - 'f:/etc/system-release -> r:^CentOS && r:release 7' + + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + +# 1.1.1.1 cramfs: filesystem + - id: 6000 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/directory ending in .conf. Example: vim /etc/modprobe.d/cramfs.confand add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found' + - 'not c:lsmod -> r:cramfs' + +# 1.1.1.2 squashfs: filesystem + - id: 6001 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found' + - 'not c:lsmod -> r:squashfs' + +# 1.1.1.3 udf: filesystem + - id: 6002 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: rmmod udf" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v udf -> r:install /bin/true|Module udf not found' + - 'not c:lsmod -> r:udf' + +# 1.1.1.4 FAT: filesystem + - id: 6003 + title: "Ensure mounting of FAT filesystems is disabled" + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12, FAT16, and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "If utilizing UEFI the FAT filesystem format is required. If this case, ensure that the FAT filesystem is only used where appropriate. Run the following command: grep -E -i '\\svfat\\s' /etc/fstab And review that any output is appropriate for your environment. If not utilizing UEFI: Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following lines: Example: vim /etc/modprobe.d/fat.conf install fat /bin/true install vfat /bin/true install msdos /bin/true Run the following commands to unload the msdos, vfat, and fatmodules: # rmmod msdos # rmmod vfat # rmmod fat " + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found' + - 'not c:lsmod -> r:vfat' + - 'c:modprobe -n -v fat -> r:install /bin/true|Module fat not found' + - 'not c:lsmod -> r:fat' + - 'c:modprobe -n -v msdos -> r:install /bin/true|Module msdos not found' + - 'not c:lsmod -> r:msdos' + + + # 1.1.2 /tmp: partition + - id: 6004 + title: "Ensure /tmp is configured" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Create or update an entry for /tmp in either /etc/fstab OR in a systemd tmp.mount file: If /etc/fstab is used: Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp: # mount -o remount,noexec,nodev,nosuid /tmp OR If systemd tmp.mount file is used: Run the following command to create the file /etc/systemd/system/tmp.mount if it doesn't exist: # [ ! -f /etc/systemd/system/tmp.mount ] && cp -v /usr/lib/systemd/system/tmp.mount /etc/systemd/system/ Edit the file /etc/systemd/system/tmp.mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to reload the systemd daemon:# systemctl daemon-reload Run the following command to unmask tmp.mount: # systemctl unmask tmp.mpunt Run the following command to enable and start tmp.mount: # systemctl enable --now tmp.mount" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["9.4","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: any + rules: + - 'c:mount -> r:\s/tmp\s' + - 'f:/etc/fstab -> r:\s/tmp\s' + - 'c:systemctl is-enabled tmp.mount -> r:enabled' + +# 1.1.3 /tmp: noexec + - id: 6005 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstabfile and add noexecto the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + +# 1.1.4 /tmp: nodev + - id: 6006 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + +# 1.1.5 /tmp: nosuid + - id: 6007 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nosuid,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + +# 1.1.6 /dev/shm: + - id: 6008 + title: "Ensure /dev/shm is configured " + description: "/dev/shm is a traditional shared memory concept. One program will create a memory portion, which other processes (if permitted) can access. Mounting tmpfs at /dev/shm is handled automatically by systemd." + rationale: "Any user can upload and execute files inside the /dev/shm similar to the /tmp partition. Configuring /dev/shm allows an administrator to set the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Edit /etc/fstab and add or edit the following line: tmpfs /dev/shm tmpfs defaults,noexec,nodev,nosuid,seclabel 0 0 Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm" + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s' + - 'f:/etc/fstab -> r:\s/dev/shm\s' + + + + +# 1.1.7 /dev/shm: noexec + - id: 6009 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.7"] + - cis_csc: ["2.6","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + +# 1.1.8 /dev/shm: nodev + - id: 6010 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + +# 1.1.9 /dev/shm: nosuid + - id: 6011 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + + +# 1.1.10 Build considerations - Partition scheme. + - id: 6012 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + +# 1.1.11 bind mount /var/tmp to /tmp + - id: 6013 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications and is intended for temporary files that are preserved across reboots." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + +# 1.1.12 noexec set on /var/tmp + - id: 6014 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. un the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.12"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + +# 1.1.13 nodev set on /var/tmp + - id: 6015 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + +# 1.1.14 nosuid set on /var/tmp + - id: 6016 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + +# 1.1.15 /var/log: partition + - id: 6017 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data ." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.15"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + +# 1.1.16 /var/log/audit: partition + - id: 6018 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.16"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + +# 1.1.17 /home: partition + - id: 6019 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.17"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + + + +# 1.1.18 /home: nodev + - id: 6020 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.18"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + + + + +# 1.1.23 Disable Automounting + - id: 6021 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: systemctl disable autofs" + compliance: + - cis: ["1.1.23"] + - cis_csc: ["8.4","8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled autofs -> r:enabled' + +# 1.1.24 Disable USB Storage + - id: 6022 + title: "Disable USB Storage" + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf Add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.4","8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v usb-storage -> r:install /bin/true' + - 'not c:lsmod -> r:install /bin/true' + + +############################################### +# 1.2 Configure Software Updates +############################################### + +# 1.2.3 Activate gpgcheck + - id: 6023 + title: "Ensure gpgcheck is globally activated" + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." + compliance: + - cis: ["1.2.3"] + - cis_csc: ["3.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + condition: all + rules: + - 'f:/etc/yum.conf -> r:gpgcheck=1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0' + +############################################### +# 1.3 Configure sudo +############################################### + +# 1.3.1 install sudo + - id: 6024 + title: "Ensure sudo is installed" + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo. # yum install sudo" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - 'c:rpm -q sudo -> r:sudo-\S*' + + +# 1.3.2 Configure sudo + - id: 6025 + title: "Ensure sudo commands use pty" + description: "sudo can be configured to run only from a pseudo-pty" + rationale: "Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing. This can be mitigated by configuring sudo to run other commands only from a pseudo-pty, whether I/O logging is turned on or not." + remediation: "Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults use_pty" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d/ -> r:\. -> r:^\s*Defaults\s*\t*\s*use_pty' + +# 1.3.3 Ensure sudo log file exists + - id: 6026 + title: "Ensure sudo log file exists" + description: "sudo can use a custom log file" + rationale: "A sudo log file simplifies auditing of sudo commands" + remediation: "Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile='' Example:Defaults logfile=\"/var/log/sudo.log\"" + compliance: + - cis: ["1.3.3"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+logfile\s*=\s*"/var/log/sudo.log"' + - 'd:/etc/sudoers.d/ -> r:\. -> r:^\s*Defaults\s+logfile\s*=\s*"/var/log/sudo.log"' + + +############################################### +# 1.4 Filesystem Integrity Checking +############################################### + +# 1.4.1 install AIDE + - id: 6027 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: yum install aide // Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + +# 1.4.2 AIDE regular checks + - id: 6028 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check run the following command: crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. OR If aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simpleExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer " + compliance: + - cis: ["1.4.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'c:crontab -u root -l -> r:aide' + - 'c:grep -r aide /etc/cron.* /etc/crontab -> r:aide' + - 'c:systemctl is-enabled aidecheck.service -> r:enabled' + - 'c:systemctl is-enabled aidecheck.timer -> r:enabled' + - 'c:systemctl status aidecheck.timer -> r:enabled' + +############################################### +# 1.5 Secure Boot Settings +############################################### + +# 1.5.1 Set Boot Loader Password (Scored) + - id: 6029 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "For newergrub2based systems (centOS/RHEL 7.2 and newer): Create an encrypted password with grub2-setpassword: # grub2-setpassword OR For older grub2based systems: create an encrypted password with grub2-mkpasswd-pbkdf2: # grub2-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is Add the following into /etc/grub.d/01_users or a custom /etc/grub.d configuration file: cat <\"password_pbkdf2 EOF Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub2/user.cfg -> r:^GRUB2_PASSWORD\s*=\.+' + - 'f:/boot/grub2/grub.cfg -> r:^set superusers\s*=\.+' + - 'f:/boot/grub2/grub.cfg -> r:^password_pbkdf2 \.+' + + +# 1.5.2 Configure bootloader + - id: 6030 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub2/grub.cfg and linked as /etc/grub2.cfg . On newer grub2 systems the encrypted bootloader password is contained in /boot/grub2/user.cfg" + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/user.cfg # chmod og-rwx /boot/grub2/user.cfg" + compliance: + - cis: ["1.5.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub2/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat /boot/grub2/user.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|cannot stat' + +# 1.5.3 Single user authentication + - id: 6031 + title: "Ensure authentication required for single user mode" + description: "Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Edit /usr/lib/systemd/system/rescue.service and /usr/lib/systemd/system/emergency.service and set ExecStart to use /sbin/sulogin or /usr/sbin/sulogin: ExecStart=-/bin/sh -c \"/sbin/sulogin; /usr/bin/systemctl --fail --no-block default\" " + compliance: + - cis: ["1.5.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/usr/lib/systemd/system/rescue.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' + - 'f:/usr/lib/systemd/system/emergency.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' + +############################################### +# 1.6 Additional Process Hardening +############################################### +# 1.6.1 Restrict Core Dumps (Scored) + - id: 6032 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.6.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:hard\s*\t*core\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + +# 1.6.2 XD/NX enabled + - id: 6033 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.6.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'c:journalctl -> r:^kernel:\s+NX \(Execute Disable\) protection: active' + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + +# 1.6.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 6034 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + +# 1.6.4 Disable prelink + - id: 6035 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal: # prelink -ua Run the following command to uninstall prelink: # yum remove prelink" + compliance: + - cis: ["1.6.4"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q prelink -> r:package prelink is not installed' + +############################################### +# 1.7 Configure SELinux +############################################### + +# 1.7.1.1 Install SELinux + - id: 6036 + title: "Ensure SELinux is installed" + description: "SELinux provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install libselinux: # yum install libselinux" + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-\S+' + + +# 1.7.1.2 SELinux not disabled + - id: 6037 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /etc/default/grub and remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\" GRUB_CMDLINE_LINUX=\"\" || Run the following command to update the grub2 configuration: grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*linux\.+selinux=0|linux\.+enforcing=0' + + + +# 1.7.1.3 Set selinux policy + - id: 6038 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s*\t*targeted$|^Loaded policy name:\s*\t*mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + + + +# 1.7.1.4 Set selinux mode + - id: 6039 + title: "Ensure the SELinux mode is enforcing or permissive" + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. Disabled -Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future" + rationale: "Running SELinux in disabled modeis strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:getenforce -> r:^Enforcing|^Permissive' + - 'f:/etc/selinux/config -> r:^SELINUX=enforcing|^SELINUX=permissive' + + +# 1.7.1.6 Ensure no unconfined services exist + - id: 6040 + title: "Ensure no unconfined services exist" + description: "Unconfined processes run in unconfined domains" + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules – it does not replace them" + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:ps -eZ -> r:unconfined_service_t' + + +# 1.7.1.7 Remove SETroubleshoot + - id: 6041 + title: "Ensure SETroubleshoot is not installed" + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # yum remove setroubleshoot" + compliance: + - cis: ["1.7.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q setroubleshoot -> r:package setroubleshoot is not installed' + + +# 1.7.1.8 Disable MCS Translation service mcstrans + - id: 6042 + title: "Ensure the MCS Translation Service (mcstrans) is not installed" + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" + compliance: + - cis: ["1.7.1.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -q mcstrans -> r:package mcstrans is not installed' + + + +############################################### +# 1.8 Warning Banners +############################################### +# 1.8.1.1 Configure message of the day (Scored) + - id: 6043 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd" + compliance: + - cis: ["1.8.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + +# 1.8.1.2 Configure local login warning banner (Not Scored) + - id: 6044 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version -or the operating system's name." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.8.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + +# 1.8.1.3 Configure remote login warning banner (Not Scored) + - id: 6045 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.8.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + +# 1.8.1.4 Configure /etc/motd permissions (Not Scored) + - id: 6046 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.8.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.8.1.5 Configure /etc/issue permissions (Scored) + - id: 6047 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.8.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' +# 1.8.1.6 Configure /etc/issue.net permissions (Not Scored) + - id: 6048 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.8.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + +# 1.9 Ensure updates, patches, and additional security software are installed + - id: 6049 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available packages # yum update " + compliance: + - cis: ["1.9"] + - cis_csc: ["3.4","3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6","SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - 'c:yum check-update -> r:No packages needed for security' + + +# 1.10 Ensure GDM login banner is configured (Scored) + - id: 6050 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "If a graphical login is not required, it should be removed to reduce the attack surface of the system. If a graphical login is required, last logged in user display should be disabled, and a warning banner should be configured. Displaying the last logged in user eliminates half of the Userid/Password equation that an unauthorized person would need to log on. Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Run the following command to remove gdm: # yum remove gdm OR If GDM is required: Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/01-banner-message) [org/gnome/login-screen] banner-message-enable=true banner-message-text='' Example Banner Text: 'Authorized uses only. All activity may be monitored and reported. 'Edit or create the file /etc/dconf/db/gdm.d/and add the following: (This is typically /etc/dconf/db/gdm.d/00-login-screen) [org/gnome/login-screen] # Do not show the user list disable-user-list=true Run the following command to update the system databases: # dconf update" + compliance: + - cis: ["1.10"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'f:/etc/dconf/profile/gdm -> r:user-db:user' + - 'f:/etc/dconf/profile/gdm -> r:system-db:gdm' + - 'f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:banner-message-enable=true' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:banner-message-text=\.+' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:disable-user-list=true' + + + + + +############################################### +# 2 OS Services +############################################### +############################################### +# 2.1 inetd Services +############################################### + + +# 2.1.1 Ensure xinetd is not installed (Automated) + - id: 6051 + title: "Ensure daytime services are not enabled" + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed to reduce the attack surface area of the system. Note: If an xinetd service or services are required, ensure that any xinetd service not required is stopped and disabled" + remediation: "Run the following command to remove xinetd: # yum remove xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q xinetd-> r:package xinetd is not installed' + + +############################################### +# 2.2 Remove Legacy Services +############################################### + + +# 2.2.1.1 Ensure time synchronization is in use (Manual) + - id: 6052 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run One of the following commands to install chrony or NTP: to install chrony run the following command: # yum install chrony OR to install ntp: run the following command: # yum install ntp" + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'not c:rpm -q ntp -> r:^package ntp is not installed' + - 'not c:rpm -q chrony -> r:^package chrony is not installed' + +# 2.2.1.2 Ensure chrony is configured (Automated) + - id: 6053 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. Note: This recommendation only applies if chrony is in use on the system." + remediation: "1) Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . 2) Add or edit the OPTIONS in /etc/sysconfig/chronyd to include '-u chrony':OPTIONS=\"-u chrony\"" + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+$|^pool\.+$' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' + +# 2.2.1.3 Ensure ntp is configured (Automated) + - id: 6054 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/ntp.conf to match the following: - restrict -4 default kod nomodify notrap nopeer noquery and - restrict -4 default kod nomodify notrap nopeer noquery. 2) Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': - OPTIONS='-u ntp:ntp'" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/ntpd -> r:^OPTIONS\s*=\s* && r:-u ntp:ntp' + - 'f:/usr/lib/systemd/system/ntpd.service -> r:^Execstart\s*=\s*/usr/sbin/ntpd\s+-u\s+ntp:ntp' + +# 2.2.2 Remove X Windows (Scored) + - id: 6055 + title: " Ensure X11 Server components are not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # yum remove xorg-x11*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q xorg-x11-server* -> r:package xorg-x11 is not installed' + +# 2.2.3 Ensure Avahi Server is not installed (Automated) + - id: 6056 + title: " Ensure Avahi Server is not installed" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi-autoipd and avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service; # yum remove avahi-autoipd avahi" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q avahi-autoipd-> r:package avahi-autoipd is not installed' + - 'c:rpm -q avahi-> r:pacakge avahi is not installed' + +# 2.2.4 Ensure CUPS is not installed (Automated) + - id: 6057 + title: "Ensure CUPS is not installed" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # yum remove cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q cups-> r:package cups is not installed' + +# 2.2.5 Ensure DHCP Server is not installed (Automated) + - id: 6058 + title: "Ensure DHCP Server is not installed" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this the dhcp package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcpd: # yum remove dhcp" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp + condition: all + rules: + - 'c:rpm -q dhcp-> r:package dhcp is not installed' + +# 2.2.6 Ensure LDAP server is not installed (Automated) + - id: 6059 + title: "Ensure LDAP Server is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to remove slapd: # yum remove openldap-servers" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on OpenLDAP is available at https://www.openldap.org + condition: all + rules: + - 'c:rpm -q openldap-servers-> r:package openldap-servers is not installed' + + + +# 2.2.7 Ensure nfs-utils is not installed or the nfs-server service is masked (Automated) + - id: 6060 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # yum remove nfs-utils; OR if the nfs-package is required as a dependency: run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'c:rpm -q nfs-utils-> r:package nfs-utils is not installed' + - 'c:systemctl is-enabled nfs-server -> r:masked' + +# 2.2.8 Ensure rpcbind is not installed or the rpcbind services are masked (Automated) + - id: 6061 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked" + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening" + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # yum remove nfs-utils; OR if the nfs-package is required as a dependency: run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'c:rpm -q rpcbind-> r:package rpcbind is not installed' + - 'not c:systemctl is-enabled rpcbind rpcbind.socket -> r:enabled' + + + +# 2.2.9 Ensure DNS Server is not installed (Automate) + - id: 6062 + title: " Ensure DNS Server is not installed " + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable named: # yum remove bind" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q bind-> r:package bind is not installed' + +# 2.2.10 Ensure FTP Server is not installed (Automated) + - id: 6063 + title: "Ensure FTP Server is not installed" + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)" + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # yum remove vsftpd" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q vsftpd-> r:package vsftpd is not installed' + +# 2.2.11 Ensure HTTP server is not installed (Automated) + - id: 6064 + title: "Ensure HTTP server is not installed" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable httpd: # yum remove httpd" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q httpd-> r:package httpd is not installed' + +# 2.2.12 Ensure IMAP and POP3 server is not installed (Automated) + - id: 6065 + title: "Ensure IMAP and POP3 server is not installed" + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable dovecot: # yum remove dovecot" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q dovecot-> r:package dovecot is not installed' + +# 2.2.13 Ensure Samba is not installed (Automated) + - id: 6066 + title: "Ensure Samba is not installed" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to disable smb: # yum remove samba" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q samba-> r:package samba is not installed' + +# 2.2.14 Ensure HTTP Proxy Server is not installed (Automated) + - id: 6067 + title: "Ensure HTTP Proxy Server is not installed" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # yum remove squid" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q squid-> r:package squid is not installed' + +# 2.2.15 Ensure net-snmp is not installed (Automated) + - id: 6068 + title: "Ensure SNMP Server is not installed" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3replaces the simple/clear text password sharing used in SNMPv2with more securely encoded parameters. If the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system." + remediation: "Run the following command to disable snmpd: # # yum remove net-snmp" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["2.6",9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q net-snmp-> r:package net-snmp is not installed' + +# 2.2.16 Ensure mail transfer agent is configured for local-only mode (Automated) + - id: 6069 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25\s* && !r:127.0.0.1:25\.*|::1:25\.*' + +# 2.2.17 Ensure rsync is not installed or the ervice is masked (Automated) + - id: 6070 + title: "Ensure rsync is not installed or the rsyncd service is masked" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to remove the rsync package: # yum remove rsync; OR run the following command to mask the rsyncd service: # systemctl --now mask rsyncd" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: any + rules: + - 'c:rpm -q rsync-> r:package rsync is not installed' + - 'c:systemctl is-enabled rsyncd-> r:masked' + + # 2.2.18 Ensure NIS server is not installed (Automated) + - id: 6071 + title: "Ensure NIS Server is not installed" + description: "The ypserv package provides the Network Information Service (NIS). This service, formally known as Yellow Pages, is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the ypservpackage be removed, and if required a more secure services be used." + remediation: "Run the following command to disable ypserv: # yum remove ypserv" + compliance: + - cis: ["2.2.18"] + - cis_csc: ["2.6","9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q ypserv-> r:package ypserv is not installed' + + +# 2.2.19 Ensure telnet-server is not installed (Automated) + - id: 6072 + title: "Ensure telnet server is not installed" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to disable telnet: # yum remove telnet-server" + compliance: + - cis: ["2.2.19"] + - cis_csc: ["2.6","9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:rpm -q telnet-server-> r:package telnet-server is not installed' + + + +############################################### +# 2.3 Service Clients +############################################### + +# 2.3.1 Ensure NIS Client is not installed (Automated) + - id: 6073 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # yum remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q ypbind -> r:package ypbind is not installed' + +# 2.3.2 Ensure rsh client is not installed (Automated) + - id: 6074 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh, rcp and rlogin ." + remediation: "Run the following command to uninstall rsh: # yum remove rsh" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q rsh -> r:^package rsh is not installed' + +# 2.3.3 Ensure talk client is not installed (Automated) + - id: 6075 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk: # yum remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q talk -> r:^package talk is not installed' + +# 2.3.4 Ensure telnet client is not installed (Automated) + - id: 6076 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet: # yum remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q telnet -> r:^package telnet is not installed' + +# 2.3.5 Ensure LDAP client is not installed (Automated) + - id: 6077 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients: # yum remove openldap-clients" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q openldap-clients -> r:^package openldap-clients is not installed' + +# 2.5 Ensure nonessential services are removed or masked (Manual) + - id: 6078 + title: "Ensure nonessential services are removed or masked" + description: "A network port is identified by its number, the associated IP address, and the type of the communication protocol such as TCP or UDP.A listening port is a network port on which an application or process listens on, acting as a communication endpoint. Each listening port can be open or closed (filtered) using a firewall. In general terms, an open port is a network port that accepts incoming packets from remote locations" + rationale: "Services listening on the system pose a potential risk as an attack vector. These services should be reviewed, and if not required, the service should be stopped, and the package containing the service should be removed. If required packages have a dependency, the service should be stopped and masked to reduce the attack surface of the system." + remediation: "Review the output of: # lsof -i -P -n | grep -v '(ESTABLISHED)'; to ensure that all services listed are required on the system. If a listed service is not required, remove the package containing the service. If the package containing the service is required, stop and mask the service. Run the following command to remove the package containing the service:# yum remove OR if required packages have a dependency: run the following command to stop and mask the service:# systemctl --now mask " + compliance: + - cis: ["2.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:lsof -i -P -n -> r:(ESTABLISHED)' + +############################################### +# 3 Network Configuration and Firewalls +############################################### +############################################### +# 3.1 Disable unused network protocols and devices +############################################### + +# 3.1.1 Disable IPv6 (Manual) + - id: 6079 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6be disabled to reduce the attack surface of the system." + remediation: "To disable IPv6 through the GRUB2 config: edit /etc/default/gruband add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX=\"ipv6.disable=1\" Run the following command to update the grub2 configuration:# grub2-mkconfig –o /boot/grub2/grub.cfg; OR to disable IPv6 through sysctl settings: set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: # net.ipv6.conf.all.disable_ipv6 = 1; # net.ipv6.conf.default.disable_ipv6 = 1; Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.disable_ipv6=1; # sysctl -w net.ipv6.conf.default.disable_ipv6=1; # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*linux && !r:ipv6.disable=1' + - 'c:sysctl net.ipv6.conf.all.disable_ipv6-> r:net.ipv6.conf.all.disable_ipv6\s*=\s*0' + - 'c:sysctl net.ipv6.conf.default.disable_ipv6-> r:net.ipv6.conf.default.disable_ipv6\s*=\s*0' + + +# 3.1.2 Ensure wireless interfaces are disabled (Manual) + - id: 6080 + title: "Ensure wireless interfaces are disabled" + description: "Wireless networking is used when wired networks are unavailable." + rationale: "If wireless is not to be used, wireless devices should be disabled to reduce the potential attack surface" + remediation: "Run the following command to disable any wireless interfaces: # ip link set down" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:iw list-> r:Interface' + +################################################## +# 3.2 Network Parameters (Host Only) +################################################## + + +# 3.2.1 Ensure IP forwarding is disabled (Automated) + - id: 6081 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following commands to restore the default parameters and set the active kernel parameters: # grep -Els '^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1' /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri 's/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/' $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'not c:grep -RhEs "^\s*net\.ipv4\.ip_forward\s*=\s*1" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf-> r:ip_forward' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + - 'not c:grep -RhEs "^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf-> r:forwarding' + + +# 3.2.2 Ensure packet redirect sending is disabled (Automated) + - id: 6082 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0 and set the active kernel parameters. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0' + +################################################## +# 3.3 Network Parameters (Host and Router) +################################################## + +# 3.3.1 Ensure source routed packets are not accepted (Automated) + - id: 6083 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0; net.ipv4.conf.default.accept_source_route = 0 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0' + + +# 3.3.2 Ensure ICMP redirects are not accepted (Automated) + - id: 6084 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + + +# 3.3.3 Ensure secure ICMP redirects are not accepted (Automated) + - id: 6085 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0; net.ipv4.conf.default.secure_redirects = 0 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0' + +# 3.3.4 Ensure suspicious packets are logged (Automated) + - id: 6086 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1; net.ipv4.conf.default.log_martians = 1 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1' + +# 3.3.5 Ensure broadcast ICMP requests are ignored (Automated) + - id: 6087 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 and set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1' + +# 3.3.6 Ensure bogus ICMP responses are ignored (Automated) + - id: 6088 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1 and set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1' + +# 3.3.7 Ensure Reverse Path Filtering is enabled (Automated) + - id: 6089 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1; net.ipv4.conf.default.rp_filter = 1 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1' + +# 3.3.8 Ensure TCP SYN Cookies is enabled (Automated) + - id: 6090 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 and set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1' + +# 3.3.9 Ensure IPv6 router advertisements are not accepted (Automated) + - id: 6091 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0' + + + +############################################### +# 3.4 Uncommon Network Protocols +############################################### +# 3.4.1 Ensure DCCP is disabled (Automated) + - id: 6092 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:install /bin/true' + - 'not c:lsmod -> r:dccp' + + + +# 3.4.2 Ensure SCTP is disabled (Automated) + - id: 6093 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:install /bin/true' + - 'not c:lsmod -> r:sctp' + + +############################################### +# 3.5 Firewall Configuration +############################################### +############################################### +# 3.5.1 Configure firewalld +############################################### + +# 3.5.1.1 Ensure FirewallD is installed (Automated) +# 3.5.2.1 Ensure nftables is installed (Automated) +# 3.5.3.1.1 Ensure iptables packages are installed (Automated) +# 3 rules here: + - id: 6094 + title: "Ensure FirewallD or nftables or iptables-services is installed" + description: "firewalld is a firewall management tool for Linux operating systems. It provides firewall features by acting as a front-end for the Linux kernel's net filter framework via the iptables backend or provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the nftables utility. FirewallD replaces iptables as the default firewall management tool. Use the firewalld utility to configure a firewall for less complex firewalls. The utility is easy to use and covers the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can administer separate firewall zones with varying degrees of trust as defined in zone profiles." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + remediation: "Run the following command to install firewalld: # yum install firewalld iptables; OR to install nftables: # yum install nftables; OR to install iptables-services: # yum install iptables-services iptables" + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - 'not c:rpm -q iptables firewalld-> r:is not installed' + - 'not c:rpm -q nftables-> r:is not installed' + - 'not c:rpm -q iptables iptables-services-> r:is not installed' + +# 3.5.1.2 Ensure iptables-services package is not installed (Automated) +# 3.5.3.1.3 Ensure firewalld is not installed or stopped and masked(Automated) +# both of the rules are here + - id: 6095 + title: "Ensure iptables-services and FirewallD are not installed at the same time" + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both firewalld and the services included in the iptables-services package may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package: # systemctl stop iptables; # systemctl stop ip6tables; # yum remove iptables-services. OR Run the following command to remove firewalld: # yum remove firewalld OR Run the following command to stop and mask firewalld: # systemctl --now mask firewalld" + compliance: + - cis: ["3.5.1.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - 'c:rpm -q iptables-services firewalld-> r:is not installed' + - 'c:systemctl is-enabled firewalld-> r:masked' + + + +# 3.5.1.3 Ensure nftables is not installed or stopped and masked (Automated) +# 3.5.2.2 Ensure firewalld is not installed or stopped and masked (Automated) +# Both of the rules are here + - id: 6096 + title: "Ensure nftables and FirewallD are not installed at the same time or ensure one of them is stopped and masked" + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables.Note: Support for using nftables as the back-end for firewalld was added in release v0.6.0. In Fedora 19 Linux derivatives, firewalld utilizes iptables as its back-end by default." + rationale: "Running both firewalld and nftables may lead to conflict." + remediation: "Run the following command to remove nftables:# yum remove nftables; OR run the following command to stop and mask nftables: # systemctl --now mask nftables. OR Run the following command to remove firewalld: # yum remove firewalld OR Run the following command to stop and mask firewalld: # systemctl --now mask firewalld" + compliance: + - cis: ["3.5.1.3","3.5.3.1.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - 'c:rpm -q iptables-services nftables -> r:is not installed' + +# 3.5.2.3 Ensure iptables-services package is not installed (Automated) +# 3.5.3.1.2 Ensure nftables is not installed (Automated) +# Both of the rules are here + + - id: 6097 + title: "Ensure nftables and iptables-services are not installed at the same time or ensure one of them is stopped and masked" + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables.Note: Support for using nftables as the back-end for firewalld was added in release v0.6.0. In Fedora 19 Linux derivatives, firewalld utilizes iptables as its back-end by default." + rationale: "Running both nftables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables:# yum remove nftables; OR run the following command to stop and mask nftables: # systemctl --now mask nftables. OR Run the following command to remove iptables# # systemctl stop iptables; # systemctl stop ip6tables; # yum remove iptables-services" + compliance: + - cis: ["3.5.1.3","3.5.3.1.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - 'c:rpm -q firewalld nftables -> r:is not installed' + - 'c:systemctl is-enabled nftables-> r:masked' + - 'c:systemctl is-enabled firewalld-> r:masked' + + + +# 3.5.1.4 Ensure firewalld service is enabled and running (Automated) + - id: 6098 + title: "Ensure firewalld service is enabled and running" + description: "firewalld.serviceenables the enforcement of firewall rules configured through firewalld" + rationale: "Ensure that the firewalld.service is enabled and running to enforce firewall rules configured through firewalld" + remediation: "Run the following command to unmask firewalld: # systemctl unmask firewalld; Run the following command to enable and start firewalld: # systemctl --now enable firewalld" + compliance: + - cis: ["3.5.1.4"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:systemctl is-enabled firewalld -> r:enabled' + - 'c:firewall-cmd --state-> r:running' + + +############################################### +# 3.5.2 Configure nftables #################### +############################################### + +# 3.5.2.5 Ensure a table exists (Automated) + - id: 6099 + title: "Ensure a table exists" + description: "nTables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + remediation: "Run the following command to create a table in nftables: # nft create table inet " + compliance: + - cis: ["3.5.2.5"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:nft list tables-> r:table' + +# 3.5.2.6 Ensure base chains exist (Automated) + - id: 6100 + title: "Ensure base chains exist" + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + remediation: "Run the following command to create the base chains: # nft createchain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } " + compliance: + - cis: ["3.5.2.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:nft list ruleset-> r:type filter hook input priority 0' + - 'c:nft list ruleset-> r:type filter forward priority 0' + - 'c:nft list ruleset-> r:type filter hook output priority 0' + +# 3.5.2.7 Ensure loopback traffic is configured (Automated) + - id: 6101 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network" + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # nft add rule inet filter input iif lo accept; # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop; IF IPv6 is enabled: run the following command to implement the IPv6 loopback rules: # nft add rule inet filter input ip6 saddr::1 counter drop" + compliance: + - cis: ["3.5.2.7"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:nft list ruleset-> r:iif "lo" accept' + - 'c:nft list ruleset-> r:ip saddr 127.0.0.0/8 counter packets 0 bytes 0 drop' + +# 3.5.2.8 Ensure outbound and established connections are configured (Manual) + - id: 6102 + title: "Ensure outbound and established connections are configured" + description: "Configure the firewall rules for new outbound and established connections." + rationale: "If rules are not in place for new outbound and established connections, all packets will be dropped by the default policy preventing network usage." + remediation: "Configure nftables in accordance with site policy. The following commands will implement a policy to allow all outbound connections and all established connections: # nft add rule inet filter input ip protocol tcp ct state established accept; # nft add rule inet filter input ip protocol udp ct state established accept; # nft add rule inet filter input ip protocol icmp ct state established accept; # nft add rule inet filter output ip protocol tcp ct state new,related,established accept; # nft add rule inet filter output ip protocol udp ct state new,related,established accept; # nft add rule inet filter output ip protocol icmp ct state new,related,established accept" + compliance: + - cis: ["3.5.2.8"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:nft list ruleset-> r:ip protocol tcp ct state established accept' + - 'c:nft list ruleset-> r:ip protocol tcp udp state established accept' + - 'c:nft list ruleset-> r:ip protocol tcp icmp state established accept' + - 'c:nft list ruleset-> r:ip protocol tcp ct state established,related,new accept' + - 'c:nft list ruleset-> r:ip protocol tcp udp state established,related,new accept' + - 'c:nft list ruleset-> r:ip protocol tcp icmp state established,related,new accept' + + +# 3.5.2.9 Ensure default deny firewall policy (Automated) + - id: 6103 + title: "Ensure default deny firewall policy" + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; }" + compliance: + - cis: ["3.5.2.9"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:nft list ruleset-> r:type filter hook input priority 0; policy drop;' + - 'c:nft list ruleset-> r:type filter hook forward priority 0; policy drop;' + - 'c:nft list ruleset-> r:type filter hook output priority 0; policy drop;' + +# 3.5.2.10 Ensure nftables service is enabled (Automated) + - id: 6104 + title: "Ensure nftables service is enabled" + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service" + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conffile during boot or the starting of the nftables service" + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables" + compliance: + - cis: ["3.5.2.10"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:systemctl is-enabled nftables-> r:enabled' + - 'c:nft list ruleset-> r:type filter hook forward priority 0; policy drop;' + - 'c:nft list ruleset-> r:type filter hook output priority 0; policy drop;' + +# 3.5.2.11 Ensure nftables rules are permanent (Automated) + - id: 6105 + title: "Ensure nftables rules are permanent" + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames. The nftables service reads the /etc/sysconfig/nftables.conffile for a nftables file or files to include in the nftables ruleset. A nftables ruleset containing the input, forward, and output base chains allow network traffic to be filtered." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables" + rationale: "Changes made to nftables ruleset only affect the live system, you will also need to configure the nftables ruleset to apply on boot" + compliance: + - cis: ["3.5.2.11"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'f:/etc/sysconfig/nftables.conf-> r:^include "/etc/nftables/nftables.rules"' + - 'not f:/etc/sysconfig/nftables.conf-> r:#\s*include "/etc/nftables/nftables.rules"' + + +############################################### +# 3.5.3 Configure iptables #################### +############################################### +############################################### +#3.5.3.2 Configure IPv4 iptabl +############################################### + +# 3.5.3.2.1 Ensure default deny firewall policy (Automated) + - id: 6106 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP" + compliance: + - cis: ["3.5.3.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + + +# 3.5.3.2.2 Ensure loopback traffic is configured (Automated) + - id: 6107 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.5.3.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + +# 3.5.3.2.6 Ensure iptables is enabled and running (Automated) + - id: 6108 + title: "Ensure iptables is enabled and running" + description: "iptables.service is a utility for configuring and maintaining iptables." + rationale: "iptables.service willload the iptables rules saved in the file /etc/sysconfig/iptablesat boot, otherwise the iptables rules will be cleared during a re-boot of the system." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP; # ip6tables -P OUTPUT DROP; # ip6tables -PFORWARD DROP" + compliance: + - cis: ["3.5.3.2.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:systemctl is-enabled iptables -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:systemctl status iptables -> r:Active: active (running) since \w+ \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d' + +############################################### +# 3.5.3.3 Configure IPv6 ip6tables +############################################### + +# 3.5.3.3.1 Ensure IPv6 default deny firewall policy (Automated) + - id: 6109 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP; # ip6tables -P OUTPUT DROP; # ip6tables -PFORWARD DROP" + compliance: + - cis: ["3.5.3.3.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L-> r:Chain INPUT (policy DROP)' + - 'c:ip6tables -L-> r:Chain FORWARD (policy DROP)' + - 'c:ip6tables -L-> r:Chain OUTPUT (policy DROP)' + + +# 3.5.3.3.2 Ensure IPv6 loopback traffic is configured (Automated) + - id: 6110 + title: "Ensure IPv6 loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic tothe loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure" + remediation: "Run the following commands to implement the loopback rules:# ip6tables -A INPUT -i lo -j ACCEPT# ip6tables -A OUTPUT -o lo -j ACCEPT# ip6tables -A INPUT -s::1 -j DROP" + compliance: + - cis: ["3.5.3.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n-> r:ACCEPT' + - 'c:ip6tables -L INPUT -v -n-> r:DROP' + - 'c:ip6tables -L OUTPUT -v -n-> r:ACCEPT' + +# 3.5.3.3.3 Ensure IPv6 outbound and established connections are configured (Manual) + - id: 6111 + title: "Ensure IPv6 outbound and established connections are configured" + description: "Configure the firewall rules for new outbound, and established IPv6 connections." + rationale: "If rules are not in place for new outbound, and established connections all packets will be dropped by the default policy preventing network usage" + remediation: "Configure iptables in accordance with site policy. The following commands will implement a policy to allow all outbound connections and all established connections:# ip6tables -AOUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT# ip6tables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT# ip6tables -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT# ip6tables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT# ip6tables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT# ip6tables -A INPUT -p icmp -m state --state ESTABLISHED -j ACCEPT" + compliance: + - cis: ["3.5.3.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L OUTPUT -v -n-> r:state NEW,ESTABLISHED' + - 'c:ip6tables -L INPUT -v -n-> r:state ESTABLISHED' + + +# 3.5.3.3.6 Ensure ip6tables is enabled and running (Automated) + - id: 6112 + title: "Ensure ip6tables is enabled and running" + description: "ip6tables.service is a utility for configuring and maintaining ip6tables." + rationale: "ip6tables.service will load the iptables rules saved in the file /etc/sysconfig/ip6tables at boot, otherwise the ip6tables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start ip6tables: # systemctl --now start ip6tables" + compliance: + - cis: ["3.5.3.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:systemctl is-enabled ip6tables -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:systemctl status ip6tables -> r:Active: active (running) since \w+ \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d' + + + +############################################### +# 4 Logging and Auditing +############################################### +############################################### +# 4.1 Configure System Accounting (auditd) +############################################### + +# 4.1.1.1 Ensure auditd is installed + - id: 6113 + title: "Ensure auditd is installed" + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # yum install audit audit-libs" + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1","10.7"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:rpm -q audit -> r:^audit-\S+' + - 'c:rpm -q audit-libs -> r:^audit-libs-\S+' + +# 4.1.1.2 Ensure auditd service is enabled (Scored) + - id: 6114 + title: "Ensure auditd service is enabled and running" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1","10.7"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled auditd -> r:^enabled' + - 'c:systemctl status auditd -> r:Active: active \(running\)' + + +# 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 6115 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected. Note: This recommendation is designed around the grub2 bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + remediation: "Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\" . Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.2.6","10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + +# 4.1.2.1 Ensure audit log storage size is configured (Not Scored) + - id: 6116 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.2.1"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file = \d+' + +# 4.1.2.2 Ensure audit logs are not automatically deleted (Scored) + - id: 6117 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.2.2"] + - cis_csc: ["6.2","6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + +# 4.1.2.3 Ensure system is disabled when audit logs are full (Scored) + - id: 6118 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.2.3"] + - cis_csc: ["6.2","6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt' + +# 4.1.2.4 Ensure audit_backlog_limit is sufficient + - id: 6119 + title: "Ensure audit_backlog_limit is sufficient" + description: "The backlog limit has a default setting of 64" + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more than 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected" + remediation: "Edit /etc/default/grub and add audit_backlog_limit= to GRUB_CMDLINE_LINUX: Example: GRUB_CMDLINE_LINUX=\"audit_backlog_limit=8192\" Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["4.1.2.4"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:audit_backlog_limit=' + + + +# 4.1.3 Ensure events that modify date and time information are collected (Scored) + - id: 6120 + title: "Ensure events that modify date and time information are collected" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"." + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/time-change.rules and add the following lines: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/time-change.rules and add the following lines: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.3"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/localtime && r:-p wa && r:-k time-change' + +# 4.1.4 Ensure events that modify user/group information are collected (Scored) + - id: 6121 + title: "Ensure events that modify user/group information are collected" + description: "Record events affecting the group, passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/identity.rules and add the following lines: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.4"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/group && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/passwd && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/gshadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/shadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/security/opasswd && r:-p wa && r:-k identity' + +# 4.1.5 Ensure events that modify the system's network environment are collected (Scored) + - id: 6122 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale " + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.5","6.2"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/issue && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/issue.net && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/hosts && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sysconfig/network && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale' + +# 4.1.6 Ensure events that modify the system's Mandatory Access Controls are collected (Scored) + - id: 6123 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/MAC-policy.rules and add the following lines: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy ." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/selinux/ && r:-p wa && r:-k MAC-policy' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /usr/share/selinux/ && r:-p wa && r:-k MAC-policy' + +# 4.1.7 Ensure login and logout events are collected (Scored) + - id: 6124 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The /var/run/faillock/ directory maintains records of login failures via the pam_faillock module. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/logins.rules and add the following lines: -w /var/log/lastlog -p wa -k logins -w /var/run/faillog/ -p wa -k logins IF the pam_faillock.so module is used: Also include the line: -w /var/run/faillock/ -p wa -k logins OR IF the pam_tally2.so module is used: Also include the line: -w /var/log/tallylog -p wa -k logins" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["4.9","16.11","16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/lastlog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/run/faillog/ && r:-p wa && r:-k logins' + +# 4.1.8 Ensure session initiation information is collected (Scored) + - id: 6125 + title: "Ensure session initiation information is collected" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"." + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/logins.rules and add the following lines: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins . Notes: The last command can be used to read /var/log/wtmp ( last with no parameters) and /var/run/utmp ( last -f /var/run/utmp ) Reloading the auditd config to set active settings may require a system reboot." + compliance: + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9","16.11","16.13"] + - pci_dss: ["10.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/run/utmp && r:-p wa && r:-k session' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/wtmp && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/btmp && r:-p wa && r:-k logins' + +# 4.1.9 Ensure discretionary access control permission modification events are collected (Scored) + - id: 6126 + title: "Ensure discretionary access control permission modification events are collected" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod, fchmod and fchmodat system calls affect the permissions associated with a file. The chown, fchown, fchownat and lchown system calls affect owner and group attributes on a file. The setxattr, lsetxattr, fsetxattr (set extended file attributes) and removexattr, lremovexattr, fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/perm_mod.rules and add the following lines: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/perm_mod.rules and add the following lines: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem . Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + +# 4.1.10 Ensure unsuccessful unauthorized file access attempts are collected (Scored) + - id: 6127 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open, openat ) and truncation ( truncate, ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/access.rules and add the following lines: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/access.rules and add the following lines: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access . Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + +# 4.1.12 Ensure successful file system mounts are collected (Scored) + - id: 6128 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/mount.rules and add the following lines: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/mounts.rules and add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts . Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' + + +# 4.1.13 Ensure file deletion events by users are collected (Scored) + - id: 6129 + title: "Ensure file deletion events by users are collected" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for ollowing system calls and tags them with the identifier \"delete\": unlink -remove a file unlinkat - remove a file attribute), rename (rename a file and renameat - rename a file attribute." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/delete.rules and add the following lines: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/delete.rules and add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete . Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["6.2","13"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4","PI1.5","CC7.1","CC7.2","CC7.3","CC8.1"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' + +# 4.1.14 Ensure changes to system administration scope (sudoers) is collected (Scored) + - id: 6130 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: "Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers or a file in the /etc/sudoers.d directory will be written to when the file or its attributes have changed." + rationale: "Changes in the /etc/sudoers file, or a file in the /etc/sudoers.d/ directory can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/scope.rules and add the following lines:: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope . Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope' + +# 4.1.15 Ensure system administrator actions (sudolog) are collected (Scored) + - id: 6131 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. The sudo log file is configured in /etc/sudoersor a file in /etc/sudoers.d. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to the sudo log file. Any time a command is executed, an audit event will be triggered as the sudo log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules . Example: vi /etc/audit/rules.d/action.rules and add the following lines: -w /var/log/sudo.log -p wa -k actions ." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.9","5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/sudo.log && r:-p wa && r:-k actions' + +# 4.1.16 Ensure kernel module loading and unloading is collected (Scored) + - id: 6132 + title: "Ensure kernel module loading and unloading is collected" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/modules.rules and add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b32 -S init_module -S delete_module -k modules For 64 bit systems Edit or create a file in the /etc/audit/rules.d/directory ending in .rules Example: vi /etc/audit/rules.d/modules.rules Add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b64 -S init_module -S delete_module -k modules " + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + +# 4.1.17 Ensure the audit configuration is immutable (Scored) + - id: 6133 + title: "Ensure the audit configuration is immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl . Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rulesand add the following line at the end of the file: -e 2" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-e 2' + + +############################################### +# 4.2 Configure Logging +############################################### + + +# 4.2.1.1 Ensure rsyslog is installed (Scored) + - id: 6134 + title: "Ensure rsyslog is installed" + description: "The rsyslog software is a recommended replacement to the original syslogd daemon. rsyslog provides improvements over syslogd, including: - connection-oriented (i.e. TCP) transmission of logs - The option to log to database formats - Encryption of log data en route to a central logging server" + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # yum install rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'c:rpm -q rsyslog -> r:^rsyslog-\S+' + + +# 4.2.1.2 Ensure rsyslog Service is enabled (Scored) + - id: 6135 + title: "Ensure rsyslog Service is enabled and running" + description: "rsyslogneeds to be enabled and running to perform logging" + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lackblogging instead." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled rsyslog -> enabled' + - 'c:systemctl status rsyslog -> r:active \(running\)' + +# 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 6136 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\.*.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + +# 4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host (Scored) + - id: 6137 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["6.6","6.8"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + + +############################################### +# 4.2 Configure journald +############################################### + + +# 4.2.2.1 Ensure journald is configured to send logs to rsyslog + - id: 6138 + title: "Ensure journald is configured to send logs to rsyslog " + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.5"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog\s*=\s*yes' + +# 4.2.2.2 Ensure journald is configured to compress large log files + - id: 6139 + title: "Ensure journald is configured to compress large log files" + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Compress\s*=\s*yes' + +# 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk + - id: 6140 + title: "Ensure journald is configured to compress large log files" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Storage\s*=\s*persistent' + + + + # 4.2.3 Ensure permissions on all logfiles are configured (Scored) + - id: 6141 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected. Other/world should not have the ability to view this information. Group should not have the ability to modify this information." + remediation: "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx \"{}\" + -o -type d -exec chmod g-wx,o-rwx \"{}\" +" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + +#################################################### +# 5 Access, Authentication and Authorization +#################################################### +#################################################### +# 5.1 Configure time-based job schedulers +#################################################### +# 5.1.1 Ensure cron daemon is enabled and running (Automated) + - id: 6142 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # systemctl enable crond; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:systemctl is-enabled crond -> enabled' + - 'c:systemctl status crond -> r:Active: active \(running\) since \w+ \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d' + + +# 5.1.2 Ensure permissions on /etc/crontab are configured (Automated) + - id: 6143 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab; # chmod og-rwx /etc/crontab; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\w00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Automated) + - id: 6144 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly; # chmod og-rwx /etc/cron.hourly; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.4 Ensure permissions on /etc/cron.daily are configured (Automated) + - id: 6145 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily; # chmod og-rwx /etc/cron.daily; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Automated) + - id: 6146 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly; # chmod og-rwx /etc/cron.weekly; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Automated) + - id: 6147 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly; # chmod og-rwx /etc/cron.monthly; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\w00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.7 Ensure permissions on /etc/cron.d are configured (Automated) + - id: 6148 + title: "Ensure permissions on /etc/cron.d are configured" + description: "The /etc/cron.d/directory contains system cronjobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab, but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d; # chmod og-rwx /etc/cron.d; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.8 Ensure cron is restricted to authorized users (Scored) + - id: 6149 + title: "Ensure cron is restricted to authorized users" + description: "If cronis installed in the system, configure /etc/cron.allowto allow specific users to use these services. If /etc/cron.allowdoes not exist, then /etc/cron.denyis checked. Any user not specifically defined in those files is allowed to use cron. By removing the file, only users in /etc/cron.alloware allowed to use cron." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allowfile to control who can run cronjobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.deny -> r:No such file or directory$' + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.9 Ensure at is restricted to authorized users (Automated) + - id: 6150 + title: "Ensure at is restricted to authorized users" + description: "If atis installed in the system, configure /etc/at.allowto allow specific users to use these services. If /etc/at.allowdoes not exist, then /etc/at.denyis checked. Any user not specifically defined in those files is allowed to use at. By removing the file, only users in /etc/at.alloware allowed to use at." + rationale: "On many systems, only the system administrator is authorized to schedule atjobs. Using the at.allowfile to control who can run atjobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.9"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/at.deny -> r:No such file or directory$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + + +############################################### +# 5.2 Configure SSH Server +############################################### +# 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Automated) + - id: 6151 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: chown root:root /etc/ssh/sshd_config and chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + + +# 5.2.2 Ensure permissions on SSH private host key files are configured (Automated) + - id: 6152 + title: "Ensure permissions on SSH private host key files are configured" + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated" + remediation: "Run the following commands to set permissions, ownership, and group on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod u-x,g-wx,o-rwx {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:ssh_keys {} \\;" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_rsa_key" -exec stat {} \;->^Access: \(0\d40/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ecdsa_key" -exec stat {} \;->^Access: \(0\d40/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ed25519_key" -exec stat {} \;->^Access: \(0\d400/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.2.3 Ensure permissions on SSH public host key files are configured (Automated) + - id: 6153 + title: "Ensure permissions on SSH private host key files are configured" + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod u-x,go-wx {} \\; #find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_rsa_key.pub" -exec stat {} \;->^Access: \(0\d444/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ecdsa_key.pub" -exec stat {} \;->^Access: \(0\d44/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ed25519_key.pub" -exec stat {} \;->^Access: \(0\d44/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + + +# 5.2.4 Ensure SSH access is limited (Scored) + - id: 6154 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. AllowGroups The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. DenyUsers The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. DenyGroups The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: # AllowUsers ; # AllowGroups ; # DenyUsers ; # DenyGroups " + compliance: + - cis: ["5.2.4"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'f:$sshd_file -> r:^\s*AllowUsers' + - 'f:$sshd_file -> r:^\s*AllowGroups' + - 'f:$sshd_file -> r:^\s*DenyUsers' + - 'f:$sshd_file -> r:^\s*DenyGroups' + +# 5.2.5 Ensure SSH LogLevel is appropriate (Automated) + - id: 6155 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field.VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: any + rules: + - 'f:$sshd_file -> r:^# && r:LogLevel\s*\t*INFO' + - 'f:$sshd_file -> r:^# && r:LogLevel\s*\t*VERBOSE' + + +# 5.2.6 Ensure SSH X11 forwarding is disabled (Automated) + - id: 6156 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - pci_dss: ["9.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*X11Forwarding\s*\t*no' + +# 5.2.7 Ensure SSH MaxAuthTries is set to 4 or less (Automated) + - id: 6157 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + + +# 5.2.8 Ensure SSH IgnoreRhosts is enabled (Automated) + - id: 6158 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' + +# 5.2.9 Ensure SSH HostbasedAuthentication is disabled (Automated) + - id: 6159 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' + +# 5.2.10 Ensure SSH root login is disabled (Automated) + - id: 6160 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' + +# 5.2.11 Ensure SSH PermitEmptyPasswords is disabled (Automated) + - id: 6161 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + +# 5.2.12 Ensure SSH PermitUserEnvironment is disabled (Automated) + - id: 6162 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*PermitUserEnvironment\s*\t*no' + +# 5.2.13 Ensure only strong Ciphers are used (Automated) + - id: 6163 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "This variable limits the ciphers that SSH can use during communication." + rationale: "Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised.: The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a 'Sweet32' attack; The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involvingLSB values, aka the 'Bar Mitzvah' issue; The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session; Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors; The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address" + remediation: "Edit the /etc/ssh/sshd_configfile add/modify the Ciphersline to contain a comma separated list of the site approved ciphersExample:Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["14.4"] + - pci_dss: ["12.3.8"] + condition: none + rules: + - 'c:sshd -T -> r:ciphers && r:3des-cbc|aes192-cbc|aes256-cbc|arcfour|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se' + +# 5.2.14 Ensure only strong MAC algorithms are used (Automated) + - id: 6164 + title: "Ensure only strong MAC algorithms are used" + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example:MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["14.4", "16.5"] + - pci_dss: ["12.3.8"] + condition: none + rules: + - 'c:sshd -T -> r:macs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com' + + +# 5.2.15 Ensure only strong Key Exchange algorithms are used (Automated) + - id: 6165 + title: "Ensure only strong Key Exchange algorithms are used" + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms.Example:'KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256'" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["14.4"] + - pci_dss: ["12.3.8"] + condition: none + rules: + - 'c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1' + + + +# 5.2.16 Ensure SSH Idle Timeout Interval is configured (Automated) + - id: 6166 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare >= 1' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare >= 1' + +# 5.2.17 Ensure SSH LoginGraceTime is set to one minute or less (Automated) + - id: 6167 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + +# 5.2.18 Ensure SSH warning banner is configured (Automated) + - id: 6168 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.18"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*Banner\s*\t*/etc/issue.net' + + +# 5.2.19 Ensure SSH PAM is enabled (Automated) + - id: 6169 + title: "Ensure SSH PAM is enabled" + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthenticationand PasswordAuthentication in addition to PAM account and session module processing for all authentication types" + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*UsePAM\s*yes' + + +# 5.2.20 Ensure SSH AllowTcpForwarding is disabled (Automated) + - id: 6170 + title: "Ensure SSH AllowTcpForwarding is disabled" + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines" + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors.SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no" + compliance: + - cis: ["5.2.20"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*AllowTcpForwarding\s*no' + + +# 5.2.21 Ensure SSH MaxStartups is configured (Automated) + - id: 6171 + title: "Ensure SSH MaxStartups is configured" + description: "The MaxStartupsparameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon" + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60" + compliance: + - cis: ["5.2.21"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*maxstartups\s*10:30:60' + + +# 5.2.22 Ensure SSH MaxSessions is limited (Automated) + - id: 6172 + title: "Ensure SSH MaxSessions is limited" + description: "The MaxSessionsparameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10" + compliance: + - cis: ["5.2.22"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*MaxSessions\s*10' + + + +############################################### +# 5.3 Configure PAM +############################################### +# 5.3.1 Ensure password creation requirements are configured (Automated) + - id: 6173 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy: minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy: minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy:password requisite pam_pwquality.so try_first_pass retry=3" + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> n:^\s*minclass\s+\t*=\s+\t*(\d+) compare >= 4' + - 'f:/etc/pam.d/password-auth -> n:try_first_pass retry=(\d+) compare <=3' + - 'f:/etc/pam.d/system-auth -> n:try_first_pass retry=(\d+) compare <=3' + +# 5.3.3 Ensure password hashing algorithm is SHA-512 (Automated) + - id: 6174 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these changes only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1","8.2.1"] + - tsc: ["CC6.1","CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + - 'f:/etc/pam.d/system-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + +# 5.3.4 Ensure password reuse is limited (Automated) + - id: 6175 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these changes only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=5 or password required pam_pwhistory.so remember=5" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + + +############################################### +# 5.4 User Accounts and Environment +############################################### +############################################### +# 5.4.1 Set Shadow Password Suite Parameters +############################################### +# 5.4.1.1 Ensure password expiration is 365 days or less (Automated) + - id: 6176 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + + +# 5.4.1.2 Ensure minimum days between password changes is configured (Automated) + - id: 6177 + title: "Ensure minimum days between password changes is configured" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs: PASS_MIN_DAYS 1 and modify user parameters for all users with a password set to match: chage --mindays 1 " + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + +# 5.4.1.3 Ensure password expiration warning days is 7 or more (Automated) + - id: 6178 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + +# 5.4.1.4 Ensure inactive password lock is 30 days or less (Automated) + - id: 6179 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + + +# 5.4.3 Ensure default group for the root account is GID 0 (Automated) + - id: 6180 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + + +# 5.4.4 Ensure default user shell timeout is configured (Automated) + - id: 6181 + title: " Ensure default user shell timeout is configured" + description: "TMOUT is an environmental setting that determines the timeout of a shell in seconds." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized user access to another user's shell session that has been left unattended. It also ends the inactive session and releases the resources associated with that session." + remediation: "Edit the /etc/bashrc and /etc/profile files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + +# 5.4.5 Ensure default user umask is configured (Automated) + - id: 6182 + title: "Ensure default user umask is configured" + description: "The user file-creation mode mask (umask) is use to determine the file permission for newly created directories and files. In Linux, the default permissions for any newly created directory is 0777 (rwxrwxrwx), and for any newly created file it is 0666 (rw-rw-rw-). The umask modifies the default Linux permissions by restricting (masking) these permissions. The umask is not simply subtracted, but is processed bitwise. Bits set in the umaskare cleared in the resulting file mode." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc, /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + + + +# 5.6 Ensure access to the su command is restricted (Automated) + - id: 6183 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + +############################################### +# 6 System Maintenance +############################################### +############################################### +# 6.1 System File Permissions +############################################### + + +# 6.1.2 Configure /etc/passwd permissions (Automated) + - id: 6184 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod u-x,g-wx,o-wx /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.3 Ensure permissions on /etc/shadow are configured (Automated) + - id: 6185 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 000 /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.4 Ensure permissions on /etc/group are configured (Automated) + - id: 6186 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod u-x,g-wx,o-wx /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.5 Ensure permissions on /etc/gshadow are configured (Automated) + - id: 6187 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chmod 000 /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.6 Ensure permissions on /etc/passwd-are configured (Automated) + - id: 6188 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.7 Ensure permissions on /etc/shadow-are configured (Automated) + - id: 6189 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:root /etc/shadow- # chmod 000 /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.8 Ensure permissions on /etc/group-are configured (Automated) + - id: 6190 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.9 Ensure permissions on /etc/gshadow-are configured (Automated) + - id: 6191 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 000 /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + + +############################################### +# 6.2 Review User and Group Settings +############################################### + + +# 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords (Automated) + - id: 6192 + title: "Ensure accounts in /etc/passwd use shadowed passwords" + description: "Local accounts can uses shadowed passwords. With shadowed passwords, The passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an xin the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack." + remediation: "f any accounts in the /etc/passwdfile do not have a single x in the password field, run the following command to set these accounts to use shadowed passwords:# sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwdInvestigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'not f:/etc/shadow -> !r:^# && r:\w\w:' + + +# 6.2.2 Ensure /etc/shadow password fields are not empty (Automated) + - id: 6193 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + +# 6.2.3 Ensure root is the only UID 0 account (Automated) + - id: 6194 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + +# 6.2.18 Ensure shadow group is empty (Automated) + - id: 6195 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group" + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily runa password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.18"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not f:/etc/shadow -> !r:^# && r:^shadow:\.+:\.+:\.+:\.+' diff --git a/sca/centos/8/cis_centos8_linux.yml b/sca/centos/8/cis_centos8_linux.yml new file mode 100644 index 000000000..dbca48a9c --- /dev/null +++ b/sca/centos/8/cis_centos8_linux.yml @@ -0,0 +1,3441 @@ +# Security Configuration Assessment +# CIS Checks for CentOS 8 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security CentOS Linux 8 Benchmark v1.0 - 10-31-2019 + +policy: + id: "cis_centos8_linux" + file: "cis_centos8_linux.yml" + name: "CIS Benchmark for CentOS Linux 8" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for CentOS Linux 8 systems running on x86 and x64 platforms. This document was tested against CentOS Linux 8" + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Centos 8 family platform" + description: "Requirements for running the policy against CentOS 8 family." + condition: any + rules: + - 'f:/etc/redhat-release -> r:^Centos && r:release 8' + + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + +############################################### +# 1 Initial setup +############################################### +############################################### +# 1.1 Filesystem Configuration +############################################### +# 1.1.1.1 cramfs: filesystem + - id: 6500 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf .Example: vim /etc/modprobe.d/cramfs.conf: and add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: # rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found' + - 'not c:lsmod -> r:cramfs' + + +# 1.1.1.2 vFAT: filesystem + - id: 6501 + title: "Ensure mounting of FAT filesystems is limited" + description: "The VFAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf . Example: vim /etc/modprobe.d/vfat.conf: install vfat /bin/true. Run the following command to unload the vfat module: # rmmod vfat" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found' + - 'not c:lsmod -> r:vfat' + + + +# 1.1.1.3 squashfs: filesystem + - id: 6502 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf . Example: vim /etc/modprobe.d/squashfs.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found' + - 'not c:lsmod -> r:squashfs' + +# 1.1.1.4 udfs: filesystem + - id: 6503 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf. Example: vim /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v udf -> r:install /bin/true|Module udf not found' + - 'not c:lsmod -> r:udf' +# 1.1.2 /tmp: partition + - id: 6504 + title: "Ensure /tmp is configured" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + remediation: "Configure /etc/fstab as appropriate. example: \"tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,realtime 0 0\" OR Run the following commands to enable systemd /tmp mounting: # systemctl unmask tmp.mount # systemctl enable tmp.mount Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + +# 1.1.3 /tmp: nodev + - id: 6505 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nodev /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:nodev' + +# 1.1.4 /tmp: nosuid + - id: 6506 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nosuid /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:nosuid' + +# 1.1.5 /tmp: noexec + - id: 6507 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,noexec /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:noexec' + + +# 1.1.6 Build considerations - Partition scheme. + - id: 6508 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + +# 1.1.7 bind mount /var/tmp to /tmp + - id: 6509 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + + +# 1.1.8 nodev set on /var/tmp + - id: 6510 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:nodev' + + +# 1.1.9 nosuid set on /var/tmp + - id: 6511 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:nosuid' + +# 1.1.10 noexec set on /var/tmp + - id: 6512 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["5.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:noexec' + + +# 1.1.11 /var/log: partition + - id: 6513 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data ." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.12 /var/log/audit: partition + - id: 6514 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.13 /home: partition + - id: 6515 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + + # 1.1.14 /home: nodev + - id: 6516 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/home\s && !r:nodev' + + # 1.1.15 /dev/shm: nodev + - id: 6517 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/dev/shm\s && !r:nodev' + + # 1.1.16 /dev/shm: nosuid + - id: 6518 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/dev/shm\s && !r:nosuid' + + # 1.1.17 /dev/shm: noexec + - id: 6519 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/dev/shm\s && !r:noexec' + + # 1.1.22 Disable Automounting + - id: 6520 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs : systemctl disable autofs" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.4","8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled autofs -> enabled' + + # 1.1.23 Disable USB Storage (Scored) + - id: 6521 + title: "Disable USB Storage" + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb-storage.conf and add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: # rmmod usb-storage" + compliance: + - cis: ["1.1.23"] + - cis_csc: ["8.4","8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v usb-storage -> r:install /bin/true' + - 'not c:lsmod -> r:usb-storage' + + +############################################### +# 1.2 Configure Software Updates +############################################### + + + +# 1.2.2 Activate gpgcheck + - id: 6522 + title: "Ensure gpgcheck is globally activated" + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." + compliance: + - cis: ["1.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + condition: all + rules: + - 'f:/etc/yum.conf -> r:gpgcheck=1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0' + +############################################### +# 1.3 Configure sudo +############################################### + +# 1.3.1 install sudo + - id: 6523 + title: "Ensure sudo is installed" + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo: # dnf install sudo" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q sudo -> r:sudo-\S*' + +# 1.3.2 Ensure sudo commands use pty (Scored) + - id: 6524 + title: "Ensure sudo commands use pty" + description: "sudo can be configured to run only from a pseudo-pty" + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + remediation: "edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'c:grep -r Default /etc/sudoers.d/ -> !r:# && r:\s*Defaults\s+use_pty' + +# 1.3.3 Ensure sudo log file exists (Scored) + - id: 6525 + title: "Ensure sudo log file exists" + description: "sudo can use a custom log file" + rationale: "A sudo log file simplifies auditing of sudo commands" + remediation: "edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults logfile=\"\"" + compliance: + - cis: ["1.3.3"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+logfile=' + - 'c:grep -r Default /etc/sudoers.d/ -> !r:# && r:\s*Defaults\s+logfile' + +############################################### +# 1.4 Filesystem Integrity Checking +############################################### + +# 1.4.1 install AIDE + - id: 6526 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install aide: # dnf install aide || Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: #aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - 'AIDE stable manual: http://aide.sourceforge.net/stable/manual.html' + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + +# 1.4.2 AIDE regular checks + - id: 6527 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: " Run the following commands: # cp ./config/aidecheck.service /etc/systemd/system/aidecheck.service # cp ./config/aidecheck.timer /etc/systemd/system/aidecheck.timer # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl reenable aidecheck.timer # systemctl restart aidecheck.timer # systemctl daemon-reload. OR Run the following command: crontab -u root -e // Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. " + compliance: + - cis: ["1.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - 'https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service' + - 'https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer' + condition: any + rules: + - 'c:crontab -u root -l -> r:aide' + - 'c:grep -r aide /etc/cron.* /etc/crontab -> r:aide' + +############################################### +# 1.5 Secure Boot Settings +############################################### +# 1.5.1 Configure bootloader + - id: 6528 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg and grubenv stored in /boot/grub2/" + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/grubenv # chmod og-rwx /boot/grub2/grubenv" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub2/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat /boot/grub2/grubenv -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.5.2 Set Boot Loader Password (Scored) + - id: 6529 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub2-setpassword: # grub2-setpassword || Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["1.5.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub2/user.cfg -> r:^GRUB2_PASSWORD\s*=\.+' + +# 1.5.3 Single user authentication + - id: 6530 + title: "Ensure authentication required for single user mode" + description: "Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Edit /usr/lib/systemd/system/rescue.service and add/modify the following line: ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue Edit /usr/lib/systemd/system/emergency.service and add/modify the following line: ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/usr/lib/systemd/system/rescue.service -> r:ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue' + - 'f:/usr/lib/systemd/system/emergency.service -> r:ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency' + +############################################### +# 1.6 Additional Process Hardening +############################################### +# 1.6.1 Restrict Core Dumps (Scored) + - id: 6531 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file.The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5)). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0. If systemd-coredump is installed: edit /etc/systemd/coredump.conf and add/modify the following lines: Storage=none ProcessSizeMax=0 Run the command: # systemctl daemon-reload" + compliance: + - cis: ["1.6.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + +# 1.6.2 Ensure address space layout randomization (ASLR) is enabled (Scored) + - id: 6532 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + + +############################################### +# 1.7 Configure SELinux +############################################### +# 1.7.1.1 Ensure SELinux is installed(Scored) + - id: 6533 + title: "Ensure SELinux is installed" + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux : # dnf install libselinux" + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-' + +# 1.7.1.2 SELinux not disabled + - id: 6534 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /etc/default/grub and remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\" GRUB_CMDLINE_LINUX=\"\" || Run the following command to update the grub2 configuration: grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + +# 1.7.1.3 Set selinux policy + - id: 6535 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.7.1.4 Set selinux state + - id: 6536 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled$' + - 'c:sestatus -> r:^Current mode:\s+enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + +# 1.7.1.5 Ensure no unconfined services exist (Scored) + - id: 6537 + title: "Ensure no unconfined services exist" + description: "Unconfined processes run in unconfined domains" + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules – it does not replace them" + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them. Notes: Occasionally certain daemons such as backup or centralized management software may require running unconfined. Any such software should be carefully analyzed and documented before such an exception is made." + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:ps -eZ -> r:unconfined_service_t' + + +# 1.7.1.6 Remove SETroubleshoot + - id: 6538 + title: "Ensure SETroubleshoot is not installed" + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa setroubleshoot -> r:setroubleshoot' + + +# 1.7.1.7 Disable MCS Translation service mcstrans + - id: 6539 + title: "Ensure the MCS Translation Service (mcstrans) is not installed" + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa mcstrans -> r:mcstrans' + + +# 1.11 Ensure system-wide crypto policy is FUTURE or FIPS (Scored) + - id: 6540 + title: "Ensure system-wide crypto policy is FUTURE or FIPS" + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457 FUTURE: Is a conservative security level that is believed to withstand any near-term future attacks. This level does not allow the use of SHA-1 in signature algorithms. The RSA and Diffie-Hellman parameters are accepted if larger than 3071 bits. The level provides at least 128-bit security FIPS: Conforms to the FIPS 140-2 requirements. This policy is used internally by the fips-mode-setup(8) tool which can switch the system into the FIPS 140-2 compliance mode. The level provides at least 112-bit security" + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set FUTURE OR To switch the system to FIPS mode, run the following command: # fips-mode-setup --enable" + compliance: + - cis: ["1.11"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*FUTURE|^\s*FIPS' + + +############################################### +# 1.8 Warning Banners +############################################### +# 1.8.1.1 Configure message of the day (Scored) + - id: 6541 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd" + compliance: + - cis: ["1.8.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + +# 1.8.1.2 Configure local login warning banner (Scored) + - id: 6542 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.8.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + +# 1.8.1.3 Configure remote login warning banner (Scored) + - id: 6543 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.8.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + +# 1.8.1.4 Configure /etc/motd permissions (Scored) + - id: 6544 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.8.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.8.1.5 Configure /etc/issue permissions (Scored) + - id: 6545 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.8.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.8.1.6 Configure /etc/issue.net permissions (Scored) + - id: 6546 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.8.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.8.2 Ensure GDM login banner is configured (Scored) + - id: 6547 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add the following in 3 lines: (1) [org/gnome/login-screen] (2) banner-message-enable=true (3) banner-message-text='Authorized uses only. All activity may be monitored and reported.'" + compliance: + - cis: ["1.8.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:[org/gnome/login-screen]' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:banner-message-enable=true' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:banner-message-text=' + +# 1.9 Ensure updates, patches, and additional security software are installed (Not Scored) + - id: 6548 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available security updates: # dnf update --security . Site policy may mandate a testing period before install onto production systems for available updates. The audit and remediation here only cover security updates. Non-security updates can be audited with and comparing against site policy: # dnf check-update" + compliance: + - cis: ["1.9"] + - cis_csc: ["3.4"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6","SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - 'c:yum check-update --security -> r:No packages needed for security' + + +# 1.10 Ensure system-wide crypto policy is not legacy (Scored) + - id: 6549 + title: "Ensure system-wide crypto policy is not legacy" + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457" + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies" + compliance: + - cis: ["1.10"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://access.redhat.com/articles/3642912#what-polices-are-provided-1' + condition: none + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + +############################################### +# 2 OS Services +############################################### +############################################### +# 2.1 inetd Services +############################################### + # 2.1.1 Ensure xinetd is not installed (Scored) + - id: 6550 + title: "Ensure xinetd is not installed" + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to remove xinetd: # dnf remove xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q xinetd -> r:^package xinetd is not installed' + +############################################### +# 2.2 Remove Legacy Services +############################################### + +# 2.2.1.1 Ensure time synchronization is in use (Not Scored) + - id: 6551 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available install chrony: # dnf install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and verify that host based synchronization is in use." + compliance: + - cis: ["2.2.2.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:rpm -q chrony -> r:^chrony-' + +# 2.2.1.2 Configure Network Time Protocol (Chrony) (Scored) + - id: 6552 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Configure chrony to run as the chrony user" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'http://chrony.tuxfamily.org/' + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\s*\t*\.+|^pool\s*\t*\.+' + - 'not c:ps -ef -> r:\.+/chronyd\s*\t*$ && !r:^\s*\t*chrony\s*\t*' + +# 2.2.2 Ensure X Window System is not installed (Scored) + - id: 6553 + title: "Ensure X Window System is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # dnf remove xorg-x11*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa xorg-x11* -> r:^xorg-x11' + +# 2.2.3 Remove rsync service (Scored) + - id: 6554 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl --now disable rsyncd" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled rsyncd -> enabled' + +# 2.2.4 Disable Avahi Server (Scored) + - id: 6555 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl --now disable avahi-daemon" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled avahi-daemon -> enabled' + +# 2.2.5 Remove SNMP Server (Scored) + - id: 6556 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl --now disable snmpd" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled snmpd -> enabled' + +# 2.2.6 Remove HTTP Proxy Server (Scored) + - id: 6557 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl --now disable squid" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled squid -> enabled' + +# 2.2.7 Remove Samba (Scored) + - id: 6558 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable smb: # systemctl --now disable smb" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled smb -> enabled' + +# 2.2.8 Remove Dovecot (IMAP and POP3 services) (Scored) + - id: 6559 + title: "Ensure IMAP and POP3 server is not enabled" + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dovecot: # systemctl --now disable dovecot" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled dovecot -> enabled' + +# 2.2.9 Remove HTTP Server (Scored) + - id: 6560 + title: "Ensure HTTP server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable httpd: # systemctl --now disable httpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled httpd -> enabled' + +# 2.2.10 Remove FTP Server (Scored) + - id: 6561 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl --now disable vsftpd" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled vsftpd -> enabled' + +# 2.2.11 Ensure DNS Server is not enabled (Scored) + - id: 6562 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named : # systemctl --now disable named" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled named -> enabled' + + +# 2.2.12 Ensure NFS is not enabled (Scored) + - id: 6563 + title: "Ensure NFS is not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares, it is recommended that the NFS be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs: # systemctl --now disable nfs" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled nfs -> enabled' + +# 2.2.13 Ensure RPC is not enabled (Scored) + - id: 6564 + title: "Ensure RPC is not enabled" + description: "The rpcbind service maps Remote Procedure Call (RPC) services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service." + rationale: "If the system does not require rpc based services, it is recommended that rpcbind be disabled to reduce the remote attack surface." + remediation: "Run the following commands to disable nfs: # systemctl --now disable rpcbind" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled rpcbind -> enabled' + +# 2.2.14 Remove LDAP Server (Scored) + - id: 6565 + title: "Ensure LDAP Server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl --now disable slapd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on OpenLDAP is available at https://www.openldap.org + condition: none + rules: + - 'c:systemctl is-enabled slapd -> enabled' + +# 2.2.15 Remove DHCP Server (Scored) + - id: 6566 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dhcpd: # systemctl --now disable dhcpd" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp + condition: none + rules: + - 'c:systemctl is-enabled dhcpd -> enabled' + +# 2.2.16 Ensure CUPS is not enabled (Scored) + - id: 6567 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups : # systemctl --now disable cups" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'More detailed documentation on CUPS is available at the project homepage at http://www.cups.org.' + condition: none + rules: + - 'c:systemctl is-enabled cups -> enabled' + + +# 2.2.17 Remove NIS Server (Scored) + - id: 6568 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable ypserv: # systemctl --now disable ypserv" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled ypserv -> enabled' + +# 2.2.18 Ensure mail transfer agent is configured for local-only mode (Scored) + - id: 6569 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.18"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25\.* && !r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + +############################################### +# 2.3 Service Clients +############################################### + +# 2.3.1 Remove NIS Client (Scored) + - id: 6570 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # dnf remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa ypbind -> r:ypbind' + +# 2.3.2 Ensure telnet client is not installed (Scored) + - id: 6571 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet : # dnf remove telnet" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q telnet -> r:^package telnet is not installed' + +# 2.3.3 Ensure LDAP client is not installed (Scored) + - id: 6572 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # dnf remove openldap-clients" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q openldap-clients -> r:^package openldap-clients is not installed' + + +############################################### +# 3 Network Configuration +############################################### +############################################### +# 3.1 Network Parameters (Host Only) +############################################### +# 3.1.1 Ensure IP forwarding is disabled (Scored) + - id: 6573 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following commands to restore the default parameters and set the active kernel parameters: # grep -Els \"^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" \"s/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1 && # grep -Els \"^\\s*net\\.ipv6\\.conf\\.all\\.forwarding\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv6\\.conf\\.all\\.forwarding\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv6.conf.all.forwarding=0; sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:grep -Rh -E -s ^\s*net.ipv4.ip_forward /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.ip_forward\s*=\s*1' + - 'c:grep -Rh -E -s ^\s*net.ipv6.conf.all.forwarding /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv6.conf.all.forwarding\s*=\s*1' + - 'c:sysctl net.ipv4.ip_forward -> r:^\s*net.ipv4.ip_forward\s*=\s*1' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:^\s*net.ipv6.conf.all.forwarding\s*=\s*1' + + +# 3.1.2 Ensure packet redirect sending is disabled (Scored) + - id: 6574 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 .Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh net.ipv4.conf.all.send_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.send_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.default.send_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.send_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^\s*net.ipv4.conf.all.send_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^\s*net.ipv4.conf.default.send_redirects\s*=\s*0' + +############################################### +# 3.2 Network Parameters (Host and Router) +############################################### +# 3.2.1 Ensure source routed packets are not accepted (Scored) + - id: 6575 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0 and Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0; # sysctl -w net.ipv4.conf.default.accept_source_route=0; # sysctl -w net.ipv6.conf.all.accept_source_route=0; # sysctl -w net.ipv6.conf.default.accept_source_route=0; # sysctl -w net.ipv4.route.flush=1; # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.all.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.default.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0|No such file or directory' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0|No such file or directory' + - 'c:grep -Rh net.ipv6.conf.all.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.default.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0' + + + + +# 3.2.2 Ensure ICMP redirects are not accepted (Scored) + - id: 6576 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects and net.ipv6.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0; # sysctl -w net.ipv4.conf.default.accept_redirects=0; # sysctl -w net.ipv6.conf.all.accept_redirects=0; # sysctl -w net.ipv6.conf.default.accept_redirects=0; # sysctl -w net.ipv4.route.flush=1 and # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^\s*net.ipv4.conf.default.accept_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.all.accept_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.default.accept_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.accept_redirects\s*=\s*0' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.all.accept_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.default.accept_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0' + + +# 3.2.3 Ensure secure ICMP redirects are not accepted (Scored) + - id: 6577 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 and net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0; # sysctl -w net.ipv4.conf.default.secure_redirects=0 and # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.all.secure_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.default.secure_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0' + +# 3.2.4 Ensure suspicious packets are logged (Scored) + - id: 6578 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 and net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1; # sysctl -w net.ipv4.conf.default.log_martians=1 and # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^\s*net.ipv4.conf.all.log_martians\s*=\s*1' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^\s*net.ipv4.conf.default.log_martians\s*=\s*1' + - 'c:grep -Rh net.ipv4.conf.all.log_martians /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.log_martians\s*=\s*1' + - 'c:grep -Rh net.ipv4.conf.default.log_martians /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.log_martians\s*=\s*1' + +# 3.2.5 Ensure broadcast ICMP requests are ignored (Scored) + - id: 6579 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Run the following command to restore the default parameters and set the active kernel parameters: # grep -Els \"^\\s*net\\.ipv4\\.icmp_echo_ignore_broadcasts\\s*=\\s*0\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf \"s/^\\s*(net\\.ipv4\\.icmp_echo_ignore_broadcasts\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.icmp_echo_ignore_broadcasts=1; sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1' + - 'not c:grep -E -s -Rh ^\s*net.ipv4.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*0' + +# 3.2.6 Ensure bogus ICMP responses are ignored (Scored) + - id: 6580 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Run the following commands to restore the default parameters and set the active kernel parameters: # grep -Els \"^\\s*net\\.ipv4\\.icmp_ignore_bogus_error_responses\\s*=\\s*0 /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.icmp_ignore_bogus_error_responses\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1; sysctl -w net.ipv4.route.flush=1\"" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1' + - 'not c:grep -E -s -Rh ^\s*net.ipv4.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*0' + +# 3.2.7 Ensure Reverse Path Filtering is enabled (Scored) + - id: 6581 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Run the following command to restore the default net.ipv4.conf.all.rp_filter = 1 parameter and set the active kernel parameter: # grep -Els \"^\\s*net\\.ipv4\\.conf\\.all\\.rp_filter\\s*=\\s*0\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.net.ipv4.conf\\.all\\.rp_filter\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.conf.all.rp_filter=1; sysctl -w net.ipv4.route.flush=1 .Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.default.rp_filter=1 and Run the following commands to set the active kernel parameter: # sysctl -w net.ipv4.conf.default.rp_filter=1 and # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^\s*net.ipv4.conf.all.rp_filter\s*=\s*1' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^\s*net.ipv4.conf.default.rp_filter\s*=\s*1' + - 'not c:grep -E -s -Rh ^\s*net.ipv4.conf.all.rp_filter /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.conf.all.rp_filter\s*=\s*0' + - 'c:grep -E -s -Rh ^\s*net.ipv4.conf.default.rp_filter /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.conf.default.rp_filter\s*=\s*1' + +# 3.2.8 Ensure TCP SYN Cookies is enabled (Scored) + - id: 6582 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Run the following command to restore the default parameter and set the active kernel parameters: grep -Els \"^\\s*net\\.ipv4\\.tcp_syncookies\\s*=\\s*[02]*\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.tcp_syncookies\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.tcp_syncookies=1; sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^\s*net.ipv4.tcp_syncookies\s*=\s*1' + - 'not c:grep -E -r -Rh ^\s*net.ipv4.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.tcp_syncookies\s*=\s*[02]' + +# 3.2.9 Ensure IPv6 router advertisements are not accepted (Scored) + - id: 6583 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems do not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 . Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0; # sysctl -w net.ipv6.conf.default.accept_ra=0 and # sysctl -w net.ipv6.route.flush=1;" + compliance: + - cis: ["3.2.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^\s*net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^\s*net.ipv6.conf.default.accept_ra\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.all.accept_ra /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.default.accept_ra /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.default.accept_ra\s*=\s*0' + + +############################################### +# 3.3 Uncommon Network Protocols +############################################### +# 3.3.1 Ensure DCCP is disabled (Scored) + - id: 6584 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery" + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf. Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:^\s*install\s*/bin/true|Module dccp not found' + - 'not c:lsmod -> r:dccp' + +# 3.3.2 Ensure SCTP is disabled (Scored) + - id: 6585 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf .Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:^\s*install\s*/bin/true|Module sctp not found' + - 'not c:lsmod -> r:sctp' + +# 3.3.3 Ensure RDS is disabled (Scored) + - id: 6586 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf .Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.3.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v rds -> r:^\s*install\s*/bin/true|Module rds not found' + - 'not c:lsmod -> r:rds' + + +# 3.3.4 Ensure TIPC is disabled (Scored) + - id: 6587 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf .Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v tipc -> r:^\s*install\s*/bin/true|Module tipc not found' + - 'not c:lsmod -> r:tipc' + +# 3.6 Disable IPv6 (Not Scored) + - id: 6588 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system." + remediation: "Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX=\"ipv6.disable=1\" .Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["3.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.6","CC5.2"] + condition: all + rules: + - 'f:/boot/grub2/grubenv -> r:^\s*kernelopts=\.+ipv6.disable=1' + +############################################### +# 3.4 Firewall Configuration +############################################### +############################################### +# 3.4.1 Ensure Firewall software is installed +############################################### +# 3.4.1.1 Ensure a Firewall package is installed (Scored) + - id: 6589 + title: "Ensure a Firewall package is installed" + description: "A Firewall package should be selected. Most firewall configuration utilities operate as a front end to nftables or iptables." + rationale: "A Firewall package is required for firewall management and configuration." + remediation: "Run one of the following commands to install a Firewall package. For firewalld: dnf install firewalld .For nftables: # dnf install nftables. For iptables: # dnf install iptables" + compliance: + - cis: ["3.4.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC6.6"] + condition: any + rules: + - 'c:rpm -q firewalld -> r:^firewalld-' + - 'c:rpm -q nftables -> r:^nftables-' + - 'c:rpm -q iptables -> r:^iptables-' + +############################################### +# 3.4.2 Configure firewalld +############################################### + +# 3.4.2.1 Ensure firewalld service is enabled and running (Scored) + - id: 6590 + title: "Ensure firewalld service is enabled and running" + description: "Ensure that the firewalld service is enabled to protect your system" + rationale: "firewalld (Dynamic Firewall Manager) tool provides a dynamically managed firewall. The tool enables network/firewall zones to define the trust level of network connections and/or interfaces. It has support both for IPv4 and IPv6 firewall settings. Also, it supports Ethernet bridges and allow you to separate between runtime and permanent configuration options. Finally, it supports an interface for services or applications to add firewall rules directly" + remediation: "Run the following command to enable and start firewalld: # systemctl --now enable firewalld" + compliance: + - cis: ["3.4.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:systemctl is-enabled firewalld -> enabled' + - 'c:firewall-cmd --state -> r:running' + + + +# 3.4.2.3 Ensure nftables is not enabled (Scored) + - id: 6591 + title: "Ensure nftables is not enabled" + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables. nftables are installed as a dependency with firewalld." + rationale: "Running firewalld and nftables concurrently may lead to conflict, therefore nftables should be stopped and masked when using firewalld." + remediation: "Run the following command to mask and stop nftables: systemctl --now mask nftables" + compliance: + - cis: ["3.4.2.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:systemctl status nftables -> r:Loaded:\s*disabled|Loaded:\s*masked|could not be found' + - 'c:systemctl status nftables -> r:Active:\s*inactive\s*\(dead\)|could not be found' + - 'c:systemctl is-enabled nftables -> !r:^enabled' + + +# 3.4.2.6 Ensure iptables is not enabled (Scored) + - id: 6592 + title: "Ensure iptables is not enabled" + description: "IPtables is an application that allows a system administrator to configure the IPv4 and IPv6 tables, chains and rules provided by the Linux kernel firewall. IPtables is installed as a dependency with firewalld." + rationale: "Running firewalld and IPtables concurrently may lead to conflict, therefore IPtables should be stopped and masked when using firewalld." + remediation: "Run the following command to stop and mask iptables: systemctl --now mask iptables" + compliance: + - cis: ["3.4.2.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:systemctl status iptables -> r:Loaded:\s*disabled|Loaded:\s*masked|could not be found' + - 'c:systemctl status iptables -> r:Active:\s*inactive\s*\(dead\)|could not be found' + - 'c:systemctl is-enabled iptables -> !r:enabled' + +############################################### +# 3.4.3 Configure nftables +############################################### + +# 3.4.3.1 Ensure iptables are flushed (Not Scored) + - id: 6593 + title: "Ensure iptables are flushed" + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables" + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded." + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F and For ip6tables: # ip6tables -F" + compliance: + - cis: ["3.4.3.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: none + rules: + - 'c:iptables -L -> !r:^\s*Chain|^\s*target && r:\s*\S+' + - 'c:ip6tables -L -> !r:^\s*Chain|^\s*target && r:\s*\S+' + +# 3.4.3.2 Ensure a table exists (Scored) + - id: 6594 + title: "Ensure a table exists" + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + remediation: "Run the following command to create a table in nftables: # nft create table inet
.Example: # nft create table inet filter" + compliance: + - cis: ["3.4.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list tables -> r:\w+' + + +# 3.4.3.3 Ensure base chains exist (Scored) + - id: 6595 + title: "Ensure base chains exist" + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } . Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0\\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }" + compliance: + - cis: ["3.4.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list ruleset -> r:hook input' + - 'c:nft list ruleset -> r:hook forward' + - 'c:nft list ruleset -> r:hook output' + +# 3.4.3.6 Ensure default deny firewall policy (Scored) + - id: 6596 + title: "Ensure default deny firewall policy" + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept , the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } . Example: # nft chain inet filter input { policy drop \\; } ; # nft chain inet filter forward { policy drop \\; } and # nft chain inet filter output { policy drop \\; }" + compliance: + - cis: ["3.4.3.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list ruleset -> r:hook input && r:policy drop' + - 'c:nft list ruleset -> r:hook forward && r:policy drop' + - 'c:nft list ruleset -> r:hook output && r:policy drop' + +# 3.4.3.7 Ensure nftables service is enabled (Scored) + - id: 6597 + title: "Ensure nftables service is enabled" + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting of the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl --now enable nftables" + compliance: + - cis: ["3.4.3.7"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:systemctl is-enabled nftables -> r:^enabled' + +############################################### +# 3.4.4 Configure iptables +############################################### +############################################### +# 3.4.4.1 Configure IPv4 iptables +############################################### +# 3.4.4.1.1 Ensure default deny firewall policy (Scored) + - id: 6598 + title: "Configure IPv4 iptables" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP; # iptables -P OUTPUT DROP; # iptables -P FORWARD DROP" + compliance: + - cis: ["3.4.4.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + +# 3.4.4.1.2 Ensure loopback traffic is configured (Scored) + - id: 6599 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.4.4.1.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + +############################################### +# 3.4.4.2 Configure IPv6 ip6tables +############################################### +# 3.4.4.2.1 Ensure IPv6 default deny firewall policy (Scored) + - id: 6600 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP; # ip6tables -P OUTPUT DROP; # ip6tables -P FORWARD DROP" + compliance: + - cis: ["3.4.4.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:ip6tables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:ip6tables -L -> r:Chain OUTPUT \(policy DROP\)' + +# 3.4.4.2.2 Ensure IPv6 loopback traffic is configured (Scored) + - id: 6601 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP" + compliance: + - cis: ["3.4.4.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + +# 3.5 Ensure wireless interfaces are disabled (Scored) + - id: 6602 + title: "Ensure wireless interfaces are disabled" + description: "Wireless networking is used when wired networks are unavailable. CentOS Linux contains a wireless tool kit to allow system administrators to configure and use wireless networks." + rationale: "If wireless is not to be used, wireless devices can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable any wireless interfaces: # nmcli radio all off . Disable any wireless interfaces in your network configuration." + compliance: + - cis: ["3.5"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.6"] + references: + - nmcli(1) - Linux man page + condition: all + rules: + - 'c:nmcli radio wifi -> r:^disabled' + - 'c:nmcli radio wwan -> r:^disabled' + + + +############################################### +# 4 Logging and Auditing +############################################### +############################################### +# 4.1 Configure System Accounting (auditd) +############################################### + +# 4.1.1.1 Ensure auditd is installed (Scored) + - id: 6603 + title: "Ensure auditd is installed" + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit audit-libs" + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:rpm -q audit audit-libs -> r:^audit-' + +# 4.1.1.2 Ensure auditd service is enabled (Scored) + - id: 6604 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd : # systemctl --now enable auditd" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1","10.7"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled auditd -> enabled' + + +# 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 6605 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX : GRUB_CMDLINE_LINUX=\"audit=1\" . Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.2.6","10.7"] + - nist_800_53: ["AU.2"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts= && !r:audit=1' + + +# 4.1.1.4 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 6606 + title: "Ensure audit_backlog_limit is sufficient" + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more than 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Edit /etc/default/grub and add audit_backlog_limit= to GRUB_CMDLINE_LINUX: Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["4.1.1.4"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts= && n:audit_backlog_limit=(\d+) compare >= 8192' + +# 4.1.2.1 Ensure audit log storage size is configured (Not Scored) + - id: 6607 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.2.1"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file\s*=\s*\d+' + +# 4.1.2.2 Ensure audit logs are not automatically deleted (Scored) + - id: 6608 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file_action\s*=\s*keep_logs' + +# 4.1.2.3 Ensure system is disabled when audit logs are full (Scored) + - id: 6609 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^admin_space_left_action\s*=\s*halt' + +## 4.1.3 Ensure changes to system administration scope (sudoers) is collected (Scored) + - id: 6610 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope" + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> .rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d -> .rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope' + + +# 4.1.4 Ensure login and logout events are collected (Scored) + - id: 6611 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/log/lastlog -p wa -k logins -w /var/run/faillock/ -p wa -k logins" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["4.9","16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/lastlog -p wa -k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/run/faillock/ -p wa -k logins' + +# 4.1.5 Ensure session initiation information is collected (Scored) + - id: 6612 + title: "Ensure session initiation information is collected" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"." + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins" + compliance: + compliance: + - cis: ["4.1.5"] + - cis_csc: ["4.9","16.13"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7","AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/run/utmp -p wa -k session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/wtmp -p wa -k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/btmp -p wa -k logins' + +# 4.1.6 Ensure events that modify date and time information are collected (Scored) + - id: 6613 + title: "Ensure events that modify date and time information are collected" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"." + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b32 -S clock_settime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S adjtimex -S settimeofday -S stime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S clock_settime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/localtime -p wa -k time-change' + +# 4.1.7 Ensure events that modify the system's Mandatory Access Controls are collected (Scored) + - id: 6614 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/selinux/ -p wa -k MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /usr/share/selinux/ -p wa -k MAC-policy' + +# 4.1.8 Ensure events that modify the system's network environment are collected (Scored) + - id: 6615 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/issue -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/issue.net -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/hosts -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/sysconfig/network -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/sysconfig/network-scripts/ -p wa -k system-locale' + +# 4.1.9 Ensure discretionary access control permission modification events are collected (Scored) + - id: 6616 + title: "Ensure discretionary access control permission modification events are collected" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem" + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod' + +# 4.1.10 Ensure unsuccessful unauthorized file access attempts are collected (Scored) + - id: 6617 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access" + compliance: + - cis: ["4.1.10"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access' + +# 4.1.11 Ensure events that modify user/group information are collected (Scored) + - id: 6618 + title: "Ensure events that modify user/group information are collected" + description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity" + compliance: + - cis: ["4.1.11"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/group -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/passwd -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/gshadow -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/shadow -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/security/opasswd -p wa -k identity' + +# 4.1.12 Ensure successful file system mounts are collected (Scored) + - id: 6619 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts" + compliance: + - cis: ["4.1.12"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts' + +# 4.1.14 Ensure file deletion events by users are collected (Scored) + - id: 6620 + title: "Ensure file deletion events by users are collected" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete" + compliance: + - cis: ["4.1.14"] + - cis_csc: ["13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["PI1.4","PI1.5","CC7.1","CC7.2","CC7.3","CC8.1"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete' + +# 4.1.15 Ensure kernel module loading and unloading is collected (Scored) + - id: 6621 + title: "Ensure kernel module loading and unloading is collected" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b32 -S init_module -S delete_module -k modules -a always,exit -F arch=b64 -S init_module -S delete_module -k modules" + compliance: + - cis: ["4.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /sbin/insmod -p x -k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /sbin/rmmod -p x -k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /sbin/modprobe -p x -k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S init_module -S delete_module -k modules' + +# 4.1.16 Ensure system administrator actions (sudolog) are collected (Scored) + - id: 6622 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.16"] + - cis_csc: ["4.9"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /var/log/sudo.log -p wa -k actions' + +# 4.1.17 Ensure the audit configuration is immutable (Scored) + - id: 6623 + title: "Ensure the audit configuration is immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl . Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line: -e 2 at the end of the file" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:tail -1 /etc/audit/rules.d/99-finalize.rules -> -e 2' + + # 4.2.1.1 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 6624 + title: "Ensure rsyslog is installed" + description: "The rsyslog software is a recommended replacement to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:rpm -q rsyslog -> r:^rsyslog-' + +# 4.2.1.2 Ensure rsyslog Service is enabled (Scored) + - id: 6625 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable rsyslog : # systemctl --now enable rsyslog" + compliance: + - cis: ["4.2.1.2"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled rsyslog -> enabled' + +# 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 6626 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2","CC7.2"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0' + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d20|^\$FileCreateMode 0\d00' + +# 4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host (Scored) + - id: 6627 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["6.6","6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + +# 4.2.2.1 Ensure journald is configured to send logs to rsyslog (Scored) + - id: 6628 + title: "Ensure journald is configured to send logs to rsyslog" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.5"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.9","AU.4"] + - tsc: ["CC5.2","CC7.2"] + references: + - 'https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf' + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + +# 4.2.2.2 Ensure journald is configured to compress large log files (Scored) + - id: 6629 + title: "Ensure journald is configured to compress large log files" + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Compress\s*=\s*yes' + +# 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk (Scored) + - id: 6630 + title: "Ensure journald is configured to write logfiles to persistent disk" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Storage\s*=\s*persistent' + + # 4.2.3 Ensure permissions on all logfiles are configured (Scored) + - id: 6631 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx {} +" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2","CC7.2"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + +############################################### +# 5 Access, Authentication and Authorization +############################################### +############################################### +# 5.1 Configure cron +############################################### +# 5.1.1 Ensure cron daemon is enabled (Scored) + - id: 6632 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # systemctl --now enable crond" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:systemctl is-enabled crond -> enabled' + +# 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 6633 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 6634 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 6635 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 6636 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 6637 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 6638 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 6639 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow : # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.deny -> r:No such file or directory$' + - 'c:stat /etc/at.deny -> r:No such file or directory$' + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +############################################### +# 5.2 Configure SSH +############################################### +# 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Scored) + - id: 6640 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config : # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2.2 Ensure SSH access is limited (Scored) + - id: 6641 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. AllowGroups The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. DenyUsers The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. DenyGroups The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers ; AllowGroups ; DenyUsers and DenyGroups " + compliance: + - cis: ["5.2.2"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowGroups' + - 'f:/etc/ssh/sshd_config -> r:^\s*DenyUsers' + - 'f:/etc/ssh/sshd_config -> r:^\s*DenyGroups' + +# 5.2.3 Ensure permissions on SSH private host key files are configured (Scored) + - id: 6642 + title: "Ensure permissions on SSH private host key files are configured" + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated" + remediation: "Run the following commands to set ownership and permissions on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:root {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod 0600 {} \\;" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/ssh_host_rsa_key -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ecdsa_key -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ed25519_key -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2.4 Ensure permissions on SSH public host key files are configured (Scored) + - id: 6643 + title: "Ensure permissions on SSH public host key files are configured" + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod 0644 {} \\; #find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/ssh_host_rsa_key.pub -> r:^Access: \(0\d\d\d/\w\w\w\w\w\w-\w\w-\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ecdsa_key.pub -> r:^Access: \(0\d\d\d/\w\w\w\w\w\w-\w\w-\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ed25519_key.pub -> r:^Access: \(0\d\d\d/\w\w\w\w\w\w-\w\w-\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2.5 Ensure SSH LogLevel is appropriate (Scored) + - id: 6644 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - https://www.ssh.com/ssh/sshd_config/ + condition: all + rules: + - 'c:sshd -T -> r:^\s*LogLevel\s+VERBOSE|^\s*loglevel\s+INFO' + + +# 5.2.6 Ensure SSH X11 forwarding is disabled (Scored) + - id: 6645 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*X11Forwarding\s*\t*no' + + # 5.2.7 Ensure SSH MaxAuthTries is set to 4 or less (Scored) + - id: 6646 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + +# 5.2.8 Ensure SSH IgnoreRhosts is enabled (Scored) + - id: 6647 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Ignorerhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:ignorerhosts\s*\t*yes' + +# 5.2.9 Ensure SSH HostbasedAuthentication is disabled (Scored) + - id: 6648 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:HostbasedAuthentication\s*\t*no' + +# 5.2.10 Ensure SSH root login is disabled (Scored) + - id: 6649 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:PermitRootLogin\s*\t*no' + +# 5.2.11 Ensure SSH PermitEmptyPasswords is disabled (Scored) + - id: 6650 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + +# 5.2.12 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 6651 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*PermitUserEnvironment\s*\t*no' + +# 5.2.13 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 6652 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'c:sshd -T -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + +# 5.2.14 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 6653 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + +# 5.2.15 Ensure SSH warning banner is configured (Scored) + - id: 6654 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*Banner\s*\t*/etc/issue.net' + +# 5.2.16 Ensure SSH PAM is enabled (Scored) + - id: 6655 + title: "Ensure SSH PAM is enabled" + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*usepam\s+yes' + + +# 5.2.17 Ensure SSH AllowTcpForwarding is disabled (Scored) + - id: 6656 + title: "Ensure SSH AllowTcpForwarding is disabled" + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - https://www.ssh.com/ssh/tunneling/example + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowTcpForwarding\s+no' + +# 5.2.19 Ensure SSH MaxSessions is set to 4 or less (Scored) + - id: 6657 + title: "Ensure SSH MaxSessions is set to 4 or less" + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 4" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*MaxSessions\s+(\d+) compare <= 4' + +# 5.2.20 Ensure system-wide crypto policy is not over-ridden (Scored) + - id: 6658 + title: "Ensure system-wide crypto policy is not over-ridden" + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH" + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgoritms and GSSAPIKexAlgorithsm" + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd; # systemctl reload sshd" + compliance: + - cis: ["5.2.20"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:/etc/sysconfig/sshd -> !r:^\s*CRYPTO_POLICY=' + +############################################### +# 5.3 Configure authselect +############################################### +# 5.3.1 Create custom authselect profile (Scored) + - id: 6659 + title: "Create custom authselect profile" + description: "A custom profile can be created by copying and customizing one of the default profiles. The default profiles include: sssd, winbind, or the nis." + rationale: "A custom profile is required to customize many of the pam options" + remediation: "Run the following command to create a custom authselect profile: # authselect create-profile -b .Example: # authselect create-profile custom-profile -b sssd --symlink-meta" + compliance: + - cis: ["5.3.1"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:authselect current -> r:^Profile ID: custom' + +# 5.3.3 Ensure authselect includes with-faillock (Scored) + - id: 6660 + title: "Ensure authselect includes with-faillock" + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than deny consecutive failed authentications. It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following command to include the with-faillock option: # authselect select with-faillock Example: # authselect select custom/custom-profile with-sudo with-faillock without-nullok" + compliance: + - cis: ["5.3.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:authselect current -> r:with-faillock' + - 'f:/etc/authselect/authselect.conf -> r:with-faillock' + +############################################### +# 5.4 Configure PAM +############################################### +# 5.4.1 Ensure password creation requirements are configured (Scored) + - id: 6661 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. retry=3 - Allow 3 tries before sending back a failure. minlen=14 - password must be 14 characters or more Either of the following can be used to enforce complex passwords: minclass=4 - provide at least four classes of characters for the new password OR dcredit=-1 - provide at least one digit ucredit=-1 - provide at least one uppercase character ocredit=-1 - provide at least one special character lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy: minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy: minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 -1 = -1 Run the following to update the system-auth and password-auth files: CP=$(authselect current | awk 'NR == 1 {print $3}' | grep custom/) for FN in system-auth password-auth; do [[ -n $CP ]] && PTF=/etc/authselect/$CP/$FN || PTF=/etc/authselect/$FN [[ -z $(grep -E '^\\s*password\\s+requisite\\s+pam_pwquality.so\\s+.*enforce-for-root\\s*.*$' $PTF) ]] && sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce-for-root/' $PTF [[ -n $(grep -E '^\\s*password\\s+requisite\\s+pam_pwquality.so\\s+.*\\s+retry=\\S+\\s*.*$' $PTF) ]] && sed -ri '/pwquality/s/retry=\\S+/retry=3/' $PTF || sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' $PTF done authselect apply-changes" + compliance: + - cis: ["5.4.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass' + - 'f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass' + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + +# 5.4.2 Ensure lockout for failed password attempts is configured (Scored) + - id: 6662 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. deny= - Number of attempts before the account is locked. unlock_time= - Time in seconds before the account is unlocked. Set the lockout number and unlock time to follow local site policy." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Set password lockouts and unlock times to conform to site policy. Run the following to update the system-auth and password-auth files. This script will update/add the deny=5 and unlock_time=900 options. This script should be modified as needed to follow local site policy.CP=$(authselect current | awk \"NR == 1 {print $3}\" | grep custom/) for FN in system-auth password-auth; do [[ -n $CP ]] && PTF=/etc/authselect/$CP/$FN || PTF=/etc/authselect/$FN [[ -n $(grep -E \"^\\s*auth\\s+required\\s+pam_faillock.so\\s+.*deny=\\S+\\s*.*$\" $PTF) ]] && sed -ri \"/pam_faillock.so/s/deny=\\S+/deny=5/g\" $PTF || sed -ri \"s/^\\^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)(.*[^{}])(\\{.*\\}|)$/\\1\\2 deny=5 \\3/\" $PTF [[ -n $(grep -E \"^\\s*auth\\s+required\\s+pam_faillock.so\\s+.*unlock_time=\\S+\\s*.*$\" $PTF) ]] && sed -ri \"/pam_faillock.so/s/unlock_time=\\S+/unlock_time=900/g\" $PTF || sed -ri \"s/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)(.*[^{}])(\\{.*\\}|)$/\\1\\2 unlock_time=900 \\3/\" $PTF done authselect apply-changes" + compliance: + - cis: ["5.4.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^\s*auth\.+required\.+pam_faillock.so\.+ && n:deny=(\d+) compare <= 5 && n:unlock_time=(\d+) compare >= 900' + - 'f:/etc/pam.d/system-auth -> r:^\s*auth\.+required\.+pam_faillock.so\.+ && n:deny=(\d+) compare <= 5 && n:unlock_time=(\d+) compare >= 900' + + +# 5.4.3 Ensure password reuse is limited (Scored) + - id: 6663 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users\" old passwords and can be checked to ensure that users are not recycling recent passwords. remember=<5> - Number of old passwords to remember" + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: CP=$(authselect current | awk \"NR == 1 {print $3}\" | grep custom/) [[ -n $CP ]] && PTF=/etc/authselect/$CP/system-auth || PTF=/etc/authselect/system-auth [[ -n $(grep -E \"^\\s*password\\s+(sufficient\\s+pam_unix|requi(red|site)\\s+pam_pwhistory).so\\s+ ([^#]+\\s+)*remember=\\S+\\s*.*$\" $PTF) ]] && sed -ri \"s/^\\s*(password\\s+(requisite|sufficient)\\s+(pam_pwquality\\.so|pam_unix\\.so)\\s+)(.*)(remember=\\S+\\s*)(.*)$/\\1\\4 remember=5 \\6/\" $PTF || sed -ri \"s/^\\s*(password\\s+(requisite|sufficient)\\s+(pam_pwquality\\.so|pam_unix\\.so)\\s+)(.*)$/\\1\\4 remember=5/\" $PTF authselect apply-changes" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+requisite\.+pam_pwquality\.so\.+ && n:remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so\.+ && n:remember=(\d+) compare >= 5' + +# 5.4.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 6664 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Run the following script to dd or modify the pam_unix.so lines in the password-auth and system-auth files to include the sha512 option: CP=$(authselect current | awk 'NR == 1 {print $3}' | grep custom/) for FN in system-auth password-auth; do [[ -z $(grep -E '^\\s*password\\s+sufficient\\s+pam_unix.so\\s+.*sha512\\s*.*$' $PTF) ]] && sed -ri 's/^\\s*(password\\s+sufficient\\s+pam_unix.so\\s+)(.*)$/\\1\\2 sha512/' $PTF done authselect apply-changes" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1","8.2.1"] + - tsc: ["CC6.1","CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so && r:sha512' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so && r:sha512' + +############################################### +# 5.5 User Accounts and Environment +############################################### +############################################### +# 5.5.1 Set Shadow Password Suite Parameters +############################################### +# 5.5.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 6665 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.5.1.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + +# 5.5.1.2 Ensure minimum days between password changes is 7 or more (Scored) + - id: 6666 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 and modify user parameters for all users with a password set to match: chage --mindays 7 " + compliance: + - cis: ["5.5.1.2"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + +# 5.5.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 6667 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.5.1.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + +# 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 6668 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + +# 5.5.3 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 6669 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: readonly TMOUT=900 ; export TMOUT . Note that setting the value to readonly prevents unwanted modification during runtime." + compliance: + - cis: ["5.5.3"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> !r:^# && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not c:grep -Rh TMOUT /etc/profile /etc/profile.d/*.sh -> !r:^# && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> !r:^# && n:readonly TMOUT\s*=\s*(\d+)\s*; compare <= 900 && r:export TMOUT\s*$' + - 'c:grep -Rh TMOUT /etc/profile /etc/profile.d/*.sh -> !r:^# && n:readonly TMOUT\s*=\s*(\d+)\s*; compare <= 900 && r:export TMOUT\s*$' + +# 5.5.4 Ensure default group for the root account is GID 0 (Scored) + - id: 6670 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.5.4"] + - cis_csc: ["5.1"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + +# 5.5.5 Ensure default user umask is 027 or more restrictive (Scored) + - id: 6671 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.5.5"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + +# 5.7 Ensure access to the su command is restricted (Scored) + - id: 6672 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo , which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.7"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:# && r:auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + +############################################### +# 6 System Maintenance +############################################### +############################################### +# 6.1 System File Permissions +############################################### +# 6.1.2 Configure /etc/passwd permissions (Scored) + - id: 6673 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.3 Configure /etc/shadow permissions (Scored) + - id: 6674 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/ shadow: # chown root:root /etc/shadow # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + +# 6.1.4 Configure /etc/group permissions (Scored) + - id: 6675 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.5 Configure /etc/gshadow permissions (Scored) + - id: 6676 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chown root:shadow /etc/gshadow # chmod o-rwx,g-rw /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + +# 6.1.6 Configure /etc/passwd- permissions (Scored) + - id: 6677 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 600 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.7 Configure /etc/shadow- permissions (Scored) + - id: 6678 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:shadow /etc/shadow- # chmod u-x,go-rwx /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + +# 6.1.8 Configure /etc/group- permissions (Scored) + - id: 6679 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.9 Configure /etc/gshadow- permissions (Scored) + - id: 6680 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-rw /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + + +############################################### +# 6.2 Review User and Group Settings +############################################### +# 6.2.1 Check passwords fields (Scored) + - id: 6681 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + +# 6.2.2 Delete legacy entries in /etc/passwd (Scored) + - id: 6682 + title: "Ensure no legacy \"+\" entries exist in /etc/passwd" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && r:^+:' + + # 6.2.4 Delete legacy entries in /etc/shadow (Scored) + - id: 6683 + title: "Ensure no legacy \"+\" entries exist in /etc/shadow" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^+:' + +# 6.2.5 Delete legacy entries in /etc/group (Scored) + - id: 6684 + title: "Ensure no legacy \"+\" entries exist in /etc/group" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/group if they exist." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:^+:' + +# 6.2.6 Verify No UID 0 Accounts Exist Other Than root (Scored) + - id: 6685 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + + + + + + + + + + + + + + diff --git a/sca/darwin/15/cis_apple_macOS_10.11.yml b/sca/darwin/15/cis_apple_macOS_10.11.yml index 4e67644cc..32f9661a1 100644 --- a/sca/darwin/15/cis_apple_macOS_10.11.yml +++ b/sca/darwin/15/cis_apple_macOS_10.11.yml @@ -1,5 +1,5 @@ # Security Configuration Assessment -# CIS Checks for MacOS 10.11 +# CIS Checks for macOS 10.11 # Copyright (C) 2015-2020, Wazuh Inc. # # This program is free software; you can redistribute it @@ -19,8 +19,8 @@ policy: - https://www.cisecurity.org/cis-benchmarks/ requirements: - title: "Check MacOS version" - description: "Requirements for running the SCA scan against MacOS 10.11 (El Capitan)." + title: "Check macOS version" + description: "Requirements for running the SCA scan against macOS 10.11 (El Capitan)." condition: any rules: - 'c:sw_vers -> r:^ProductVersion:\t*\s*10\p11' @@ -29,7 +29,7 @@ requirements: checks: # 1.1 Verify all Apple provided software is current (Scored) - - id: 7500 + - id: 8500 title: "Verify all Apple provided software is current" description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." @@ -41,7 +41,7 @@ checks: - 'c:softwareupdate -l -> r:No new software available' # 1.2 Enable Auto Update (Scored) - - id: 7501 + - id: 8501 title: "Enable Auto Update" description: "Auto Update verifies that your system has the newest security patches and software updates. If \"Automatically check for updates\" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur." rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." @@ -56,7 +56,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> 1' # 1.3 Enable app update installs (Scored) - - id: 7502 + - id: 8502 title: "Enable app update installs" description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" @@ -68,7 +68,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1' # 1.4 Enable system data files and security update installs (Scored) - - id: 7503 + - id: 8503 title: "Enable system data files and security update installs" description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper, with this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" @@ -84,7 +84,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> 1' # 1.5 Enable OS X update installs (Scored) - - id: 7504 + - id: 8504 title: "Enable OS X update installs" description: "Ensure that OS X updates are installed after they are available from Apple. This setting enables OS X updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" @@ -96,7 +96,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -> 1' # 2.2.1 Enable "Set time and date automatically" (Not Scored) - - id: 7505 + - id: 8505 title: "Enable \"Set time and date automatically\"" description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Apple's automatic time update solution will enable an NTP server that is not controlled by the Application Firewall. Turning on \"Set time and date automatically\" allows other computers to connect to set their time and allows for exploit attempts against ntpd. It also allows for more accurate network detection and OS fingerprinting." rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." @@ -108,7 +108,7 @@ checks: - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' # 2.2.3 Restrict NTP server to loopback interface (Scored) - - id: 7506 + - id: 8506 title: "Restrict NTP server to loopback interface" description: "The Apple System Preference setting to \"Set date and time automatically\" enables both an NTP client that can synchronize the time from known time server(s) and an open listening NTP server that can be used by any other computer that can connect to port 123 on the time syncing computer. This open listening service can allow for both exploits of future NTP vulnerabilities and allow for open ports that can be used for fingerprinting to target exploits. Access to this port should be restricted. Editing the /etc/ntp-restrict.conf file by adding a control on the loopback interface limits external access." rationale: "Mobile workstations on untrusted networks should not have open listening services available to other nodes on the network." @@ -120,7 +120,7 @@ checks: - 'f:/etc/ntp-restrict.conf -> r:restrict lo' # 2.4.1 Disable Remote Apple Events (Scored) - - id: 7507 + - id: 8507 title: "Disable Remote Apple Events" description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." @@ -132,7 +132,7 @@ checks: - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' # 2.4.4 Disable Printer Sharing (Scored) - - id: 7508 + - id: 8508 title: "Disable Printer Sharing" description: "By enabling Printer sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." @@ -144,7 +144,7 @@ checks: - 'c:system_profiler SPPrintersDataType -> r:Shared:\s*\t*Yes' # 2.4.5 Disable Remote Login (Scored) - - id: 7509 + - id: 8509 title: "Disable Remote Login" description: "Remote Login allows an interactive terminal connection to a computer." rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple OSX clients, not servers." @@ -156,7 +156,7 @@ checks: - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' # 2.4.8 Disable File Sharing (Scored) - - id: 7510 + - id: 8510 title: "Disable File Sharing" description: "Apple's File Sharing uses a combination of SMB (Windows sharing) and AFP (Mac sharing)" rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." @@ -169,7 +169,7 @@ checks: - 'f:/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist -> r:\ r:womp && !r:\s0$' # 2.6.1 Enable FileVault (Scored) - - id: 7512 + - id: 8512 title: "Enable FileVault" description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it." rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." @@ -195,7 +195,7 @@ checks: - 'c:diskutil cs list -> r:^Encryption Type && r:AES-XTS' # 2.6.2 Enable Gatekeeper (Scored) - - id: 7513 + - id: 8513 title: "Enable Gatekeeper" description: "Gatekeeper is Apple's application white-listing control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." @@ -207,7 +207,7 @@ checks: - 'c:spctl --status -> r:^assessments\s*\t*enabled$' # 2.6.3 Enable Firewall (Scored) - - id: 7514 + - id: 8514 title: "Enable Firewall" description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." @@ -221,7 +221,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$' # 2.6.4 Enable Firewall Stealth Mode (Scored) - - id: 7515 + - id: 8515 title: "Enable Firewall Stealth Mode" description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." @@ -235,7 +235,7 @@ checks: - 'c:/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode -> r:^Stealth mode enabled' # 2.10 Enable Secure Keyboard Entry in terminal.app (Scored) - - id: 7516 + - id: 8516 title: "Enable Secure Keyboard Entry in terminal.app" description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." @@ -247,7 +247,7 @@ checks: - 'c:defaults read -app Terminal SecureKeyboardEntry -> 1' # 2.11 Java 6 is not the default Java runtime (Scored) - - id: 7517 + - id: 8517 title: "Java 6 is not the default Java runtime" description: "Apple had made Java part of the core Operating System for OS X. Apple is no longer providing Java updates for OS X and updated JREs and JDK are made available by Oracle. The latest version of Java 6 made available by Apple has many unpatched vulnerabilities and should not be the default runtime for Java applets that request one from the Operating System" rationale: "Java is one of the most exploited environments and is no longer maintained by Apple, old versions may still be installed and should be removed from the computer or not be in the default path." @@ -259,7 +259,7 @@ checks: - 'c:/usr/libexec/java_home -> r:1.6.0' # 3.2 Enable security auditing (Scored) - - id: 7518 + - id: 8518 title: "Enable security auditing" description: "OSX's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." @@ -271,7 +271,7 @@ checks: - 'c:launchctl list -> r:com.apple.auditd' # 3.3 Configure Security Auditing Flags (Scored) - - id: 7519 + - id: 8519 title: "Configure Security Auditing Flags" description: "Auditing is the capture and maintenance of information about security-related events." rationale: "Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises or attacks that have occurred, have begun, or are about to begin. Audit logs are necessary to provide a trail of evidence in case the system or network is compromised." @@ -283,7 +283,7 @@ checks: - 'f:/etc/security/audit_control -> r:^flags && r:lo && r:ad && r:fd && r:fm && r:-all' # 4.1 Disable Bonjour advertising service (Scored) - - id: 7520 + - id: 8520 title: "Disable Bonjour advertising service" description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on Mac OS X is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." rationale: "Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour's multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of \"I'm here!\" messages. Typical end-user endpoints should not have to advertise services to other computers. This setting does not stop the computer from sending out service discovery messages when looking for services on an internal subnet, if the computer is looking for a printer or server and using service discovery. To block all Bonjour traffic except to approved devices the pf or other firewall would be needed." @@ -295,7 +295,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> 1' # 4.4 Ensure http server is not running (Scored) - - id: 7521 + - id: 8521 title: "Ensure http server is not running" description: "Mac OS X used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." @@ -308,7 +308,7 @@ checks: - 'p:/usr/sbin/httpd' # 4.5 Ensure ftp server is not running (Scored) - - id: 7522 + - id: 8522 title: "Ensure ftp server is not running" description: "Mac OS X used to have a graphical front-end to the embedded ftp server in the Operating System. Ftp sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Running an Ftp server from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. The Ftp server however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Ftp servers meet a specialized need to distribute files without strong authentication and should only be done through hardened servers. Cloud services or other distribution methods should be considered" rationale: "Ftp servers should not be run on an end user desktop. Dedicated servers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." @@ -320,7 +320,7 @@ checks: - 'c:launchctl list -> r:com.apple.ftpd' # 4.6 Ensure nfs server is not running (Scored) - - id: 7523 + - id: 8523 title: "Ensure nfs server is not running" description: "Mac OS X can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end user computer." rationale: "File serving should not be done from a user desktop, dedicated servers should be used. Open ports make it easier to exploit the computer." @@ -334,7 +334,7 @@ checks: - 'f:/etc/exports' # 5.7 Do not enable the "root" account (Scored) - - id: 7524 + - id: 8524 title: "Do not enable the \"root\" account" description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. In the UNIX/Linux world, the system administrator commonly uses the root account to perform administrative functions." rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a Mac OS X client computer. It is enabled on Mac OS X Server. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." @@ -346,7 +346,7 @@ checks: - 'c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority' # 5.8 Disable automatic login (Scored) - - id: 7525 + - id: 8525 title: "Disable automatic login" description: "The automatic login feature saves a user's system access credentials and bypasses the login screen, instead the system automatically loads to the user's desktop screen." rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." @@ -358,7 +358,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.loginwindow -> r:autoLoginUser' # 5.9 Require a password to wake the computer from sleep or screen saver (Scored) - - id: 7526 + - id: 8526 title: "Require a password to wake the computer from sleep or screen saver" description: "Sleep and screensaver modes are low power modes that reduces electrical consumption while the system is not in use." rationale: "Prompting for a password when waking from sleep or screensaver mode mitigates the threat of an unauthorized person gaining access to a system in the user's absence." @@ -370,7 +370,7 @@ checks: - 'c:defaults read com.apple.screensaver askForPassword -> 1' # 5.11 Disable ability to login to another user's active and locked session (Scored) - - id: 7527 + - id: 8527 title: "Disable ability to login to another user's active and locked session" description: "OSX has a privilege that can be granted to any user that will allow that user to unlock active user's sessions." rationale: "Disabling the admins and/or user's ability to log into another user's active and locked session prevents unauthorized persons from viewing potentially sensitive and/or personal information." @@ -382,7 +382,7 @@ checks: - 'f:/etc/pam.d/screensaver -> r:group=admin,wheel|group=wheel,admin && r:fail_safe' # 5.18 System Integrity Protection status (Scored) - - id: 7528 + - id: 8528 title: "System Integrity Protection status" description: "System Integrity Protection is a new security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." @@ -394,7 +394,7 @@ checks: - 'c:/usr/bin/csrutil status -> r:^System Integrity Protection status: enabled' # 6.1.3 Disable guest account login (Scored) - - id: 7529 + - id: 8529 title: "Disable guest account login" description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes, cannot remotely login to the system and all created files, caches, and passwords are deleted upon logging out." rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." @@ -406,7 +406,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> 0' # 6.1.5 Remove Guest home folder (Scored) - - id: 7530 + - id: 8530 title: "Remove Guest home folder" description: "The guest account login should have been disabled, so there is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folders continued existence it is best removed." rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." @@ -418,7 +418,7 @@ checks: - 'd:/Users/Guest' # 6.2 Turn on filename extensions (Scored) - - id: 7531 + - id: 8531 title: "Turn on filename extensions" description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." rationale: "Visible filename extensions allows the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." @@ -430,7 +430,7 @@ checks: - 'c:defaults read NSGlobalDomain AppleShowAllExtensions -> 1' # 6.3 Disable the automatic run of safe files in Safari (Scored) - - id: 7532 + - id: 8532 title: "Disable the automatic run of safe files in Safari" description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." diff --git a/sca/darwin/16/cis_apple_macOS_10.12.yml b/sca/darwin/16/cis_apple_macOS_10.12.yml index 66242403e..f037054fa 100644 --- a/sca/darwin/16/cis_apple_macOS_10.12.yml +++ b/sca/darwin/16/cis_apple_macOS_10.12.yml @@ -1,5 +1,5 @@ # Security Configuration Assessment -# CIS Checks for MacOS 10.12 +# CIS Checks for macOS 10.12 # Copyright (C) 2015-2020, Wazuh Inc. # # This program is free software; you can redistribute it @@ -19,8 +19,8 @@ policy: - https://www.cisecurity.org/cis-benchmarks/ requirements: - title: "Check MacOS version" - description: "Requirements for running the SCA scan against MacOS 10.12 (Sierra)." + title: "Check macOS version" + description: "Requirements for running the SCA scan against macOS 10.12 (Sierra)." condition: any rules: - 'c:sw_vers -> r:^ProductVersion:\t*\s*10\p12' @@ -29,7 +29,7 @@ requirements: checks: # 1.1 Verify all Apple provided software is current (Scored) - - id: 8000 + - id: 9000 title: "Verify all Apple provided software is current" description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." @@ -41,7 +41,7 @@ checks: - 'c:softwareupdate -l -> r:No new software available' # 1.2 Enable Auto Update (Scored) - - id: 8001 + - id: 9001 title: "Enable Auto Update" description: "Auto Update verifies that your system has the newest security patches and software updates. If \"Automatically check for updates\" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur." rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." @@ -56,7 +56,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> 1' # 1.3 Enable app update installs (Scored) - - id: 8002 + - id: 9002 title: "Enable app update installs" description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" @@ -68,7 +68,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1' # 1.4 Enable system data files and security update installs (Scored) - - id: 8003 + - id: 9003 title: "Enable system data files and security update installs" description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper, with this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" @@ -84,7 +84,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> 1' # 1.5 Enable macOS update installs (Scored) - - id: 8004 + - id: 9004 title: "Enable macOS update installs" description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" @@ -96,7 +96,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -> 1' # 2.2.1 Enable "Set time and date automatically" (Scored) - - id: 8005 + - id: 9005 title: "Enable \"Set time and date automatically\"" description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Note: If your organization has internal time servers, enter them here. Enterprise mobile devices may need to use a mix of internal and external time servers. If multiple servers are required use the Date & Time System Preference with each server separated by a space." rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." @@ -108,7 +108,7 @@ checks: - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' # 2.4.1 Disable Remote Apple Events (Scored) - - id: 8006 + - id: 9006 title: "Disable Remote Apple Events" description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." @@ -120,7 +120,7 @@ checks: - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' # 2.4.4 Disable Printer Sharing (Scored) - - id: 8007 + - id: 9007 title: "Disable Printer Sharing" description: "By enabling Printer sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." @@ -132,7 +132,7 @@ checks: - 'c:system_profiler SPPrintersDataType -> r:Shared:\s*\t*Yes' # 2.4.5 Disable Remote Login (Scored) - - id: 8008 + - id: 9008 title: "Disable Remote Login" description: "Remote Login allows an interactive terminal connection to a computer." rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers." @@ -144,7 +144,7 @@ checks: - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' # 2.4.8 Disable File Sharing (Scored) - - id: 8009 + - id: 9009 title: "Disable File Sharing" description: "Apple's File Sharing uses a combination of SMB (Windows sharing) and AFP (Mac sharing)" rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." @@ -157,7 +157,7 @@ checks: - 'f:/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist -> r:\ r:womp && !r:\s0$' # 2.6.1.1 Enable FileVault (Scored) - - id: 8011 + - id: 9011 title: "Enable FileVault" description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it." rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." @@ -181,7 +181,7 @@ checks: - 'c:fdesetup status -> r:^FileVault\s*\t*is\s*\t*On$' # 2.6.2 Enable Gatekeeper (Scored) - - id: 8012 + - id: 9012 title: "Enable Gatekeeper" description: "Gatekeeper is Apple's application white-listing control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." @@ -193,7 +193,7 @@ checks: - 'c:spctl --status -> r:^assessments\s*\t*enabled$' # 2.6.3 Enable Firewall (Scored) - - id: 8013 + - id: 9013 title: "Enable Firewall" description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." @@ -207,7 +207,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$' # 2.6.4 Enable Firewall Stealth Mode (Scored) - - id: 8014 + - id: 9014 title: "Enable Firewall Stealth Mode" description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." @@ -221,7 +221,7 @@ checks: - 'c:/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode -> r:^Stealth mode enabled' # 2.10 Enable Secure Keyboard Entry in terminal.app (Scored) - - id: 8015 + - id: 9015 title: "Enable Secure Keyboard Entry in terminal.app" description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." @@ -233,7 +233,7 @@ checks: - 'c:defaults read -app Terminal SecureKeyboardEntry -> 1' # 2.11 Java 6 is not the default Java runtime (Scored) - - id: 8016 + - id: 9016 title: "Java 6 is not the default Java runtime" description: "Apple had made Java part of the core Operating System for macOS. Apple is no longer providing Java updates for macOS and updated JREs and JDK are made available by Oracle. The latest version of Java 6 made available by Apple has many unpatched vulnerabilities and should not be the default runtime for Java applets that request one from the Operating System" rationale: "Java has been one of the most exploited environments and Java 6, which was provided as an OS component by Apple, is no longer maintained by Apple or Oracle. The old versions provided by Apple are both unsupported and missing the more modern security controls that have limited current exploits. The EOL version may still be installed and should be removed from the computer or not be in the default path." @@ -245,7 +245,7 @@ checks: - 'c:/usr/libexec/java_home -> r:1.6.0' # 3.1 Enable security auditing (Scored) - - id: 8017 + - id: 9017 title: "Enable security auditing" description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." @@ -257,7 +257,7 @@ checks: - 'c:launchctl list -> r:com.apple.auditd' # 3.2 Configure Security Auditing Flags (Scored) - - id: 8018 + - id: 9018 title: "Configure Security Auditing Flags" description: "Auditing is the capture and maintenance of information about security-related events." rationale: "Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises or attacks that have occurred, have begun, or are about to begin. Audit logs are necessary to provide a trail of evidence in case the system or network is compromised." @@ -269,7 +269,7 @@ checks: - 'f:/etc/security/audit_control -> r:^flags && r:lo && r:ad && r:fd && r:fm && r:-all' # 4.1 Disable Bonjour advertising service (Scored) - - id: 8019 + - id: 9019 title: "Disable Bonjour advertising service" description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." rationale: "Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour's multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of \"I'm here!\" messages. Typical end-user endpoints should not have to advertise services to other computers." @@ -281,7 +281,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> 1' # 4.4 Ensure http server is not running (Scored) - - id: 8020 + - id: 9020 title: "Ensure http server is not running" description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." @@ -294,7 +294,7 @@ checks: - 'p:/usr/sbin/httpd' # 4.5 Ensure FTP server is not running (Scored) - - id: 8021 + - id: 9021 title: "Ensure FTP server is not running" description: "macOS used to have a graphical front-end to the embedded FTP server in the Operating System. FTP sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Running an FTP server from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. The FTP server however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. FTP servers meet a specialized need to distribute files without strong authentication and should only be done through hardened servers. Cloud services or other distribution methods should be considered" rationale: "FTP servers should not be run on an end user desktop. Dedicated servers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." @@ -306,7 +306,7 @@ checks: - 'c:launchctl list -> r:com.apple.ftpd' # 4.6 Ensure nfs server is not running (Scored) - - id: 8022 + - id: 9022 title: "Ensure nfs server is not running" description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end user computer." rationale: "File serving should not be done from a user desktop, dedicated servers should be used. Open ports make it easier to exploit the computer." @@ -320,7 +320,7 @@ checks: - 'f:/etc/exports' # 5.8 Do not enable the "root" account (Scored) - - id: 8023 + - id: 9023 title: "Do not enable the \"root\" account" description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some Linux distros the system administrator may commonly uses the root account to perform administrative functions." rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." @@ -332,7 +332,7 @@ checks: - 'c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority' # 5.9 Disable automatic login (Scored) - - id: 8024 + - id: 9024 title: "Disable automatic login" description: "The automatic login feature saves a user's system access credentials and bypasses the login screen, instead the system automatically loads to the user's desktop screen." rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." @@ -345,7 +345,7 @@ checks: # 5.20 System Integrity Protection status (Scored) - - id: 8025 + - id: 9025 title: "System Integrity Protection status" description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." @@ -357,7 +357,7 @@ checks: - 'c:/usr/bin/csrutil status -> r:^System Integrity Protection status: enabled' # 6.1.3 Disable guest account login (Scored) - - id: 8026 + - id: 9026 title: "Disable guest account login" description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes, cannot remotely login to the system and all created files, caches, and passwords are deleted upon logging out." rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." @@ -369,7 +369,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> 0' # 6.1.5 Remove Guest home folder (Scored) - - id: 8027 + - id: 9027 title: "Remove Guest home folder" description: "The guest account login should have been disabled, so there is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folders continued existence it is best removed." rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." @@ -381,7 +381,7 @@ checks: - 'd:/Users/Guest' # 6.2 Turn on filename extensions (Scored) - - id: 8028 + - id: 9028 title: "Turn on filename extensions" description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." rationale: "Visible filename extensions allows the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." @@ -393,7 +393,7 @@ checks: - 'c:defaults read NSGlobalDomain AppleShowAllExtensions -> 1' # 6.3 Disable the automatic run of safe files in Safari (Scored) - - id: 8029 + - id: 9029 title: "Disable the automatic run of safe files in Safari" description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." diff --git a/sca/darwin/17/cis_apple_macOS_10.13.yml b/sca/darwin/17/cis_apple_macOS_10.13.yml index ea3642917..214462d53 100644 --- a/sca/darwin/17/cis_apple_macOS_10.13.yml +++ b/sca/darwin/17/cis_apple_macOS_10.13.yml @@ -1,5 +1,5 @@ # Security Configuration Assessment -# CIS Checks for MacOS 10.13 +# CIS Checks for macOS 10.13 # Copyright (C) 2015-2020, Wazuh Inc. # # This program is free software; you can redistribute it @@ -19,8 +19,8 @@ policy: - https://www.cisecurity.org/cis-benchmarks/ requirements: - title: "Check MacOS version" - description: "Requirements for running the SCA scan against MacOS 10.13 (High Sierra)." + title: "Check macOS version" + description: "Requirements for running the SCA scan against macOS 10.13 (High Sierra)." condition: any rules: - 'c:sw_vers -> r:^ProductVersion:\t*\s*10\p13' @@ -29,7 +29,7 @@ requirements: checks: # 1.1 Verify all Apple provided software is current (Scored) - - id: 8500 + - id: 9500 title: "Verify all Apple provided software is current" description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." @@ -41,7 +41,7 @@ checks: - 'c:softwareupdate -l -> r:No new software available' # 1.2 Enable Auto Update (Scored) - - id: 8501 + - id: 9501 title: "Enable Auto Update" description: "Auto Update verifies that your system has the newest security patches and software updates. If \"Automatically check for updates\" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur." rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." @@ -56,7 +56,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> 1' # 1.3 Enable app update installs (Scored) - - id: 8502 + - id: 9502 title: "Enable app update installs" description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" @@ -68,7 +68,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1' # 1.4 Enable system data files and security update installs (Scored) - - id: 8503 + - id: 9503 title: "Enable system data files and security update installs" description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper, with this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" @@ -84,7 +84,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> 1' # 1.5 Enable macOS update installs (Scored) - - id: 8504 + - id: 9504 title: "Enable macOS update installs" description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" @@ -97,7 +97,7 @@ checks: # 2.2.1 Enable "Set time and date automatically" (Scored) - - id: 8505 + - id: 9505 title: "Enable \"Set time and date automatically\"" description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries." rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." @@ -109,7 +109,7 @@ checks: - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' # 2.4.1 Disable Remote Apple Events (Scored) - - id: 8506 + - id: 9506 title: "Disable Remote Apple Events" description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." @@ -121,7 +121,7 @@ checks: - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' # 2.4.4 Disable Printer Sharing (Scored) - - id: 8507 + - id: 9507 title: "Disable Printer Sharing" description: "By enabling Printer sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." @@ -133,7 +133,7 @@ checks: - 'c:system_profiler SPPrintersDataType -> r:Shared:\s*\t*Yes' # 2.4.5 Disable Remote Login (Scored) - - id: 8508 + - id: 9508 title: "Disable Remote Login" description: "Remote Login allows an interactive terminal connection to a computer." rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers." @@ -145,7 +145,7 @@ checks: - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' # 2.4.8 Disable File Sharing (Scored) - - id: 8509 + - id: 9509 title: "Disable File Sharing" description: "Apple's File Sharing uses a combination of SMB (Windows sharing) and AFP (Mac sharing)" rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." @@ -158,7 +158,7 @@ checks: - 'f:/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist -> r:\ r:womp && !r:\s0$' # 2.6.1.1 Enable FileVault (Scored) - - id: 8511 + - id: 9511 title: "Enable FileVault" description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it." rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." @@ -182,7 +182,7 @@ checks: - 'c:fdesetup status -> r:^FileVault\s*\t*is\s*\t*On$' # 2.6.2 Enable Gatekeeper (Scored) - - id: 8512 + - id: 9512 title: "Enable Gatekeeper" description: "Gatekeeper is Apple's application white-listing control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." @@ -194,7 +194,7 @@ checks: - 'c:spctl --status -> r:^assessments\s*\t*enabled$' # 2.6.3 Enable Firewall (Scored) - - id: 8513 + - id: 9513 title: "Enable Firewall" description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." @@ -208,7 +208,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$' # 2.6.4 Enable Firewall Stealth Mode (Scored) - - id: 8514 + - id: 9514 title: "Enable Firewall Stealth Mode" description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." @@ -222,7 +222,7 @@ checks: - 'c:/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode -> r:^Stealth mode enabled' # 2.10 Enable Secure Keyboard Entry in terminal.app (Scored) - - id: 8515 + - id: 9515 title: "Enable Secure Keyboard Entry in terminal.app" description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." @@ -234,11 +234,11 @@ checks: - 'c:defaults read -app Terminal SecureKeyboardEntry -> 1' # 2.11 Java 6 is not the default Java runtime (Scored) - - id: 8516 + - id: 9516 title: "Java 6 is not the default Java runtime" description: "Apple had made Java part of the core Operating System for macOS. Apple is no longer providing Java updates for macOS and updated JREs and JDK are made available by Oracle. The latest version of Java 6 made available by Apple has many unpatched vulnerabilities and should not be the default runtime for Java applets that request one from the Operating System" rationale: "Java has been one of the most exploited environments and Java 6, which was provided as an OS component by Apple, is no longer maintained by Apple or Oracle. The old versions provided by Apple are both unsupported and missing the more modern security controls that have limited current exploits. The EOL version may still be installed and should be removed from the computer or not be in the default path." - remediation: "Java 6 can be removed completely or, if required Java applications will only work with Java 6, a custom path can be used. Apple is likely to finally pull the plug on Java 6 in upcoming MacOS versions so any applications that still require Java 6 will likely soon be unavailable." + remediation: "Java 6 can be removed completely or, if required Java applications will only work with Java 6, a custom path can be used. Apple is likely to finally pull the plug on Java 6 in upcoming macOS versions so any applications that still require Java 6 will likely soon be unavailable." compliance: - cis: ["2.11"] condition: none @@ -246,7 +246,7 @@ checks: - 'c:/usr/libexec/java_home -> r:1.6.0' # 2.13 Ensure EFI version is valid and being regularly checked (Scored) - - id: 8517 + - id: 9517 title: "Ensure EFI version is valid and being regularly checked" description: "In order to mitigate firmware attacks Apple has created a automated Firmware check to ensure that the EFI version running is a known good version from Apple. There is also an automated process to check it every seven days." rationale: "If the Firmware of a computer has been compromised the Operating System that the Firmware loads cannot be trusted either." @@ -259,7 +259,7 @@ checks: - 'c:launchctl list -> r:^-\s*\t*0\s*\t*com.apple.driver.eficheck$' # 3.1 Enable security auditing (Scored) - - id: 8518 + - id: 9518 title: "Enable security auditing" description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." @@ -271,7 +271,7 @@ checks: - 'c:launchctl list -> r:com.apple.auditd' # 3.2 Configure Security Auditing Flags (Scored) - - id: 8519 + - id: 9519 title: "Configure Security Auditing Flags" description: "Auditing is the capture and maintenance of information about security-related events." rationale: "Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises or attacks that have occurred, have begun, or are about to begin. Audit logs are necessary to provide a trail of evidence in case the system or network is compromised." @@ -283,7 +283,7 @@ checks: - 'f:/etc/security/audit_control -> r:^flags && r:lo && r:ad && r:fd && r:fm && r:-all' # 4.1 Disable Bonjour advertising service (Scored) - - id: 8520 + - id: 9520 title: "Disable Bonjour advertising service" description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." rationale: "Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour's multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of \"I'm here!\" messages. Typical end-user endpoints should not have to advertise services to other computers." @@ -295,7 +295,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> 1' # 4.4 Ensure http server is not running (Scored) - - id: 8521 + - id: 9521 title: "Ensure http server is not running" description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." @@ -308,7 +308,7 @@ checks: - 'p:/usr/sbin/httpd' # 4.5 Ensure nfs server is not running (Scored) - - id: 8522 + - id: 9522 title: "Ensure nfs server is not running" description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end user computer." rationale: "File serving should not be done from a user desktop, dedicated servers should be used. Open ports make it easier to exploit the computer." @@ -322,7 +322,7 @@ checks: - 'f:/etc/exports' # 5.11 Do not enable the "root" account (Scored) - - id: 8523 + - id: 9523 title: "Do not enable the \"root\" account" description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some Linux distros the system administrator may commonly uses the root account to perform administrative functions." rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." @@ -334,7 +334,7 @@ checks: - 'c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority' # 5.12 Disable automatic login (Scored) - - id: 8524 + - id: 9524 title: "Disable automatic login" description: "The automatic login feature saves a user's system access credentials and bypasses the login screen, instead the system automatically loads to the user's desktop screen." rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." @@ -346,7 +346,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.loginwindow -> r:autoLoginUser' # 5.23 System Integrity Protection status (Scored) - - id: 8525 + - id: 9525 title: "System Integrity Protection status" description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." @@ -358,7 +358,7 @@ checks: - 'c:/usr/bin/csrutil status -> r:^System Integrity Protection status: enabled' # 6.1.3 Disable guest account login (Scored) - - id: 8526 + - id: 9526 title: "Disable guest account login" description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes, cannot remotely login to the system and all created files, caches, and passwords are deleted upon logging out." rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." @@ -370,7 +370,7 @@ checks: - 'c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> 0' # 6.1.5 Remove Guest home folder (Scored) - - id: 8527 + - id: 9527 title: "Remove Guest home folder" description: "The guest account login should have been disabled, so there is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folders continued existence it is best removed." rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." @@ -382,7 +382,7 @@ checks: - 'd:/Users/Guest' # 6.2 Turn on filename extensions (Scored) - - id: 8528 + - id: 9528 title: "Turn on filename extensions" description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." rationale: "Visible filename extensions allows the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." @@ -394,7 +394,7 @@ checks: - 'c:defaults read NSGlobalDomain AppleShowAllExtensions -> 1' # 6.3 Disable the automatic run of safe files in Safari (Scored) - - id: 8529 + - id: 9529 title: "Disable the automatic run of safe files in Safari" description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." diff --git a/sca/debian/cis_debian10.yml b/sca/debian/cis_debian10.yml new file mode 100644 index 000000000..5285e55f7 --- /dev/null +++ b/sca/debian/cis_debian10.yml @@ -0,0 +1,3425 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 10 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Linux 10 Benchmark v1.0.0 - 02-13-2020 + +policy: + id: "cis_debian10" + file: "cis_debian10.yml" + name: "CIS Benchmark for Debian/Linux 10" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 10." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version" + description: "Requirements for running the SCA scan against Debian/Ubuntu." + condition: all + rules: + - 'f:/etc/debian_version' + - 'f:/proc/sys/kernel/ostype -> Linux' + +checks: + + +############################################################ +# 1 Initial Setup +############################################################ + +# 1.1 Filesystem configuration + - id: 2500 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/freevxfs.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: # rmmod freevxfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v freevxfs -> r:^install /bin/true' + - 'not c:lsmod -> r:freevxfs' + + - id: 2501 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/jffs2.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v jffs2 -> r:^install /bin/true' + - 'not c:lsmod -> r:jffs2' + + - id: 2502 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/hfs.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v hfs -> r:^install /bin/true' + - 'not c:lsmod -> r:hfs' + + - id: 2503 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .confExample: vi /etc/modprobe.d/hfsplus.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v hfsplus -> r:^install /bin/true' + - 'not c:lsmod -> r:hfsplus' + + - id: 2504 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/squashfs.confand add the following line: install squashfs /bin/true Run the following command to unload the squashfsmodule: # rmmod squashfs" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found' + - 'not c:lsmod -> r:squashfs' + + - id: 2505 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v udf -> r:^install /bin/true' + - 'not c:lsmod -> r:udf' + + - id: 2506 + title: "Ensure mounting of FAT filesystems is disabled" + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/vfat.conf: install vfat /bin/true. Run the following command to unload the vfat module: rmmod vfat" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found' + - 'not c:lsmod -> r:vfat' + +# 1.1.x Filesystem Configuration + - id: 2507 + title: "Ensure /tmp is configured" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + remediation: "Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,realtime 0 0 or Run the following commands to enable systemd /tmp mounting: systemctl unmask tmp.mount systemctl enable tmp.mount Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + - id: 2508 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodevto the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp: # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 2509 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuidto the /tmp mount options:[Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp:# mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 2510 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add noexecto the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexecto the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp: # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + + - id: 2511 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 2512 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + - id: 2513 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + - id: 2514 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + - id: 2515 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + + + - id: 2516 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 2517 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 2518 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + + - id: 2519 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 2520 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://manpages.debian.org/buster/initscripts/tmpfs.5.en.html + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + - id: 2521 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + - id: 2522 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2.6", "8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + - id: 2523 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run one of the following commands: Run the following command to disable autofs: # systemctl --now disable autofs OR Run the following command to remove autofs: # apt purge autofs" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.4","8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled autofs -> enabled' + + + - id: 2524 + title: "Disable USB Storage" + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/usb_storage.conf and add the following line: # install usb-storage /bin/true . Run the following command to unload the usb-storage module: # rmmod usb-storage" + compliance: + - cis: ["1.1.23"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v usb-storage -> r:install /bin/true' + - 'not c:lsmod -> r:usb-storage' + +# 1.3 Configure Sudo + + - id: 2525 + title: "Ensure sudo is installed" + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Install sudo using the following command. # apt install sudo OR # apt install sudo-ldap" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.sudo.ws/ + condition: any + rules: + - 'c:dpkg -s sudo -> r:install ok installed' + - 'c:dpkg -s sudo-ldap -> r:install ok installed' + + - id: 2526 + title: "Ensure sudo commands use pty" + description: "sudo can be configured to run only froma pseudo-pty" + rationale: "Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing." + remediation: "edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + - id: 2527 + title: "Ensure sudo log file exists" + description: "sudo can use a custom log file" + rationale: "A sudo log file simplifies auditing of sudo commands" + remediation: "edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults logfile=\"\" Example Defaults logfile=\"/var/log/sudo.log\"" + compliance: + - cis: ["1.3.3"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*logfile=' + +# 1.4 Filesystem Integrity Checking + - id: 2528 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Install AIDE: # apt install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit . Notes: The prelinking feature can interfere with AIDE because it alters binaries to speed up their start up times. Run prelink -ua to restore the binaries to their prelinked state, thus avoiding false positives from AIDE." + compliance: + - cis: ["1.4.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:dpkg -s aide -> r:install ok installed' + + - id: 2529 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check, run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check" + compliance: + - cis: ["1.4.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer + condition: all + rules: + - 'c:grep -Rh aide /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab -> r:\.+' + - 'c:crontab -u root -l -> r:aide' + +# 1.5 Secure Boot Settings + - id: 2530 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: chown root:root /boot/grub/grub.cfg, chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2531 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub-mkpasswd-pbkdf2 : # grub-mkpasswd-pbkdf2 Enter password: Reenter password: PBKDF2 hash of your password is Add the following into a custom /etc/grub.d configuration file: cat <\" password_pbkdf2 EOF The superuser/user information and password should not be contained in the /etc/grub.d/00_header file as this file could be overwritten in a package update. If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS=\"--class gnu-linux --class gnu --class os --unrestricted\" Run the following command to update the grub2 configuration: # update-grub" + compliance: + - cis: ["1.5.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 2532 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^root:*:|^root:!:' + + +# 1.6 Additional Process Hardening + + - id: 2533 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.6.1"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:journalctl -> r:NX \(Execute Disable\) protection: active' + + - id: 2534 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:\s*\t*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + - id: 2535 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following command to restore binaries to normal: # prelink -ua Uninstall prelink using the appropriate package manager or manual installation: # apt purge prelink" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s prelink -> r:install ok installed' + + - id: 2536 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.6.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> !r:^# && r:=\s*\t*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + +# 1.7 Mandatory Access Control + + - id: 2537 + title: "Ensure AppArmor is installed" + description: "AppArmor provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Install Apparmor. # apt install apparmor # apt install apparmor-utils" + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'c:dpkg -s apparmor-utils -> r:install ok installed' + - 'c:dpkg -s apparmor -> r:install ok installed' + + - id: 2538 + title: "Ensure AppArmor is enabled in the bootloader configuration" + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwrittenby the bootloader boot parameters." + rationale: "AppArmor must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /etc/default/grub and add the apparmor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX=\"apparmor=1 security=apparmor\" Run the following command to update the grub2 configuration # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && !r:apparmor=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && !r:security=apparmor' + + - id: 2539 + title: "Ensure all AppArmor Profiles are in enforce or complain mode" + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* OR Run the following command to set all profiles to complain mode: # aa-complain /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:apparmor_status -> r:0 processes are unconfined' + + + - id: 2540 + title: "Ensure all AppArmor Profiles are enforcing" + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' + - 'c:apparmor_status -> r:^0\s*profiles are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + +# 1.8 Warning Banners + - id: 2541 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd" + compliance: + - cis: ["1.8.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + - 'not f:/etc/motd' + + - id: 2542 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v , or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.8.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 2543 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.8.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 2544 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd" + compliance: + - cis: ["1.8.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2545 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue" + compliance: + - cis: ["1.8.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2546 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net" + compliance: + - cis: ["1.8.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2547 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add: [org/gnome/login-screen], banner-message-enable=true, banner-message-text='Authorized uses only. All activity may be monitored and reported.'" + compliance: + - cis: ["1.8.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^[org/gnome/login-screen]' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-enable=true' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-text=\.+' + + - id: 2548 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. Notes: Site policy may mandate a testing period before install onto production systems for available updates." + compliance: + - cis: ["1.9"] + - cis_csc: ["3.4", "3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6","SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: none + rules: + - 'c:apt -s upgrade -> r:^The following packages will be upgraded' + +############################################################ +# 2 Services +############################################################ + + - id: 2549 + title: "Ensure xinetd is not installed" + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed." + remediation: "Run the following command to remove xinetd: # apt purge xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s xinetd -> r:install ok installed' + + - id: 2550 + title: "Ensure openbsd-inetd is not installed" + description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no inetd services required, it is recommended that the daemon be removed." + remediation: "Run the following command to uninstall openbsd-inetd: apt purge openbsd-inetd" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s openbsd-inetd -> r:install ok installed' + + - id: 2551 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On systems where host based time synchronization is not available, configure systemd-timesyncd. If \"full featured\" and/or encrypted time synchronization is required, install chrony or NTP. To install chrony: # apt install chrony To install ntp: # apt install ntp On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'c:dpkg -s ntp -> r:install ok installed' + - 'c:dpkg -s chrony -> r:install ok installed' + - 'c:systemctl is-enabled systemd-timescynd -> enabled' + + - id: 2552 + title: "Ensure systemd-timesyncd is configured" + description: "systemd-timesyncd is a daemon that has been added for synchronizing the system clock across the network. It implements an SNTP client. In contrast to NTP implementations such as chrony or the NTP reference server this only implements a client side, and does not bother with the full NTP complexity, focusing only on querying time from one remote server and synchronizing the local clock to it. The daemon runs with minimal privileges, and has been hooked up with networkd to only operate when network connectivity is available. The daemon saves the current clock to disk every time a new NTP sync has been acquired, and uses this to possibly correct the system clock early at bootup, in order to accommodate for systems that lack an RTC such as the Raspberry Pi and embedded devices, and make sure that time monotonically progresses on these systems, even if it is not always correct. To make use of this daemon a new system user and group \"systemd- timesync\" needs to be created on installation of systemd. Note: The systemd-timesyncd service specifically implements only SNTP. This minimalistic service will set the system clock for large offsets or slowly adjust it for smaller deltas. More complex use cases are not covered by systemd-timesyncd. This recommendation only applies if timesyncd is in use on the system." + rationale: "Proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if timesyncd is in use on the system." + remediation: "Run the following command to enable systemd-timesyncd # systemctl enable systemd-timesyncd.service || Edit the file /etc/systemd/timesyncd.conf and add/modify the following lines: NTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org FallbackNTP=2.debian.pool.ntp.org 3.debian.pool.ntp.org RootDistanceMax=1 || Run the following commands to start systemd-timesyncd.service # systemctl start systemd-timesyncd.service # timedatectl set-ntp true || Notes: Servers listed and RootDistanceMax should be In Accordance With Local Policy some versions of systemd have been compiled without systemd-timesycnd. On these distributions, chrony or NTP should be used instead of systemd-timesycnd. Not all options are available on all versions of systemd-timesyncd" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:systemctl is-enabled systemd-timesyncd.service -> enabled' + + - id: 2553 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." + remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server Configure chrony to run as the chrony user by configuring the appropriate startup script for your distribution. Startup scripts are typically stored in /etc/init.d or /etc/systemd ." + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony/chrony.conf -> r:^server\.+|^pool\.+' + + - id: 2554 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" + compliance: + - cis: ["2.2.1.4"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + +# 2.2.2 Ensure the X Window system is not installed (Scored) + - id: 2555 + title: "Ensure the X Window system is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Remove the X Windows System packages: apt purge xserver-xorg*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + - id: 2556 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl --now disable avahi-daemon" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled avahi-daemon -> enabled' + + - id: 2557 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups: # systemctl --now disable cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.cups.org + condition: none + rules: + - 'c:systemctl is-enabled cups -> enabled' + + - id: 2558 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following commands to disable dhcpd: # systemctl --now disable isc-dhcp-server # systemctl --now disable isc-dhcp-server6" + references: + - https://www.isc.org/dhcp/ + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled isc-dhcp-server -> enabled' + - 'c:systemctl is-enabled isc-dhcp-server6 -> enabled' + + - id: 2559 + title: "Ensure LDAP server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl --now disable slapd" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.openldap.org + condition: none + rules: + - 'c:systemctl is-enabled slapd -> enabled' + + - id: 2560 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind: # systemctl --now disable nfs-server # systemctl --now disable rpcbind" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled nfs-server -> enabled' + - 'c:systemctl is-enabled rpcbind -> enabled' + + - id: 2561 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable named: # systemctl --now disable bind9" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled bind9 -> enabled' + + - id: 2562 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl --now disable vsftpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled vsftpd -> enabled' + + - id: 2563 + title: "Ensure HTTP Server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable apache2: # systemctl --now disable apache2" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled apache2 -> enabled' + + - id: 2564 + title: "Ensure email services are not enabled" + description: "dovecot is an open source mail submission and transport server for Linux based systems." + rationale: "Unless mail transport services are to be provided by this system, it is recommended that the service be disabled or deleted to reduce the potential attack surface." + remediation: "Run one of the following commands to disable dovecot : # systemctl --now disable dovecot" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled dovecot -> enabled' + + - id: 2565 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable smbd: # systemctl --now disable smbd" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled smbd -> enabled' + + - id: 2566 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl --now disable squid" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled squid -> enabled' + + - id: 2567 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl --now disable snmpd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled snmpd -> enabled' + + - id: 2568 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/exim4/update-exim4.conf.conf and and or modify following lines to look like the lines below: dc_eximconfig_configtype='local' dc_local_interfaces='127.0.0.1 ; ::1' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='' dc_use_split_config='false' dc_hide_mailname='' dc_mailname_in_oh='true' dc_localdelivery='mail_spool' Restart exim4: # systemctl restart exim4" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + - id: 2569 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl --now disable rsync" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - 'c:systemctl is-enabled rsync -> enabled' + + - id: 2570 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable nis: # systemctl --now disable nis" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled nis -> enabled' + + - id: 2571 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall nis : apt purge nis" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s nis -> r:install ok installed' + + - id: 2572 + title: "Ensure rsh client is not installed" + description: "The rsh-client package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Uninstall rsh : apt purge rsh-client" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s rsh-client -> r:install ok installed' + + - id: 2573 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Uninstall talk : apt purge talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s talk -> r:install ok installed' + + - id: 2574 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Uninstall telnet : # apt purge telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s telnet -> r:install ok installed' + + - id: 2575 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Uninstall ldap-utils : # apt purge ldap-utils" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s ldap-utils -> r:install ok installed' + +############################################################ +# 3 Network Configuration +############################################################ +############################################################ +# 3.1 Disable unused network protocols and devices +############################################################ + +# 3.1.1 Disable IPv6 (Not Scored) + - id: 2576 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system." + remediation: "Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX=\"ipv6.disable=1\" Run the following command to update the grub2 configuration: # update-grub" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.6","CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:ipv6.disable=1' + + +# 3.1.2 Ensure wireless interfaces are disabled (Scored) + - id: 2577 + title: "Ensure wireless interfaces are disabled" + description: "Wireless networking is used when wired networks are unavailable. Debian contains a wireless tool kit to allow system administrators to configure and use wireless networks." + rationale: "If wireless is not to be used, wireless devices can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable any wireless interfaces: # nmcli radio all off" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.6"] + references: + - nmcli(1) - Linux man page + condition: all + rules: + - 'c:nmcli radio wifi -> r:^disabled' + - 'c:nmcli radio wwan -> r:^disabled' +########################################################## +# 3.2 Network Parameters +########################################################## +# 3.2.1 Ensure packet redirect sending is disabled + - id: 2578 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' +# 3.2.2 Ensure IP forwarding is disabled + - id: 2579 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following command to restore the default parameter and set the active kernel parameter: # grep -Els \"^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1 IF IPv6 is enabled: Run the following command to restore the default parameter and set the active kernel parameter: # grep -Els \"^\\s*net\\.ipv6\\.conf\\.all\\.forwarding\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv6\\.conf\\.all\\.forwarding\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv6.conf.all.forwarding=0; sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.forwarding /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + +############################################################# +# 3.3 Network Parameters +############################################################# +# 3.3.1 Ensure source routed packets are not accepted + - id: 2580 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 IF IPv6 is enabled: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + +# 3.3.2 Ensure ICMP redirects are not accepted + - id: 2581 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 IF IPv6 is enabled: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + +# 3.3.3 Ensure secure ICMP redirects are not accepted + - id: 2582 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + +# 3.3.4 Ensure suspicious packets are logged (Scored) + - id: 2583 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + +# 3.3.5 Ensure broadcast ICMP requests are ignored + - id: 2584 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + +# 3.3.6 Ensure bogus ICMP responses are ignored (Scored) + - id: 2585 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + +# 3.3.7 Ensure Reverse Path Filtering is enabled (Scored) + - id: 2586 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + +# 3.3.8 Ensure TCP SYN Cookies is enabled (Scored) + - id: 2587 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + +# 3.3.9 Ensure IPv6 router advertisements are not accepted (Scored) + - id: 2588 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + + +##################################################################### +# 3.4 Uncommon Network Protocols +##################################################################### +# 3.4.1 Ensure DCCP is disabled (Scored) + - id: 2589 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v dccp -> r:install /bin/true' + - 'c:lsmod -> r:dccp' + +# 3.4.2 Ensure SCTP is disabled (Scored) + - id: 2590 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v sctp -> r:install /bin/true' + - 'c:lsmod -> r:sctp' + + +# 3.4.3 Ensure RDS is disabled (Scored) + - id: 2591 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v rds -> r:install /bin/true' + - 'c:lsmod -> r:rds' + +# 3.4.4 Ensure TIPC is disabled (Scored) + - id: 2592 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v tipc -> r:install /bin/true' + - 'c:lsmod -> r:tipc' + + + +################################################################# +# 3.5 Firewall configuration +################################################################# +################################################################# +# 3.5.1 Ensure Firewall software is installed +################################################################# +# 3.5.1.1 Ensure a Firewall package is installed (Scored) + - id: 2593 + title: "Ensure a Firewall package is installed" + description: "A Firewall package should be selected. Most firewall configuration utilities operate as a front end to nftables or iptables." + rationale: "A Firewall package is required for firewall management and configuration." + remediation: "Run one of the following commands to install the Firewall package that follows local site policy: To install UFW , run the following command: # apt install ufw To install nftables , run the following command: # apt install nftables To install iptables , run the following command: # apt install iptables" + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC6.6"] + condition: any + rules: + - 'c:dpkg -s ufw -> r:Status: install ok installed' + - 'c:dpkg -s nftables -> r:Status: install ok installed' + - 'c:dpkg -s iptables -> r:Status: install ok installed' +################################################################# +# 3.5.2 Configure UncomplicatedFirewall +################################################################# +# 3.5.2.1 Ensure ufw service is enabled (Scored) + - id: 2594 + title: "Ensure ufw service is enabled" + description: "UncomplicatedFirewall (ufw) is a frontend for iptables. ufw provides a framework for managing netfilter, as well as a command-line and available graphical user interface for manipulating the firewall. Ensure that the ufw service is enabled to protect your system." + rationale: "The ufw service must be enabled and running in order for ufw to protect the system" + remediation: "Run the following command to enable ufw: # ufw enable" + compliance: + - cis: ["3.5.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + reference: + - "http://manpages.ubuntu.com/manpages/precise/en/man8/ufw.8.html" + condition: all + rules: + - 'c:systemctl is-enabled ufw -> enabled' + - 'c:ufw status -> Status: active' + +# 3.5.2.2 Ensure default deny firewall policy (Scored) + - id: 2595 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default deny policy: # ufw default deny incoming # ufw default deny outgoing # ufw default deny routed" + compliance: + - cis: ["3.5.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ufw status verbose -> r:^Default && r:deny\W+(incoming)|reject\W+(incoming)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+(outgoing)|reject\W+(outgoing)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+(routed)|reject\W+(routed)' + +# 3.5.2.3 Ensure loopback traffic is configured (Scored) + - id: 2596 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ufw allow in on lo # ufw allow out on lo # sudo ufw deny in from 127.0.0.0/8 # sudo ufw deny in from ::1" + compliance: + - cis: ["3.5.2.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ufw status verbose -> r:Anywhere on lo\s*\t*ALLOW IN\s*\t*Anywhere' + - 'c:ufw status verbose -> r:Anywhere\s*\t*DENY IN\s*\t*127.0.0.0/8' + - 'c:ufw status verbose -> r:Anywhere \(v6\) on lo\s*\t*ALLOW IN\s*\t*Anywhere \(v6\)' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*DENY IN\s*\t*::1' + - 'c:ufw status verbose -> r:Anywhere\s*\t*ALLOW OUT\s*\t*Anywhere on lo' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*ALLOW OUT\s*\t*Anywhere \(v6\) on lo' + +###################################################################### +# 3.5.3 Configure nftables +###################################################################### + +# 3.5.3.2 Ensure a table exists (Scored) + - id: 2597 + title: "Ensure a table exists" + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + remediation: "Run the following command to create a table in nftables: # nft create table inet
.Example: # nft create table inet filter" + compliance: + - cis: ["3.5.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list tables -> r:\w+' + +# 3.5.3.3 Ensure base chains exist (Scored) + - id: 2598 + title: "Ensure base chains exist" + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } . Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0\\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }" + compliance: + - cis: ["3.5.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list ruleset -> r:hook input' + - 'c:nft list ruleset -> r:hook forward' + - 'c:nft list ruleset -> r:hook output' + +# 3.5.3.6 Ensure default deny firewall policy (Scored) + - id: 2599 + title: "Ensure default deny firewall policy" + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept , the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } . Example: # nft chain inet filter input { policy drop \\; } ; # nft chain inet filter forward { policy drop \\; } and # nft chain inet filter output { policy drop \\; }" + compliance: + - cis: ["3.5.3.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list ruleset -> r:hook input && r:policy drop' + - 'c:nft list ruleset -> r:hook forward && r:policy drop' + - 'c:nft list ruleset -> r:hook output && r:policy drop' + +# 3.5.3.7 Ensure nftables service is enabled (Scored) + - id: 2600 + title: "Ensure nftables service is enabled" + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting of the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables" + compliance: + - cis: ["3.5.3.7"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:systemctl is-enabled nftables -> enabled' + +####################################################################### +# 3.5.4 Configure iptables +####################################################################### +####################################################################### +# 3.5.4.1 Configure IPv4 iptables +####################################################################### +# 3.5.4.1.1 Ensure default deny firewall policy (Scored) + - id: 2601 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP; # iptables -P OUTPUT DROP; # iptables -P FORWARD DROP" + compliance: + - cis: ["3.5.4.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)|Chain INPUT \(policy REJECT\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)|Chain FORWARD \(policy REJECT\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)|Chain OUTPUT \(policy REJECT\)' + +# 3.5.4.1.2 Ensure loopback traffic is configured (Scored) + - id: 2602 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.5.4.1.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + +######################################################################### +# 3.5.4.2 Configure IPv6 ip6tables +######################################################################### +# 3.5.4.2.1 Ensure IPv6 default deny firewall policy (Scored) + - id: 2603 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.4.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L -> r:^Chain INPUT && r:policy DROP' + - 'c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP' + - 'c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP' + +# 3.5.4.2.2 Ensure IPv6 loopback traffic is configured (Scored) + - id: 2604 + title: "Ensure IPv6 loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP" + compliance: + - cis: ["3.5.4.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + + +############################################################ +# 4 Logging and Auditing +############################################################ + + + + - id: 2605 + title: "Ensure auditd is installed" + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk" + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # apt install auditd audispd-plugins" + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:dpkg -s auditd -> r:install ok installed' + - 'c:dpkg -s audispd-plugins -> r:install ok installed' + + - id: 2606 + title: "Ensure auditd service is enabled" + description: "Enable and start the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1","10.7"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled auditd -> enabled' + + - id: 2607 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\" Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.2.6","10.7"] + - nist_800_53: ["AU.2"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + - id: 2608 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." + compliance: + - cis: ["4.1.2.1"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + - id: 2609 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + - id: 2610 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.2.3"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' + + + - id: 2611 + title: "Ensure events that modify date and time information are collected" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"" + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.3"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change' + + - id: 2612 + title: "Ensure events that modify user/group information are collected" + description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.4"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity' + + - id: 2613 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale-w /etc/network -p wa -k system-locale For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale" + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale' + + - id: 2614 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor AppArmor mandatory access control. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor/ && r:-p wa && r:-k MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy' + + - id: 2615 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.7"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins' + + - id: 2616 + title: "Ensure session initiation information is collected" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"" + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7","AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins' + + - id: 2617 + title: "Ensure discretionary access control permission modification events are collected" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + + - id: 2618 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/directory ending in .rules Example: vi /etc/audit/rules.d/audit.rules and add the following lines: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems Edit or create a file in the /etc/audit/rules.d/directory ending in .rules Example: vi /etc/audit/rules.d/access.rules and add the following lines: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access Notes: Reloading the auditd config toset active settings requires the auditd service to be restarted, and may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + + - id: 2619 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.12"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' + + - id: 2620 + title: "Ensure file deletion events by users are collected" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["6.2", "13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["PI1.4","PI1.5","CC7.1","CC7.2","CC7.3","CC8.1"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' + + - id: 2621 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["4.8"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["PI1.4","PI1.5","CC7.1","CC7.2","CC7.3","CC8.1"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope' + + - id: 2622 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.9"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w \.+ && r:-p wa && r:-k actions' + + - id: 2623 + title: "Ensure kernel module loading and unloading is collected" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b32 -S init_module -S delete_module -k modules. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S init_module && r:-S delete_module && r:-k modules' + + - id: 2624 + title: "Ensure the audit configuration is immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl. Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." + compliance: + - cis: ["4.1.17"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'd:/etc/audit/rules.d -> r:^99-finalize.rules$' + - 'd:/etc/audit/rules.d -> r:^99-finalize.rules$ -> r:^\s*\t*-e 2$' + + +# 4.2,1 Configure rsyslog + - id: 2625 + title: "Ensure rsyslog is installed" + description: "The rsyslog software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslogsuch as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog: # apt install rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: any + rules: + - 'c:dpkg -s rsyslog -> r:install ok installed' + - id: 2626 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog" + compliance: + - cis: ["4.2.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:systemctl is-enabled rsyslog -> enabled' + + - id: 2627 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + - id: 2628 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add one of the following lines: Newer syntax: action(type=\"omfwd\" target=\"\" port=\"\" protocol=\"tcp\" ction.resumeRetryCount=\"\" queue.type=\"linkList\" queue.size=\") Example: *.* action(type=\"omfwd\" target=\"192.168.2.100\" port\"514\" protocol=\"tcp\" action.resumeRetryCount=\"100\" queue.type=\"linkList\" queue.size=\"1000\") Older syntax: *.* @@" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'c:grep -Rh ^*.* /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* action\.+target=' + + - id: 2629 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts" + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.6"] + - cis_csc: ["9.2"] + - pci_dss: ["10.5.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' + - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' + +# 4.2.2.1 Ensure journald is configured to send logs to rsyslog (Scored) + - id: 2630 + title: "Ensure journald is configured to send logs to rsyslog" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.5"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.9","AU.4"] + - tsc: ["CC5.2","CC7.2"] + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + +# 4.2.2.2 Ensure journald is configured to compress large log files (Scored) + - id: 2631 + title: "Ensure journald is configured to compress large log files" + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Compress\s*=\s*yes' + +# 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk (Scored) + - id: 2632 + title: "Ensure journald is configured to write logfiles to persistent disk" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Storage\s*=\s*persistent' + + # 4.2.3 Ensure permissions on all logfiles are configured (Scored) + - id: 2633 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: "Run the following command to set permissions on all existing log files: find /var/log -type f -exec chmod g-wx,o-rwx \"{}\" + -o -type d -exec chmod g-w,o-rwx \"{}\" +" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2","CC7.2"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + - id: 2634 + title: "Ensure logrotate assigns appropriate permissions" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit /etc/logrotate.conf and update the create line to read 0640 or more restrictive, following local site policy Example: create 0640 root utmp" + compliance: + - cis: ["4.4"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'f:/etc/logrotate.conf -> r:^\s*\t*create\s*\t*0\d40|^\s*\t*create\s*\t*0\d00 && r:^\s*\t*create\s*\t*06\d0|^\s*\t*create\s*\t*04\d0|^\s*\t*create\s*\t*02\d0|^\s*\t*create\s*\t*00\d0' + + +############################################################ +# 5 Access, Authentication and Authorization +############################################################ +############################################################ +# 5.1 Configure cron +############################################################ + - id: 2635 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: systemctl --now enable cron" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:systemctl is-enabled cron -> enabled' + + +# 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 2636 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 2637 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 2638 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 2639 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 2640 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 2641 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 2642 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/cron.allow' + - 'f:/etc/at.allow' + - 'not f:/etc/cron.deny' + - 'not f:/etc/at.deny' + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d\d0/\w\w\w\w\w-----\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d\d0/\w\w\w\w\w-----\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +###################################################### +# 5.2 SSH Server Configuration +###################################################### +# 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured + - id: 2643 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2.2 Ensure permissions on SSH private host key files are configured (Scored) + - id: 2644 + title: "Ensure permissions on SSH private host key files are configured" + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated" + remediation: "Run the following commands to set ownership and permissions on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:root {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod 0600 {} \\;" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/ssh_host_rsa_key -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ecdsa_key -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ed25519_key -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2.3 Ensure permissions on SSH public host key files are configured (Scored) + - id: 2645 + title: "Ensure permissions on SSH public host key files are configured" + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod 0644 {} \\; #find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/ssh_host_rsa_key.pub -> r:^Access: \(0\d\d\d/-\w\w\w\w--\w--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ecdsa_key.pub -> r:^Access: \(0\d\d\d/-\w\w\w\w--\w--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ed25519_key.pub -> r:^Access: \(0\d\d\d/-\w\w\w\w--\w--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2.4 Ensure SSH Protocol is not set to 1 (Scored) + - id: 2646 + title: "Ensure SSH Protocol is not set to 1" + description: "Older versions of SSH support two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2. Notes: This command not longer exists in newer versions of SSH. This check is still being included for systems that may be running an older version of SSH. As of openSSH version 7.4 this parameter will not cause an issue when included." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["4.5", "14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: none + rules: + - 'c:sshd -T -> r:Protocol\s*\t*1' + +# 5.2.5 Ensure SSH LogLevel is appropriate (Scored) + - id: 2647 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.5"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:LogLevel\s+INFO|LogLevel\s+VERBOSE' + +# 5.2.6 Ensure SSH X11 forwarding is disabled (Scored) + - id: 2648 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:sshd -T -> r:X11Forwarding\s+no' + +# 5.2.7 Ensure SSH MaxAuthTries is set to 4 or less (Scored) + - id: 2649 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + +# 5.2.8 Ensure SSH IgnoreRhosts is enabled (Scored) + - id: 2650 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:IgnoreRhosts\s+yes' + +# 5.2.9 Ensure SSH HostbasedAuthentication is disabled (Scored) + - id: 2651 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:HostbasedAuthentication\s+no' + +# 5.2.10 Ensure SSH root login is disabled (Scored) + - id: 2652 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitRootLogin\s+no' + +# 5.2.11 Ensure SSH PermitEmptyPasswords is disabled (Scored) + - id: 2653 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitEmptyPasswords\s+no' + +# 5.2.12 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 2654 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["14.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:PermitUserEnvironment\s+no' + +# 5.2.13 Ensure only strong Ciphers are used (Scored) + - id: 2655 + title: "Ensure only strong ciphers are used" + description: "This variable limits the ciphers that SSH can use during communication." + rationale: "Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a \"Sweet32\" attack The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the \"Bar Mitzvah\" issue The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - 'https://nvd.nist.gov/vuln/detail/CVE-2016-2183' + - 'https://nvd.nist.gov/vuln/detail/CVE-2015-2808' + - 'https://www.kb.cert.org/vuls/id/565052' + - 'https://www.openssh.com/txt/cbc.adv' + - 'https://nvd.nist.gov/vuln/detail/CVE-2008-5161' + - 'https://nvd.nist.gov/vuln/detail/CVE-2013-4548' + - 'https://www.kb.cert.org/vuls/id/565052' + - 'https://www.openssh.com/txt/cbc.adv' + condition: none + rules: + - 'c:sshd -T -> r:ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se' + +# 5.2.14 Ensure only strong MAC algorithms are used (Scored) + - id: 2656 + title: "Ensure only strong MAC algorithms are used" + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["14.4","16.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - 'http://www.mitls.org/pages/attacks/SLOTH' + condition: none + rules: + - 'c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com' + +# 5.2.15 Ensure only strong Key Exchange algorithms are used (Scored) + - id: 2657 + title: "Ensure only strong Key Exchange algorithms are used" + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: none + rules: + - 'c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1' + +# 5.2.16 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 2658 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' + - 'c:sshd -T -> n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' + +# 5.2.17 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 2659 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> n:LoginGraceTime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + +# 5.2.18 Ensure SSH access is limited (Scored) + - id: 2660 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["5.2.18"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' + +# 5.2.19 Ensure SSH warning banner is configured (Scored) + - id: 2661 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:Banner\s*\t*/etc/issue.net' + +# 5.2.20 Ensure SSH PAM is enabled (Scored) + - id: 2662 + title: "Ensure SSH PAM is enabled" + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes" + compliance: + - cis: ["5.2.20"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*usepam\s+yes' + + +# 5.2.21 Ensure SSH AllowTcpForwarding is disabled (Scored) + - id: 2663 + title: "Ensure SSH AllowTcpForwarding is disabled" + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no" + compliance: + - cis: ["5.2.21"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - https://www.ssh.com/ssh/tunneling/example + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowTcpForwarding\s+no' + + + - id: 2664 + title: "Ensure SSH MaxStartups is configured" + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60" + compliance: + - cis: ["5.2.22"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*maxstartups\s+10:30:60' + +# 5.2.23 Ensure SSH MaxSessions is limited (Scored) + - id: 2665 + title: "Ensure SSH MaxSessions is limited" + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxSessions\s+(\d+) compare <= 10' + +###################################################### +# 5.3 Configure PAM +###################################################### +# 5.3.1 Ensure password creation requirements are configured (Scored) + - id: 2666 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Run the following command to install the pam_pwquality module: apt install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'f:/etc/pam.d/common-password -> !r:^# && n:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=(\d+) compare <=3' + +# 5.3.2 Ensure lockout for failed password attempts is configured (Scored) + - id: 2667 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. Edit the /etc/pam.d/common-account file and add the account lines below: account requisite pam_deny.so account required pam_tally2.so. Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user. Notes:BUG In pam_tally2.so To work around this issue the addition of pam_tally2.so in the accounts section of the /etc/pam.d/common-account file has been added to the audit and remediation sections. pam_tally2 line must be added for the counter to reset to 0 when using sudo. Use of the \"audit\" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization." + compliance: + - cis: ["5.3.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*requisite\s*\t*pam_deny.so' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*required\s*\t*pam_tally2.so' + +# 5.3.3 Ensure password reuse is limited (Scored) + - id: 2668 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + +# 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 2669 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.14"] + - pci_dss: ["3.6.1","8.2.1"] + - tsc: ["CC6.1","CC6.7"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> r:^password\.+pam_unix.so && !r:sha512' + +#################################################### +# 5.4 User Accounts and Environment +#################################################### +#################################################### +# 5.4.1 Set Shadow Password Suite Parameters +#################################################### +# 5.4.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 2670 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + +# 5.4.1.2 Ensure minimum days between password changes is configured + - id: 2671 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + +# 5.4.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 2672 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + +# 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 2673 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not c:useradd -D -> n:^INACTIVE=(\d+) compare < 0' + +# 5.4.3 Ensure default group for the root account is GID 0 (Scored) + - id: 2674 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["14.6"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + +# 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 2675 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["14.6"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + + +# 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 2676 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: readonly TMOUT=900 ; export TMOUT . Note that setting the value to readonly prevents unwanted modification during runtime." + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not d:/etc/profile.d -> .sh -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/bash.bashrc -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'd:/etc/profile.d -> .sh -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/bash.bashrc -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + +# 5.6 Ensure access to the su command is restricted (Scored) + - id: 2677 + title: "Ensure access to the su command is restricted" + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=' + +############################################################ +# 6 System Maintenance +############################################################ + +############################################################ +# 6.1 System File Permissions +############################################################ +# 6.1.2 Ensure permissions on /etc/passwd are configured (Scored) + - id: 2678 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.3 Ensure permissions on /etc/gshadow- are configured (Scored) + - id: 2679 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-wx /etc/gshadow-" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.4 Ensure permissions on /etc/shadow are configured (Scored) + - id: 2680 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the one following commands to set permissions on /etc/shadow : # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + +# 6.1.5 Ensure permissions on /etc/group are configured (Scored) + - id: 2681 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.6 Ensure permissions on /etc/passwd- are configured (Scored) + - id: 2682 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod u-x,go-rwx /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.7 Ensure permissions on /etc/shadow- are configured (Scored) + - id: 2683 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/shadow- : # chown root:shadow /etc/shadow- # chmod u-x,go-rwx /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.8 Ensure permissions on /etc/group- are configured (Scored) + - id: 2684 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-rwx /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.9 Ensure permissions on /etc/gshadow are configured (Scored) + - id: 2685 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following commands to set permissions on /etc/gshadow : # chown root:shadow /etc/gshadow # chmod o-rwx,g-rw /etc/gshadow" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + +#################################################### +# 6.2 User and Group Settings +#################################################### + +# 6.2.1 Ensure password fields are not empty (Scored) + - id: 2686 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + +# 6.2.2 Ensure no legacy "+" entries exist in /etc/passwd (Scored) + - id: 2687 + title: "Ensure no legacy \"+\" entries exist in /etc/passwd" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && r:^+:' + +# 6.2.4 Ensure no legacy "+" entries exist in /etc/shadow (Scored) + - id: 2688 + title: "Ensure no legacy \"+\" entries exist in /etc/shadow" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^+:' + +# 6.2.5 Ensure no legacy "+" entries exist in /etc/group (Scored) + - id: 2689 + title: "Ensure no legacy \"+\" entries exist in /etc/group" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/group if they exist." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:^+:' + +# 6.2.6 Ensure root is the only UID 0 account (Scored) + - id: 2690 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + +# 6.2.20 Ensure shadow group is empty (Scored) + - id: 2691 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["6.2.20"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/sca/debian/cis_debian7.yml b/sca/debian/cis_debian7.yml new file mode 100644 index 000000000..e0f426f90 --- /dev/null +++ b/sca/debian/cis_debian7.yml @@ -0,0 +1,2662 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 7 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Linux 7 Benchmark v1.0.0 - 12-31-2015 + +policy: + id: "cis_debian7" + file: "cis_debian7.yml" + name: "CIS Benchmark for Debian/Linux 7" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 7." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version" + description: "Requirements for running the SCA scan against Debian/Ubuntu." + condition: all + rules: + - 'f:/etc/debian_version' + - 'f:/proc/sys/kernel/ostype -> Linux' + +checks: + +# 2 Filesystem Configuration + + - id: 1000 + title: "Create Separate Partition for /tmp" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Configure /etc/fstab as appropriate or Run the following commands to enable systemd /tmp mounting: systemctl umask tmp.mount; systemctl enable tmp.mount. Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount." + compliance: + - cis: ["2.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + - id: 1001 + title: "Set nodev option for /tmp Partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /tmp" + compliance: + - cis: ["2.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 1002 + title: "Set nosuid option for /tmp Partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nosuid /tmp" + compliance: + - cis: ["2.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 1003 + title: "Set noexec option for /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,noexec /tmp" + compliance: + - cis: ["2.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + - id: 1004 + title: "Create Separate Partition for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["2.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 1005 + title: "Bind mount the /var/tmp directory to /tmp" + description: "The /var/tmp directory is normally a standalone directory in the /var file system. Binding /var/tmp to /tmp establishes an unbreakable link to /tmp that cannot be removed (even by the root user). It also allows /var/tmp to inherit the same mount options that /tmp owns, allowing /var/tmp to be protected in the same manner /tmp is protected. It will also prevent /var from filling up with temporary files as the contents of /var/tmp will actually reside in the file system containing /tmp." + rationale: "All programs that use /var/tmp and /tmp to read/write temporary files will always be write to tmp file system, preventing a user from running the /var file system out of space or trying to perform operations that have been blocked in the /tmp filesystem." + remediation: "# mount --bind /tmp /var/tmp and edit the /etc/fstab file to contain the following line: /tmp /var/tmp none bind 0 0" + compliance: + - cis: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:findmnt -> r:/var/tmp && r:[/tmp]' + - 'f:/etc/fstab -> r:^/tmp && r:\s*/var/tmp\s* && r:bind' + + - id: 1006 + title: "Create Separate Partition for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["2.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 1007 + title: "Create Separate Partition for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["2.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 1008 + title: "Create Separate Partition for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["2.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 1009 + title: "Add nodev Option to /home" + description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["2.10"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + + + - id: 1010 + title: "Add nodev Option to /run/shm Partition" + description: "The nodev mount option specifies that the /run/shm (temporary filesystem stored in memory) cannot contain block or character special devices." + rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /run/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options of entries that have mount points that contain /run/shm. See the fstab(5) manual page for more information. # mount -o remount,nodev /run/shm" + compliance: + - cis: ["2.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/run/shm\s && r:nodev' + + - id: 1011 + title: "Add nosuid Option to /run/shm Partition" + description: "The nosuid mount option specifies that the /run/shm (temporary filesystem stored in memory) will not execute setuid and setgid on executable programs as such, but rather execute them with the uid and gid of the user executing the program." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). Look for entries that have mount points that contain /run/shm. See the fstab(5) manual page for more information. # mount -o remount,nosuid /run/shm" + compliance: + - cis: ["2.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/run/shm\s && r:nosuid' + + - id: 1012 + title: "Add noexec Option to /run/shm Partition" + description: "Set noexec on the shared memory partition to prevent programs from executing from there." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options). Look for entries that have mount points that contain /run/shm. See the fstab(5) manual page for more information. # mount -o remount,noexec /run/shm" + compliance: + - cis: ["2.16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/run/shm\s && r:noexec' + + + + - id: 1013 + title: "Disable Mounting of cramfs Filesystems" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true" + compliance: + - cis: ["2.18"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v cramfs -> r:^install /bin/true' + - 'not c:/sbin/lsmod -> r:cramfs' + + - id: 1014 + title: "Disable Mounting of freevxfs Filesystems" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install freevxfs /bin/true" + compliance: + - cis: ["2.19"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v freevxfs -> r:^install /bin/true' + - 'not c:/sbin/lsmod -> r:freevxfs' + + - id: 1015 + title: "Disable Mounting of jffs2 Filesystems" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install jffs2 /bin/true" + compliance: + - cis: ["2.20"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v jffs2 -> r:^install /bin/true' + - 'not c:/sbin/lsmod -> r:jffs2' + + - id: 1016 + title: "Disable Mounting of hfs Filesystems" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfs /bin/true" + compliance: + - cis: ["2.21"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v hfs -> r:^install /bin/true' + - 'not c:/sbin/lsmod -> r:hfs' + + - id: 1017 + title: "Disable Mounting of hfsplus Filesystems" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfsplus /bin/true" + compliance: + - cis: ["2.22"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v hfsplus -> r:^install /bin/true' + - 'not c:/sbin/lsmod -> r:hfsplus' + + - id: 1018 + title: "Disable Mounting of squashfs Filesystems" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true" + compliance: + - cis: ["2.23"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v squashfs -> r:^install /bin/true' + - 'not c:/sbin/lsmod -> r:squashfs' + + - id: 1019 + title: "Disable Mounting of udf Filesystems" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats" + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true" + compliance: + - cis: ["2.24"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - 'c:/sbin/modprobe -n -v udf -> r:^install /bin/true' + - 'not c:/sbin/lsmod -> r:udf' + + + - id: 1020 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Disable autofs: # update-rc.d autofs disable" + compliance: + - cis: ["2.25"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:find /etc/ -name *autofs* -> r:/etc/rc\d+.d/S\d+autofs' + +# 3 Secure Boot Settings + + - id: 1021 + title: "Set User/Group Owner on bootloader config" + description: "Set the owner and group of your boot loaders config file to the root user. These instructions default to GRUB stored at /boot/grub/grub.cfg ." + rationale: "Setting the owner and group to root prevents non-root users from changing the file." + remediation: "Run the following to change ownership of /boot/grub/grub.cfg : # chown root:root /boot/grub/grub.cfg" + compliance: + - cis: ["3.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1022 + title: "Set Permissions on bootloader config" + description: "Set permission on the your boot loaders config file to read and write for root only." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following to set the permissions fro /boot/grub/grub.cfg : # chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["3.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:^Access: \(0\d00/-\w\w\w------\)' + + - id: 1023 + title: "Set Boot Loader Password" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters" + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub-md5-crypt: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file: cat <\" password_pbkdf2 EOF Unless the --unrestricted option is added to CLASS in /etc/grub.d/10_linux a password will be required to boot in addition to editing boot parameters: CLASS=\"--class gnu-linux --class gnu --class os --unrestricted\" Run the following to update the grub configuration: # update-grub" + compliance: + - cis: ["3.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 1024 + title: "Require authentication for Single-User mode" + description: "Setting a password for the root user will force authentication in single user mode." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["3.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^root:*:|^root:!:' +########################################### +# 4 Additional Process Hardening +########################################### +# 4.1 Restrict Core Dumps (Scored) + - id: 1025 + title: "Restrict Core Dumps" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5)). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to the /etc/security/limits.conf file. * hard core 0 Add the following line to the /etc/sysctl.conf file. fs.suid_dumpable = 0" + compliance: + - cis: ["4.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s0$|\t0$' + +# 4.2 Enable XD/NX Support on 32-bit x86 Systems (Not Scored) + - id: 1026 + title: "Enable XD/NX Support on 32-bit x86 Systems" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["4.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + +# 4.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 1027 + title: "Enable Randomized Virtual Memory Region Placement" + description: "Set the system flag to force randomized virtual memory region placement." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Add the following line to the /etc/sysctl.conf file. kernel.randomize_va_space = 2" + compliance: + - cis: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + +# 4.4 Disable prelink + - id: 1028 + title: "Disable Prelink" + description: "The prelinking feature changes binaries in an attempt to decrease their startup time." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the command: # /usr/sbin/prelink -ua to restore binaries to a normal, non-prelinked state, then remove prelink: # apt-get purge prelink" + compliance: + - cis: ["4.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s prelink -> r:install ok installed' + + - id: 1029 + title: "Activate AppArmor" + description: "AppArmor provides a Mandatory Access Control (MAC) system that greatly augments the default Discretionary Access Control (DAC) model." + rationale: "For an action to occur, both the traditional DAC permissions must be satisfied as well as the AppArmor MAC rules. The action will not be allowed if either one of these models does not permit the action. In this way, AppArmor rules can only make a system's permissions more restrictive and secure." + remediation: "Install apparmor and apparmor-utils if missing (additional profiles can be found in the apparmor-profiles package): # apt-get install apparmor apparmor-profiles apparmor-utils Add apparmor=1 and security=apparmor to GRUB_CMDLINE_LINUX in /etc/default/grub: GRUB_CMDLINE_LINUX=\"apparmor=1 security=apparmor\"Update grub configuration (reboot will be required to apply changes): # update-grub Set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["4.5"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' + - 'c:apparmor_status -> r:^0\s*processes are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + +###################################### +# 5 OS Services +###################################### +# 5.1.1 Ensure NIS is not installed (Scored) + - id: 1030 + title: "Ensure NIS is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall the nis package: # apt-get purge nis" + compliance: + - cis: ["5.1.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'c:dpkg -s nis -> r:install ok installed' + +# 5.1.2 Ensure rsh server is not enabled (Scored) + - id: 1031 + title: "Ensure rsh server is not enabled" + description: "The Berkeley rsh-server (rsh, rlogin, rcp) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy service contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "Remove or comment out any shell, login, or exec lines in /etc/inetd.conf: #shell stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rshd #login stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rlogind #exec stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rexecd" + compliance: + - cis: ["5.1.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/inetd.conf -> !r:^# && r:^shell|^login|^exec' + +# 5.1.3 Ensure rsh client is not installed (Scored) + - id: 1032 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Uninstall the rsh-client and rsh-reload-client packages: # apt-get purge rsh-client rsh-reload-client" + compliance: + - cis: ["5.1.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'c:dpkg -s rsh-client -> r:install ok installed' + - 'c:dpkg -s rsh-redone-client -> r:install ok installed' + +# 5.1.4 Ensure talk server is not enabled (Scored) + - id: 1033 + title: "Ensure talk server is not enabled" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Remove or comment out any talk or ntalk lines in /etc/inetd.conf: #talk dgram udp wait nobody.tty /usr/sbin/in.talkd in.talkd #ntalk dgram udp wait nobody.tty /usr/sbin/in.ntalkd in.ntalkd" + compliance: + - cis: ["5.1.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/inetd.conf -> !r:^# && r:^talk|^ntalk' + +# 5.1.5 Ensure talk client is not installed (Scored) + - id: 1034 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Uninstall the talk package: # apt-get purge talk" + compliance: + - cis: ["2.3.3"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'c:dpkg -s talk -> r:install ok installed' + +# 5.1.6 Ensure telnet server is not enabled (Scored) + - id: 1035 + title: "Ensure telnet server is not enabled" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Remove or comment out any telnet lines in /etc/inetd.conf: #telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd" + compliance: + - cis: ["5.1.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/inetd.conf -> !r:^# && r:telnet' + +# 5.1.7 Ensure tftp-server is not enabled (Scored) + - id: 1036 + title: "Ensure tftp-server is not enabled" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The packages tftp and atftp are both used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Remove or comment out any tftp lines in /etc/inetd.conf: #tftp stream tcp nowait root internal" + compliance: + - cis: ["5.1.7"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/inetd.conf -> !r:^# && r:tftp' + +# 5.1.8 Ensure xinetd is not enabled (Scored) + - id: 1037 + title: "Ensure xinetd is not enabled" + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests. Note: Several other services recommended to be disabled in this benchmark have xinetd versions as well, if xinetd is required in your environment ensure they are disabled in xinetd configuration as well." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Disable xinetd: # update-rc.d xinetd disable" + compliance: + - cis: ["5.1.8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'c:find /etc/ -name *xinetd* -> r:/etc/rc\d+.d/S\d+xinetd' + +# 5.2 Ensure chargen is not enabled (Scored) + - id: 1038 + title: "Ensure chargen is not enabled" + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any chargen lines in /etc/inetd.conf: #chargen stream tcp nowait root internal" + compliance: + - cis: ["5.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/inetd.conf -> !r:^# && r:chargen' + +# 5.3 Ensure daytime is not enabled (Scored) + - id: 1039 + title: "Ensure daytime is not enabled" + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any daytime lines in /etc/inetd.conf: #daytime stream tcp nowait root internal" + compliance: + - cis: ["5.3"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/inetd.conf -> !r:^# && r:daytime' + +# 5.4 Ensure echo is not enabled (Scored) + - id: 1040 + title: "Ensure echo is not enabled" + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any echo lines in /etc/inetd.conf: #echo stream tcp nowait root internal" + compliance: + - cis: ["5.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/inetd.conf -> !r:^# && r:echo' + +# 5.5 Ensure discard is not enabled (Scored) + - id: 1041 + title: "Ensure discard is not enabled" + description: "discard is a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any discard lines in /etc/inetd.conf: #discard stream tcp nowait root internal" + compliance: + - cis: ["5.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/inetd.conf -> !r:^# && r:discard' + +# 5.6 Ensure time is not enabled (Scored) + - id: 1042 + title: "Ensure time is not enabled" + description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any time lines in /etc/inetd.conf: #time stream tcp nowait root internal" + compliance: + - cis: ["5.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/inetd.conf -> !r:^# && r:time' + +############################################### +# 6 Special Purpose Services +############################################### + +# 6.1 Ensure the X Window system is not installed (Scored) + - id: 1043 + title: "Ensure the X Window system is not installed" + description: "The X Window system provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Window system is typically used on desktops where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Uninstall X Windows: # apt-get purge xserver-xorg-core*" + compliance: + - cis: ["6.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + +# 6.2 Ensure Avahi Server is not enabled (Scored) + - id: 1044 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Since servers are not normally used for printing, this service is not needed unless dependencies require it. If this is the case, disable the service to reduce the potential attack surface." + remediation: "Disable avahi-daemon: # update-rc.d avahi-daemon disable" + compliance: + - cis: ["6.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *avahi-daemon* -> r:/etc/rc\d+.d/S\d+avahi-daemon' + +# 6.3 Ensure print server is not enabled (Scored) + - id: 1045 + title: "Ensure print server is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Disable cups: # update-rc.d cups disable" + compliance: + - cis: ["6.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *cups* -> r:/etc/rc\d+.d/S\d+cups' + +# 6.4 Ensure DHCP Server is not enabled (Scored) + - id: 1046 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a server is specifically set up to act as a DHCP server, it is recommended that this service be deleted to reduce the potential attack surface." + remediation: "Disable isc-dhcp-server: # update-rc.d isc-dhcp-server disable" + references: + - "https://www.isc.org/dhcp/" + compliance: + - cis: ["6.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *isc-dhcp-server* -> r:/etc/rc\d+.d/S\d+isc-dhcp-server' + +# 6.5 Configure Network Time Protocol (Scored) + - id: 1047 + title: "Configure Network Time Protocol (NTP)" + description: "The Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. NTP can be configured to be a client and/or a server." + rationale: "It is recommended that physical systems and virtual guests lacking direct access to the physical host's clock be configured as NTP clients to synchronize their clocks (especially to support time sensitive security mechanisms like Kerberos). This also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Install ntp: # apt-get install ntp Ensure the following lines are in /etc/ntp.conf: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Also, make sure /etc/ntp.conf has at least one NTP server specified: server Note: is the IP address or hostname of a trusted time server. Configuring an NTP server is outside the scope of this benchmark." + compliance: + - cis: ["6.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'c:dpkg -s ntp -> r:install ok installed' + - 'f:/etc/ntp.conf -> r:^restrict -4 default && r:kod && r:nomodify && r:notrap && r:nopeer && r:noquery' + - 'f:/etc/ntp.conf -> r:^restrict -6 default && r:kod && r:nomodify && r:notrap && r:nopeer && r:noquery' + - 'f:/etc/ntp.conf -> r:^server\s\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + +# 6.6 Ensure LDAP is not enabled (Scored) + - id: 1048 + title: "Ensure LDAP is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the server will not need to act as an LDAP client or server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Uninstall the slapd package: # apt-get purge slapd" + compliance: + - cis: ["6.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + references: + - http://www.openldap.org + condition: none + rules: + - 'c:dpkg -s slapd -> r:install ok installed' + +# 6.7 Ensure NFS and RPC are not enabled (Scored) + - id: 1049 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the server does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Disable rpcbind: # update-rc.d rpcbind disable Disable nfs-kernel-server: # update-rc.d nfs-kernel-server disable" + compliance: + - cis: ["6.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *rpcbind* -> r:/etc/rc\d+.d/S\d+rpcbind' + - 'c:find /etc/ -name *nfs-kernel-server* -> r:/etc/rc\d+.d/S\d+nfs-kernel-server' + +# 6.8 Ensure DNS Server is not enabled (Scored) + - id: 1050 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a server is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Disable bind9: # update-rc.d bind9 disable" + compliance: + - cis: ["6.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *bind9* -> r:/etc/rc\d+.d/S\d+bind9' + +# 6.9 Ensure FTP Server is not enabled (Scored) + - id: 1051 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Disable vsftpd: # update-rc.d vsftpd disable" + compliance: + - cis: ["6.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *vsftpd* -> r:/etc/rc\d+.d/S\d+vsftp' + +# 6.10 Ensure HTTP Server is not enabled (Scored) + - id: 1052 + title: "Ensure HTTP Server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Disable apache2: # update-rc.d apache2 disable" + compliance: + - cis: ["6.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *apache2* -> r:/etc/rc\d+.d/S\d+apache2' + +# 6.11 Ensure IMAP and POP Server is not enabled (Scored) + - id: 1053 + title: "Ensure IMAP and POP server is not enabled" + description: "Dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided to this server, it is recommended that the service be deleted to reduce the potential attack surface." + remediation: "Disable dovecot: # update-rc.d dovecot disable" + compliance: + - cis: ["6.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *dovecot* -> r:/etc/rc\d+.d/S\d+dovecot' + +# 6.12 Ensure Samba is not enabled (Scored) + - id: 1054 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Disable samba: # update-rc.d samba disable" + compliance: + - cis: ["6.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *samba* -> r:/etc/rc\d+.d/S\d+samba' + +# 6.13 Ensure HTTP Proxy Server is not enabled (Scored) + - id: 1055 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Disable squid3: # update-rc.d squid3 disable" + compliance: + - cis: ["6.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *squid3* -> r:/etc/rc\d+.d/S\d+squid3' + +# 6.14 Ensure SNMP Server is not enabled (Scored) + - id: 1056 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server communicates using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used." + remediation: "Disable snmpd: # update-rc.d snmpd disable" + compliance: + - cis: ["6.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *snmpd* -> r:/etc/rc\d+.d/S\d+snmpd' + +# 6.15 Ensure Mail Transfer Agent for Local-Only Mode (Scored) + - id: 1057 + title: "Configure Mail Transfer Agent for Local-Only Mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: The remediation given here provides instructions for configuring the postfix mail server, depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/exim4/update-exim4.conf.conf and edit the dc_local_interfaces line to remove non loopback addresses: dc_local_interfaces='127.0.0.1 ; ::1' Run update-exim4.conf: # update-exim4.conf Reload exim4 configuration: # service exim4 reload" + compliance: + - cis: ["6.15"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:netstat -an -> r:\.*25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + +# 6.16 Ensure rsync service is not enabled (Scored) + - id: 1058 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Set RSYNC_ENABLE to false in /etc/default/rsync: RSYNC_ENABLE=false" + compliance: + - cis: ["6.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: any + rules: + - 'not c:dpkg -s rsync -> r:install ok installed' + - 'f:/etc/default/rsync -> !r:^# && r:RSYNC_ENABLE\s*\t*=\s*\t*false' + +############################################### +# 7 Network Configuration and Firewall +############################################### +############################################### +# 7.1 Modify Network Parameters +############################################### + +# 7.1.1 Disable IP Forwarding (Scored) + - id: 1059 + title: "Disable IP Forwarding" + description: "The net.ipv4.ip_forward flag is used to tell the server whether it can forward packets or not. If the server is not to be used as a router, set the flag to 0." + rationale: "Setting the flag to 0 ensures that a server with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the net.ipv4.ip_forward parameter to 0 in /etc/sysctl.conf: net.ipv4.ip_forward=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.ip_forward=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + +# 7.1.2 Disable Send Packet Redirects (Scored) + - id: 1060 + title: "Disable Send Packet Redirects" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.send_redirects=0 # /sbin/sysctl -w net.ipv4.conf.default.send_redirects=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + +############################################### +# 7.2 Modify Network Parameters (Host and Router) +############################################### + +# 7.2.1 Disable Source Routed Packet Acceptance (Scored) + - id: 1061 + title: "Disable Source Routed Packet Acceptance" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this server was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the server as a way to reach the private address servers. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.accept_source_route=0 net.ipv4.conf.default.accept_source_route=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.accept_source_route=0 # /sbin/sysctl -w net.ipv4.conf.default.accept_source_route=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + +# 7.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 1062 + title: "Disable ICMP Redirect Acceptance" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the net.ipv4.conf.all.accept_redirects and net.ipv4.conf.default.accept_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.accept_redirects=0 net.ipv4.conf.default.accept_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.accept_redirects=0 # /sbin/sysctl -w net.ipv4.conf.default.accept_redirects=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + +# 7.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 1063 + title: "Disable Secure ICMP Redirect Acceptance" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the net.ipv4.conf.all.secure_redirects and net.ipv4.conf.default.secure_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.secure_redirects=0 net.ipv4.conf.default.secure_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.secure_redirects=0 # /sbin/sysctl -w net.ipv4.conf.default.secure_redirects=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + +# 7.2.4 Log Suspicious Packets (Scored) + - id: 1064 + title: "Log Suspicious Packets" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the net.ipv4.conf.all.log_martians and net.ipv4.conf.default.log_martians parameters to 1 in /etc/sysctl.conf: net.ipv4.conf.all.log_martians=1 net.ipv4.conf.default.log_martians=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.log_martians=1 # /sbin/sysctl -w net.ipv4.conf.default.log_martians=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:/sbin/sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + +# 7.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 1065 + title: "Enable Ignore Broadcast Requests" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the net.ipv4.icmp_echo_ignore_broadcasts parameter to 1 in /etc/sysctl.conf: net.ipv4.icmp_echo_ignore_broadcasts=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + +# 7.2.6 Enable Bad Error Message Protection (Scored) + - id: 1066 + title: "Enable Bad Error Message Protection" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the net.ipv4.icmp_ignore_bogus_error_responses parameter to 1 in /etc/sysctl.conf: net.ipv4.icmp_ignore_bogus_error_responses=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + +# 7.2.7 Enable RFC-recommended Source Route Validation (Scored) + - id: 1067 + title: "Enable RFC-recommended Source Route Validation" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your server, you will not be able to enable this feature without breaking the routing." + remediation: "Set the net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter parameters to 1 in /etc/sysctl.conf: net.ipv4.conf.all.rp_filter=1 net.ipv4.conf.default.rp_filter=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.rp_filter=1 # /sbin/sysctl -w net.ipv4.conf.default.rp_filter=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:/sbin/sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + +# 7.2.8 Enable TCP SYN Cookies (Scored) + - id: 1068 + title: "Enable TCP SYN Cookies" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the server to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a server by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the server to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the net.ipv4.tcp_syncookies parameter to 1 in /etc/sysctl.conf: net.ipv4.tcp_syncookies=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.tcp_syncookies=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + +# 7.3.1 Disable IPv6 Router Advertisements (Not Scored) + - id: 1069 + title: "Disable IPv6 Router Advertisements" + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the net.ipv6.conf.all.accept_ra and net.ipv6.conf.default.accept_ra parameter to 0 in /etc/sysctl.conf: net.ipv6.conf.all.accept_ra=0 net.ipv6.conf.default.accept_ra=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv6.conf.all.accept_ra=0 # /sbin/sysctl -w net.ipv6.conf.default.accept_ra=0 # /sbin/sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["7.3.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + +# 7.3.2 Disable IPv6 Redirect Acceptance (Not Scored) + - id: 1070 + title: "Disable IPv6 Redirect Acceptance" + description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." + rationale: "It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the net.ipv6.conf.all.accept_redirects and net.ipv6.conf.default.accept_redirects parameters to 0 in /etc/sysctl.conf: net.ipv6.conf.all.accept_redirects=0 net.ipv6.conf.default.accept_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv6.conf.all.accept_redirects=0 # /sbin/sysctl -w net.ipv6.conf.default.accept_redirects=0 # /sbin/sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["7.3.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + +# 7.3.3 Disable IPv6 (Not Scored) + - id: 1071 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: "Create or edit the file /etc/sysctl.conf and add the following lines: net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6=1 Run the following command or reboot to apply the changes: # sysctl -p" + compliance: + - cis: ["7.3.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'not c:ip addr -> r:inet6' + +# 7.4.1 Install TCP Wrappers (Scored) + - id: 1072 + title: "Install TCP Wrappers" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Install tcpd : # apt-get install tcpd To verify if a service supports TCP Wrappers, run the following command: # ldd | grep libwrap.so If there is any output, then the service supports TCP Wrappers." + compliance: + - cis: ["7.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:dpkg -s tcpd -> r:install ok installed' + +# 7.4.2 Create /etc/hosts.allow (Not Scored) + - id: 1073 + title: "Create /etc/hosts.allow" + description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the server." + remediation: "Create /etc/hosts.allow: # echo \"ALL: /, /, ...\" >/etc/hosts.allow where each / combination (for example, \"192.168.1.0/255.255.255.0\") represents one network block in use by your organization that requires access to this system." + compliance: + - cis: ["7.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.allow' + +# 7.4.3 Verify permissions on /etc/hosts.allow (Scored) + - id: 1074 + title: "Verify permissions on /etc/hosts.allow" + description: "The /etc/hosts.allow file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "If the permissions of the /etc/hosts.allow file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/hosts.allow" + compliance: + - cis: ["7.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:/bin/ls -l /etc/hosts.allow -> r:-rw-r--r--' + +# 7.4.4 Create /etc/hosts.deny (Not Scored) + - id: 1075 + title: "Create /etc/hosts.deny" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." + remediation: "Create /etc/hosts.deny: # echo \"ALL: ALL\" >> /etc/hosts.deny" + compliance: + - cis: ["7.4.4"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.deny' + - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' + +# 7.4.5 Verify permissions on /etc/hosts.deny (Scored) + - id: 1076 + title: "Verify permissions on /etc/hosts.deny" + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "If the permissions of the /etc/hosts.deny file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/hosts.deny" + compliance: + - cis: ["7.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:/bin/ls -l /etc/hosts.deny -> r:-rw-r--r--' + +# 7.5.1 Disable DCCP (Not Scored) + - id: 1077 + title: "Disable DCCP" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "# echo \"install dccp /bin/true\" >> /etc/modprobe.d/CIS.conf" + compliance: + - cis: ["7.5.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/modprobe.d/CIS.conf' + - 'f:/etc/modprobe.d/CIS.conf -> r:install dccp /bin/true' + +# 7.5.2 Disable SCTP (Not Scored) + - id: 1078 + title: "Disable SCTP" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "# echo \"install sctp /bin/true\" >> /etc/modprobe.d/CIS.conf" + compliance: + - cis: ["7.5.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/modprobe.d/CIS.conf' + - 'f:/etc/modprobe.d/CIS.conf -> r:install sctp /bin/true' + +# 7.5.3 Disable RDS (Not Scored) + - id: 1079 + title: "Disable RDS" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "# echo \"install rds /bin/true\" >> /etc/modprobe.d/CIS.conf" + compliance: + - cis: ["7.5.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/modprobe.d/CIS.conf' + - 'f:/etc/modprobe.d/CIS.conf -> r:install rds /bin/true' + +# 7.5.4 Disable TIPC (Not Scored) + - id: 1080 + title: "Disable TIPC" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "# echo \"install tipc /bin/true\" >> /etc/modprobe.d/CIS.conf" + compliance: + - cis: ["7.5.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/modprobe.d/CIS.conf' + - 'f:/etc/modprobe.d/CIS.conf -> r:install tipc /bin/true' + +# 7.6 Deactivate Wireless Interfaces (Not Scored) + - id: 1081 + title: "Deactivate Wireless Interfaces" + description: "Wireless networking is used when wired networks are unavailable. Debian provides the nmcli interface which allows system administrators to configure and use wireless networks." + rationale: "If wireless is not to be used, wireless devices can be disabled to reduce the potential attack surface." + remediation: "Use the following command to disable wireless: # nmcli nm wifi off" + compliance: + - cis: ["7.6"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nmcli nm wifi -> r:disabled' + +# 7.7 Ensure Firewall is active (Scored) + - id: 1082 + title: "Ensure Firewall is active" + description: "IPtables is an application that allows a system administrator to configure the IPv4 tables, chains and rules provided by the Linux kernel firewall. The iptables-persistent package in Debian provides one way to ensure iptables rules are reapplied on reboot. Note: the audit and remediation included provide instructions for using iptables-persistent to reapply iptables rules. Other methods are available which may be in use in your environment and may conflict with these steps." + rationale: "IPtables provides extra protection for the Linux system by limiting communications in and out of the box to specific IPv4 addresses and ports." + remediation: "Install the iptables and iptables-persistent packages: # apt-get install iptables iptables-persistent Enable the iptables-persistent service: # update-rc.d iptables-persistent enable" + compliance: + - cis: ["7.7"] + - cis_csc: ["9.2"] + - pci_dss: ["1.1"] + condition: all + rules: + - 'c:dpkg -s iptables -> r:install ok installed' + - 'c:dpkg -s iptables-persistent -> r:install ok installed' + - 'c:find /etc/rc2.d -name *iptables-persistent* -> r:/etc/rc2.d/S\d+iptables-persistent' + - 'c:find /etc/rc3.d -name *iptables-persistent* -> r:/etc/rc3.d/S\d+iptables-persistent' + - 'c:find /etc/rc4.d -name *iptables-persistent* -> r:/etc/rc4.d/S\d+iptables-persistent' + - 'c:find /etc/rc5.d -name *iptables-persistent* -> r:/etc/rc5.d/S\d+iptables-persistent' + +############################################### +# 8 Logging and Auditing +############################################### + +############################################### +# 8.1 Configure System Accounting (auditd) +############################################### + +# 8.1.1.1 Configure Audit Log Storage Size (Not Scored) + - id: 1083 + title: "Configure Audit Log Storage Size" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the max_log_file parameter in /etc/audit/auditd.conf max_log_file = Note: MB is the number of MegaBytes the file can be." + compliance: + - cis: ["8.1.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:max_log_file\s*=\s*\d+' + +# 8.1.1.2 Disable System on Audit Log Full (Not Scored) + - id: 1084 + title: "Disable System on Audit Log Full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Add the following lines to the /etc/audit/auditd.conf file. space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["8.1.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*=\s*halt' + +# 8.1.1.3 Keep All Auditing Information (Scored) + - id: 1085 + title: "Keep All Auditing Information" + description: "Normally, auditd will hold 4 logs of maximum log file size before deleting older log files." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Add the following line to the /etc/audit/auditd.conf file. max_log_file_action = keep_logs" + compliance: + - cis: ["8.1.1.3"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*=\s*keep_logs' + +# 8.1.2 Install and Enable auditd Service (Scored) + - id: 1086 + title: "Install and Enable auditd Service" + description: "Install and turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Install auditd: # apt-get install auditd If needed enable auditd in /etc/rc*.d: # update-rc.d auditd enable" + compliance: + - cis: ["8.1.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1","10.7"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:dpkg -s auditd -> r:install ok installed' + - 'c:find /etc/rc2.d -name *auditd* -> r:/etc/rc2.d/S\d+auditd' + - 'c:find /etc/rc3.d -name *auditd* -> r:/etc/rc3.d/S\d+auditd' + - 'c:find /etc/rc4.d -name *auditd* -> r:/etc/rc4.d/S\d+auditd' + - 'c:find /etc/rc5.d -name *auditd* -> r:/etc/rc5.d/S\d+auditd' + +# 8.1.3 Enable Auditing for Processes That Start Prior to auditd (Scored) + - id: 1087 + title: "Enable Auditing for Processes That Start Prior to auditd" + description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "Edit /etc/default/grub to include audit=1 as part of GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\"And run the following command to update the grub configuration: # update-grub" + compliance: + - cis: ["8.1.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.6","10.7"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + condition: all + rules: + - 'f:/etc/default/grub -> r:^GRUB_CMDLINE_LINUX\s*=\s*\p*audit\s*=\s*1\p*' + +# 8.1.4 Record Events That Modify Date and Time Information (Scored) + - id: 1088 + title: "Record Events That Modify Date and Time Information" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"" + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change # Execute the following command to restart auditd # pkill -P 1-HUP auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.4"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/localtime && r:-p wa && r:-k time-change' + +# 8.1.5 Record Events That Modify User/Group Information (Scored) + - id: 1089 + title: "Record Events That Modify User/Group Information" + description: "Record events affecting the group, passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.5"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/group && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/passwd && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/gshadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/shadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/security/opasswd && r:-p wa && r:-k identity' + +# 8.1.6 Record Events That Modify the System's Network Environment (Scored) + - id: 1090 + title: "Record Events That Modify the System's Network Environment" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed prelogin), /etc/hosts (file containing host names and associated IP addresses) and /etc/network (directory containing network interface scripts and configurations) files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a exit,always -F arch=b64 -S sethostname -S setdomainname -k system-locale -a exit,always -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale # Execute the following command to restart auditd # pkill -P 1-HUP auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a exit,always -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.6"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname -k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/issue && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/issue.net && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/hosts && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/network && r:-p wa && r:-k system-locale' + +# 8.1.7 Record Events That Modify the System's Mandatory Access Controls (Scored) + - id: 1091 + title: "Record Events That Modify the System's Mandatory Access Controls" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux directory." + rationale: "Changes to files in this directory could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Add the following lines to the /etc/audit/audit.rules file. Add the following lines to /etc/audit/audit.rules -w /etc/selinux/ -p wa -k MAC-policy # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.7"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/selinux/ && r:-p wa && r:-k MAC-policy' + +# 8.1.8 Collect Login and Logout Events (Scored) + - id: 1092 + title: "Collect Login and Logout Events" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.&& r:rules file. -w /var/log/faillog -p wa -k logins -w /var/log/lastlog -p wa -k logins -w /var/log/tallylog -p wa -k logins # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.8"] + - cis_csc: ["5.5","16.10","16.4"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w /var/log/faillog && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:^-w /var/log/lastlog && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:^-w /var/log/tallylog && r:-p wa && r:-k logins' + +# 8.1.9 Collect Session Initiation Information (Scored) + - id: 1093 + title: "Collect Session Initiation Information" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. The /var/log/wtmp file tracks logins, logouts, shutdown and reboot events. All audit records will be tagged with the identifier \"session.\" The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier \"logins.\"" + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session # Execute the following command to restart auditd # pkill -HUP -P 1 auditd Note: Use the last command to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp)" + compliance: + - cis: ["8.1.9"] + - cis_csc: ["5.5","16.10","16.4"] + - pci_dss: ["10.3"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w /var/run/utmp && r:-p wa && r:-k session' + - 'f:/etc/audit/audit.rules -> r:^-w /var/log/wtmp && r:-p wa && r:-k session' + - 'f:/etc/audit/audit.rules -> r:^-w /var/log/btmp && r:-p wa && r:-k session' + +# 8.1.10 Collect Discretionary Access Control Permission Modification Events (Scored) + - id: 1094 + title: "Collect Discretionary Access Control Permission Modification Events" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permis&& r:sions and attributes. The chmod, fchmod and fchmodat system calls affect the permissions associated with a file. The chown, fchown, fchownat and lchown system calls affect owner and group attributes on a file. The setxattr, lsetxattr, fsetxattr (set extended file attributes) and removexattr, lremovexattr, fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system userids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S \\ lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S \\ lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S \\ lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.10"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + +# 8.1.11 Collect Unsuccessful Unauthorized Access Attempts to Files (Scored) + - id: 1095 + title: "Collect Unsuccessful Unauthorized Access Attempts to Files" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation (creat), opening (open, openat) and truncation (truncate, ftruncate) of files. An audit log record will only be written if the user is a nonprivileged user (auid > = 500), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.11"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + +# 8.1.13 Collect Successful File System Mounts (Scored) + - id: 1096 + title: "Collect Successful File System Mounts" + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user" + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' + +# 8.1.14 Collect File Deletion Events by User (Scored) + - id: 1097 + title: "Collect File Deletion Events by User" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "At a minimum, configure the audit system to collect file deletion events for all users and root. For 64 bit systems, add the following to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 \\ -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 \\ -F auid!=4294967295 -k delete # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 \\ -F auid!=4294967295 -k delete # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.14"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4","PI1.5","CC7.1","CC7.2","CC7.3","CC8.1"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' + +# 8.1.15 Collect Changes to System Administration Scope (sudoers) (Scored) + - id: 1098 + title: "Collect Changes to System Administration Scope (sudoers)" + description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /etc/sudoers -p wa -k scope # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.15"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w /etc/sudoers && r:-p wa && r:-k scope' + +# 8.1.16 Collect System Administrator Actions (sudolog) (Scored) + - id: 1099 + title: "Collect System Administrator Actions (sudolog)" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log. Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /var/log/sudo.log -p wa -k actions # Execute the following command to restart auditd # pkill -HUP -P 1 auditd Note: The system must be configured with su disabled (See Item 9.5 Restrict Access to the su Command) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root" + compliance: + - cis: ["8.1.16"] + - cis_csc: ["5.1","5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - tsc: ["CC7.2","CC6.1","CC6.3","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w /var/log/sudo.log && r:-p wa && r:-k actions' + +# 8.1.17 Collect Kernel Module Loading and Unloading (Scored) + - id: 1100 + title: "Collect Kernel Module Loading and Unloading" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules For 32 bit systems, add -a always,exit -F arch=b32 -S init_module -S delete_module -k modules For 64 bit systems, add -a always,exit -F arch=b64 -S init_module -S delete_module -k modules" + compliance: + - cis: ["8.1.17"] + - cis_csc: ["3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - tsc: ["CC7.2","CC6.1","CC7.3","CC7.4","CC6.8"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w /sbin/insmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-w /sbin/rmmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-w /sbin/modprobe && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S init_module && r:-S delete_module && r:-k modules' + +# 8.1.18 Make the Audit Configuration Immutable (Scored) + - id: 1101 + title: "Make the Audit Configuration Immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl. Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot" + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -e 2 Note: This must be the last line in the /etc/audit/audit.rules file" + compliance: + - cis: ["8.1.18"] + - cis_csc: ["3","6"] + - pci_dss: ["10.5"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-e 2$' + +############################################### +# 8.2 Configure rsyslog +############################################### + +# 8.2.1 Install the rsyslog package (Scored) + - id: 1102 + title: "Install the rsyslog package" + description: "The rsyslog package is a third party package that provides many enhancements to syslog, such as multi-threading, TCP communication, message filtering and data base support." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install the rsyslog package: # apt-get install rsyslog" + compliance: + - cis: ["8.2.2"] + - cis_csc: ["6.2"] + condition: all + rules: + - 'c:dpkg -s rsyslog -> r:install ok installed' + +# 8.2.2 Ensure the rsyslog Service is activated (Scored) + - id: 1103 + title: "Ensure the rsyslog Service is activated" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Enable rsyslog: # update-rc.d rsyslog enable" + compliance: + - cis: ["8.2.2"] + - cis_csc: ["6.2"] + condition: all + rules: + - 'c:find /etc/rc2.d -name *rsyslog* -> r:/etc/rc2.d/S\d+rsyslog' + - 'c:find /etc/rc3.d -name *rsyslog* -> r:/etc/rc3.d/S\d+rsyslog' + - 'c:find /etc/rc4.d -name *rsyslog* -> r:/etc/rc4.d/S\d+rsyslog' + - 'c:find /etc/rc5.d -name *rsyslog* -> r:/etc/rc5.d/S\d+rsyslog' + +# 8.2.5 Configure rsyslog to send logs to a Remote Log Host (Scored) + - id: 1104 + title: "Configure rsyslog to Send Logs to a Remote Log Host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system" + remediation: "Edit the /etc/rsyslog.conf file and add the following line (where logfile.example.com is the name of your central log host). *.* @@loghost.example.com # Execute the following command to restart rsyslogd # pkill -HUP rsyslogd Note: The double \"at\" sign (@@) directs rsyslog to use TCP to send log messages to the server, which is a more reliable transport mechanism than the default UDP protocol." + compliance: + - cis: ["8.2.5"] + - cis_csc: ["6.6"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\s*\t**.* @@\.+' + +# 8.2.6 Accept remote rsyslog messages only on designated log hosts (Not Scored) + - id: 1105 + title: "Accept Remote rsyslog Messages Only on Designated Log Hosts" + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment the following lines: $ModLoad imtcp.so $InputTCPServerRun 514 Execute the following command to restart rsyslogd: # pkill -HUP rsyslogd" + compliance: + - cis: ["8.2.6"] + - cis_csc: ["9.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\s*\t*\$ModLoad\s*\t*imtcp.so' + - 'f:/etc/rsyslog.conf -> r:^\s*\t*\$InputTCPServerRun\s*\t*514' + + +############################################### +# 8.3 Advanced Intrusion Detection Environment (AIDE) +############################################### + +# 8.3.1 Install AIDE (Scored) + - id: 1106 + title: "Install AIDE" + description: "In some installations, AIDE is not installed automatically" + rationale: "Install AIDE to make use of the file integrity features to monitor critical files for changes that could affect the security of the system." + remediation: "Install AIDE: # apt-get install aide Initialize AIDE: # aideinit # cp /var/lib/aide/aide.db.new /var/lib/aide/aide.db Note: The prelinking feature can interfere with AIDE because it alters binaries to speed up their start up times. Run /usr/sbin/prelink -ua to restore the binaries to their prelinked state, thus avoiding false positives from AIDE." + compliance: + - cis: ["8.3.1"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + condition: all + rules: + - 'c:dpkg -s aide -> r:install ok installed' + +# 8.3.2 Implement Periodic Execution of File Integrity (Scored) + - id: 1107 + title: "Implement Periodic Execution of File Integrity" + description: "Implement periodic file checking, in compliance with site policy" + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Execute the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check Note: The checking in this instance occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy." + compliance: + - cis: ["8.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:crontab -u root -l -> !r:^# && r:\s*\t*/usr/sbin/aide\s*\t*--check' + + +############################################### +# 9 System Access, Authentication and Authorization +####################################################### +# 9.1.1 Enable cron Daemon (Scored) + - id: 1108 + title: "Enable cron Daemon" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run and cron is used to execute them." + remediation: "Enable cron: # update-rc.d cron enable Enable anacron: # update-rc.d anacron enable" + compliance: + - cis: ["9.1.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:find /etc/rc2.d -name *cron* -> r:/etc/rc2.d/S\d+cron' + - 'c:find /etc/rc3.d -name *cron* -> r:/etc/rc3.d/S\d+cron' + - 'c:find /etc/rc4.d -name *cron* -> r:/etc/rc4.d/S\d+cron' + - 'c:find /etc/rc5.d -name *cron* -> r:/etc/rc5.d/S\d+cron' + - 'c:find /etc/rc2.d -name *anacron* -> r:/etc/rc2.d/S\d+anacron' + - 'c:find /etc/rc3.d -name *anacron* -> r:/etc/rc3.d/S\d+anacron' + - 'c:find /etc/rc4.d -name *anacron* -> r:/etc/rc4.d/S\d+anacron' + - 'c:find /etc/rc5.d -name *anacron* -> r:/etc/rc5.d/S\d+anacron' + + +# 9.1.2 Set User/Group Owner and Permission on /etc/crontab (Scored) + - id: 1109 + title: "Set User/Group Owner and Permission on /etc/crontab" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["9.1.2"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 9.1.3 Set User/Group Owner and Permission on /etc/cron.hourly (Scored) + - id: 1110 + title: "Set User/Group Owner and Permission on /etc/cron.hourly" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["9.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 9.1.4 Set User/Group Owner and Permission on /etc/cron.daily (Scored) + - id: 1111 + title: "Set User/Group Owner and Permission on /etc/cron.daily" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["9.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 9.1.5 Set User/Group Owner and Permission on /etc/cron.weekly (Scored) + - id: 1112 + title: "Set User/Group Owner and Permission on /etc/cron.weekly" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["9.1.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 9.1.6 Set User/Group Owner and Permission on /etc/cron.monthly (Scored) + - id: 1113 + title: "Set User/Group Owner and Permission on /etc/cron.monthly" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["9.1.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 9.1.7 Set User/Group Owner and Permission on /etc/cron.d (Scored) + - id: 1114 + title: "Set User/Group Owner and Permission on /etc/cron.d" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["9.1.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 9.1.8 Restrict at/cron to Authorized Users (Scored) + - id: 1115 + title: "Restrict at/cron to Authorized Users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "# /bin/rm /etc/cron.deny # /bin/rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["9.1.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/cron.allow' + - 'f:/etc/at.allow' + - 'not f:/etc/cron.deny' + - 'not f:/etc/at.deny' + - 'c:stat -c%u-%g-%a /etc/cron.allow -> r:^0-0-600' + - 'c:stat -c%u-%g-%a /etc/at.allow -> r:^0-0-600' + +########################################### +# 9.2 Configure PAM +########################################### + +# 9.2.1 Set Password Creation Requirement Parameters Using pam_cracklib (Scored) + - id: 1116 + title: "Set Password Creation Requirement Parameters Using pam_cracklib" + description: "The pam_cracklib module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_cracklib.so options. # retry=3 - Allow 3 tries before sending back a failure. # minlen=14 - password must be 14 characters or more # dcredit=-1 - provide at least one digit # ucredit=-1 - provide at least one uppercase character # ocredit=-1 - provide at least one special character # lcredit=-1 - provide at least one lowercase character The setting shown above is one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Install the libpam-cracklib package: # apt-get install libpam-cracklib 2) Set the pam_cracklib.so parameters as follows in /etc/pam.d/common-password: password required pam_cracklib.so retry=3 minlen=14 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1" + compliance: + - cis: ["9.2.1"] + - pci_dss: ["8.2.3"] + condition: all + rules: + - 'c:dpkg -s libpam-cracklib -> r:install ok installed' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_cracklib.so && r:retry=\d && n:minlen=(\d+) compare >= 14 && r:dcredit=-\d+ && r:ucredit=-\d+ && r:ocredit=-\d+ && r:lcredit=-\d+' + +# 9.2.2 Set Lockout for Failed Password Attempts (Not Scored) + - id: 1117 + title: "Set Lockout for Failed Password Attempts" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration file /etc/pam.d/login. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out userIDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/login file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900 Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user." + compliance: + - cis: ["9.2.2"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/login -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny=\d && r:unlock_time=\d\d\d+' + +# 9.2.3 Limit Password Reuse (Scored) + - id: 1118 + title: "Limit Password Reuse" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Set the pam_unix.so remember parameter to 5 in /etc/pam.d/common-password: password [success=1 default=ignore] pam_unix.so obscure sha512 remember=5 Note: The default password setting in this document is the last 5 passwords. Change this number to conform to your site's password policy." + compliance: + - cis: ["9.2.3"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password && r:pam_unix.so && n:remember\s*\t*=\s*\t*(\d+) compare >= 5' + +########################################### +# 9.3 Configure SSH +########################################### +# 9.3.1 Set SSH Protocol to 2 (Scored) + - id: 1119 + title: "Set SSH Protocol to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["9.3.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\s*\t*2' + +# 9.3.2 Set LogLevel to INFO (Scored) + - id: 1120 + title: "Set LogLevel to INFO" + description: "The INFO parameter specifices that record login and logout activity will be logged." + rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["9.3.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:^\s*\t*LogLevel\s+INFO' + +# 9.3.3 Set Permissions on /etc/ssh/sshd_config (Scored) + - id: 1121 + title: "Set Permissions on /etc/ssh/sshd_config" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "If the user and group ownership of the /etc/ssh/sshd_config file are incorrect, run the following command to correct them: # chown root:root /etc/ssh/sshd_config If the permissions are incorrect, run the following command to correct them: # chmod 600 /etc/ssh/sshd_config" + compliance: + - cis: ["9.3.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/-\w\w-------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 9.3.4 Disable SSH X11 Forwarding (Scored) + - id: 1122 + title: "Disable SSH X11 Forwarding" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["9.3.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:X11Forwarding\s+no' + +# 9.3.5 Set SSH MaxAuthTries to 4 or Less (Scored) + - id: 1123 + title: "Set SSH MaxAuthTries to 4 or Less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, it is set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["9.3.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && n:MaxAuthTries\s*\t*(\d+) compare <= 4' + +# 9.3.6 Set SSH IgnoreRhosts to Yes (Scored) + - id: 1124 + title: "Set SSH IgnoreRhosts to Yes" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["9.3.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\s+yes' + +# 9.3.7 Set SSH HostbasedAuthentication to No (Scored) + - id: 1125 + title: "Set SSH HostbasedAuthentication to No" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["9.3.7"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\s+no' + +# 9.3.8 Disable SSH Root Login (Scored) + - id: 1126 + title: "Disable SSH Root Login" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["9.3.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\s+no' + +# 9.3.9 Set SSH PermitEmptyPasswords to No (Scored) + - id: 1127 + title: "Set SSH PermitEmptyPasswords to No" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["9.3.9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitEmptyPasswords\s+no' + +# 9.3.10 Do Not Allow Users to Set Environment Options (Scored) + - id: 1128 + title: "Do Not Allow Users to Set Environment Options" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["9.3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitUserEnvironment\s+no' + +# 9.3.11 Use Only Approved Cipher in Counter Mode (Scored) + - id: 1129 + title: "Use Only Approved Cipher in Counter Mode" + description: "This variable limits the types of ciphers that SSH can use during communication." + rationale: "Based on research conducted at various institutions, it was determined that the symmetric portion of the SSH Transport Protocol (as described in RFC 4253) has security weaknesses that allowed recovery of up to 32 bits of plaintext from a block of ciphertext that was encrypted with the Cipher Block Chaining (CBD) method. From that research, new Counter mode algorithms (as described in RFC4344) were designed that are not vulnerable to these types of attacks and these algorithms are now recommended for standard use." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Ciphers aes128-ctr,aes192-ctr,aes256-ctr" + compliance: + - cis: ["9.3.11"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Ciphers\.+aes128-ctr' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Ciphers\.+aes192-ctr' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Ciphers\.+aes256-ctr' + + +# 9.3.12 Set Idle Timeout Interval for User Login (Scored) + - id: 1130 + title: "Set Idle Timeout Interval for User Login" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening.. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["9.3.12"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && n:ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:ClientAliveCountMax\s+0' + +# 9.3.13 Limit Access via SSH (Scored) + - id: 1131 + title: "Limit Access via SSH" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["9.3.13"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:AllowUsers\s+\w+' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:AllowGroups\s+\w+' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:DenyUsers\s+\w+' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:DenyGroups\s+\w+' + +# 9.3.14 Set SSH Banner (Scored) + - id: 1132 + title: "Set SSH Banner" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Consult with your legal department for the appropriate warning banner for your site." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["9.3.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Banner\s*\t*/etc/issue.net|Banner\s\t*/etc/issue' + +# 9.5 Restrict Access to the su Command (Scored) + - id: 1133 + title: "Restrict Access to the su Command" + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the wheel group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid 2) Once this is done, create a comma separated list of users in the wheel statement in the /etc/group file." + compliance: + - cis: ["9.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth && r:required && r:pam_wheel.so && r:use_uid' + - 'f:/etc/group -> !r:^# && r:wheel:' + +###################################### +# 10 User Accounts and Environment +###################################### +# 10.1.1 Set Password Expiration Days (Scored) + - id: 1134 + title: "Set Password Expiration Days" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 90 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to 90 in /etc/login.defs: PASS_MAX_DAYS 90 Modify user parameters for all users with a password set to match: # chage --maxdays 90 " + compliance: + - cis: ["10.1.1"] + - pci_dss: ["8.2.4"] + condition: all + rules: + - 'f:/etc/login.defs -> !r:^# && n:PASS_MAX_DAYS\s*\t*(\d+) compare <= 90' + +# 10.1.2 Set Password Change Minimum Number of Days (Scored) + - id: 1135 + title: "Set Password Change Minimum Number of Days" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 Modify user parameters for all users with a password set to match: # chage --mindays 7 " + compliance: + - cis: ["10.1.2"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> !r:^# && n:PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + +# 10.1.3 Set Password Expiring Warning Days (Scored) + - id: 1136 + title: "Set Password Expiring Warning Days" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 " + compliance: + - cis: ["10.1.3"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> !r:^# && n:PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + +# 10.3 Set Default Group for root Account (Scored) + - id: 1137 + title: "Set Default Group for root Account" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "# usermod -g 0 root" + compliance: + - cis: ["10.3"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + +# 10.4 Set Default umask for Users (Scored) + - id: 1138 + title: "Set Default umask for Users" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files (.profile, .bashrc, etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system. Note: The directives in this section apply to bash and shell. If other shells are supported on the system, it is recommended that their configuration files also are checked." + remediation: "Edit the /etc/bash.bashrc and /etc/profile.d/cis.sh files (and the appropriate files for any other shell supported on your system) and add the following the UMASK parameter as shown: umask 077" + compliance: + - cis: ["10.4"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:grep -Rh ^umask[[:space:]][[:space:]]*077 /etc/profile.d/ -> !r:^# && r:umask\s*\t*077' + - 'f:/etc/bash.bashrc -> !r:^# && r:umask\s*\t*077' + +# 10.5 Lock Inactive User Accounts (Scored) + - id: 1139 + title: "Lock Inactive User Accounts" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 35 or more days be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "# useradd -D -f 35" + compliance: + - cis: ["10.5"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 35' + +########################################## +# 11 Warning Banners +########################################## +# 11.1 Set Warning Banner for Standard Login Services (Scored) + - id: 1140 + title: "Set Warning Banner for Standard Login Services" + description: "The contents of the /etc/issue file are displayed prior to the login prompt on the system's console and serial devices, and also prior to logins via telnet. The contents of the /etc/motd file is generally displayed after all successful logins, no matter where the user is logging in from, but is thought to be less useful because it only provides notification to the user after the machine has been accessed." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Consult with your organization's legal counsel for the appropriate wording for your specific organization." + remediation: "# touch /etc/motd # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net # chown root:root /etc/motd # chmod 644 /etc/motd # chown root:root /etc/issue # chmod 644 /etc/issue # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["11.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'f:/etc/motd' + - 'f:/etc/issue' + - 'f:/etc/issue.net' + - 'c:stat -c%u-%g-%a /etc/motd -> 0-0-644' + - 'c:stat -c%u-%g-%a /etc/issue -> 0-0-644' + - 'c:stat -c%u-%g-%a /etc/issue.net -> 0-0-644' + +# 11.2 Remove OS Information from Login Warning Banners (Scored) + - id: 1141 + title: "Remove OS Information from Login Warning Banners" + description: "Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform." + rationale: "Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \"uname -a\" command once they have logged in." + remediation: "Edit the /etc/motd, /etc/issue and /etc/issue.net files and remove any lines containing \\m, \\r, \\s or \\v." + compliance: + - cis: ["11.2"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + +# 11.3 Ensure GDM login banner is configured (Scored) + - id: 1142 + title: "Ensure GDM login banner is configured" + description: "Debian defaults to using GNOME Display Manager for graphical login session management. KDM is also available as well as lightdm. Instructions are provided for GDM only, if you are using another display manager you will need to follow different procedures to audit and remediate this setting." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Consult with your organization's legal counsel for the appropriate wording for your specific organization." + remediation: "Uncomment or add the following lines to /etc/gdm3/greeter.gsettings : banner-message-enable=true banner-message-text=''" + compliance: + - cis: ["11.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'f:/etc/gdm3/greeter.gsettings -> !r:^# && r:banner-message-enable=true' + - 'f:/etc/gdm3/greeter.gsettings -> !r:^# && r:banner-message-text=\.+' + +############################################### +# 12 Verify System File Permissions +############################################### + +# 12.1 Verify Permissions on /etc/passwd (Scored) + - id: 1143 + title: "Verify permissions on /etc/passwd" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "If the permissions of the /etc/passwd file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/passwd" + compliance: + - cis: ["12.1"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/bin/ls -l /etc/passwd -> r:-rw-r--r--' + +# 12.2 Verify Permissions on /etc/shadow (Scored) + - id: 1144 + title: "Verify permissions on /etc/shadow" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "If the permissions of the /etc/shadow file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/shadow" + compliance: + - cis: ["12.2"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/bin/ls -l /etc/shadow -> r:-rw-r-----' + +# 12.3 Verify Permissions on /etc/group (Scored) + - id: 1145 + title: "Verify permissions on /etc/group" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "If the permissions of the /etc/group file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/group" + compliance: + - cis: ["12.3"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/bin/ls -l /etc/group -> r:-rw-r--r--' + +# 12.4 Verify User/Group Ownership on /etc/passwd + - id: 1146 + title: "Verify User/Group Ownership on /etc/passwd" + description: "The /etc/passwd file contains a list of all the valid userIDs defined in the system, but not the passwords. The command below sets the owner and group of the file to root." + rationale: "The /etc/passwd file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "If the user and group ownership of the /etc/passwd file are incorrect, run the following command to correct them: # /bin/chown root:root /etc/passwd" + compliance: + - cis: ["12.4"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/bin/ls -l /etc/passwd -> r:root\s*\t*root' + +# 12.5 Verify User/Group Ownership on /etc/shadow (Scored) + - id: 1147 + title: "Verify User/Group Ownership on /etc/shadow" + description: "The /etc/shadow file contains the one-way cipher text passwords for each user defined in the /etc/passwd file. The command below sets the user and group ownership of the file to root." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "If the ownership of the /etc/shadow file are incorrect, run the following command to correct them: # /bin/chown root:shadow /etc/shadow" + compliance: + - cis: ["12.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/bin/ls -l /etc/shadow -> r:root\s*\t*shadow|root\s*\t*root' + +# 12.6 Verify User/Group Ownership on /etc/group (Scored) + - id: 1148 + title: "Verify User/Group Ownership on /etc/group" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "If the ownership of the /etc/group file are incorrect, run the following command to correct them: # /bin/chown root:root /etc/group" + compliance: + - cis: ["12.6"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/bin/ls -l /etc/group -> r:root\s*\t*root' + + +############################################### +# 13 Review User and Group Settings +############################################### + +# 13.1 Ensure Password Fields are Not Empty + - id: 1149 + title: "Ensure Password Fields are Not Empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # /usr/bin/passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["13.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + +# 13.2 Verify No Legacy "+" Entries Exist in /etc/passwd File + - id: 1150 + title: "Verify No Legacy \"+\" Entries Exist in /etc/passwd File" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Delete these entries if they exist." + compliance: + - cis: ["13.2"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && r:^+:' + +# 13.3 Verify No Legacy "+" Entries Exist in /etc/shadow File + - id: 1151 + title: "Verify No Legacy \"+\" Entries Exist in /etc/shadow File" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Delete these entries if they exist." + compliance: + - cis: ["13.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^+:' + +# 13.4 Verify No Legacy "+" Entries Exist in /etc/group File + - id: 1152 + title: "Verify No Legacy \"+\" Entries Exist in /etc/group File" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Delete these entries if they exist." + compliance: + - cis: ["13.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:^+:' + +# 13.5 Verify No UID 0 Accounts Exist Other Than root + - id: 1153 + title: "Verify No UID 0 Accounts Exist Other Than root" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 9.4 Restrict root Login to System Console." + remediation: "Delete any other entries that are displayed." + compliance: + - cis: ["13.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4","CC8.1"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + +# 13.20 Ensure shadow group is empty + - id: 1154 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["13.20"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/sca/debian/cis_debian7_L1.yml b/sca/debian/cis_debian7_L1.yml deleted file mode 100644 index 5f4286e2b..000000000 --- a/sca/debian/cis_debian7_L1.yml +++ /dev/null @@ -1,1207 +0,0 @@ -# Security Configuration Assessment -# Level 1 CIS Checks for Debian Linux 7 -# Copyright (C) 2015-2020, Wazuh Inc. -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License (version 2) as published by the FSF - Free Software -# Foundation -# -# Based on: -# Center for Internet Security Debian Linux 7 Benchmark v1.0.0 - 12-31-2015 - -policy: - id: "cis_debian7_L1" - file: "cis_debian7_L1.yml" - name: "CIS benchmark for Debian/Linux 7 L1" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 7." - references: - - https://www.cisecurity.org/cis-benchmarks/ - -requirements: - title: "Check Debian version" - description: "Requirements for running the SCA scan against Debian/Ubuntu." - condition: all - rules: - - 'f:/etc/debian_version' - - 'f:/proc/sys/kernel/ostype -> Linux' - -checks: - -# 2 Filesystem Configuration - - - id: 1000 - title: "Create Separate Partition for /tmp" - description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." - rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." - remediation: "Configure /etc/fstab as appropiate or Run the following commands to enable systemd /tmp mounting: systemctl umask tmp.mount; systemctl enable tmp.mount. Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount." - compliance: - - cis: ["2.1"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/tmp\s' - - - id: 1001 - title: "Set nodev option for /tmp Partition" - description: "The nodev mount option specifies that the filesystem cannot contain special devices." - rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /tmp" - compliance: - - cis: ["2.2"] - condition: all - rules: - - 'not c:mount -> r:\s/tmp\s' - - 'c:mount -> r:\s/tmp\s && r:nodev' - - - id: 1002 - title: "Set nosuid option for /tmp Partition" - description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." - rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." - remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nosuid /tmp" - compliance: - - cis: ["2.3"] - condition: all - rules: - - 'not c:mount -> r:\s/tmp\s' - - 'c:mount -> r:\s/tmp\s && r:nosuid' - - - id: 1003 - title: "Set noexec option for /tmp partition" - description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." - rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." - remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,noexec /tmp" - compliance: - - cis: ["2.4"] - condition: all - rules: - - 'not c:mount -> r:\s/tmp\s' - - 'c:mount -> r:\s/tmp\s && r:noexec' - - - id: 1004 - title: "Create Separate Partition for /var" - description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." - rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." - compliance: - - cis: ["2.5"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var\s' - - - id: 1005 - title: "Bind mount the /var/tmp directory to /tmp" - description: "The /var/tmp directory is normally a standalone directory in the /var file system. Binding /var/tmp to /tmp establishes an unbreakable link to /tmp that cannot be removed (even by the root user). It also allows /var/tmp to inherit the same mount options that /tmp owns, allowing /var/tmp to be protected in the same manner /tmp is protected. It will also prevent /var from filling up with temporary files as the contents of /var/tmp will actually reside in the file system containing /tmp." - rationale: "All programs that use /var/tmp and /tmp to read/write temporary files will always be write to tmp file system, preventing a user from running the /var file system out of space or trying to perform operations that have been blocked in the /tmp filesystem." - remediation: "# mount --bind /tmp /var/tmp and edit the /etc/fstab file to contain the following line: /tmp /var/tmp none bind 0 0" - compliance: - - cis: ["2.6"] - condition: all - rules: - - 'c:findmnt -> r:/var/tmp && r:[/tmp]' - - 'f:/etc/fstab -> r:^/tmp && r:\s*/var/tmp\s* && r:bind' - - - id: 1006 - title: "Create Separate Partition for /var/log" - description: "The /var/log directory is used by system services to store log data." - rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." - compliance: - - cis: ["2.7"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var/log\s' - - - id: 1007 - title: "Create Separate Partition for /var/log/audit" - description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." - rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." - compliance: - - cis: ["2.8"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var/log/audit\s' - - - id: 1008 - title: "Create Separate Partition for /home" - description: "The /home directory is used to support disk storage needs of local users." - rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." - compliance: - - cis: ["2.9"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/home\s' - - - id: 1009 - title: "Add nodev Option to /home" - description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." - rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /home" - compliance: - - cis: ["2.10"] - condition: all - rules: - - 'not c:mount -> r:\s/home\s' - - 'c:mount -> r:\s/home\s && r:nodev' - - - id: 1010 - title: "Add nodev Option to /run/shm Partition" - description: "The nodev mount option specifies that the /run/shm (temporary filesystem stored in memory) cannot contain block or character special devices." - rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /run/shm partitions." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options of entries that have mount points that contain /run/shm. See the fstab(5) manual page for more information. # mount -o remount,nodev /run/shm" - compliance: - - cis: ["2.14"] - condition: all - rules: - - 'not c:mount -> r:\s/run/shm\s' - - 'c:mount -> r:\s/run/shm\s && r:nodev' - - - id: 1011 - title: "Add nosuid Option to /run/shm Partition" - description: "The nosuid mount option specifies that the /run/shm (temporary filesystem stored in memory) will not execute setuid and setgid on executable programs as such, but rather execute them with the uid and gid of the user executing the program." - rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." - remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). Look for entries that have mount points that contain /run/shm. See the fstab(5) manual page for more information. # mount -o remount,nosuid /run/shm" - compliance: - - cis: ["2.15"] - condition: all - rules: - - 'not c:mount -> r:\s/run/shm\s' - - 'c:mount -> r:\s/run/shm\s && r:nosuid' - - - id: 1012 - title: "Add noexec Option to /run/shm Partition" - description: "Set noexec on the shared memory partition to prevent programs from executing from there." - rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." - remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options). Look for entries that have mount points that contain /run/shm. See the fstab(5) manual page for more information. # mount -o remount,noexec /run/shm" - compliance: - - cis: ["2.16"] - condition: all - rules: - - 'not c:mount -> r:\s/run/shm\s' - - 'c:mount -> r:\s/run/shm\s && r:noexec' - - - id: 1013 - title: "Disable Automounting" - description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." - rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." - remediation: "Disable autofs: # update-rc.d autofs disable" - compliance: - - cis: ["2.25"] - condition: none - rules: - - 'c:find /etc/rc* -name *autofsc* -> r:S\.' - -# 3 Secure Boot Settings - - - id: 1014 - title: "Set Boot Loader Password" - description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters" - rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." - remediation: "Create an encrypted password with grub-md5-crypt: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file: cat <\" password_pbkdf2 EOF Unless the --unrestricted option is added to CLASS in /etc/grub.d/10_linux a password will be required to boot in addition to editing boot parameters: CLASS=\"--class gnu-linux --class gnu --class os --unrestricted\" Run the following to update the grub configuration: # update-grub" - compliance: - - cis: ["3.3"] - condition: all - rules: - - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' - - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' - - - id: 1015 - title: "Require authentication for Single-User mode" - description: "Setting a password for the root user will force authentication in single user mode." - rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." - remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" - compliance: - - cis: ["3.4"] - condition: none - rules: - - 'f:/etc/shadow -> r:^root:*:|^root:!:' - -# 4 Additional Process Hardening - - id: 1016 - title: "Restrict Core Dumps" - description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." - rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5)). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." - remediation: "Add the following line to the /etc/security/limits.conf file. * hard core 0 Add the following line to the /etc/sysctl.conf file. fs.suid_dumpable = 0" - compliance: - - cis: ["4.1"] - condition: all - rules: - - 'c:sysctl fs.suid_dumpable -> r:=\s*0$' - - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s0$|\t0$' - - - id: 1017 - title: "Enable Randomized Virtual Memory Region Placement" - description: "Set the system flag to force randomized virtual memory region placement." - rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." - remediation: "Add the following line to the /etc/sysctl.conf file. kernel.randomize_va_space = 2" - compliance: - - cis: ["4.3"] - condition: all - rules: - - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' - -# 5 OS Services - - - id: 1018 - title: "Ensure NIS is not installed" - description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." - rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." - remediation: "Uninstall the nis package: # apt-get purge nis" - compliance: - - cis: ["5.1.1"] - condition: none - rules: - - 'c:dpkg -s nis -> r:install ok installed' - - - id: 1019 - title: "Ensure rsh server is not enabled" - description: "The Berkeley rsh-server (rsh, rlogin, rcp) package contains legacy services that exchange credentials in clear-text." - rationale: "These legacy service contain numerous security exposures and have been replaced with the more secure SSH package." - remediation: "Remove or comment out any shell, login, or exec lines in /etc/inetd.conf: #shell stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rshd #login stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rlogind #exec stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rexecd" - compliance: - - cis: ["5.1.2"] - condition: none - rules: - - 'f:/etc/inetd.conf -> !r:^# && r:^shell|^login|^exec' - - - id: 1020 - title: "Ensure talk server is not enabled" - description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." - rationale: "The software presents a security risk as it uses unencrypted protocols for communication." - remediation: "Remove or comment out any talk or ntalk lines in /etc/inetd.conf: #talk dgram udp wait nobody.tty /usr/sbin/in.talkd in.talkd #ntalk dgram udp wait nobody.tty /usr/sbin/in.ntalkd in.ntalkd" - compliance: - - cis: ["5.1.4"] - condition: none - rules: - - 'f:/etc/inetd.conf -> !r:^# && r:^talk|^ntalk' - - - id: 1021 - title: "Ensure telnet server is not enabled" - description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." - rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." - remediation: "Remove or comment out any telnet lines in /etc/inetd.conf: #telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd" - compliance: - - cis: ["5.1.6"] - condition: none - rules: - - 'f:/etc/inetd.conf -> !r:^# && r:telnet' - - - id: 1022 - title: "Ensure tftp-server is not enabled" - description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The packages tftp and atftp are both used to define and support a TFTP server." - rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." - remediation: "Remove or comment out any tftp lines in /etc/inetd.conf: #tftp stream tcp nowait root internal" - compliance: - - cis: ["5.1.7"] - condition: none - rules: - - 'f:/etc/inetd.conf -> !r:^# && r:tftp' - - - id: 1023 - title: "Ensure xinetd is not enabled" - description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests. Note: Several other services recommended to be disabled in this benchmark have xinetd versions as well, if xinetd is required in your environment ensure they are disabled in xinetd configuration as well." - rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." - remediation: "Disable xinetd: # update-rc.d xinetd disable" - compliance: - - cis: ["5.1.8"] - condition: none - rules: - - 'c:find /etc/rc* -name *xinetd* -> r:S\.' - - - id: 1024 - title: "Ensure chargen is not enabled" - description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Remove or comment out any chargen lines in /etc/inetd.conf: #chargen stream tcp nowait root internal" - compliance: - - cis: ["5.2"] - condition: none - rules: - - 'f:/etc/inetd.conf -> !r:^# && r:chargen' - - - id: 1025 - title: "Ensure daytime is not enabled" - description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Remove or comment out any daytime lines in /etc/inetd.conf: #daytime stream tcp nowait root internal" - compliance: - - cis: ["5.3"] - condition: none - rules: - - 'f:/etc/inetd.conf -> !r:^# && r:daytime' - - - id: 1026 - title: "Ensure echo is not enabled" - description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Remove or comment out any echo lines in /etc/inetd.conf: #echo stream tcp nowait root internal" - compliance: - - cis: ["5.4"] - condition: none - rules: - - 'f:/etc/inetd.conf -> !r:^# && r:echo' - - - id: 1027 - title: "Ensure discard is not enabled" - description: "discard is a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Remove or comment out any discard lines in /etc/inetd.conf: #discard stream tcp nowait root internal" - compliance: - - cis: ["5.5"] - condition: none - rules: - - 'f:/etc/inetd.conf -> !r:^# && r:discard' - - - id: 1028 - title: "Ensure time is not enabled" - description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Remove or comment out any time lines in /etc/inetd.conf: #time stream tcp nowait root internal" - compliance: - - cis: ["5.6"] - condition: none - rules: - - 'f:/etc/inetd.conf -> !r:^# && r:time' - -# 6 Special Purpose Services - - - id: 1029 - title: "Ensure Avahi Server is not enabled" - description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." - rationale: "Since servers are not normally used for printing, this service is not needed unless dependencies require it. If this is the case, disable the service to reduce the potential attack surface." - remediation: "Disable avahi-daemon: # update-rc.d avahi-daemon disable" - compliance: - - cis: ["6.2"] - condition: none - rules: - - 'c:find /etc/rc* -name *avahi-daemon* -> r:S\.' - - - id: 1030 - title: "Ensure print server is not enabled" - description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." - rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." - remediation: "Disable cups: # update-rc.d cups disable" - compliance: - - cis: ["6.3"] - condition: none - rules: - - 'c:find /etc/rc* -name *cups* -> r:S\.' - - - id: 1031 - title: "Ensure DHCP Server is not enabled" - description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." - rationale: "Unless a server is specifically set up to act as a DHCP server, it is recommended that this service be deleted to reduce the potential attack surface." - remediation: "Disable isc-dhcp-server: # update-rc.d isc-dhcp-server disable" - references: - - "https://www.isc.org/dhcp/" - compliance: - - cis: ["6.4"] - condition: none - rules: - - 'c:find /etc/rc* -name *isc-dhcp-server* -> r:S\.' - - - id: 1032 - title: "Configure Network Time Protocol (NTP)" - description: "The Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. NTP can be configured to be a client and/or a server." - rationale: "It is recommended that physical systems and virtual guests lacking direct access to the physical host's clock be configured as NTP clients to synchronize their clocks (especially to support time sensitive security mechanisms like Kerberos). This also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." - remediation: "Install ntp: # apt-get install ntp Ensure the following lines are in /etc/ntp.conf: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Also, make sure /etc/ntp.conf has at least one NTP server specified: server Note: is the IP address or hostname of a trusted time server. Configuring an NTP server is outside the scope of this benchmark." - compliance: - - cis: ["6.5"] - references: - - http://www.ntp.org/ - condition: all - rules: - - 'c:dpkg -s ntp -> r:install ok installed' - - 'f:/etc/ntp.conf -> r:^restrict -4 default && r:kod && r:nomodify && r:notrap && r:nopeer && r:noquery' - - 'f:/etc/ntp.conf -> r:^restrict -6 default && r:kod && r:nomodify && r:notrap && r:nopeer && r:noquery' - - 'f:/etc/ntp.conf -> r:^server\s\.+' - - 'f:/etc/ntp.conf -> r:^RUNASUSER\s*\t*=\s*\t*ntp' - - - id: 1033 - title: "Ensure LDAP is not enabled" - description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." - rationale: "If the server will not need to act as an LDAP client or server, it is recommended that the software be disabled to reduce the potential attack surface." - remediation: "Uninstall the slapd package: # apt-get purge slapd" - compliance: - - cis: ["6.6"] - references: - - http://www.openldap.org - condition: none - rules: - - 'c:dpkg -s slapd -> r:install ok installed' - - - id: 1034 - title: "Ensure NFS and RPC are not enabled" - description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." - rationale: "If the server does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." - remediation: "Disable rpcbind: # update-rc.d rpcbind disable Disable nfs-kernel-server: # update-rc.d nfs-kernel-server disable" - compliance: - - cis: ["6.7"] - condition: none - rules: - - 'c:find /etc/rc* -name *rpcbind* -> r:S\.' - - 'c:find /etc/rc* -name *nfs-kernel-server* -> r:S\.' - - - id: 1035 - title: "Ensure DNS Server is not enabled" - description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." - rationale: "Unless a server is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." - remediation: "Disable bind9: # update-rc.d bind9 disable" - compliance: - - cis: ["6.8"] - condition: none - rules: - - 'c:find /etc/rc* -name *bind9* -> r:S\.' - - - id: 1036 - title: "Ensure FTP Server is not enabled" - description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." - rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." - remediation: "Disable vsftpd: # update-rc.d vsftpd disable" - compliance: - - cis: ["6.9"] - condition: none - rules: - - 'c:find /etc/rc* -name *vsftpd* -> r:S\.' - - - id: 1037 - title: "Ensure HTTP Server is not enabled" - description: "HTTP or web servers provide the ability to host web site content." - rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." - remediation: "Disable apache2: # update-rc.d apache2 disable" - compliance: - - cis: ["6.10"] - condition: none - rules: - - 'c:find /etc/rc* -name *apache2* -> r:S\.' - - - id: 1038 - title: "Ensure IMAP and POP server is not enabled" - description: "Dovecot is an open source IMAP and POP3 server for Linux based systems." - rationale: "Unless POP3 and/or IMAP servers are to be provided to this server, it is recommended that the service be deleted to reduce the potential attack surface." - remediation: "Disable dovecot: # update-rc.d dovecot disable" - compliance: - - cis: ["6.11"] - condition: none - rules: - - 'c:find /etc/rc* -name *dovecot* -> r:S\.' - - - id: 1039 - title: "Ensure Samba is not enabled" - description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." - rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." - remediation: "Disable samba: # update-rc.d samba disable" - compliance: - - cis: ["6.12"] - condition: none - rules: - - 'c:find /etc/rc* -name *smb* -> r:S\.' - - - id: 1040 - title: "Ensure HTTP Proxy Server is not enabled" - description: "Squid is a standard proxy server used in many distributions and environments." - rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." - remediation: "Disable squid3: # update-rc.d squid3 disable" - compliance: - - cis: ["6.13"] - condition: none - rules: - - 'c:find /etc/rc* -name *squid3* -> r:S\.' - - - id: 1041 - title: "Ensure SNMP Server is not enabled" - description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." - rationale: "The SNMP server communicates using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used." - remediation: "Disable snmpd: # update-rc.d snmpd disable" - compliance: - - cis: ["6.14"] - condition: none - rules: - - 'c:find /etc/rc* -name *snmpd* -> r:S\.' - - - id: 1042 - title: "Configure Mail Transfer Agent for Local-Only Mode" - description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." - rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: The remediation given here provides instructions for configuring the postfix mail server, depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." - remediation: "Edit /etc/exim4/update-exim4.conf.conf and edit the dc_local_interfaces line to remove non loopback addresses: dc_local_interfaces='127.0.0.1 ; ::1' Run update-exim4.conf: # update-exim4.conf Reload exim4 configuration: # service exim4 reload" - compliance: - - cis: ["6.15"] - condition: all - rules: - - 'f:/etc/exim4/update-exim4.conf.conf -> r:^dc_local_interfaces= && r:\p127.0.0.1\s*\p\s*::1\p$|\p::1\s*\p\s*127.0.0.1\p$|\p127.0.0.1\p$|\p::1\p$' - - - id: 1043 - title: "Ensure rsync service is not enabled" - description: "The rsyncd service can be used to synchronize files between systems over network links." - rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." - remediation: "Set RSYNC_ENABLE to false in /etc/default/rsync: RSYNC_ENABLE=false" - compliance: - - cis: ["6.16"] - condition: none - rules: - - 'c:dpkg -s rsync -> r:install ok installed' - - 'not f:/etc/default/rsync -> !r:^# && r:RSYNC_ENABLE\s*\t*=\s*\t*false' - -# 7 Network Configuration and Firewall - - - id: 1044 - title: "Disable IP Forwarding" - description: "The net.ipv4.ip_forward flag is used to tell the server whether it can forward packets or not. If the server is not to be used as a router, set the flag to 0." - rationale: "Setting the flag to 0 ensures that a server with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." - remediation: "Set the net.ipv4.ip_forward parameter to 0 in /etc/sysctl.conf: net.ipv4.ip_forward=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.ip_forward=0 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.1.1"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' - - - id: 1045 - title: "Disable Send Packet Redirects" - description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." - rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." - remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.send_redirects=0 # /sbin/sysctl -w net.ipv4.conf.default.send_redirects=0 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.1.2"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' - - 'c:/sbin/sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' - - - id: 1046 - title: "Disable Source Routed Packet Acceptance" - description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." - rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this server was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the server as a way to reach the private address servers. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." - remediation: "Set the net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.accept_source_route=0 net.ipv4.conf.default.accept_source_route=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.accept_source_route=0 # /sbin/sysctl -w net.ipv4.conf.default.accept_source_route=0 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.2.1"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' - - 'c:/sbin/sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' - - - id: 1047 - title: "Disable ICMP Redirect Acceptance" - description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." - rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." - remediation: "Set the net.ipv4.conf.all.accept_redirects and net.ipv4.conf.default.accept_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.accept_redirects=0 net.ipv4.conf.default.accept_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.accept_redirects=0 # /sbin/sysctl -w net.ipv4.conf.default.accept_redirects=0 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.2.2"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' - - 'c:/sbin/sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' - - - id: 1048 - title: "Disable Secure ICMP Redirect Acceptance" - description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." - rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." - remediation: "Set the net.ipv4.conf.all.secure_redirects and net.ipv4.conf.default.secure_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.secure_redirects=0 net.ipv4.conf.default.secure_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.secure_redirects=0 # /sbin/sysctl -w net.ipv4.conf.default.secure_redirects=0 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.2.3"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' - - 'c:/sbin/sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' - - - id: 1049 - title: "Log Suspicious Packets" - description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." - rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." - remediation: "Set the net.ipv4.conf.all.log_martians and net.ipv4.conf.default.log_martians parameters to 1 in /etc/sysctl.conf: net.ipv4.conf.all.log_martians=1 net.ipv4.conf.default.log_martians=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.log_martians=1 # /sbin/sysctl -w net.ipv4.conf.default.log_martians=1 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.2.4"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' - - 'c:/sbin/sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' - - - id: 1050 - title: "Enable Ignore Broadcast Requests" - description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." - rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." - remediation: "Set the net.ipv4.icmp_echo_ignore_broadcasts parameter to 1 in /etc/sysctl.conf: net.ipv4.icmp_echo_ignore_broadcasts=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.2.5"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' - - - id: 1051 - title: "Enable Bad Error Message Protection" - description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." - rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." - remediation: "Set the net.ipv4.icmp_ignore_bogus_error_responses parameter to 1 in /etc/sysctl.conf: net.ipv4.icmp_ignore_bogus_error_responses=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.2.6"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' - - - id: 1052 - title: "Enable RFC-recommended Source Route Validation" - description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." - rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your server, you will not be able to enable this feature without breaking the routing." - remediation: "Set the net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter parameters to 1 in /etc/sysctl.conf: net.ipv4.conf.all.rp_filter=1 net.ipv4.conf.default.rp_filter=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.rp_filter=1 # /sbin/sysctl -w net.ipv4.conf.default.rp_filter=1 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.2.7"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' - - 'c:/sbin/sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' - - - id: 1053 - title: "Enable TCP SYN Cookies" - description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the server to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." - rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a server by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the server to keep accepting valid connections, even if under a denial of service attack." - remediation: "Set the net.ipv4.tcp_syncookies parameter to 1 in /etc/sysctl.conf: net.ipv4.tcp_syncookies=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.tcp_syncookies=1 # /sbin/sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["7.2.8"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' - - - id: 1054 - title: "Disable IPv6 Router Advertisements" - description: "This setting disables the systems ability to accept router advertisements" - rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." - remediation: "Set the net.ipv6.conf.all.accept_ra and net.ipv6.conf.default.accept_ra parameter to 0 in /etc/sysctl.conf: net.ipv6.conf.all.accept_ra=0 net.ipv6.conf.default.accept_ra=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv6.conf.all.accept_ra=0 # /sbin/sysctl -w net.ipv6.conf.default.accept_ra=0 # /sbin/sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["7.3.1"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' - - 'c:/sbin/sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' - - - id: 1055 - title: "Disable IPv6 Redirect Acceptance" - description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." - rationale: "It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." - remediation: "Set the net.ipv6.conf.all.accept_redirects and net.ipv6.conf.default.accept_redirects parameters to 0 in /etc/sysctl.conf: net.ipv6.conf.all.accept_redirects=0 net.ipv6.conf.default.accept_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv6.conf.all.accept_redirects=0 # /sbin/sysctl -w net.ipv6.conf.default.accept_redirects=0 # /sbin/sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["7.3.2"] - condition: all - rules: - - 'c:/sbin/sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' - - 'c:/sbin/sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' - - - id: 1056 - title: "Disable IPv6" - description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." - rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." - remediation: "Create or edit the file /etc/sysctl.conf and add the following lines: net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6=1 Run the following command or reboot to apply the changes: # sysctl -p" - compliance: - - cis: ["7.3.3"] - condition: all - rules: - - 'c:sysctl net.ipv6.conf.all.disable_ipv6 -> r:=\s*\t*1$' - - 'c:sysctl net.ipv6.conf.default.disable_ipv6 -> r:=\s*\t*1$' - - 'c:sysctl net.ipv6.conf.lo.disable_ipv6 -> r:=\s*\t*1$' - - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.all.disable_ipv6\s*\t*=\s*\t*1' - - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.default.disable_ipv6\s*\t*=\s*\t*1' - - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.lo.disable_ipv6\s*\t*=\s*\t*1' - - - id: 1057 - title: "Create /etc/hosts.allow" - description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." - rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the server." - remediation: "Create /etc/hosts.allow: # echo \"ALL: /, /, ...\" >/etc/hosts.allow where each / combination (for example, \"192.168.1.0/255.255.255.0\") represents one network block in use by your organization that requires access to this system." - compliance: - - cis: ["7.4.2"] - condition: all - rules: - - 'f:/etc/hosts.allow' - - - id: 1058 - title: "Create /etc/hosts.deny" - description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." - rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." - remediation: "Create /etc/hosts.deny: # echo \"ALL: ALL\" >> /etc/hosts.deny" - compliance: - - cis: ["7.4.4"] - condition: all - rules: - - 'f:/etc/hosts.deny' - - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' - - - id: 1059 - title: "Disable DCCP" - description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." - rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." - remediation: "# echo \"install dccp /bin/true\" >> /etc/modprobe.d/CIS.conf" - compliance: - - cis: ["7.5.1"] - condition: none - rules: - - 'c:lsmod -> r:dccp' - - - id: 1060 - title: "Disable SCTP" - description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." - rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." - remediation: "# echo \"install sctp /bin/true\" >> /etc/modprobe.d/CIS.conf" - compliance: - - cis: ["7.5.2"] - condition: none - rules: - - 'c:lsmod -> r:sctp' - - - id: 1061 - title: "Disable RDS" - description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." - rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." - remediation: "# echo \"install rds /bin/true\" >> /etc/modprobe.d/CIS.conf" - compliance: - - cis: ["7.5.3"] - condition: none - rules: - - 'c:lsmod -> r:rds' - - - id: 1062 - title: "Disable TIPC" - description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." - rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." - remediation: "# echo \"install tipc /bin/true\" >> /etc/modprobe.d/CIS.conf" - compliance: - - cis: ["7.5.4"] - condition: none - rules: - - 'c:lsmod -> r:tipc' - - - id: 1063 - title: "Ensure Firewall is active" - description: "IPtables is an application that allows a system administrator to configure the IPv4 tables, chains and rules provided by the Linux kernel firewall. The iptables-persistent package in Debian provides one way to ensure iptables rules are reapplied on reboot. Note: the audit and remediation included provide instructions for using iptables-persistent to reapply iptables rules. Other methods are available which may be in use in your environment and may conflict with these steps." - rationale: "IPtables provides extra protection for the Linux system by limiting communications in and out of the box to specific IPv4 addresses and ports." - remediation: "Install the iptables and iptables-persistent packages: # apt-get install iptables iptables-persistent Enable the iptables-persistent service: # update-rc.d iptables-persistent enable" - compliance: - - cis: ["7.7"] - condition: all - rules: - - 'c:dpkg -s iptables -> r:install ok installed' - - 'c:dpkg -s iptables-persistent -> r:install ok installed' - - 'c:find /etc/rc* -name *iptables-persistent* -> r:S\.' - -# 8 Logging and Auditing - - - id: 1064 - title: "Ensure the rsyslog Service is activated" - description: "Once the rsyslog package is installed it needs to be activated." - rationale: "If the rsyslog service is not activated the system will not have a syslog service running." - remediation: "Enable rsyslog: # update-rc.d rsyslog enable" - compliance: - - cis: ["8.2.2"] - condition: all - rules: - - 'c:find /etc/rc* -name *rsyslog* -> r:S\.' - - - id: 1065 - title: "Configure rsyslog to Send Logs to a Remote Log Host" - description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." - rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system" - remediation: "Edit the /etc/rsyslog.conf file and add the following line (where logfile.example.com is the name of your central log host). *.* @@loghost.example.com # Execute the following command to restart rsyslogd # pkill -HUP rsyslogd Note: The double \"at\" sign (@@) directs rsyslog to use TCP to send log messages to the server, which is a more reliable transport mechanism than the default UDP protocol." - compliance: - - cis: ["8.2.5"] - references: - - rsyslog.conf(5) man page - condition: all - rules: - - 'c:grep -Rh ^*.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* @@\.+' - - - id: 1066 - title: "Accept Remote rsyslog Messages Only on Designated Log Hosts" - description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." - rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." - remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment the following lines: $ModLoad imtcp.so $InputTCPServerRun 514 Execute the following command to restart rsyslogd: # pkill -HUP rsyslogd" - compliance: - - cis: ["8.2.6"] - references: - - rsyslog.conf(8) man page - condition: all - rules: - - 'c:grep -Rh ^\$ModLoad[[:space:]][[:space:]]*imtcp.so /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^$ModLoad\s*\t*imtcp.so' - - 'c:grep -Rh ^\$InputTCPServerRun[[:space:]][[:space:]]*514 /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^$InputTCPServerRun\s*\t*514' - -# 9 System Access, Authentication and Authorization - - - id: 1067 - title: "Enable cron Daemon" - description: "The cron daemon is used to execute batch jobs on the system." - rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run and cron is used to execute them." - remediation: "Enable cron: # update-rc.d cron enable Enable anacron: # update-rc.d anacron enable" - compliance: - - cis: ["9.1.1"] - condition: all - rules: - - 'c:find /etc/rc* -name *cron* -> r:S\.' - - 'c:find /etc/rc* -name *anacron* -> r:S\.' - - - id: 1068 - title: "Restrict at/cron to Authorized Users" - description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." - rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." - remediation: "# /bin/rm /etc/cron.deny # /bin/rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" - compliance: - - cis: ["9.1.8"] - condition: all - rules: - - 'f:/etc/cron.allow' - - 'f:/etc/at.allow' - - 'not f:/etc/cron.deny' - - 'not f:/etc/at.deny' - - 'c:stat -c%u-%g-%a /etc/cron.allow -> r:^0-0-600' - - 'c:stat -c%u-%g-%a /etc/at.allow -> r:^0-0-600' - - - id: 1069 - title: "Set Password Creation Requirement Parameters Using pam_cracklib" - description: "The pam_cracklib module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_cracklib.so options. # retry=3 - Allow 3 tries before sending back a failure. # minlen=14 - password must be 14 characters or more # dcredit=-1 - provide at least one digit # ucredit=-1 - provide at least one uppercase character # ocredit=-1 - provide at least one special character # lcredit=-1 - provide at least one lowercase character The setting shown above is one possible policy. Alter these values to conform to your own organization's password policies." - rationale: "Strong passwords protect systems from being hacked through brute force methods." - remediation: "1) Install the libpam-cracklib package: # apt-get install libpam-cracklib 2) Set the pam_cracklib.so parameters as follows in /etc/pam.d/common-password: password required pam_cracklib.so retry=3 minlen=14 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1" - compliance: - - cis: ["9.2.1"] - condition: all - rules: - - 'c:dpkg -s libpam-cracklib -> r:install ok installed' - - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_cracklib.so && r:retry=\d && n:minlen=(\d+) compare >= 14 && r:dcredit=-\d+ && r:ucredit=-\d+ && r:ocredit=-\d+ && r:lcredit=-\d+' - - - id: 1070 - title: "Set Lockout for Failed Password Attempts" - description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration file /etc/pam.d/login. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." - rationale: "Locking out userIDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." - remediation: "Edit the /etc/pam.d/login file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900 Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user." - compliance: - - cis: ["9.2.2"] - condition: all - rules: - - 'f:/etc/pam.d/login -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny=\d && r:unlock_time=\d\d\d+' - - - id: 1071 - title: "Limit Password Reuse" - description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." - rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." - remediation: "Set the pam_unix.so remember parameter to 5 in /etc/pam.d/common-password: password [success=1 default=ignore] pam_unix.so obscure sha512 remember=5 Note: The default password setting in this document is the last 5 passwords. Change this number to conform to your site's password policy." - compliance: - - cis: ["9.2.3"] - condition: all - rules: - - 'f:/etc/pam.d/common-password -> !r:^# && r:password && r:pam_unix.so && n:remember\s*\t*=\s*\t*(\d+) compare >= 5' - - - id: 1072 - title: "Set SSH Protocol to 2" - description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." - rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" - compliance: - - cis: ["9.3.1"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\s*\t*2' - - - id: 1073 - title: "Set LogLevel to INFO" - description: "The INFO parameter specifices that record login and logout activity will be logged." - rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" - compliance: - - cis: ["9.3.2"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:^\s*\t*LogLevel\s+INFO' - - - id: 1074 - title: "Disable SSH X11 Forwarding" - description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." - rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no" - compliance: - - cis: ["9.3.4"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> r:^X11Forwarding\s+no' - - - id: 1075 - title: "Set SSH MaxAuthTries to 4 or Less" - description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." - rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, it is set the number based on site policy." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" - compliance: - - cis: ["9.3.5"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> n:^MaxAuthTries\s*\t*(\d+) compare <= 4' - - - id: 1076 - title: "Set SSH IgnoreRhosts to Yes" - description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." - rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" - compliance: - - cis: ["9.3.6"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\s+yes' - - - id: 1077 - title: "Set SSH HostbasedAuthentication to No" - description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." - rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" - compliance: - - cis: ["9.3.7"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\s+no' - - - id: 1078 - title: "Disable SSH Root Login" - description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." - rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" - compliance: - - cis: ["9.3.8"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\s+no' - - - id: 1079 - title: "Set SSH PermitEmptyPasswords to No" - description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." - rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" - compliance: - - cis: ["9.3.9"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitEmptyPasswords\s+no' - - - id: 1080 - title: "Do Not Allow Users to Set Environment Options" - description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." - rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" - compliance: - - cis: ["9.3.10"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitUserEnvironment\s+no' - - - id: 1081 - title: "Set Idle Timeout Interval for User Login" - description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." - rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening.. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: ClientAliveInterval 300 ClientAliveCountMax 0" - compliance: - - cis: ["9.3.12"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && n:ClientAliveInterval\s*\t*(\d+) compare <= 300' - - 'f:/etc/ssh/sshd_config -> !r:^# && r:ClientAliveCountMax\s+0' - - - id: 1082 - title: "Limit Access via SSH" - description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." - rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." - remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " - compliance: - - cis: ["9.3.13"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' - - - id: 1083 - title: "Set SSH Banner" - description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." - rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Consult with your legal department for the appropriate warning banner for your site." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" - compliance: - - cis: ["9.3.14"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:Banner\s*\t*/etc/issue.net|^Banner\s\t*/etc/issue' - - - id: 1084 - title: "Restrict Access to the su Command" - description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the wheel group to execute su." - rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." - remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid 2) Once this is done, create a comma separated list of users in the wheel statement in the /etc/group file." - compliance: - - cis: ["9.5"] - condition: all - rules: - - 'f:/etc/pam.d/su -> !r:^# && r:auth && r:required && r:pam_wheel.so && r:use_uid' - - 'f:/etc/group -> !r:^# && r:wheel:' - -# 10 User Accounts and Environment - - - id: 1085 - title: "Set Password Expiration Days" - description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 90 days." - rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." - remediation: "Set the PASS_MAX_DAYS parameter to 90 in /etc/login.defs: PASS_MAX_DAYS 90 Modify user parameters for all users with a password set to match: # chage --maxdays 90 " - compliance: - - cis: ["10.1.1"] - condition: all - rules: - - 'f:/etc/login.defs -> n:^PASS_MAX_DAYS\s*\t*(\d+) compare <= 90' - - - id: 1086 - title: "Set Password Change Minimum Number of Days" - description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." - rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." - remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 Modify user parameters for all users with a password set to match: # chage --mindays 7 " - compliance: - - cis: ["10.1.2"] - condition: all - rules: - - 'f:/etc/login.defs -> n:^PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' - - - id: 1087 - title: "Set Password Expiring Warning Days" - description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." - rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." - remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 " - compliance: - - cis: ["10.1.3"] - condition: all - rules: - - 'f:/etc/login.defs -> n:^PASS_WARN_AGE\s*\t*(\d+) compare >= 7' - - - id: 1088 - title: "Set Default Group for root Account" - description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." - rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." - remediation: "# usermod -g 0 root" - compliance: - - cis: ["10.3"] - condition: all - rules: - - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' - - - id: 1089 - title: "Set Default umask for Users" - description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files (.profile, .bashrc, etc.) in their home directories." - rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system. Note: The directives in this section apply to bash and shell. If other shells are supported on the system, it is recommended that their configuration files also are checked." - remediation: "Edit the /etc/bash.bashrc and /etc/profile.d/cis.sh files (and the appropriate files for any other shell supported on your system) and add the following the UMASK parameter as shown: umask 077" - compliance: - - cis: ["10.4"] - condition: all - rules: - - 'c:grep -Rh ^umask[[:space:]][[:space:]]*077 /etc/profile.d/ -> !r:^# && r:umask\s*\t*077' - - 'f:/etc/bash.bashrc -> !r:^# && r:umask\s*\t*077' - - - id: 1090 - title: "Lock Inactive User Accounts" - description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 35 or more days be disabled." - rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." - remediation: "# useradd -D -f 35" - compliance: - - cis: ["10.5"] - condition: all - rules: - - 'f:/etc/default/useradd -> n:^INACTIVE=(\d+) compare <= 35' - -# 11 Warning Banners - - id: 1091 - title: "Set Warning Banner for Standard Login Services" - description: "The contents of the /etc/issue file are displayed prior to the login prompt on the system's console and serial devices, and also prior to logins via telnet. The contents of the /etc/motd file is generally displayed after all successful logins, no matter where the user is logging in from, but is thought to be less useful because it only provides notification to the user after the machine has been accessed." - rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Consult with your organization's legal counsel for the appropriate wording for your specific organization." - remediation: "# touch /etc/motd # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net # chown root:root /etc/motd # chmod 644 /etc/motd # chown root:root /etc/issue # chmod 644 /etc/issue # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" - compliance: - - cis: ["11.1"] - condition: all - rules: - - 'f:/etc/motd' - - 'f:/etc/issue' - - 'f:/etc/issue.net' - - 'c:stat -c%u-%g-%a /etc/motd -> 0-0-644' - - 'c:stat -c%u-%g-%a /etc/issue -> 0-0-644' - - 'c:stat -c%u-%g-%a /etc/issue.net -> 0-0-644' - - - id: 1092 - title: "Remove OS Information from Login Warning Banners" - description: "Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform." - rationale: "Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \"uname -a\" command once they have logged in." - remediation: "Edit the /etc/motd, /etc/issue and /etc/issue.net files and remove any lines containing \\m, \\r, \\s or \\v." - compliance: - - cis: ["11.2"] - condition: none - rules: - - 'f:/etc/issue -> r:\v|\r|\m|\s' - - 'f:/etc/motd -> r:\v|\r|\m|\s' - - 'f:/etc/issue.net -> r:\v|\r|\m|\s' - -# 13 Review User and Group Settings - - - id: 1093 - title: "Ensure Password Fields are Not Empty" - description: "An account with an empty password field means that anybody may log in as that user without providing a password." - rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." - remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # /usr/bin/passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." - compliance: - - cis: ["13.1"] - condition: none - rules: - - 'f:/etc/shadow -> r:^\w+::' - - - id: 1094 - title: "Verify No Legacy \"+\" Entries Exist in /etc/passwd File" - description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." - rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." - remediation: "Delete these entries if they exist." - compliance: - - cis: ["13.2"] - condition: none - rules: - - 'f:/etc/passwd -> !r:^# && r:^+:' - - - id: 1095 - title: "Verify No Legacy \"+\" Entries Exist in /etc/shadow File" - description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." - rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." - remediation: "Delete these entries if they exist." - compliance: - - cis: ["13.3"] - condition: none - rules: - - 'f:/etc/shadow -> !r:^# && r:^+:' - - id: 1096 - title: "Verify No Legacy \"+\" Entries Exist in /etc/group File" - description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." - rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." - remediation: "Delete these entries if they exist." - compliance: - - cis: ["13.4"] - condition: none - rules: - - 'f:/etc/group -> !r:^# && r:^+:' - - - id: 1097 - title: "Verify No UID 0 Accounts Exist Other Than root" - description: "Any account with UID 0 has superuser privileges on the system." - rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 9.4 Restrict root Login to System Console." - remediation: "Delete any other entries that are displayed." - compliance: - - cis: ["13.5"] - condition: none - rules: - - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' - - - id: 1098 - title: "Ensure shadow group is empty" - description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." - rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." - remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." - compliance: - - cis: ["13.20"] - condition: none - rules: - - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/sca/debian/cis_debian7_L2.yml b/sca/debian/cis_debian7_L2.yml deleted file mode 100644 index b1cb2f27b..000000000 --- a/sca/debian/cis_debian7_L2.yml +++ /dev/null @@ -1,430 +0,0 @@ -# Security Configuration Assessment -# Level 2 CIS Checks for Debian Linux 7 -# Copyright (C) 2015-2020, Wazuh Inc. -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License (version 2) as published by the FSF - Free Software -# Foundation -# -# Based on: -# Center for Internet Security Debian Linux 7 Benchmark v1.0.0 - 12-31-2015 - -policy: - id: "cis_debian7_L2" - file: "cis_debian7_L2.yml" - name: "CIS benchmark for Debian/Linux 7 L2" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 7." - references: - - https://www.cisecurity.org/cis-benchmarks/ - -requirements: - title: "Check Debian version" - description: "Requirements for running the SCA scan against Debian/Ubuntu." - condition: all - rules: - - 'f:/etc/debian_version' - - 'f:/proc/sys/kernel/ostype -> Linux' - -checks: - -# 2 Filesystem Configuration - - - id: 1500 - title: "Disable Mounting of cramfs Filesystems" - description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." - remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true" - compliance: - - cis: ["2.18"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v cramfs -> r:^install /bin/true' - - 'not c:/sbin/lsmod -> r:cramfs' - - - id: 1501 - title: "Disable Mounting of freevxfs Filesystems" - description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." - remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install freevxfs /bin/true" - compliance: - - cis: ["2.19"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v freevxfs -> r:^install /bin/true' - - 'not c:/sbin/lsmod -> r:freevxfs' - - - id: 1502 - title: "Disable Mounting of jffs2 Filesystems" - description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." - remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install jffs2 /bin/true" - compliance: - - cis: ["2.20"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v jffs2 -> r:^install /bin/true' - - 'not c:/sbin/lsmod -> r:jffs2' - - - id: 1503 - title: "Disable Mounting of hfs Filesystems" - description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." - remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfs /bin/true" - compliance: - - cis: ["2.21"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v hfs -> r:^install /bin/true' - - 'not c:/sbin/lsmod -> r:hfs' - - - id: 1504 - title: "Disable Mounting of hfsplus Filesystems" - description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." - remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfsplus /bin/true" - compliance: - - cis: ["2.22"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v hfsplus -> r:^install /bin/true' - - 'not c:/sbin/lsmod -> r:hfsplus' - - - id: 1505 - title: "Disable Mounting of squashfs Filesystems" - description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs). A squashfs image can be used without having to first decompress the image." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." - remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true" - compliance: - - cis: ["2.23"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v squashfs -> r:^install /bin/true' - - 'not c:/sbin/lsmod -> r:squashfs' - - - id: 1506 - title: "Disable Mounting of udf Filesystems" - description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats" - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." - remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true" - compliance: - - cis: ["2.24"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v udf -> r:^install /bin/true' - - 'not c:/sbin/lsmod -> r:udf' - -# 4 Additional Process Hardening - - - id: 1507 - title: "Activate AppArmor" - description: "AppArmor provides a Mandatory Access Control (MAC) system that greatly augments the default Discretionary Access Control (DAC) model." - rationale: "For an action to occur, both the traditional DAC permissions must be satisfied as well as the AppArmor MAC rules. The action will not be allowed if either one of these models does not permit the action. In this way, AppArmor rules can only make a system's permissions more restrictive and secure." - remediation: "Install apparmor and apparmor-utils if missing (additional profiles can be found in the apparmor-profiles package): # apt-get install apparmor apparmor-profiles apparmor-utils Add apparmor=1 and security=apparmor to GRUB_CMDLINE_LINUX in /etc/default/grub: GRUB_CMDLINE_LINUX=\"apparmor=1 security=apparmor\"Update grub configuration (reboot will be required to apply changes): # update-grub Set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." - compliance: - - cis: ["4.5"] - condition: all - rules: - - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' - - 'c:apparmor_status -> r:^0\s*processes are in complain mode' - - 'c:apparmor_status -> r:^0\s*processes are unconfined' - -# 8.1 Configure System Accounting (auditd) - - id: 1508 - title: "Configure Audit Log Storage Size" - description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." - rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." - remediation: "Set the max_log_file parameter in /etc/audit/auditd.conf max_log_file = Note: MB is the number of MegaBytes the file can be." - compliance: - - cis: ["8.1.1.1"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/auditd.conf' - - 'f:/etc/audit/auditd.conf -> r:max_log_file\s*=\s*\d+' - - - id: 1509 - title: "Disable System on Audit Log Full" - description: "The auditd daemon can be configured to halt the system when the audit logs are full." - rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." - remediation: "Add the following lines to the /etc/audit/auditd.conf file. space_left_action = email action_mail_acct = root admin_space_left_action = halt" - compliance: - - cis: ["8.1.1.2"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/auditd.conf' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*=\s*root' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*=\s*email' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*=\s*halt' - - - id: 1510 - title: "Keep All Auditing Information" - description: "Normally, auditd will hold 4 logs of maximum log file size before deleting older log files." - rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." - remediation: "Add the following line to the /etc/audit/auditd.conf file. max_log_file_action = keep_logs" - compliance: - - cis: ["8.1.1.3"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/auditd.conf' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*=\s*keep_logs' - - - id: 1511 - title: "Install and Enable auditd Service" - description: "Install and turn on the auditd daemon to record system events." - rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." - remediation: "Install auditd: # apt-get install auditd If needed enable auditd in /etc/rc*.d: # update-rc.d auditd enable" - compliance: - - cis: ["8.1.2"] - condition: all - rules: - - 'c:dpkg -s auditd -> r:install ok installed' - - 'c:find /etc/rc* -name *auditd* -> r:S\.' - - - id: 1512 - title: "Enable Auditing for Processes That Start Prior to auditd" - description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." - rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." - remediation: "Edit /etc/default/grub to include audit=1 as part of GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\"And run the following command to update the grub configuration: # update-grub" - compliance: - - cis: ["8.1.3"] - condition: all - rules: - - 'f:/etc/default/grub -> r:^GRUB_CMDLINE_LINUX\s*=\s*\p*audit\s*=\s*1\p*' - - - id: 1513 - title: "Record Events That Modify Date and Time Information" - description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"" - rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." - remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change # Execute the following command to restart auditd # pkill -P 1-HUP auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change # Execute the following command to restart auditd # pkill -P 1-HUP auditd" - compliance: - - cis: ["8.1.4"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit && r:-F arch=b64 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit && r:-F arch=b64 && r:-S clock_settime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/localtime && r:-p wa && r:-k time-change' - - - id: 1514 - title: "Record Events That Modify User/Group Information" - description: "Record events affecting the group, passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." - rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." - remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity # Execute the following command to restart auditd # pkill -P 1-HUP auditd" - compliance: - - cis: ["8.1.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/group && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/passwd && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/gshadow && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/shadow && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/security/opasswd && r:-p wa && r:-k identity' - - - id: 1515 - title: "Record Events That Modify the System's Network Environment" - description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed prelogin), /etc/hosts (file containing host names and associated IP addresses) and /etc/network (directory containing network interface scripts and configurations) files." - rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" - remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a exit,always -F arch=b64 -S sethostname -S setdomainname -k system-locale -a exit,always -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale # Execute the following command to restart auditd # pkill -P 1-HUP auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a exit,always -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale # Execute the following command to restart auditd # pkill -P 1-HUP auditd" - compliance: - - cis: ["8.1.6"] - condition: all - rules: - - 'f:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname -k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-a exit,always|always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/issue && r:-p wa && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/issue.net && r:-p wa && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/hosts && r:-p wa && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/network && r:-p wa && r:-k system-locale' - - - id: 1516 - title: "Record Events That Modify the System's Mandatory Access Controls" - description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux directory." - rationale: "Changes to files in this directory could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." - remediation: "Add the following lines to the /etc/audit/audit.rules file. Add the following lines to /etc/audit/audit.rules -w /etc/selinux/ -p wa -k MAC-policy # Execute the following command to restart auditd # pkill -P 1-HUP auditd" - compliance: - - cis: ["8.1.7"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/selinux/ && r:-p wa && r:-k MAC-policy' - - - id: 1517 - title: "Collect Login and Logout Events" - description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" - rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." - remediation: "Add the following lines to the /etc/audit/audit.&& r:rules file. -w /var/log/faillog -p wa -k logins -w /var/log/lastlog -p wa -k logins -w /var/log/tallylog -p wa -k logins # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" - compliance: - - cis: ["8.1.8"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w /var/log/faillog && r:-p wa && r:-k logins' - - 'f:/etc/audit/audit.rules -> r:^-w /var/log/lastlog && r:-p wa && r:-k logins' - - 'f:/etc/audit/audit.rules -> r:^-w /var/log/tallylog && r:-p wa && r:-k logins' - - - id: 1518 - title: "Collect Session Initiation Information" - description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. The /var/log/wtmp file tracks logins, logouts, shutdown and reboot events. All audit records will be tagged with the identifier \"session.\" The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier \"logins.\"" - rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." - remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session # Execute the following command to restart auditd # pkill -HUP -P 1 auditd Note: Use the last command to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp)" - compliance: - - cis: ["8.1.9"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w /var/run/utmp && r:-p wa && r:-k session' - - 'f:/etc/audit/audit.rules -> r:^-w /var/log/wtmp && r:-p wa && r:-k session' - - 'f:/etc/audit/audit.rules -> r:^-w /var/log/btmp && r:-p wa && r:-k session' - - - id: 1519 - title: "Collect Discretionary Access Control Permission Modification Events" - description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permis&& r:sions and attributes. The chmod, fchmod and fchmodat system calls affect the permissions associated with a file. The chown, fchown, fchownat and lchown system calls affect owner and group attributes on a file. The setxattr, lsetxattr, fsetxattr (set extended file attributes) and removexattr, lremovexattr, fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system userids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" - rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." - remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S \\ lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S \\ lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S \\ lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" - compliance: - - cis: ["8.1.10"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - - id: 1520 - title: "Collect Unsuccessful Unauthorized Access Attempts to Files" - description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation (creat), opening (open, openat) and truncation (truncate, ftruncate) of files. An audit log record will only be written if the user is a nonprivileged user (auid > = 500), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" - rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." - remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" - compliance: - - cis: ["8.1.11"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - - id: 1521 - title: "Collect Successful File System Mounts" - description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user" - rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." - remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" - compliance: - - cis: ["8.1.13"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' - - - id: 1522 - title: "Collect File Deletion Events by User" - description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." - rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." - remediation: "At a minimum, configure the audit system to collect file deletion events for all users and root. For 64 bit systems, add the following to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 \\ -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 \\ -F auid!=4294967295 -k delete # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 \\ -F auid!=4294967295 -k delete # Execute the following command to restart auditd # pkill -P 1-HUP auditd" - compliance: - - cis: ["8.1.14"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' - - - id: 1523 - title: "Collect Changes to System Administration Scope (sudoers)" - description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" - rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." - remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /etc/sudoers -p wa -k scope # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" - compliance: - - cis: ["8.1.15"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w /etc/sudoers && r:-p wa && r:-k scope' - - - id: 1524 - title: "Collect System Administrator Actions (sudolog)" - description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log. Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." - rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." - remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /var/log/sudo.log -p wa -k actions # Execute the following command to restart auditd # pkill -HUP -P 1 auditd Note: The system must be configured with su disabled (See Item 9.5 Restrict Access to the su Command) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root" - compliance: - - cis: ["8.1.16"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w /var/log/sudo.log && r:-p wa && r:-k actions' - - - id: 1525 - title: "Collect Kernel Module Loading and Unloading" - description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." - rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." - remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules For 32 bit systems, add -a always,exit -F arch=b32 -S init_module -S delete_module -k modules For 64 bit systems, add -a always,exit -F arch=b64 -S init_module -S delete_module -k modules" - compliance: - - cis: ["8.1.17"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w /sbin/insmod && r:-p x && r:-k modules' - - 'f:/etc/audit/audit.rules -> r:^-w /sbin/rmmod && r:-p x && r:-k modules' - - 'f:/etc/audit/audit.rules -> r:^-w /sbin/modprobe && r:-p x && r:-k modules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S init_module && r:-S delete_module && r:-k modules' - - - id: 1526 - title: "Make the Audit Configuration Immutable" - description: "Set system audit so that audit rules cannot be modified with auditctl. Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot" - rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." - remediation: "Add the following lines to the /etc/audit/audit.rules file. -e 2 Note: This must be the last line in the /etc/audit/audit.rules file" - compliance: - - cis: ["8.1.18"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-e 2$' - -# 8.3 Advanced Intrusion Detection Environment (AIDE) - - id: 1527 - title: "Install AIDE" - description: "In some installations, AIDE is not installed automatically" - rationale: "Install AIDE to make use of the file integrity features to monitor critical files for changes that could affect the security of the system." - remediation: "Install AIDE: # apt-get install aide Initialize AIDE: # aideinit # cp /var/lib/aide/aide.db.new /var/lib/aide/aide.db Note: The prelinking feature can interfere with AIDE because it alters binaries to speed up their start up times. Run /usr/sbin/prelink -ua to restore the binaries to their prelinked state, thus avoiding false positives from AIDE." - compliance: - - cis: ["8.3.1"] - condition: all - rules: - - 'c:dpkg -s aide -> r:install ok installed' - - - id: 1528 - title: "Implement Periodic Execution of File Integrity" - description: "Implement periodic file checking, in compliance with site policy" - rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." - remediation: "Execute the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check Note: The checking in this instance occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy." - compliance: - - cis: ["8.3.2"] - condition: all - rules: - - 'f:/etc/crontab -> r:\s*\t*/usr/sbin/aide\s*\t*--check' diff --git a/sca/debian/cis_debian8.yml b/sca/debian/cis_debian8.yml new file mode 100644 index 000000000..fbea3e625 --- /dev/null +++ b/sca/debian/cis_debian8.yml @@ -0,0 +1,3018 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 8 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Linux 8 Benchmark v2.0.0 - 12-28-2018 + +policy: + id: "cis_debian8" + file: "cis_debian8.yml" + name: "CIS Benchmark for Debian/Linux 8" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 8." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version" + description: "Requirements for running the SCA scan against Debian/Ubuntu." + condition: all + rules: + - 'f:/etc/debian_version' + - 'f:/proc/sys/kernel/ostype -> Linux' + +checks: +# 1.1.1 Disable unused filesystems + - id: 1500 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install cramfs /bin/true. 2) Run the following command to unload the cramfs module: # rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v cramfs -> r:^install /bin/true' + - 'not c:lsmod -> r:cramfs' + + - id: 1501 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install freevxfs /bin/true. 2) Run the following command to unload the freevxfs module: # rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v freevxfs -> r:^install /bin/true' + - 'not c:lsmod -> r:freevxfs' + + - id: 1502 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install jffs2 /bin/true. 2) Run the following command to unload the jffs2 module: # rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v jffs2 -> r:^install /bin/true' + - 'not c:lsmod -> r:jffs2' + + - id: 1503 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install hfs /bin/true. 2) Run the following command to unload the hfs module: # rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v hfs -> r:^install /bin/true' + - 'not c:lsmod -> r:hfs' + + - id: 1504 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install hfsplus /bin/true. 2) Run the following command to unload the hfsplus module: # rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v hfsplus -> r:^install /bin/true' + - 'not c:lsmod -> r:hfsplus' + + - id: 1505 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install squashfs /bin/true. 2) Run the following command to unload the squashfs module: # rmmod squashfs" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v squashfs -> r:^install /bin/true' + - 'not c:lsmod -> r:squashfs' + + - id: 1506 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install udf /bin/true. 2) Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v udf -> r:^install /bin/true' + - 'not c:lsmod -> r:udf' + +# 1.1.2 Filesystem Configuration + - id: 1507 + title: "Ensure /tmp is configured" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Configure /etc/fstab as appropriate or Run the following commands to enable systemd /tmp mounting: systemctl umask tmp.mount; systemctl enable tmp.mount. Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount." + compliance: + - cis: ["1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + - 'c:systemctl is-enabled tmp.mount -> enabled' + + - id: 1508 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 1509 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + + - id: 1510 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 1511 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + + - id: 1512 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.7"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + - id: 1513 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + - id: 1514 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + + + - id: 1515 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 1516 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 1517 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 1518 + title: "Ensure nodev option set on /home partition" + description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.13"] + - cis_csc: ["13", "15.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 1519 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + - id: 1520 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + - id: 1521 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /run/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + - id: 1522 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Disable autofs: # update-rc.d autofs disable" + compliance: + - cis: ["1.1.21"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled autofs -> enabled' + +# 1.3 Filesystem Integrity Checking + - id: 1523 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Install AIDE: # apt-get install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:dpkg -s aide -> r:install ok installed' + + - id: 1524 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Execute the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check. Note: The checking in this instance occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy." + compliance: + - cis: ["1.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:crontab -u root -l -> !r:^# && r:/usr/bin/aide && r:--check' + +# 1.4 Secure Boot Settings + - id: 1525 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: chown root:root /boot/grub/grub.cfg, chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\(0\w00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1526 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "1) Create an encrypted password with grub-md5-crypt: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is 2) Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file: cat <\" password_pbkdf2 EOF Unless the --unrestricted option is added to CLASS in /etc/grub.d/10_linux a password will be required to boot in addition to editing boot parameters: CLASS=\"--class gnu-linux --class gnu --class os --unrestricted\" 3) Run the following to update the grub configuration: # update-grub" + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 1527 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^root:*:|^root:!:' + +# 1.5 Additional Process Hardening + - id: 1528 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to the /etc/security/limits.conf file. * hard core 0 Add the following line to the /etc/sysctl.conf file: fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:=\s*\t*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + + - id: 1529 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + + - id: 1530 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Add the following line to the /etc/sysctl.conf file: kernel.randomize_va_space = 2 and run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:=\s*\t*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + - id: 1531 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && apt-get remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["3.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s prelink -> r:install ok installed' + +# 1.6 Configure SELinux + + + - id: 1532 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /etc/default/grub and remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\" GRUB_CMDLINE_LINUX=\"\" || Run the following command to update the grub2 configuration: # update-grub" + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:linux\.*selinux=0|linux\.*enforcing=0' + + - id: 1533 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled$' + - 'c:sestatus -> r:^Current mode:\s+enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + - id: 1534 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.6.1.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + - id: 1535 + title: "Ensure no unconfined daemons exist" + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.4"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk' + + - id: 1536 + title: "Ensure AppArmor is enabled in the bootloader configuration" + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwrittenby the bootloader boot parameters." + rationale: "AppArmor must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /etc/default/grub and add the appermor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX=\"apparmor=1 security=apparmor\" update the grub configuration # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["1.6.2.1"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:apparmor=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:security=apparmor' + + - id: 1537 + title: "Ensure all AppArmor Profiles are enforcing" + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.2.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' + - 'c:apparmor_status -> r:^0\s*processes are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + + - id: 1538 + title: "Ensure SELinux or AppArmor are installed" + description: "SELinux and AppArmor provide Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run one of the following commands to install SELinux or apparmor: # apt-get install selinux-basics Or: # apt-get install apparmor apparmor-profiles apparmor-utils" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'c:dpkg -s selinux-basics -> r:install ok installed' + - 'c:dpkg -s apparmor -> r:install ok installed' + + +# 1.7 Warning Banners + - id: 1539 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["13"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 1540 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m,\\r,\\s, or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["13"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 1541 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["13"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 1542 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1543 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1544 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1545 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add: [org/gnome/login-screen], banner-message-enable=true, banner-message-text='Authorized uses only. All activity may be monitored and reported.'" + compliance: + - cis: ["1.7.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^[org/gnome/login-screen]' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-enable=true' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-text=\.+' + + - id: 1546 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. Notes: Site policy may mandate a testing period before install onto production systems for available updates." + compliance: + - cis: ["1.8"] + - cis_csc: ["4.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6","SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: none + rules: + - 'c:apt-get -s upgrade -> r:^The following packages will be upgraded' + +# 2 Services + - id: 1547 + title: "Ensure xinetd is not installed" + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to disable xinetd: # apt-get remove xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s xinetd -> r:install ok installed' + + - id: 1548 + title: "Ensure inetd is not installed" + description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no inetd services required, it is recommended that the daemon be removed." + remediation: "Run the following commands to uninstall openbsd-inetd and inetutils-inetd: # apt-get remove openbsd-inetd # apt-get remove inetutils-inetd" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s openbsd-inetd -> r:install ok installed' + - 'c:dpkg -s inetutils-inetd -> r:install ok installed' + + - id: 1549 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available install NTP or chrony using one of the following commands: # apt-get install ntp # apt-get install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'c:dpkg -s ntp -> r:install ok installed' + - 'c:dpkg -s chrony -> r:install ok installed' + + - id: 1550 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery . Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + + - id: 1551 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." + remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server " + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony/chrony.conf -> r:^server\.+|^pool\.+' + + +# 2.2.2 Ensure the X Window system is not installed (Scored) + - id: 1552 + title: "Ensure the X Window system is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: apt-get remove xserver-xorg*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + - id: 1553 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled avahi-daemon -> enabled' + + - id: 1554 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups: # systemctl disable cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.cups.org + condition: none + rules: + - 'c:systemctl is-enabled cups -> enabled' + + - id: 1555 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following commands to disable dhcpd: # systemctl disable isc-dhcp-server # systemctl disable isc-dhcp-server6" + references: + - https://www.isc.org/dhcp/ + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled isc-dhcp-server -> enabled' + - 'c:systemctl is-enabled isc-dhcp-server6 -> enabled' + + - id: 1556 + title: "Ensure LDAP server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl disable slapd" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.openldap.org + condition: none + rules: + - 'c:systemctl is-enabled slapd -> enabled' + + - id: 1557 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind: # systemctl disable nfs-server # systemctl disable rpcbind" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled nfs-server -> enabled' + - 'c:systemctl is-enabled rpcbind -> enabled' + + - id: 1558 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable named: # systemctl disable bind9" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled bind9 -> enabled' + + - id: 1559 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl disable vsftpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled vsftpd -> enabled' + + - id: 1560 + title: "Ensure HTTP Server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable apache2: # systemctl disable apache2" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled apache2 -> enabled' + + - id: 1561 + title: "Ensure IMAP and POP3 server is not enabled" + description: "exim is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following commands to remove exim: # apt-get remove exim4; # apt-get purge exim4" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s exim4 -> r:install ok installed' + + - id: 1562 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable smbd: # systemctl disable smbd" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled smbd -> enabled' + + - id: 1563 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl disable squid" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled squid -> enabled' + + - id: 1564 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl disable snmpd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled snmpd -> enabled' + + - id: 1565 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + - id: 1566 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl disable rsync" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - 'c:systemctl is-enabled rsync -> enabled' + + - id: 1567 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable nis: # systemctl disable nis" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled nis -> enabled' + + - id: 1568 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall the nis package: # apt-get remove nis" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s nis -> r:install ok installed' + + - id: 1569 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rshpackage removes the clients for rsh, rcpand rlogin." + remediation: "Run the following command to uninstall rsh: apt-get remove rsh-client rsh-redone-client" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["3.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s rsh-client -> r:install ok installed' + - 'c:dpkg -s rsh-redone-client -> r:install ok installed' + + - id: 1570 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk: apt-get remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s talk -> r:install ok installed' + + - id: 1571 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet: # apt-get remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["3.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s telnet -> r:install ok installed' + + - id: 1572 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Uninstall ldap-utils using the appropriate package manager or manual installation: # apt-get remove ldap-utils" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s ldap-utils -> r:install ok installed' + +# 3 Network Configuration + - id: 1573 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 net.ipv6.conf.all.forwarding = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv6.conf.all.forwarding=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.forwarding /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + + - id: 1574 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + - id: 1575 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + + - id: 1576 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + - id: 1577 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + - id: 1578 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + - id: 1579 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + - id: 1580 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + - id: 1581 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing. + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + - id: 1582 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + - id: 1583 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.9"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + + - id: 1584 + title: "Install TCP Wrappers" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Install tcpd : # apt-get install tcpd Notes: To verify if a service supports TCP Wrappers, run the following command: # ldd | grep libwrap.so If there is any output, then the service supports TCP Wrappers." + compliance: + - cis: ["3.3.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:dpkg -s tcpd -> r:install ok installed' + + - id: 1585 + title: "Ensure /etc/hosts.allow is configured" + description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: "Run the following command to create /etc/hosts.allow: # echo \"ALL: /, /, ...\" >/etc/hosts.allow. Where each / combination (for example, \"192.168.1.0/255.255.255.0\") represents one network block in use by your organization that requires access to this system." + compliance: + - cis: ["3.3.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.allow' + + - id: 1586 + title: "Ensure /etc/hosts.deny is configured" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." + remediation: "Run the following command to create /etc/hosts.deny: # echo \"ALL: ALL\" >> /etc/hosts.deny" + compliance: + - cis: ["3.3.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.deny' + - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' + + - id: 1587 + title: "Verify permissions on /etc/hosts.allow" + description: "The /etc/hosts.allow file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : # chown root:root /etc/hosts.allow # chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 1588 + title: "Verify permissions on /etc/hosts.deny" + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : # chown root:root /etc/hosts.deny # chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + +# 3.4 Uncommon Network Protocols + + - id: 1589 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v dccp -> r:install /bin/true' + - 'c:lsmod -> r:dccp' + + - id: 1590 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v sctp -> r:install /bin/true' + - 'c:lsmod -> r:sctp' + + - id: 1591 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v rds -> r:install /bin/true' + - 'c:lsmod -> r:rds' + + - id: 1592 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v tipc -> r:install /bin/true' + - 'c:lsmod -> r:tipc' + +# 3.5 Firewall configuration + + - id: 1593 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L -> r:^Chain INPUT && r:policy DROP' + - 'c:iptables -L -> r:^Chain FORWARD && r:policy DROP' + - 'c:iptables -L -> r:^Chain OUTPUT && r:policy DROP' + + - id: 1594 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.5.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + + - id: 1595 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L -> r:^Chain INPUT && r:policy DROP' + - 'c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP' + - 'c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP' + + - id: 1596 + title: "Ensure IPv6 loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP" + compliance: + - cis: ["3.5.2.2"] + - cis_csc: ["9.1"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + - id: 1597 + title: "Ensure iptables is installed" + description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables." + rationale: "iptables is required for firewall management and configuration." + remediation: "Run the following command to install iptables: # apt-get install iptables" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:dpkg -s iptables -> r:install ok installed' + + +# 3.7 Disable IPv6 (Not Scored) + - id: 1598 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: "Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX=\"ipv6.disable=1\" Run the following command to update the grub2 configuration: # update-grub" + compliance: + - cis: ["3.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:ipv6.disable=1' + + + +# 4 Logging and Auditing + + - id: 1599 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.3"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + - id: 1600 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.3"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' + + - id: 1601 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.3"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + + - id: 1602 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl enable auditd" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1","10.7"] + - tsc: [CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled auditd -> enabled' + + - id: 1603 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "1) Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\" 2) Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.6","10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + - id: 1604 + title: "Ensure events that modify date and time information are collected" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"" + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.3", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change' + + - id: 1605 + title: "Ensure events that modify user/group information are collected" + description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/group && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity' + + - id: 1606 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale | -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale | -w /etc/issue -p wa -k system-locale | -w /etc/issue.net -p wa -k system-locale | -w /etc/hosts -p wa -k system-locale | -w /etc/sysconfig/network -p wa -k system-locale Notes: /etc/sysconfig/network is common to Red Hat and SUSE based distributions. You should expand or replace this coverage to any network configuration files on your system such as /etc/network on Debian based distributions. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale' + + - id: 1607 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux/AppArmor mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "On systems using SELinux add the following line to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy | -w /usr/share/selinux/ -p wa -k MAC-policy On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/selinux/ && r:-p wa && r:-k MAC-policy' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/usr/share/selinux/ && r:-p wa && r:-k MAC-policy' + + - id: 1608 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins' + + - id: 1609 + title: "Ensure session initiation information is collected" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"" + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7","AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins' + + - id: 1610 + title: "Ensure discretionary access control permission modification events are collected" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + + - id: 1611 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + + - id: 1612 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' + + - id: 1613 + title: "Ensure file deletion events by users are collected" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' + + - id: 1614 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope' + + - id: 1615 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1", "5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/sudo.log && r:-p wa && r:-k actions' + + - id: 1616 + title: "Ensure kernel module loading and unloading is collected" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.17"] + - cis_csc: ["3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S init_module && r:-S delete_module && r:-k modules' + + - id: 1617 + title: "Ensure the audit configuration is immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl. Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." + compliance: + - cis: ["4.1.18"] + - cis_csc: ["3", "6"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^\s*\t*-e 2$' + + + - id: 1618 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Run the following command to enable rsyslog: # systemctl enable rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:systemctl is-enabled rsyslog -> enabled' + +# 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 1619 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + - id: 1620 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host): *.* @@loghost.example.com. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'c:grep -Rh ^*.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* @@\.+' + + - id: 1621 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts" + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines:$ModLoad imtcp & $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["9.1"] + - pci_dss: ["10.5.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' + - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' + +# 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 1622 + title: "Ensure syslog-ng service is enabled" + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable rsyslog : # systemctl enable syslog-ng" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:systemctl is-enabled syslog-ng -> enabled' + +# 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 1623 + title: "Ensure syslog-ng default file permissions configured" + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(06\d0\)|perm\(04\d0\)|perm\(02\d0\)|perm\(00\d0\) && r:perm\(0\d40\)|perm\(0\d00\)' + +# 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 1624 + title: "Ensure syslog-ng is configured to send logs to a remote log host" + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp(\"logfile.example.com\" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng" + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:destination logserver' + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:log\.+source\.+destination' + +# 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 1625 + title: "Ensure rsyslog or syslog-ng is installed" + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # apt-get install rsyslog # apt-get install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: any + rules: + - 'c:dpkg -s rsyslog -> r:install ok installed' + - 'c:dpkg -s syslog-ng -> r:install ok installed' + +# 5 Access, Authentication and Authorization + - id: 1626 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: systemctl enable cron" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:systemctl is-enabled cron -> enabled' + + +# 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 1627 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/\w\w\w-------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 1628 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 1629 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 1630 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 1631 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 1632 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + + - id: 1633 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/cron.allow' + - 'f:/etc/at.allow' + - 'not f:/etc/cron.deny' + - 'not f:/etc/at.deny' + - 'c:stat -c%u-%g-%a /etc/cron.allow -> r:^0-0-\d00' + - 'c:stat -c%u-%g-%a /etc/at.allow -> r:^0-0-\d00' + +# 5.2 SSH Server Configuration + + - id: 1634 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -c%u-%g-%a /etc/ssh/sshd_config -> r:^0-0-\d00' + + - id: 1635 + title: "Ensure SSH Protocol is set to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:Protocol\s*2' + + - id: 1636 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:LogLevel\s+INFO|LogLevel\s+VERBOSE' + + - id: 1637 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["16"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + reference: + - 'https://www.ssh.com/ssh/sshd_config/' + condition: all + rules: + - 'c:sshd -T -> r:X11Forwarding\s+no' + + - id: 1638 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:MaxAuthTries\s*\t*(\d+) compare <= 4' + + - id: 1639 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:IgnoreRhosts\s+yes' + + - id: 1640 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:HostbasedAuthentication\s+no' + + - id: 1641 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["5.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitRootLogin\s+no' + + - id: 1642 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitEmptyPasswords\s+no' + + - id: 1643 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:PermitUserEnvironment\s+no' + +# 5.2.13 Ensure only strong ciphers are used (Scored) + - id: 1644 + title: "Ensure only strong ciphers are used" + description: "This variable limits the ciphers that SSH can use during communication." + rationale: "Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a \"Sweet32\" attack The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the \"Bar Mitzvah\" issue The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - 'https://nvd.nist.gov/vuln/detail/CVE-2016-2183' + - 'https://nvd.nist.gov/vuln/detail/CVE-2015-2808' + - 'https://nvd.nist.gov/vuln/detail/CVE-2008-5161' + - 'https://nvd.nist.gov/vuln/detail/CVE-2013-4548' + - 'https://www.kb.cert.org/vuls/id/565052' + - 'https://www.openssh.com/txt/cbc.adv' + condition: none + rules: + - 'c:sshd -T -> r:ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se' + +# 5.2.14 Ensure only sytrong MAC algorithms are used (Scored) + - id: 1645 + title: "Ensure only strong MAC algorithms are used" + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - 'http://www.mitls.org/pages/attacks/SLOTH' + condition: none + rules: + - 'c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com' + +# 5.2.15 Ensure only strong Key Exchange algorithms are used (Scored) + - id: 1646 + title: "Ensure only strong Key Exchange algorithms are used" + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: none + rules: + - 'c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1' + + + - id: 1647 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' + - 'c:sshd -T -> n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + +# 5.2.17 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 1648 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'c:sshd -T -> n:LoginGraceTime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + + - id: 1649 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["5.2.18"] + - cis_csc: ["5.1", "5.8"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'c:sshd -T -> r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' + + - id: 1650 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:Banner\s*\t*/etc/issue.net' + +# 5.3 Configure PAM + + - id: 1651 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Run the following command to install the pam_pwquality module: apt-get install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." + compliance: + - cis: ["5.3.1"] + - cis_csc: ["5.7", "16.12"] + - pci_dss: ["8.2.3"] + condition: all + rules: + - 'c:dpkg -s libpam-pwquality -> r:install ok installed' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=\d' + - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> !r:^# && r:dcredit' + - 'f:/etc/security/pwquality.conf -> !r:^# && r:ucredit' + - 'f:/etc/security/pwquality.conf -> !r:^# && r:ocredit' + - 'f:/etc/security/pwquality.conf -> !r:^# && r:lcredit' + + - id: 1652 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user. Notes: Use of the \"audit\" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization." + compliance: + - cis: ["5.3.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + + - id: 1653 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + +# 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 1654 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.14"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> r:^password\.+pam_unix.so && !r:sha512' + +# 5.4 User Accounts and Environment + + - id: 1655 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + - id: 1656 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + - id: 1657 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + - id: 1658 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + - id: 1659 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + +# 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 1660 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + +# 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 1661 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc, /etc/profile files, and /etc/profile.d*.sh (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not d:/etc/profile.d -> .sh -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/bash.bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'd:/etc/profile.d -> .sh -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/bash.bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + + - id: 1662 + title: "Ensure access to the su command is restricted" + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so 2) Create a comma separated list of users in the sudo statement in the /etc/group file: sudo:x:10:root, Notes: The use_uid option to pam_wheel.so is a no-op on debian based systems. It is acceptable but not required as these systems use its behavior as default." + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so' + - 'f:/etc/group -> !r:^# && r:sudo:\w+:\d+:\.' + +# 6.1.2 Ensure permissions on /etc/passwd are configured (Scored) + - id: 1663 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.3 Ensure permissions on /etc/shadow are configured (Scored) + - id: 1664 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set permissions on /etc/shadow : # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + +# 6.1.4 Configure /etc/group permissions (Scored) + - id: 1665 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.5 Ensure permissions on /etc/gshadow are configured (Scored) + - id: 1666 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following commands to set permissions on /etc/gshadow : # chown root:shadow /etc/gshadow # chmod o-rwx,g-wx /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + +# 6.1.6 Ensure permissions on /etc/passwd- are configured (Scored) + - id: 1667 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod u-x,go-wx /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.7 Ensure permissions on /etc/shadow- are configured (Scored) + - id: 1668 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/shadow- : # chown root:root /etc/shadow- # chown root:shadow /etc/shadow- # chmod o-rwx,g-rw /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\) && r:Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.8 Configure /etc/group- permissions (Scored) + - id: 1669 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.9 Ensure permissions on /etc/gshadow- are configured (Scored) + - id: 1670 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-wx /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\) && r:Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.2 User and Group Settings + + - id: 1671 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + - id: 1672 + title: "Ensure no legacy \"+\" entries exist in /etc/passwd" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && r:^+:' + + - id: 1673 + title: "Ensure no legacy \"+\" entries exist in /etc/shadow" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^+:' + + - id: 1674 + title: "Ensure no legacy \"+\" entries exist in /etc/group" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:^+:' + + - id: 1675 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + + - id: 1676 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["6.2.20"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/sca/debian/cis_debian8_L1.yml b/sca/debian/cis_debian8_L1.yml deleted file mode 100644 index 7e179b9b3..000000000 --- a/sca/debian/cis_debian8_L1.yml +++ /dev/null @@ -1,1362 +0,0 @@ -# Security Configuration Assessment -# Level 1 CIS Checks for Debian Linux 8 -# Copyright (C) 2015-2020, Wazuh Inc. -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License (version 2) as published by the FSF - Free Software -# Foundation -# -# Based on: -# Center for Internet Security Debian Linux 8 Benchmark v2.0.0 - 12-28-2018 - -policy: - id: "cis_debian8_L1" - file: "cis_debian8_L1.yml" - name: "CIS benchmark for Debian/Linux 8 L1" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 8." - references: - - https://www.cisecurity.org/cis-benchmarks/ - -requirements: - title: "Check Debian version" - description: "Requirements for running the SCA scan against Debian/Ubuntu." - condition: all - rules: - - 'f:/etc/debian_version' - - 'f:/proc/sys/kernel/ostype -> Linux' - -checks: -# 1.1.1 Disable unused filesystems - - id: 2000 - title: "Ensure mounting of cramfs filesystems is disabled" - description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." - remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install cramfs /bin/true. 2) Run the following command to unload the cramfs module: # rmmod cramfs" - compliance: - - cis: ["1.1.1.1"] - - cis_csc: ["13"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v cramfs -> r:^install /bin/true' - - 'not c:lsmod -> r:cramfs' - - - id: 2001 - title: "Ensure mounting of freevxfs filesystems is disabled" - description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install freevxfs /bin/true. 2) Run the following command to unload the freevxfs module: # rmmod freevxfs" - compliance: - - cis: ["1.1.1.2"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v freevxfs -> r:^install /bin/true' - - 'not c:lsmod -> r:freevxfs' - - - id: 2002 - title: "Ensure mounting of jffs2 filesystems is disabled" - description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install jffs2 /bin/true. 2) Run the following command to unload the jffs2 module: # rmmod jffs2" - compliance: - - cis: ["1.1.1.3"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v jffs2 -> r:^install /bin/true' - - 'not c:lsmod -> r:jffs2' - - - id: 2003 - title: "Ensure mounting of hfs filesystems is disabled" - description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install hfs /bin/true. 2) Run the following command to unload the hfs module: # rmmod hfs" - compliance: - - cis: ["1.1.1.4"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v hfs -> r:^install /bin/true' - - 'not c:lsmod -> r:hfs' - - - id: 2004 - title: "Ensure mounting of hfsplus filesystems is disabled" - description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install hfsplus /bin/true. 2) Run the following command to unload the hfsplus module: # rmmod hfsplus" - compliance: - - cis: ["1.1.1.5"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v hfsplus -> r:^install /bin/true' - - 'not c:lsmod -> r:hfsplus' - - - id: 2005 - title: "Ensure mounting of squashfs filesystems is disabled" - description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install squashfs /bin/true. 2) Run the following command to unload the squashfs module: # rmmod squashfs" - compliance: - - cis: ["1.1.1.6"] - - cis_csc: ["13"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v squashfs -> r:^install /bin/true' - - 'not c:lsmod -> r:squashfs' - - - id: 2006 - title: "Ensure mounting of udf filesystems is disabled" - description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install udf /bin/true. 2) Run the following command to unload the udf module: # rmmod udf" - compliance: - - cis: ["1.1.1.7"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v udf -> r:^install /bin/true' - - 'not c:lsmod -> r:udf' - -# 2 Filesystem Configuration - - id: 2007 - title: "Ensure /tmp is configured" - description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." - rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." - remediation: "Configure /etc/fstab as appropiate or Run the following commands to enable systemd /tmp mounting: systemctl umask tmp.mount; systemctl enable tmp.mount. Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount." - compliance: - - cis: ["1.1.2"] - - cis_csc: ["13", "5.1"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ - condition: all - rules: - - 'c:mount -> r:\s/tmp\s' - - - id: 2008 - title: "Ensure nodev option set on /tmp partition" - description: "The nodev mount option specifies that the filesystem cannot contain special devices." - rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /tmp" - compliance: - - cis: ["1.1.3"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:mount -> r:\s/tmp\s && r:nodev' - - - id: 2009 - title: "Ensure nosuid option set on /tmp partition" - description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." - rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." - remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nosuid /tmp" - compliance: - - cis: ["1.1.4"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:mount -> r:\s/tmp\s && r:nosuid' - - - id: 2010 - title: "Ensure nodev option set on /var/tmp partition" - description: "The nodev mount option specifies that the filesystem cannot contain special devices." - rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nodev /var/tmp" - compliance: - - cis: ["1.1.7"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:mount -> r:\s/var/tmp\s && r:nodev' - - - id: 2011 - title: "Ensure nosuid option set on /var/tmp partition" - description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." - rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." - remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" - compliance: - - cis: ["1.1.8"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:mount -> r:\s/var/tmp\s && r:nosuid' - - - id: 2012 - title: "Ensure noexec option set on /var/tmp partition" - description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." - rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." - remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" - compliance: - - cis: ["1.1.9"] - - cis_csc: ["2", "2.6"] - condition: all - rules: - - 'c:mount -> r:\s/var/tmp\s && r:noexec' - - - id: 2013 - title: "Ensure nodev option set on /home partition" - description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." - rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /home" - compliance: - - cis: ["1.1.13"] - - cis_csc: ["13", "15.1", "5.1"] - condition: all - rules: - - 'c:mount -> r:\s/home\s && r:nodev' - - - id: 2014 - title: "Ensure nodev option set on /dev/shm partition" - description: "The nodev mount option specifies that the filesystem cannot contain special devices." - rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" - compliance: - - cis: ["1.1.14"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:mount -> r:\s/dev/shm\s && r:nodev' - - - id: 2015 - title: "Ensure nosuid option set on /dev/shm partition" - description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." - rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." - remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" - compliance: - - cis: ["1.1.15"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:mount -> r:\s/dev/shm\s && r:nosuid' - - - id: 2016 - title: "Ensure noexec option set on /dev/shm partition" - description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." - rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." - remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /run/shm" - compliance: - - cis: ["1.1.16"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'c:mount -> r:\s/dev/shm\s && r:noexec' - - - id: 2017 - title: "Disable Automounting" - description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." - rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." - remediation: "Disable autofs: # update-rc.d autofs disable" - compliance: - - cis: ["1.1.21"] - - cis_csc: ["8.3", "8.4", "8.5"] - condition: none - rules: - - 'c:systemctl is-enabled autofs -> r:^enabled' - -# 1.3 Filesystem Integrity Checking - - id: 2018 - title: "Ensure AIDE is installed" - description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." - rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." - remediation: "Install AIDE: # apt-get install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit" - compliance: - - cis: ["1.3.1"] - - cis_csc: ["3.5", "14.9"] - condition: all - rules: - - 'c:dpkg -s aide -> r:install ok installed' - - - id: 2019 - title: "Ensure filesystem integrity is regularly checked" - description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." - rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." - remediation: "Execute the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check. Note: The checking in this instance occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy." - compliance: - - cis: ["1.3.2"] - - cis_csc: ["3.5", "14.9"] - condition: all - rules: - - 'c:grep -Rh aide /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab -> r:\.+' - -# 1.4 Secure Boot Settings - - id: 2020 - title: "Ensure bootloader password is set" - description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." - rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." - remediation: "1) Create an encrypted password with grub-md5-crypt: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is 2) Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file: cat <\" password_pbkdf2 EOF Unless the --unrestricted option is added to CLASS in /etc/grub.d/10_linux a password will be required to boot in addition to editing boot parameters: CLASS=\"--class gnu-linux --class gnu --class os --unrestricted\" 3) Run the following to update the grub configuration: # update-grub" - compliance: - - cis: ["1.4.2"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' - - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' - - - id: 2021 - title: "Ensure authentication required for single user mode" - description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." - rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." - remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" - compliance: - - cis: ["1.4.3"] - - cis_csc: ["5.1"] - condition: none - rules: - - 'f:/etc/shadow -> r:^root:*:|^root:!:' - -# 1.5 Additional Process Hardening - - id: 2022 - title: "Ensure core dumps are restricted" - description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." - rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." - remediation: "Add the following line to the /etc/security/limits.conf file. * hard core 0 Add the following line to the /etc/sysctl.conf file: fs.suid_dumpable = 0 and set the active kernel parameter." - compliance: - - cis: ["1.5.1"] - - cis_csc: ["13"] - condition: all - rules: - - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' - - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:=\s*\t*0$' - - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' - - - id: 2023 - title: "Ensure address space layout randomization (ASLR) is enabled" - description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." - rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." - remediation: "Add the following line to the /etc/sysctl.conf file: kernel.randomize_va_space = 2 and run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" - compliance: - - cis: ["1.5.3"] - - cis_csc: ["8.3", "8.4"] - condition: all - rules: - - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:\s*\t*2$' - - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' - -# 1.7 Warning Banners - - id: 2024 - title: "Ensure local login warning banner is configured properly" - description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" - rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." - remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m,\\r,\\s, or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" - compliance: - - cis: ["1.7.1.2"] - - cis_csc: ["13", "5.1"] - condition: none - rules: - - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' - - - id: 2025 - title: "Ensure GDM login banner is configured" - description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." - rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." - remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add: [org/gnome/login-screen], banner-message-enable=true, banner-message-text='Authorized uses only. All activity may be monitored and reported.'" - compliance: - - cis_csc: ["5.1"] - - cis: ["1.7.2"] - - pci_dss: ["2.2.2"] - - nist_800_53: ["CM.1"] - condition: all - rules: - - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^[org/gnome/login-screen]' - - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-enable=true' - - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-text=\.+' - -# 2 Services - - id: 2026 - title: "Ensure xinetd is not installed" - description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." - rationale: "If there are no xinetdservices required, it is recommended that the daemon be disabled." - remediation: "Run the following command to disable xinetd: # apt-get remove xinetd" - compliance: - - cis: ["2.1.1"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:dpkg -s xinetd -> r:install ok installed' - - - id: 2027 - title: "Ensure inetd is not installed" - description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." - rationale: "If there are no inetd services required, it is recommended that the daemon be removed." - remediation: "Run the following commands to uninstall openbsd-inetd and inetutils-inetd: # apt-get remove openbsd-inetd # apt-get remove inetutils-inetd" - compliance: - - cis: ["2.1.2"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:dpkg -s openbsd-inetd -> r:install ok installed' - - 'c:dpkg -s inetutils-inetd -> r:install ok installed' - - - id: 2028 - title: "Ensure ntp is configured" - description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." - rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." - remediation: "Remediation: Install ntp: # apt-get install ntp Ensure the following lines are in /etc/ntp.conf: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Also, make sure /etc/ntp.conf has at least one NTP server specified: server Note: is the IP address or hostname of a trusted time server. Configuring an NTP server is outside the scope of this benchmark." - compliance: - - cis: ["2.2.1.2"] - - cis_csc: ["6.1"] - references: - - http://www.ntp.org/ - condition: all - rules: - - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' - - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' - - 'f:/etc/ntp.conf -> r:^server\.+$|^pool\.+$' - - 'f:/etc/ntp.conf -> r:^server\s\.+' - - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' - - - id: 2029 - title: "Ensure chrony is configured" - description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." - rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." - remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server " - compliance: - - cis: ["2.2.1.3"] - - cis_csc: ["6.1"] - condition: all - rules: - - 'f:/etc/chrony.conf -> r:^server\.+$|^pool\.+$' - - - id: 2030 - title: "Ensure Avahi Server is not enabled" - description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." - rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." - remediation: "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" - compliance: - - cis: ["2.2.3"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled avahi-daemon -> r:^enabled' - - - id: 2031 - title: "Ensure CUPS is not enabled" - description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." - rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable cups: # systemctl disable cups" - compliance: - - cis: ["2.2.4"] - - cis_csc: ["9.1", "9.2"] - references: - - https://www.cups.org - condition: none - rules: - - 'c:systemctl is-enabled cups -> r:^enabled' - - - id: 2032 - title: "Ensure DHCP Server is not enabled" - description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." - rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." - remediation: "Run the following commands to disable dhcpd: # systemctl disable isc-dhcp-server # systemctl disable isc-dhcp-server6" - references: - - https://www.isc.org/dhcp/ - compliance: - - cis: ["2.2.5"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled isc-dhcp-server -> r:^enabled' - - 'c:systemctl is-enabled isc-dhcp-server6 -> r:^enabled' - - - id: 2033 - title: "Ensure LDAP server is not enabled" - description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." - rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable slapd: # systemctl disable slapd" - compliance: - - cis: ["2.2.6"] - - cis_csc: ["9.1", "9.2"] - references: - - https://www.openldap.org - condition: none - rules: - - 'c:systemctl is-enabled slapd -> r:^enabled' - - - id: 2034 - title: "Ensure NFS and RPC are not enabled" - description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." - rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." - remediation: "Run the following commands to disable nfs and rpcbind: # systemctl disable nfs-server # systemctl disable rpcbind" - compliance: - - cis: ["2.2.7"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled nfs-server -> r:^enabled' - - 'c:systemctl is-enabled rpcbind -> r:^enabled' - - - id: 2035 - title: "Ensure DNS Server is not enabled" - description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." - rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable named: # systemctl disable bind9" - compliance: - - cis: ["2.2.8"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled bind9 -> r:^enabled' - - - id: 2036 - title: "Ensure FTP Server is not enabled" - description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." - rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable vsftpd: # systemctl disable vsftpd" - compliance: - - cis: ["2.2.9"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled vsftpd -> r:^enabled' - - - id: 2037 - title: "Ensure HTTP Server is not enabled" - description: "HTTP or web servers provide the ability to host web site content." - rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable apache2: # systemctl disable apache2" - compliance: - - cis: ["2.2.10"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled apache2 -> r:^enabled' - - - id: 2038 - title: "Ensure IMAP and POP3 server is not enabled" - description: "exim is an open source IMAP and POP3 server for Linux based systems." - rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." - remediation: "Run the following commands to remove exim: # apt-get remove exim4; # apt-get purge exim4" - compliance: - - cis_csc: ["9.2"] - - cis: ["2.2.11"] - - pci_dss: ["2.2.2"] - - nist_800_53: ["CM.1"] - condition: none - rules: - - 'c:dpkg -s exim4 -> r:install ok installed' - - - id: 2039 - title: "Ensure Samba is not enabled" - description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." - rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable smbd: # systemctl disable smbd" - compliance: - - cis: ["2.2.12"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled smbd -> r:^enabled' - - - id: 2040 - title: "Ensure HTTP Proxy Server is not enabled" - description: "Squid is a standard proxy server used in many distributions and environments." - rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable squid: # systemctl disable squid" - compliance: - - cis: ["2.2.13"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled squid -> r:^enabled' - - - id: 2041 - title: "Ensure SNMP Server is not enabled" - description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." - rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." - remediation: "Run the following command to disable snmpd: # systemctl disable snmpd" - compliance: - - cis: ["2.2.14"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled snmpd -> r:^enabled' - - - id: 2042 - title: "Ensure rsync service is not enabled" - description: "The rsyncd service can be used to synchronize files between systems over network links." - rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." - remediation: "Run the following command to disable rsync: # systemctl disable rsync" - compliance: - - cis: ["2.2.16"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'c:systemctl is-enabled rsync -> r:^enabled' - - - id: 2043 - title: "Ensure NIS Server is not enabled" - description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." - rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" - remediation: "Run the following command to disable nis: # systemctl disable nis" - compliance: - - cis_csc: ["9.2"] - - cis: ["2.2.17"] - - pci_dss: ["2.2.2"] - - nist_800_53: ["CM.1"] - condition: none - rules: - - 'c:systemctl is-enabled nis -> r:^enabled' - - - id: 2044 - title: "Ensure NIS Client is not installed" - description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." - rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." - remediation: "Uninstall the nis package: # apt-get remove nis" - compliance: - - cis: ["2.3.1"] - - cis_csc: ["2", "2.6"] - condition: none - rules: - - 'c:dpkg -s nis -> r:install ok installed' - - - id: 2045 - title: "Ensure rsh client is not installed" - description: "The rshpackage contains the client commands for the rsh services." - rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rshpackage removes the clients for rsh, rcpand rlogin." - remediation: "Run the following command to uninstall rsh: apt-get remove rsh-client rsh-redone-client" - compliance: - - cis: ["2.3.2"] - - cis_csc: ["3.4", "4.5"] - condition: none - rules: - - 'c:dpkg -s rsh-client -> r:install ok installed' - - 'c:dpkg -s rsh-redone-client -> r:install ok installed' - - - id: 2046 - title: "Ensure talk client is not installed" - description: "The talksoftware makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." - rationale: "The software presents a security risk as it uses unencrypted protocols for communication." - remediation: "Run the following command to uninstall talk: apt-get remove talk" - compliance: - - cis: ["2.3.3"] - - cis_csc: ["2", "2.6"] - condition: none - rules: - - 'c:dpkg -s talk -> r:install ok installed' - - - id: 2047 - title: "Ensure telnet client is not installed" - description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." - rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." - remediation: "Run the following command to uninstall telnet: # apt-get remove telnet" - compliance: - - cis: ["2.3.4"] - - cis_csc: ["3.4", "4.5"] - condition: none - rules: - - 'c:dpkg -s telnet -> r:install ok installed' - -# 3 Network Configuration - - id: 2048 - title: "Ensure IP forwarding is disabled" - description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." - rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 net.ipv6.conf.all.forwarding = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv6.conf.all.forwarding=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["3.1.1"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' - - 'c:sysctl net.ipv6.conf.all.forwarding -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv6\.conf\.all\.forwarding /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' - - - id: 2049 - title: "Ensure packet redirect sending is disabled" - description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." - rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." - remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.1.2"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' - - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' - - - id: 2050 - title: "Ensure source routed packets are not accepted" - description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." - rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["3.2.1"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' - - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' - - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:=\s*\t*0$' - - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' - - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' - - - id: 2051 - title: "Ensure ICMP redirects are not accepted" - description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." - rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["3.2.2"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' - - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' - - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' - - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' - - - id: 2052 - title: "Ensure secure ICMP redirects are not accepted" - description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." - rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.3"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' - - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' - - - id: 2053 - title: "Ensure suspicious packets are logged" - description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." - rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.4"] - - cis_csc: ["6", "6.2", "6.3"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' - - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' - - - id: 2054 - title: "Ensure broadcast ICMP requests are ignored" - description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." - rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.5"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' - - - id: 2055 - title: "Ensure bogus ICMP responses are ignored" - description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." - rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.6"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' - - - id: 2056 - title: "Ensure Reverse Path Filtering is enabled" - description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." - rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing. - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.7"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' - - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' - - - id: 2057 - title: "Ensure TCP SYN Cookies is enabled" - description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." - rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.8"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' - - - id: 2058 - title: "Ensure IPv6 router advertisements are not accepted" - description: "This setting disables the systems ability to accept router advertisements" - rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["3.2.9"] - - cis_csc: ["3", "11", "5.1"] - condition: all - rules: - - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' - - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' - - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' - - - id: 2059 - title: "Ensure /etc/hosts.allow is configured" - description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." - rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." - remediation: "Run the following command to create /etc/hosts.allow: # echo \"ALL: /, /, ...\" >/etc/hosts.allow. Where each / combination (for example, \"192.168.1.0/255.255.255.0\") represents one network block in use by your organization that requires access to this system." - compliance: - - cis: ["3.3.2"] - - cis_csc: ["9.2", "9.4"] - condition: all - rules: - - 'f:/etc/hosts.allow' - - - id: 2060 - title: "Ensure /etc/hosts.deny is configured" - description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." - rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." - remediation: "Run the following command to create /etc/hosts.deny: # echo \"ALL: ALL\" >> /etc/hosts.deny" - compliance: - - cis: ["3.3.3"] - - cis_csc: ["9.2", "9.4"] - condition: all - rules: - - 'f:/etc/hosts.deny' - - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' - - - id: 2061 - title: "Ensure DCCP is disabled" - description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." - rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" - compliance: - - cis: ["3.4.1"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'not c:modprobe -n -v dccp -> r:install /bin/true' - - 'c:lsmod -> r:dccp' - - - id: 2062 - title: "Ensure SCTP is disabled" - description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." - rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" - compliance: - - cis: ["3.4.2"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'not c:modprobe -n -v sctp -> r:install /bin/true' - - 'c:lsmod -> r:sctp' - - - id: 2063 - title: "Ensure RDS is disabled" - description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." - rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" - compliance: - - cis: ["3.4.3"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'not c:modprobe -n -v rds -> r:install /bin/true' - - 'c:lsmod -> r:rds' - - - id: 2064 - title: "Ensure TIPC is disabled" - description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." - rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" - compliance: - - cis: ["3.4.4"] - - cis_csc: ["9.1", "9.2"] - condition: none - rules: - - 'not c:modprobe -n -v tipc -> r:install /bin/true' - - 'c:lsmod -> r:tipc' - -# 3.5 Firewall configuration - - - id: 2065 - title: "Ensure default deny firewall policy" - description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." - rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." - remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." - compliance: - - cis: ["3.5.1.1"] - - cis_csc: ["9.1", "9.4"] - condition: all - rules: - - 'c:iptables -L -> r:^Chain INPUT && r:policy DROP' - - 'c:iptables -L -> r:^Chain FORWARD && r:policy DROP' - - 'c:iptables -L -> r:^Chain OUTPUT && r:policy DROP' - - - id: 2066 - title: "Ensure IPv6 default deny firewall policy" - description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." - rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." - remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." - compliance: - - cis: ["3.5.2.1"] - - cis_csc: ["9.1", "9.4"] - condition: all - rules: - - 'c:ip6tables -L -> r:^Chain INPUT && r:policy DROP' - - 'c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP' - - 'c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP' - - - id: 2067 - title: "Ensure iptables is installed" - description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables." - rationale: "iptables is required for firewall management and configuration." - remediation: "Run the following command to install iptables: # apt-get install iptables" - compliance: - - cis: ["3.5.3"] - - cis_csc: ["9.2", "9.4"] - condition: all - rules: - - 'c:dpkg -s iptables -> r:install ok installed' - -# 4 Logging and Auditing - - id: 2068 - title: "Ensure rsyslog Service is enabled" - description: "Once the rsyslog package is installed it needs to be activated." - rationale: "If the rsyslog service is not activated the system will not have a syslog service running." - remediation: "Run the following command to enable rsyslog: # systemctl enable rsyslog" - compliance: - - cis: ["4.2.1.1"] - - cis_csc: ["6.2", "6.3"] - condition: all - rules: - - 'c:systemctl is-enabled rsyslog -> r:^enabled' - - - id: 2069 - title: "Ensure rsyslog is configured to send logs to a remote log host" - description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." - rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." - remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host): *.* @@loghost.example.com. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" - compliance: - - cis: ["4.2.1.4"] - - cis_csc: ["6.6", "6.8"] - references: - - rsyslog.conf(5) man page - condition: all - rules: - - 'c:grep -Rh ^*.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* @@\.+' - - - id: 2070 - title: "Ensure remote rsyslog messages are only accepted on designated log hosts" - description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." - rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." - remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines:$ModLoad imtcp & $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" - compliance: - - cis: ["4.2.1.5"] - - cis_csc: ["9.1", "9.2"] - references: - - rsyslog.conf(8) man page - condition: all - rules: - - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' - - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' - -# 5 Access, Authentication and Authorization - - id: 2071 - title: "Ensure cron daemon is enabled" - description: "The cron daemon is used to execute batch jobs on the system." - rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." - remediation: "Run the following command to enable cron: systemctl enable cron" - compliance: - - cis: ["5.1.1"] - - cis_csc: ["6", "5.1"] - condition: all - rules: - - 'c:systemctl is-enabled cron -> r:^enabled$' - - - id: 2072 - title: "Ensure at/cron is restricted to authorized users" - description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." - rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." - remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" - compliance: - - cis: ["5.1.8"] - - cis_csc: ["16"] - condition: all - rules: - - 'f:/etc/cron.allow' - - 'f:/etc/at.allow' - - 'not f:/etc/cron.deny' - - 'not f:/etc/at.deny' - - 'c:stat -c%u-%g-%a /etc/cron.allow -> r:^0-0-600' - - 'c:stat -c%u-%g-%a /etc/at.allow -> r:^0-0-600' - - - id: 2073 - title: "Ensure permissions on /etc/ssh/sshd_config are configured" - description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." - rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." - remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" - compliance: - - cis: ["5.2.1"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:stat -c%u-%g-%a /etc/ssh/sshd_config -> r:^0-0-600' - - - id: 2074 - title: "Ensure SSH Protocol is set to 2" - description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." - rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" - compliance: - - cis: ["5.2.4"] - - cis_csc: ["3.4", "4.5"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\s*\t*2' - - - id: 2075 - title: "Ensure SSH LogLevel is appropriate" - description: "INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." - rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" - references: - - https://www.ssh.com/ssh/sshd_config/ - compliance: - - cis: ["5.2.5"] - - cis_csc: ["16", "6.2", "6.3"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:LogLevel\s+INFO|LogLevel\s+VERBOSE' - - - id: 2076 - title: "Ensure SSH X11 forwarding is disabled" - description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." - rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." - remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" - compliance: - - cis: ["5.2.6"] - - cis_csc: ["16", "9.2"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:X11Forwarding\s+no' - - - id: 2077 - title: "Ensure SSH MaxAuthTries is set to 4 or less" - description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." - rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" - compliance: - - cis: ["5.2.7"] - - cis_csc: ["16", "16.13"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' - - - id: 2078 - title: "Ensure SSH IgnoreRhosts is enabled" - description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." - rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" - compliance: - - cis: ["5.2.8"] - - cis_csc: ["9", "9.2"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\s+yes' - - - id: 2079 - title: "Ensure SSH HostbasedAuthentication is disabled" - description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." - rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" - compliance: - - cis: ["5.2.9"] - - cis_csc: ["9", "16.3"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\s+no' - - - id: 2080 - title: "Ensure SSH root login is disabled" - description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." - rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" - compliance: - - cis: ["5.2.10"] - - cis_csc: ["5.8", "4.3"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\s+no' - -# 5.2 SSH Server Configuration - - - id: 2081 - title: "Ensure SSH PermitEmptyPasswords is disabled" - description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." - rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" - compliance: - - cis: ["5.2.11"] - - cis_csc: ["16", "16.3"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitEmptyPasswords\s+no' - - - id: 2082 - title: "Ensure SSH PermitUserEnvironment is disabled" - description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." - rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" - compliance: - - cis: ["5.2.12"] - - cis_csc: ["16", "5.1"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitUserEnvironment\s+no' - - - id: 2083 - title: "Ensure SSH Idle Timeout Interval is configured" - description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." - rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" - compliance: - - cis: ["5.2.16"] - - cis_csc: ["16.4", "16.11"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' - - 'f:/etc/ssh/sshd_config -> !r:^# && n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' - - - id: 2084 - title: "Ensure SSH access is limited" - description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." - rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." - remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " - compliance: - - cis: ["5.2.18"] - - cis_csc: ["5.1", "5.8", "4.3"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' - - - id: 2085 - title: "Ensure SSH warning banner is configured" - description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." - rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" - compliance: - - cis: ["5.2.19"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:Banner\s*\t*/etc/issue.net|Banner\s\t*/etc/issue' - -# 5.3 Configure PAM - - - id: 2086 - title: "Ensure password creation requirements are configured" - description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" - rationale: "Strong passwords protect systems from being hacked through brute force methods." - remediation: "1) Run the following command to install the pam_pwquality module: apt-get install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." - compliance: - - cis: ["5.3.1"] - - cis_csc: ["5.7", "16.12", "4.4"] - condition: all - rules: - - 'c:dpkg -s libpam-pwquality -> r:install ok installed' - - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=\d' - - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' - - 'f:/etc/security/pwquality.conf -> !r:^# && r:dcredit' - - 'f:/etc/security/pwquality.conf -> !r:^# && r:ucredit' - - 'f:/etc/security/pwquality.conf -> !r:^# && r:ocredit' - - 'f:/etc/security/pwquality.conf -> !r:^# && r:lcredit' - - - id: 2087 - title: "Ensure lockout for failed password attempts is configured" - description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." - rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." - remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user. Notes: Use of the \"audit\" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization." - compliance: - - cis: ["5.3.2"] - - cis_csc: ["16.7"] - condition: all - rules: - - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d && r:unlock_time\s*=\s*\d\d\d+' - - - id: 2088 - title: "Ensure password reuse is limited" - description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." - rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." - remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." - compliance: - - cis: ["5.3.3"] - - cis_csc: ["16"] - condition: all - rules: - - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare >= 5' - -# 5.4 User Accounts and Environment - - - id: 2089 - title: "Ensure password expiration is 365 days or less" - description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." - rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." - remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." - compliance: - - cis: ["5.4.1.1"] - - cis_csc: ["4.4", "16"] - condition: all - rules: - - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' - - - id: 2090 - title: "Ensure minimum days between password changes is 7 or more" - description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." - rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." - remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." - compliance: - - cis: ["5.4.1.2"] - - cis_csc: ["4.4", "16"] - condition: all - rules: - - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' - - - id: 2091 - title: "Ensure password expiration warning days is 7 or more" - description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." - rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." - remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." - compliance: - - cis: ["5.4.1.3"] - - cis_csc: ["4.4", "16"] - condition: all - rules: - - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' - - - id: 2092 - title: "Ensure inactive password lock is 30 days or less" - description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." - rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." - remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." - compliance: - - cis: ["5.4.1.4"] - - cis_csc: ["4.4", "16"] - condition: all - rules: - - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' - - - id: 2093 - title: "Ensure default group for the root account is GID 0" - description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." - rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." - remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" - compliance: - - cis: ["5.4.3"] - - cis_csc: ["5", "5.1"] - condition: all - rules: - - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' - - - id: 2094 - title: "Ensure access to the su command is restricted" - description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su." - rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." - remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so 2) Create a comma separated list of users in the sudo statement in the /etc/group file: sudo:x:10:root, Notes: The use_uid option to pam_wheel.so is a no-op on debian based systems. It is acceptable but not required as these systems use its behavior as default." - compliance: - - cis: ["5.6"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so' - - 'f:/etc/group -> !r:^# && r:sudo:\w+:\d+:\.' - -# 6.2 User and Group Settings - - - id: 2095 - title: "Ensure password fields are not empty" - description: "An account with an empty password field means that anybody may log in as that user without providing a password." - rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." - remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." - compliance: - - cis: ["6.2.1"] - - cis_csc: ["16", "4.4"] - condition: none - rules: - - 'f:/etc/shadow -> r:^\w+::' - - - id: 2096 - title: "Ensure no legacy \"+\" entries exist in /etc/passwd" - description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." - rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." - remediation: "Remove any legacy + entries from /etc/passwd if they exist." - compliance: - - cis: ["6.2.2"] - - cis_csc: ["16.9", "16.2"] - condition: none - rules: - - 'f:/etc/passwd -> !r:^# && r:^+:' - - - id: 2097 - title: "Ensure no legacy \"+\" entries exist in /etc/shadow" - description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." - rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." - remediation: "Remove any legacy + entries from /etc/shadow if they exist." - compliance: - - cis: ["6.2.3"] - - cis_csc: ["16.9", "16.2"] - condition: none - rules: - - 'f:/etc/shadow -> !r:^# && r:^+:' - - - id: 2098 - title: "Ensure no legacy \"+\" entries exist in /etc/group" - description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." - rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." - remediation: "Remove any legacy + entries from /etc/group if they exist." - compliance: - - cis: ["6.2.4"] - - cis_csc: ["16.9", "16.2"] - condition: none - rules: - - 'f:/etc/group -> !r:^# && r:^+:' - - - id: 2099 - title: "Ensure root is the only UID 0 account" - description: "Any account with UID 0 has superuser privileges on the system." - rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." - remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." - compliance: - - cis: ["6.2.5"] - - cis_csc: ["5.1"] - condition: none - rules: - - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' - - - id: 2100 - title: "Ensure shadow group is empty" - description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." - rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." - remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." - compliance: - - cis: ["6.2.20"] - - cis_csc: ["5.1"] - condition: none - rules: - - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/sca/debian/cis_debian8_L2.yml b/sca/debian/cis_debian8_L2.yml deleted file mode 100644 index 82428c2e8..000000000 --- a/sca/debian/cis_debian8_L2.yml +++ /dev/null @@ -1,466 +0,0 @@ -# Security Configuration Assessment -# Level 2 CIS Checks for Debian Linux 8 -# Copyright (C) 2015-2020, Wazuh Inc. -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License (version 2) as published by the FSF - Free Software -# Foundation -# -# Based on: -# Center for Internet Security Debian Linux 8 Benchmark v2.0.0 - 12-28-2018 - -policy: - id: "cis_debian8_L2" - file: "cis_debian8_L2.yml" - name: "CIS benchmark for Debian/Linux 8 L2" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 8." - references: - - https://www.cisecurity.org/cis-benchmarks/ - -requirements: - title: "Check Debian version" - description: "Requirements for running the SCA scan against Debian/Ubuntu." - condition: all - rules: - - 'f:/etc/debian_version' - - 'f:/proc/sys/kernel/ostype -> Linux' - -checks: - - - id: 2500 - title: "Ensure separate partition exists for /var" - description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." - rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." - compliance: - - cis: ["1.1.5"] - - cis_csc: ["13", "5.1"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var\s' - - - id: 2501 - title: "Ensure separate partition exists for /var/tmp" - description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." - rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." - compliance: - - cis: ["1.1.6"] - - cis_csc: ["13", "5.1"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var/tmp\s' - - - id: 2502 - title: "Ensure separate partition exists for /var/log" - description: "The /var/log directory is used by system services to store log data." - rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." - compliance: - - cis: ["1.1.10"] - - cis_csc: ["6.3", "6.4"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var/log\s' - - - id: 2503 - title: "Ensure separate partition exists for /var/log/audit" - description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." - rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." - compliance: - - cis: ["1.1.11"] - - cis_csc: ["6.3", "6.4"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var/log/audit\s' - - - id: 2504 - title: "Ensure separate partition exists for /home" - description: "The /home directory is used to support disk storage needs of local users." - rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." - compliance: - - cis: ["1.1.12"] - - cis_csc: ["13", "5.1"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/home\s' - - - id: 2505 - title: "Disable Automounting" - description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." - rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." - remediation: "Disable autofs: # update-rc.d autofs disable" - compliance: - - cis: ["1.1.21"] - - cis_csc: ["8.3", "8.4", "8.5"] - condition: none - rules: - - 'c:systemctl is-enabled autofs -> r:^enabled' - -# 4 Additional Process Hardening - - id: 2506 - title: "Ensure SELinux or AppArmor are installed" - description: "SELinux and AppArmor provide Mandatory Access Controls." - rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." - remediation: "Run one of the following commands to install SELinux or apparmor: # apt-get install selinux-basics Or: # apt-get install apparmor apparmor-profiles apparmor-utils" - compliance: - - cis: ["1.6.3"] - - cis_csc: ["14.4", "14.6"] - condition: any - rules: - - 'c:dpkg -s selinux-basics -> r:install ok installed' - - 'c:dpkg -s apparmor -> r:install ok installed' - -# 2 Services - - - id: 2507 - title: "Ensure CUPS is not enabled" - description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." - rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable cups: # systemctl disable cups" - compliance: - - cis: ["2.2.4"] - - cis_csc: ["9.1", "9.2"] - references: - - 'https://www.cups.org' - condition: none - rules: - - 'c:systemctl is-enabled cups -> r:^enabled' - -# 4 Logging and Auditing - - - id: 2508 - title: "Ensure audit log storage size is configured" - description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." - rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." - remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." - compliance: - - cis: ["4.1.1.1"] - - cis_csc: ["6.3", "6.4"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/auditd.conf' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' - - - id: 2509 - title: "Ensure system is disabled when audit logs are full" - description: "The auditd daemon can be configured to halt the system when the audit logs are full." - rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." - remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" - compliance: - - cis: ["4.1.1.2"] - - cis_csc: ["6.3", "6.4"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/auditd.conf' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' - - - id: 2510 - title: "Ensure audit logs are not automatically deleted" - description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." - rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." - remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" - compliance: - - cis: ["4.1.1.3"] - - cis_csc: ["6.3", "6.4"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/auditd.conf' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' - - - id: 2511 - title: "Ensure auditd service is enabled" - description: "Turn on the auditd daemon to record system events." - rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." - remediation: "Run the following command to enable auditd: # systemctl enable auditd" - compliance: - - cis: ["4.1.2"] - - cis_csc: ["6.2", "6.3"] - condition: all - rules: - - 'c:systemctl is-enabled auditd -> r:^enabled' - - - id: 2512 - title: "Ensure auditing for processes that start prior to auditd is enabled" - description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." - rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." - remediation: "1) Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\" 2) Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." - compliance: - - cis: ["4.1.3"] - - cis_csc: ["6.2", "6.3"] - condition: all - rules: - - 'f:/etc/default/grub -> r:^GRUB_CMDLINE_LINUX\s*=\s*\.*audit\s*=\s*1\.*' - - - id: 2513 - title: "Ensure events that modify date and time information are collected" - description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"" - rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." - remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" - compliance: - - cis: ["4.1.4"] - - cis_csc: ["3.6", "5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S adjtimex && r:-S settimeofday && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S clock_settime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change' - - - id: 2514 - title: "Ensure events that modify user/group information are collected" - description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." - rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." - remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.5"] - - cis_csc: ["5.4", "4.8"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/group && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity' - - - id: 2515 - title: "Ensure events that modify the system's network environment are collected" - description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." - rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" - remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale | -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale | -w /etc/issue -p wa -k system-locale | -w /etc/issue.net -p wa -k system-locale | -w /etc/hosts -p wa -k system-locale | -w /etc/sysconfig/network -p wa -k system-locale Notes: /etc/sysconfig/network is common to Red Hat and SUSE based distributions. You should expand or replace this coverage to any network configuration files on your system such as /etc/network on Debian based distributions. Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.6"] - - cis_csc: ["3.6", "5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale' - - - id: 2516 - title: "Ensure events that modify the system's Mandatory Access Controls are collected (SELinux)" - description: "Monitor SELinux mandatory access control. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux directory." - rationale: "Changes to files in that directory could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." - remediation: "On systems using SELinux add the following line to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy | -w /usr/share/selinux/ -p wa -k MAC-policy. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.7"] - - cis_csc: ["3.6", "5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/selinux/ && r:-p wa && r:-k MAC-policy' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/usr/share/selinux/ && r:-p wa && r:-k MAC-policy' - - - id: 2517 - title: "Ensure events that modify the system's Mandatory Access Controls are collected (AppArmor)" - description: "Monitor AppArmor mandatory access control. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/apparmor and /etc/apparmor.d directories." - rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." - remediation: "On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.7"] - - cis_csc: ["3.6", "5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/apparmor/ && r:-p wa && r:-k MAC-policy' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy' - - - id: 2518 - title: "Ensure login and logout events are collected" - description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" - rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." - remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.8"] - - cis_csc: ["5.5", "16.10", "16.4", "4.9", "16.11", "16.13"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins' - - - id: 2519 - title: "Ensure session initiation information is collected" - description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"" - rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." - remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.9"] - - cis_csc: ["5.5", "16.10", "16.4", "4.9", "16.11", "16.13"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins' - - - id: 2520 - title: "Ensure discretionary access control permission modification events are collected" - description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" - rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." - remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.10"] - - cis_csc: ["3.6", "5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - - id: 2521 - title: "Ensure unsuccessful unauthorized file access attempts are collected" - description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" - rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." - remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.11"] - - cis_csc: ["14.6", "14.9"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - - id: 2522 - title: "Ensure successful file system mounts are collected" - description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." - rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." - remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.13"] - - cis_csc: ["13", "5.1"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' - - - id: 2523 - title: "Ensure file deletion events by users are collected" - description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." - rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." - remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.14"] - - cis_csc: ["13"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' - - - id: 2524 - title: "Ensure changes to system administration scope (sudoers) is collected" - description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" - rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." - remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.15"] - - cis_csc: ["5.4", "4.8"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope' - - - id: 2525 - title: "Ensure system administrator actions (sudolog) are collected" - description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." - rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." - remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.16"] - - cis_csc: ["5.1", "5.5", "4.9"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/sudo.log && r:-p wa && r:-k actions' - - - id: 2526 - title: "Ensure kernel module loading and unloading is collected" - description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." - rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." - remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.17"] - - cis_csc: ["3", "5.1"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S init_module && r:-S delete_module && r:-k modules' - - - id: 2527 - title: "Ensure the audit configuration is immutable" - description: "Set system audit so that audit rules cannot be modified with auditctl. Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." - rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." - remediation: "Add the following line to the end of the /etc/audit/audit.rules file: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." - compliance: - - cis: ["4.1.18"] - - cis_csc: ["3", "6", "6.2", "6.3"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^\s*\t*-e 2$' - - - id: 2528 - title: "Ensure SSH X11 forwarding is disabled" - description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." - rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." - remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" - compliance: - - cis: ["5.2.6"] - - cis_csc: ["16", "9.2"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:X11Forwarding\s+no' diff --git a/sca/debian/cis_debian9.yml b/sca/debian/cis_debian9.yml new file mode 100644 index 000000000..173a3cf35 --- /dev/null +++ b/sca/debian/cis_debian9.yml @@ -0,0 +1,2975 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 9 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Linux 9 Benchmark v1.0.0 - 12-21-2018 +# Center for Internet Security Debian Linux 9 Benchmark v1.0.1 - 01-13-2020 + +policy: + id: "cis_debian9" + file: "cis_debian9.yml" + name: "CIS Benchmark for Debian/Linux 9" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 9." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version" + description: "Requirements for running the SCA scan against Debian/Ubuntu." + condition: all + rules: + - 'f:/etc/debian_version' + - 'f:/proc/sys/kernel/ostype -> Linux' + +checks: +# 1.1.1 Disable unused filesystems + - id: 2000 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/freevxfs.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: # rmmod freevxfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v freevxfs -> r:^install /bin/true' + - 'not c:lsmod -> r:freevxfs' + + - id: 2001 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/jffs2.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v jffs2 -> r:^install /bin/true' + - 'not c:lsmod -> r:jffs2' + + - id: 2002 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/hfs.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v hfs -> r:^install /bin/true' + - 'not c:lsmod -> r:hfs' + + - id: 2003 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .confExample: vim /etc/modprobe.d/hfsplus.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v hfsplus -> r:^install /bin/true' + - 'not c:lsmod -> r:hfsplus' + + - id: 2004 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v udf -> r:^install /bin/true' + - 'not c:lsmod -> r:udf' + +# 2 Filesystem Configuration + - id: 2005 + title: "Ensure /tmp is configured" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,realtime 0 0 or Run the following commands to enable systemd /tmp mounting: systemctl unmask tmp.mount systemctl enable tmp.mount Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + - 'c:systemctl is-enabled tmp.mount -> enabled' + + - id: 2006 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid and run the following commands to enable systemd /tmp mounting: systemctl unmask tmp.mount systemctl enable tmp.mount" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 2007 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 2008 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp ." + remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2.6", "8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + - id: 2009 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 2010 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + - id: 2011 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + - id: 2012 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + - id: 2013 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + + + - id: 2014 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 2015 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 2016 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + + - id: 2017 + title: "Ensure nodev option set on /home partition" + description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 2018 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + - id: 2019 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + - id: 2020 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2.6", "8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + - id: 2021 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: # systemctl disable autofs" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled autofs -> r:^enabled' + +# 1.3 Filesystem Integrity Checking + - id: 2022 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # apt-get install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + reference: + - 'AIDE stable manual: http://aide.sourceforge.net/stable/manual.html' + condition: all + rules: + - 'c:dpkg -s aide -> r:install ok installed' + + - id: 2023 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:grep -Rh aide /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab -> r:\.+' + - 'c:crontab -u root -l -> !r:^# && r:/usr/bin/aide && r:--check' + +# 1.4 Secure Boot Settings + - id: 2024 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: chown root:root /boot/grub/grub.cfg, chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2025 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub-mkpasswd-pbkdf2 Create a custom /etc/grub.d configuration file: If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS=\"--class gnu-linux --class gnu --class os --unrestricted\" Run the following command to update the grub2 configuration: # update-grub" + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 2026 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^root:*:|^root:!:' + +# 1.5 Additional Process Hardening + - id: 2027 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> !r:^# && r:=\s*\t*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + + - id: 2028 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + + - id: 2029 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:\s*\t*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + - id: 2030 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s prelink -> r:install ok installed' + + + +# 1.6 Configure SELinux + + - id: 2031 + title: "Ensure SELinux is enabled in the bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Run the following command to configure GRUB and PAM and to create /.autorelabel: # selinux-activate Edit /etc/default/grub and add the following parameters to the GRUB_CMDLINE_LINUX= line: selinux=1 security=selinux example: GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\" GRUB_CMDLINE_LINUX=\"selinux=1 security=selinux enforcing=1 audit=1\" Run the following command to update the grub2configuration: # update-grub" + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:selinux=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:security=selinux' + + - id: 2032 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing Edit /etc/default/grub and add the following parameters to the GRUB_CMDLINE_LINUX= line: enforcing=1 Example: GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\" GRUB_CMDLINE_LINUX=\"selinux=1 security=selinux enforcing=1 audit=1\" Run the following command to update the grub2 configuration: # update-grub" + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled$' + - 'c:sestatus -> r:^Current mode:\s+enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:enforcing=1' + + - id: 2033 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.6.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+default|^Loaded policy name:\s+mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*default|^\s*SELINUXTYPE\s*=\s*mls' + + - id: 2034 + title: "Ensure no unconfined daemons exist" + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk' + + + - id: 2035 + title: "Ensure AppArmor is enabled in the bootloader configuration" + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwrittenby the bootloader boot parameters." + rationale: "AppArmor must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /etc/default/grub and add the appermor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX=\"apparmor=1 security=apparmor\" update the grub configuration # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["1.6.2.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:apparmor=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:security=apparmor' + + - id: 2036 + title: "Ensure all AppArmor Profiles are enforcing" + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.2.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:apparmor status -> r:0 profiles are in complain mode' + - 'c:apparmor status -> r:0 processes are unconfined' + - 'c:apparmor status -> n:(\d+) profiles are loaded compare > 0' + + - id: 2037 + title: "Ensure SELinux or AppArmor are installed" + description: "SELinux and AppArmor provide Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run one of the following commands to install SELinux or apparmor: # apt-get install selinux-basics Or: # apt-get install apparmor apparmor-profiles apparmor-utils" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'c:dpkg -s selinux-basics -> r:install ok installed' + - 'c:dpkg -s apparmor -> r:install ok installed' + + +# 1.7 Warning Banners + - id: 2038 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian' + + - id: 2039 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v , or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian' + + - id: 2040 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian' + + - id: 2041 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2042 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2043 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2044 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add: [org/gnome/login-screen], banner-message-enable=true, banner-message-text='Authorized uses only. All activity may be monitored and reported.'" + compliance: + - cis: ["1.7.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^[org/gnome/login-screen]' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-enable=true' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-text=\.+' + + - id: 2045 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. Notes: Site policy may mandate a testing period before install onto production systems for available updates." + compliance: + - cis: ["1.8"] + - cis_csc: ["3.4", "3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6","SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: none + rules: + - 'c:apt-get -s upgrade -> r:^The following packages will be upgraded' + +# 2 Services + - id: 2046 + title: "Ensure xinetd is not installed" + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed." + remediation: "Run the following commands to remove xinetd: # apt-get remove xinetd # apt-get purge xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dpkg -s xinetd -> r:dpkg-query: package \.+ is not installed' + + - id: 2047 + title: "Ensure openbsd-inetd is not installed" + description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no inetd services required, it is recommended that the daemon be removed." + remediation: "Run the following command to uninstall openbsd-inetd: apt-get remove openbsd-inetd" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s openbsd-inetd -> r:install ok installed' + + - id: 2048 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available install NTP or chrony using one of the following commands: # apt-get install ntp # apt-get install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'c:dpkg -s ntp -> r:install ok installed' + - 'c:dpkg -s chrony -> r:install ok installed' + + - id: 2049 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + + - id: 2050 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." + remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server " + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+|^pool\.+' + +# 2.2.2 Ensure the X Window system is not installed (Scored) + - id: 2051 + title: "Ensure the X Window system is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: apt-get remove xserver-xorg*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1","CC6.8","CC7.1","CC7.2","CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + - id: 2052 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled avahi-daemon -> enabled' + + - id: 2053 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups: # systemctl disable cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.cups.org + condition: none + rules: + - 'c:systemctl is-enabled cups -> enabled' + + - id: 2054 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following commands to disable dhcpd: # systemctl disable isc-dhcp-server # systemctl disable isc-dhcp-server6" + references: + - https://www.isc.org/dhcp/ + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled isc-dhcp-server -> enabled' + - 'c:systemctl is-enabled isc-dhcp-server6 -> enabled' + + - id: 2055 + title: "Ensure LDAP server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl disable slapd" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.openldap.org + condition: none + rules: + - 'c:systemctl is-enabled slapd -> enabled' + + - id: 2056 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind: # systemctl disable nfs-server # systemctl disable rpcbind" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled nfs-server -> enabled' + - 'c:systemctl is-enabled rpcbind -> enabled' + + - id: 2057 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable named: # systemctl disable bind9" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled bind9 -> enabled' + + - id: 2058 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl disable vsftpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled vsftpd -> enabled' + + - id: 2059 + title: "Ensure HTTP Server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable apache2: # systemctl disable apache2" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled apache2 -> enabled' + + - id: 2060 + title: "Ensure IMAP and POP3 server is not enabled" + description: "exim is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following commands to remove exim: # apt-get remove exim4; # apt-get purge exim4" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s exim4 -> r:install ok installed' + + - id: 2061 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable smbd: # systemctl disable smbd" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled smbd -> enabled' + + - id: 2062 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl disable squid" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled squid -> enabled' + + - id: 2063 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl disable snmpd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled snmpd -> enabled' + + - id: 2064 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + - id: 2065 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl disable rsync" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - 'c:systemctl is-enabled rsync -> enabled' + + - id: 2066 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable nis: # systemctl disable nis" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled nis -> enabled' + + - id: 2067 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall the nis package: # apt-get remove nis" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s nis -> r:install ok installed' + + - id: 2068 + title: "Ensure rsh client is not installed" + description: "The rshpackage contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rshpackage removes the clients for rsh, rcpand rlogin." + remediation: "Run the following command to uninstall rsh: apt-get remove rsh-client rsh-redone-client" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2.6", "4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s rsh-client -> r:install ok installed' + - 'c:dpkg -s rsh-redone-client -> r:install ok installed' + + - id: 2069 + title: "Ensure talk client is not installed" + description: "The talksoftware makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk: apt-get remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s talk -> r:install ok installed' + + - id: 2070 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet: # apt-get remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2.6", "4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s telnet -> r:install ok installed' + + - id: 2071 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # apt-get remove ldap-utils" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:dpkg -s ldap-utils -> r:install ok installed' + +# 3 Network Configuration + - id: 2072 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 net.ipv6.conf.all.forwarding = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv6.conf.all.forwarding=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.forwarding /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + + - id: 2073 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + - id: 2074 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + + - id: 2075 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects and net.ipv6.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + - id: 2076 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + - id: 2077 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + - id: 2078 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + - id: 2079 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + - id: 2080 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing. + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + - id: 2081 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + - id: 2082 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + + - id: 2083 + title: "Install TCP Wrappers" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Install tcpd : # apt-get install tcpd To verify if a service supports TCP Wrappers, run the following command: # ldd | grep libwrap.so If there is any output, then the service supports TCP Wrappers." + compliance: + - cis: ["3.3.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:dpkg -s tcpd -> r:install ok installed' + + - id: 2084 + title: "Ensure /etc/hosts.allow is configured" + description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: "Run the following command to create /etc/hosts.allow: # echo \"ALL: /, /, ...\" >/etc/hosts.allow. Where each / combination (for example, \"192.168.1.0/255.255.255.0\") represents one network block in use by your organization that requires access to this system." + compliance: + - cis: ["3.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.allow' + + - id: 2085 + title: "Ensure /etc/hosts.deny is configured" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." + remediation: "Run the following command to create /etc/hosts.deny: # echo \"ALL: ALL\" >> /etc/hosts.deny" + compliance: + - cis: ["3.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.deny' + - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' + + - id: 2086 + title: "Verify permissions on /etc/hosts.allow" + description: "The /etc/hosts.allow file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : # chown root:root /etc/hosts.allow # chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 2087 + title: "Verify permissions on /etc/hosts.deny" + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : # chown root:root /etc/hosts.deny # chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 2088 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v dccp -> r:install /bin/true' + - 'c:lsmod -> r:dccp' + + - id: 2089 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v sctp -> r:install /bin/true' + - 'c:lsmod -> r:sctp' + + - id: 2090 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v rds -> r:install /bin/true' + - 'c:lsmod -> r:rds' + + - id: 2091 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not c:modprobe -n -v tipc -> r:install /bin/true' + - 'c:lsmod -> r:tipc' + +# 3.5 Firewall configuration + + - id: 2092 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L -> r:^Chain INPUT && r:policy DROP' + - 'c:iptables -L -> r:^Chain FORWARD && r:policy DROP' + - 'c:iptables -L -> r:^Chain OUTPUT && r:policy DROP' + + - id: 2093 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.5.1.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + + - id: 2094 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L -> r:^Chain INPUT && r:policy DROP' + - 'c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP' + - 'c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP' + + - id: 2095 + title: "Ensure IPv6 loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP" + compliance: + - cis: ["3.5.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + - id: 2096 + title: "Ensure iptables is installed" + description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables." + rationale: "iptables is required for firewall management and configuration." + remediation: "Run the following command to install iptables: # apt-get install iptables" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:dpkg -s iptables -> r:install ok installed' + +######################################### +# 4 Logging and Auditing +######################################### + + - id: 2097 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + - id: 2098 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: [ "6.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' + + - id: 2099 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/auditd.conf' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + - id: 2100 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl enable auditd" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1","10.7"] + - tsc: [CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled auditd -> enabled' + + - id: 2101 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "1) Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\" 2) Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.2.6","10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + - id: 2102 + title: "Ensure events that modify date and time information are collected" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"" + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.3", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change' + + - id: 2103 + title: "Ensure events that modify user/group information are collected" + description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.5"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/group && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity' + + - id: 2104 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale | -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale | -w /etc/issue -p wa -k system-locale | -w /etc/issue.net -p wa -k system-locale | -w /etc/hosts -p wa -k system-locale | -w /etc/sysconfig/network -p wa -k system-locale Notes: /etc/sysconfig/network is common to Red Hat and SUSE based distributions. You should expand or replace this coverage to any network configuration files on your system such as /etc/network on Debian based distributions. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale' + + - id: 2105 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux/AppArmor mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "On systems using SELinux add the following line to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy | -w /usr/share/selinux/ -p wa -k MAC-policy On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/selinux/|/etc/apparmor/ && r:-p wa && r:-k MAC-policy' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/usr/share/selinux/|/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy' + + - id: 2106 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins' + + - id: 2107 + title: "Ensure session initiation information is collected" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"" + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7","AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins' + + - id: 2108 + title: "Ensure discretionary access control permission modification events are collected" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + + - id: 2109 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + + - id: 2110 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' + + - id: 2111 + title: "Ensure file deletion events by users are collected" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["6,2","13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' + + - id: 2112 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope' + + - id: 2113 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.16"] + - cis_csc: ["4.9"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/sudo.log && r:-p wa && r:-k actions' + + - id: 2114 + title: "Ensure kernel module loading and unloading is collected" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.17"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32|-F arch=b64 && r:-S init_module && r:-S delete_module && r:-k modules' + + - id: 2115 + title: "Ensure the audit configuration is immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl. Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." + compliance: + - cis: ["4.1.18"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2"] + condition: all + rules: + - 'd:/etc/audit' + - 'f:/etc/audit/audit.rules' + - 'c:tail -1 /etc/audit/audit.rules -> -e 2' + + + - id: 2116 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Run the following command to enable rsyslog: # systemctl enable rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:systemctl is-enabled rsyslog -> enabled' + +# 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 2117 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + - id: 2118 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host): *.* @@loghost.example.com. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'c:grep -Rh ^*.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* @@\.+' + + - id: 2119 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts" + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines:$ModLoad imtcp & $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["9.2"] + - pci_dss: ["10.5.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' + - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' + +# 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 2120 + title: "Ensure syslog-ng service is enabled" + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable rsyslog : # systemctl enable syslog-ng" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:systemctl is-enabled syslog-ng -> enabled' + +# 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 2121 + title: "Ensure syslog-ng default file permissions configured" + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(06\d0\)|perm\(04\d0\)|perm\(02\d0\)|perm\(00\d0\) && r:perm\(0\d40\)|perm\(0\d00\)' + +# 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 2122 + title: "Ensure syslog-ng is configured to send logs to a remote log host" + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp(\"logfile.example.com\" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng" + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:destination logserver' + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:log\.+source\.+destination' + +# 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 2123 + title: "Ensure rsyslog or syslog-ng is installed" + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # apt-get install rsyslog # apt-get install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: any + rules: + - 'c:dpkg -s rsyslog -> r:install ok installed' + - 'c:dpkg -s syslog-ng -> r:install ok installed' + +######################################### +# 5 Access, Authentication and Authorization +######################################### + + - id: 2124 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: systemctl enable cron" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:systemctl is-enabled cron -> enabled' + + +# 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 2125 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/\w\w\w-------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 2126 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 2127 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 2128 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 2129 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 2130 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + - id: 2131 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/cron.allow' + - 'f:/etc/at.allow' + - 'not f:/etc/cron.deny' + - 'not f:/etc/at.deny' + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2 SSH Server Configuration + + - id: 2132 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + - id: 2133 + title: "Ensure SSH Protocol is set to 2" + description: "Older versions of SSH support two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2. Notes: This command not longer exists in newer versions of SSH. This check is still being included for systems that may be running an older version of SSH. As of openSSH version 7.4 this parameter will not cause an issue when included." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\s*\t*2' + + - id: 2134 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.5"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:LogLevel\s+INFO|LogLevel\s+VERBOSE' + + - id: 2135 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:sshd -T -> r:X11Forwarding\s+no' + + - id: 2136 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:MaxAuthTries\s*\t*(\d+) compare <= 4' + + - id: 2137 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:IgnoreRhosts\s+yes' + + - id: 2138 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:HostbasedAuthentication\s+no' + + - id: 2139 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitRootLogin\s+no' + + - id: 2140 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitEmptyPasswords\s+no' + + - id: 2141 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:PermitUserEnvironment\s+no' + + - id: 2142 + title: "Ensure only strong ciphers are used" + description: "This variable limits the ciphers that SSH can use during communication." + rationale: "Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a \"Sweet32\" attack The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the \"Bar Mitzvah\" issue The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - 'https://nvd.nist.gov/vuln/detail/CVE-2016-2183' + - 'https://nvd.nist.gov/vuln/detail/CVE-2015-2808' + - 'https://nvd.nist.gov/vuln/detail/CVE-2008-5161' + - 'https://nvd.nist.gov/vuln/detail/CVE-2013-4548' + - 'https://www.kb.cert.org/vuls/id/565052' + - 'https://www.openssh.com/txt/cbc.adv' + condition: none + rules: + - 'c:sshd -T -> r:ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se' + + - id: 2143 + title: "Ensure only strong MAC algorithms are used" + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["14.4","16.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - 'http://www.mitls.org/pages/attacks/SLOTH' + condition: none + rules: + - 'c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com' + + - id: 2144 + title: "Ensure only strong Key Exchange algorithms are used" + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman- group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18- sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie- hellman-group-exchange-sha256" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: none + rules: + - 'c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1' + + + - id: 2145 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' + - 'c:sshd -T -> n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + - id: 2146 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'c:sshd -T -> n:LoginGraceTime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + + - id: 2147 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["5.2.18"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'c:sshd -T -> r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' + + - id: 2148 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:Banner\s*\t*/etc/issue.net' + +# 5.3 Configure PAM + + - id: 2149 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Run the following command to install the pam_pwquality module: apt-get install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + condition: all + rules: + - 'c:dpkg -s libpam-pwquality -> r:install ok installed' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=\d' + - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + + - id: 2150 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. Edit the /etc/pam.d/common-account file and add the account line bellow: account required pam_tally2.so. Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user. Notes:BUG In pam_tally2.so To work around this issue the addition of pam_tally2.so in the accounts section of the /etc/pam.d/common-account file has been added to the audit and remediation sections. pam_tally2 line must be added for the counter to reset to 0 when using sudo. Use of the \"audit\" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization." + compliance: + - cis: ["5.3.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + - 'f:/etc/pam.d/common-account -> !r:^# && r:pam_tally2.so' + + - id: 2151 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + +# 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 2152 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> r:^password\.+pam_unix.so && !r:sha512' + +# 5.4 User Accounts and Environment + + - id: 2153 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2.4"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + - id: 2154 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + - id: 2155 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + - id: 2156 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not c:useradd -D -> n:^INACTIVE=(\d+) compare < 0' + + - id: 2157 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + + + - id: 2158 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + +# 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 2159 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc, /etc/profile files, and /etc/profile.d*.sh (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not d:/etc/profile.d -> .sh -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/bash.bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'd:/etc/profile.d -> .sh -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/bash.bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + + - id: 2160 + title: "Ensure access to the su command is restricted" + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so 2) Create a comma separated list of users in the sudo statement in the /etc/group file: sudo:x:10:root, Notes: The use_uid option to pam_wheel.so is a no-op on debian based systems. It is acceptable but not required as these systems use its behavior as default." + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so' + - 'f:/etc/group -> !r:^# && r:sudo:\w+:\d+:\.' + + +############################### +# 6 System Maintenance +############################### + + - id: 2161 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following commands to set permissions on /etc/gshadow : # chown root:shadow /etc/gshadow # chmod o-rwx,g-rw /etc/gshadow" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 2162 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/shadow- : # chown root:root /etc/shadow- # chown root:shadow /etc/shadow- # chmod o-rwx,g-rw /etc/shadow-" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 2163 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "# chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-rw /etc/gshadow-" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 2164 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2165 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the one following commands to set permissions on /etc/shadow : # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 2166 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2167 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + + - id: 2168 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + +# 6.2 User and Group Settings + + - id: 2169 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + - id: 2170 + title: "Ensure no legacy \"+\" entries exist in /etc/passwd" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && r:^+:' + + - id: 2171 + title: "Ensure no legacy \"+\" entries exist in /etc/shadow" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^+:' + + - id: 2172 + title: "Ensure no legacy \"+\" entries exist in /etc/group" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:^+:' + + - id: 2173 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + + - id: 2174 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["6.2.20"] + - cis_csc: ["16"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/sca/debian/cis_debian9_L1.yml b/sca/debian/cis_debian9_L1.yml deleted file mode 100644 index d5a1a7a30..000000000 --- a/sca/debian/cis_debian9_L1.yml +++ /dev/null @@ -1,1335 +0,0 @@ -# Security Configuration Assessment -# Level 1 CIS Checks for Debian Linux 9 -# Copyright (C) 2015-2020, Wazuh Inc. -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License (version 2) as published by the FSF - Free Software -# Foundation -# -# Based on: -# Center for Internet Security Debian Linux 9 Benchmark v1.0.0 - 12-21-2018 - -policy: - id: "cis_debian9_L1" - file: "cis_debian9_L1.yml" - name: "CIS benchmark for Debian/Linux 9 L1" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 9." - references: - - https://www.cisecurity.org/cis-benchmarks/ - -requirements: - title: "Check Debian version" - description: "Requirements for running the SCA scan against Debian/Ubuntu." - condition: all - rules: - - 'f:/etc/debian_version' - - 'f:/proc/sys/kernel/ostype -> Linux' - -checks: -# 1.1.1 Disable unused filesystems - - id: 3000 - title: "Ensure mounting of freevxfs filesystems is disabled" - description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/freevxfs.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: # rmmod freevxfs" - compliance: - - cis: ["1.1.1.1"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v freevxfs -> r:^install /bin/true' - - 'not c:lsmod -> r:freevxfs' - - - id: 3001 - title: "Ensure mounting of jffs2 filesystems is disabled" - description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/jffs2.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2" - compliance: - - cis: ["1.1.1.2"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v jffs2 -> r:^install /bin/true' - - 'not c:lsmod -> r:jffs2' - - - id: 3002 - title: "Ensure mounting of hfs filesystems is disabled" - description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/hfs.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs" - compliance: - - cis: ["1.1.1.3"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v hfs -> r:^install /bin/true' - - 'not c:lsmod -> r:hfs' - - - id: 3003 - title: "Ensure mounting of hfsplus filesystems is disabled" - description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .confExample: vim /etc/modprobe.d/hfsplus.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus" - compliance: - - cis: ["1.1.1.4"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v hfsplus -> r:^install /bin/true' - - 'not c:lsmod -> r:hfsplus' - - - id: 3004 - title: "Ensure mounting of udf filesystems is disabled" - description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." - rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf" - compliance: - - cis: ["1.1.1.5"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:/sbin/modprobe -n -v udf -> r:^install /bin/true' - - 'not c:lsmod -> r:udf' - -# 2 Filesystem Configuration - - id: 3005 - title: "Ensure /tmp is configured" - description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." - rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." - remediation: "Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 or Run the following commands to enable systemd /tmp mounting: systemctl unmask tmp.mount systemctl enable tmp.mount Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount" - compliance: - - cis: ["1.1.2"] - - cis_csc: ["5.1"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ - condition: all - rules: - - 'c:mount -> r:\s/tmp\s' - - - id: 3006 - title: "Ensure nodev option set on /tmp partition" - description: "The nodev mount option specifies that the filesystem cannot contain special devices." - rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." - remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount and run the following commands to enable systemd /tmp mounting: systemctl unmask tmp.mount systemctl enable tmp.mount" - compliance: - - cis: ["1.1.3"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:mount -> r:\s/tmp\s && r:nodev' - - - id: 3007 - title: "Ensure nosuid option set on /tmp partition" - description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." - rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." - remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,nodev /tmp" - compliance: - - cis: ["1.1.4"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:mount -> r:\s/tmp\s && r:nosuid' - - - id: 3008 - title: "Ensure nodev option set on /var/tmp partition" - description: "The nodev mount option specifies that the filesystem cannot contain special devices." - rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nodev /var/tmp" - compliance: - - cis: ["1.1.8"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:mount -> r:\s/var/tmp\s && r:nodev' - - - id: 3009 - title: "Ensure nosuid option set on /var/tmp partition" - description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." - rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." - remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" - compliance: - - cis: ["1.1.9"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:mount -> r:\s/var/tmp\s && r:nosuid' - - - id: 3010 - title: "Ensure noexec option set on /var/tmp partition" - description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." - rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." - remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" - compliance: - - cis: ["1.1.10"] - - cis_csc: ["2.6"] - condition: all - rules: - - 'c:mount -> r:\s/var/tmp\s && r:noexec' - - - id: 3011 - title: "Ensure nodev option set on /home partition" - description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." - rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home" - compliance: - - cis: ["1.1.14"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:mount -> r:\s/home\s && r:nodev' - - - id: 3012 - title: "Ensure nodev option set on /dev/shm partition" - description: "The nodev mount option specifies that the filesystem cannot contain special devices." - rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" - compliance: - - cis: ["1.1.15"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:mount -> r:\s/dev/shm\s && r:nodev' - - - id: 3013 - title: "Ensure nosuid option set on /dev/shm partition" - description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." - rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." - remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" - compliance: - - cis: ["1.1.16"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:mount -> r:\s/dev/shm\s && r:nosuid' - - - id: 3014 - title: "Ensure noexec option set on /dev/shm partition" - description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." - rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." - remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" - compliance: - - cis: ["1.1.17"] - - cis_csc: ["2.6", "8"] - condition: all - rules: - - 'c:mount -> r:\s/dev/shm\s && r:noexec' - - - id: 3015 - title: "Disable Automounting" - description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." - rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." - remediation: "Run the following command to disable autofs: # systemctl disable autofs" - compliance: - - cis: ["1.1.21"] - - cis_csc: ["8.4", "8.5"] - condition: none - rules: - - 'c:systemctl is-enabled autofs -> r:^enabled' - -# 1.3 Filesystem Integrity Checking - - id: 3016 - title: "Ensure AIDE is installed" - description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." - rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." - remediation: "Install AIDE: # apt-get install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit" - compliance: - - cis: ["1.3.1"] - - cis_csc: ["14.9"] - condition: all - rules: - - 'c:dpkg -s aide -> r:install ok installed' - - - id: 3017 - title: "Ensure filesystem integrity is regularly checked" - description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." - rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." - remediation: "Run the following command to install AIDE: # apt-get install aide aide-common Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit" - compliance: - - cis: ["1.3.2"] - - cis_csc: ["14.9"] - condition: all - rules: - - 'f:/etc/crontab -> r:\s*\t*/usr/sbin/aide\s*\t*|\s*\t*/usr/bin/aide\s*\t* && r:\s*\t*--check' - -# 1.4 Secure Boot Settings - - id: 3018 - title: "Ensure bootloader password is set" - description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." - rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." - remediation: "Create an encrypted password with grub-mkpasswd-pbkdf2 Create a custom /etc/grub.d configuration file: If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS=\"--class gnu-linux --class gnu --class os --unrestricted\" Run the following command to update the grub2 configuration: # update-grub" - compliance: - - cis: ["1.4.2"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' - - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' - - - id: 3019 - title: "Ensure authentication required for single user mode" - description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." - rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." - remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" - compliance: - - cis: ["1.4.3"] - - cis_csc: ["5.1"] - condition: none - rules: - - 'f:/etc/shadow -> r:^root:*:|^root:!:' - -# 1.5 Additional Process Hardening - - id: 3020 - title: "Ensure core dumps are restricted" - description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." - rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." - remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" - compliance: - - cis: ["1.5.1"] - - cis_csc: ["13"] - condition: all - rules: - - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' - - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:=\s*\t*0$' - - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' - - - id: 3021 - title: "Ensure address space layout randomization (ASLR) is enabled" - description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." - rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" - compliance: - - cis: ["1.5.3"] - - cis_csc: ["8.3"] - condition: all - rules: - - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:\s*\t*2$' - - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' - -# 1.7 Warning Banners - - id: 3022 - title: "Ensure local login warning banner is configured properly" - description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" - rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." - remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v , or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" - compliance: - - cis: ["1.7.1.2"] - - cis_csc: ["5.1"] - condition: none - rules: - - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' - - - id: 3023 - title: "Ensure GDM login banner is configured" - description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." - rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." - remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add: [org/gnome/login-screen], banner-message-enable=true, banner-message-text='Authorized uses only. All activity may be monitored and reported.'" - compliance: - - cis_csc: ["5.1"] - - cis: ["1.7.2"] - - pci_dss: ["2.2.2"] - - nist_800_53: ["CM.1"] - condition: all - rules: - - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^[org/gnome/login-screen]' - - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-enable=true' - - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-text=\.+' - -# 2 Services - - id: 3024 - title: "Ensure xinetd is not installed" - description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." - rationale: "If there are no xinetdservices required, it is recommended that the daemon be disabled." - remediation: "Run the following commands to remove xinetd: # apt-get remove xinetd # apt-get purge xinetd" - compliance: - - cis: ["2.1.1"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:dpkg -s xinetd -> r:install ok installed' - - - id: 3025 - title: "Ensure openbsd-inetd is not installed" - description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." - rationale: "If there are no inetd services required, it is recommended that the daemon be removed." - remediation: "Run the following command to uninstall openbsd-inetd: apt-get remove openbsd-inetd" - compliance: - - cis: ["2.1.2"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:dpkg -s openbsd-inetd -> r:install ok installed' - - 'c:dpkg -s inetutils-inetd -> r:install ok installed' - - - id: 3026 - title: "Ensure ntp is configured" - description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." - rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." - remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" - compliance: - - cis: ["2.2.1.2"] - - cis_csc: ["6.1"] - references: - - http://www.ntp.org/ - condition: all - rules: - - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' - - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' - - 'f:/etc/ntp.conf -> r:^server\.+$|^pool\.+$' - - 'f:/etc/ntp.conf -> r:^server\s\.+' - - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' - - id: 3027 - title: "Ensure chrony is configured" - description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." - rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." - remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server " - compliance: - - cis: ["2.2.1.3"] - - cis_csc: ["6.1"] - condition: all - rules: - - 'f:/etc/chrony.conf -> r:^server\.+$|^pool\.+$' - - - id: 3028 - title: "Ensure Avahi Server is not enabled" - description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." - rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." - remediation: "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" - compliance: - - cis: ["2.2.3"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled avahi-daemon -> r:^enabled' - - - id: 3029 - title: "Ensure CUPS is not enabled" - description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." - rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable cups: # systemctl disable cups" - compliance: - - cis: ["2.2.4"] - - cis_csc: ["9.2"] - references: - - https://www.cups.org - condition: none - rules: - - 'c:systemctl is-enabled cups -> r:^enabled' - - - id: 3030 - title: "Ensure DHCP Server is not enabled" - description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." - rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." - remediation: "Run the following commands to disable dhcpd: # systemctl disable isc-dhcp-server # systemctl disable isc-dhcp-server6" - references: - - https://www.isc.org/dhcp/ - compliance: - - cis: ["2.2.5"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled isc-dhcp-server -> r:^enabled' - - 'c:systemctl is-enabled isc-dhcp-server6 -> r:^enabled' - - - id: 3031 - title: "Ensure LDAP server is not enabled" - description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." - rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable slapd: # systemctl disable slapd" - compliance: - - cis: ["2.2.6"] - - cis_csc: ["9.2"] - references: - - https://www.openldap.org - condition: none - rules: - - 'c:systemctl is-enabled slapd -> r:^enabled' - - - id: 3032 - title: "Ensure NFS and RPC are not enabled" - description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." - rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." - remediation: "Run the following commands to disable nfs and rpcbind: # systemctl disable nfs-server # systemctl disable rpcbind" - compliance: - - cis: ["2.2.7"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled nfs-server -> r:^enabled' - - 'c:systemctl is-enabled rpcbind -> r:^enabled' - - - id: 3033 - title: "Ensure DNS Server is not enabled" - description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." - rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable named: # systemctl disable bind9" - compliance: - - cis: ["2.2.8"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled bind9 -> r:^enabled' - - - id: 3034 - title: "Ensure FTP Server is not enabled" - description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." - rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable vsftpd: # systemctl disable vsftpd" - compliance: - - cis: ["2.2.9"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled vsftpd -> r:^enabled' - - - id: 3035 - title: "Ensure HTTP Server is not enabled" - description: "HTTP or web servers provide the ability to host web site content." - rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable apache2: # systemctl disable apache2" - compliance: - - cis: ["2.2.10"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled apache2 -> r:^enabled' - - - id: 3036 - title: "Ensure IMAP and POP3 server is not enabled" - description: "exim is an open source IMAP and POP3 server for Linux based systems." - rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." - remediation: "Run the following commands to remove exim: # apt-get remove exim4; # apt-get purge exim4" - compliance: - - cis_csc: ["9.2"] - - cis: ["2.2.11"] - - pci_dss: ["2.2.2"] - - nist_800_53: ["CM.1"] - condition: none - rules: - - 'c:dpkg -s exim4 -> r:install ok installed' - - - id: 3037 - title: "Ensure Samba is not enabled" - description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." - rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable smbd: # systemctl disable smbd" - compliance: - - cis: ["2.2.12"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled smbd -> r:^enabled' - - - id: 3038 - title: "Ensure HTTP Proxy Server is not enabled" - description: "Squid is a standard proxy server used in many distributions and environments." - rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." - remediation: "Run the following command to disable squid: # systemctl disable squid" - compliance: - - cis: ["2.2.13"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled squid -> r:^enabled' - - - id: 3039 - title: "Ensure SNMP Server is not enabled" - description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." - rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." - remediation: "Run the following command to disable snmpd: # systemctl disable snmpd" - compliance: - - cis: ["2.2.14"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled snmpd -> r:^enabled' - - - id: 3040 - title: "Ensure rsync service is not enabled" - description: "The rsyncd service can be used to synchronize files between systems over network links." - rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." - remediation: "Run the following command to disable rsync: # systemctl disable rsync" - compliance: - - cis: ["2.2.16"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'c:systemctl is-enabled rsync -> r:^enabled' - - - id: 3041 - title: "Ensure NIS Server is not enabled" - description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." - rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" - remediation: "Run the following command to disable nis: # systemctl disable nis" - compliance: - - cis_csc: ["9.2"] - - cis: ["2.2.17"] - - pci_dss: ["2.2.2"] - - nist_800_53: ["CM.1"] - condition: none - rules: - - 'c:systemctl is-enabled nis -> r:^enabled' - - - id: 3042 - title: "Ensure NIS Client is not installed" - description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." - rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." - remediation: "Uninstall the nis package: # apt-get remove nis" - compliance: - - cis: ["2.3.1"] - - cis_csc: ["2.6"] - condition: none - rules: - - 'c:dpkg -s nis -> r:install ok installed' - - - id: 3043 - title: "Ensure rsh client is not installed" - description: "The rshpackage contains the client commands for the rsh services." - rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rshpackage removes the clients for rsh, rcpand rlogin." - remediation: "Run the following command to uninstall rsh: apt-get remove rsh-client rsh-redone-client" - compliance: - - cis: ["2.3.2"] - - cis_csc: ["2.6", "4.5"] - condition: none - rules: - - 'c:dpkg -s rsh-client -> r:install ok installed' - - 'c:dpkg -s rsh-redone-client -> r:install ok installed' - - - id: 3044 - title: "Ensure talk client is not installed" - description: "The talksoftware makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." - rationale: "The software presents a security risk as it uses unencrypted protocols for communication." - remediation: "Run the following command to uninstall talk: apt-get remove talk" - compliance: - - cis: ["2.3.3"] - - cis_csc: ["2.6"] - condition: none - rules: - - 'c:dpkg -s talk -> r:install ok installed' - - - id: 3045 - title: "Ensure telnet client is not installed" - description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." - rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." - remediation: "Run the following command to uninstall telnet: # apt-get remove telnet" - compliance: - - cis: ["2.3.4"] - - cis_csc: ["2.6", "4.5"] - condition: none - rules: - - 'c:dpkg -s telnet -> r:install ok installed' - -# 3 Network Configuration - - id: 3046 - title: "Ensure IP forwarding is disabled" - description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." - rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 net.ipv6.conf.all.forwarding = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv6.conf.all.forwarding=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["3.1.1"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' - - 'c:sysctl net.ipv6.conf.all.forwarding -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv6\.conf\.all\.forwarding /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' - - - id: 3047 - title: "Ensure packet redirect sending is disabled" - description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." - rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." - remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.1.2"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' - - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' - - - id: 3048 - title: "Ensure source routed packets are not accepted" - description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." - rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["3.2.1"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' - - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' - - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:=\s*\t*0$' - - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' - - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' - - - id: 3049 - title: "Ensure ICMP redirects are not accepted" - description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." - rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["3.2.2"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' - - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' - - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' - - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' - - - id: 3050 - title: "Ensure secure ICMP redirects are not accepted" - description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." - rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.3"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' - - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' - - - id: 3051 - title: "Ensure suspicious packets are logged" - description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." - rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.4"] - - cis_csc: ["6.2", "6.3"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' - - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' - - - id: 3052 - title: "Ensure broadcast ICMP requests are ignored" - description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." - rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.5"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' - - - id: 3053 - title: "Ensure bogus ICMP responses are ignored" - description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." - rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.6"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' - - - id: 3054 - title: "Ensure Reverse Path Filtering is enabled" - description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." - rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing. - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.7"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' - - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' - - - id: 3055 - title: "Ensure TCP SYN Cookies is enabled" - description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." - rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" - compliance: - - cis: ["3.2.8"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' - - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' - - - id: 3056 - title: "Ensure IPv6 router advertisements are not accepted" - description: "This setting disables the systems ability to accept router advertisements" - rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" - compliance: - - cis: ["3.2.9"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' - - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' - - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' - - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' - - - id: 3057 - title: "Ensure /etc/hosts.allow is configured" - description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." - rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." - remediation: "Run the following command to create /etc/hosts.allow: # echo \"ALL: /, /, ...\" >/etc/hosts.allow. Where each / combination (for example, \"192.168.1.0/255.255.255.0\") represents one network block in use by your organization that requires access to this system." - compliance: - - cis: ["3.3.2"] - - cis_csc: ["9.4"] - condition: all - rules: - - 'f:/etc/hosts.allow' - - - id: 3058 - title: "Ensure /etc/hosts.deny is configured" - description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." - rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." - remediation: "Run the following command to create /etc/hosts.deny: # echo \"ALL: ALL\" >> /etc/hosts.deny" - compliance: - - cis: ["3.3.3"] - - cis_csc: ["9.4"] - condition: all - rules: - - 'f:/etc/hosts.deny' - - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' - - - id: 3059 - title: "Ensure DCCP is disabled" - description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." - rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" - compliance: - - cis: ["3.4.1"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'not c:modprobe -n -v dccp -> r:install /bin/true' - - 'c:lsmod -> r:dccp' - - - id: 3060 - title: "Ensure SCTP is disabled" - description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." - rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" - compliance: - - cis: ["3.4.2"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'not c:modprobe -n -v sctp -> r:install /bin/true' - - 'c:lsmod -> r:sctp' - - - id: 3061 - title: "Ensure RDS is disabled" - description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." - rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" - compliance: - - cis: ["3.4.3"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'not c:modprobe -n -v rds -> r:install /bin/true' - - 'c:lsmod -> r:rds' - - - id: 3062 - title: "Ensure TIPC is disabled" - description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." - rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." - remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" - compliance: - - cis: ["3.4.4"] - - cis_csc: ["9.2"] - condition: none - rules: - - 'not c:modprobe -n -v tipc -> r:install /bin/true' - - 'c:lsmod -> r:tipc' - -# 3.5 Firewall configuration - - - id: 3063 - title: "Ensure default deny firewall policy" - description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." - rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." - remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." - compliance: - - cis: ["3.5.1.1"] - - cis_csc: ["9.4"] - condition: all - rules: - - 'c:iptables -L -> r:^Chain INPUT && r:policy DROP' - - 'c:iptables -L -> r:^Chain FORWARD && r:policy DROP' - - 'c:iptables -L -> r:^Chain OUTPUT && r:policy DROP' - - - id: 3064 - title: "Ensure IPv6 default deny firewall policy" - description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." - rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." - remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." - compliance: - - cis: ["3.5.2.1"] - - cis_csc: ["9.4"] - condition: all - rules: - - 'c:ip6tables -L -> r:^Chain INPUT && r:policy DROP' - - 'c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP' - - 'c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP' - - - id: 3065 - title: "Ensure iptables is installed" - description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables." - rationale: "iptables is required for firewall management and configuration." - remediation: "Run the following command to install iptables: # apt-get install iptables" - compliance: - - cis: ["3.5.3"] - - cis_csc: ["9.4"] - condition: all - rules: - - 'c:dpkg -s iptables -> r:install ok installed' - -# 4 Logging and Auditing - - id: 3066 - title: "Ensure rsyslog Service is enabled" - description: "Once the rsyslog package is installed it needs to be activated." - rationale: "If the rsyslog service is not activated the system will not have a syslog service running." - remediation: "Run the following command to enable rsyslog: # systemctl enable rsyslog" - compliance: - - cis: ["4.2.1.1"] - - cis_csc: ["6.2", "6.3"] - condition: all - rules: - - 'c:systemctl is-enabled rsyslog -> r:^enabled' - - - id: 3067 - title: "Ensure rsyslog is configured to send logs to a remote log host" - description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." - rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." - remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host): *.* @@loghost.example.com. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" - compliance: - - cis: ["4.2.1.4"] - - cis_csc: ["6.6", "6.8"] - references: - - rsyslog.conf(5) man page - condition: all - rules: - - 'c:grep -Rh ^*.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* @@\.+' - - - id: 3068 - title: "Ensure remote rsyslog messages are only accepted on designated log hosts" - description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." - rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." - remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines:$ModLoad imtcp & $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" - compliance: - - cis: ["4.2.1.5"] - - cis_csc: ["9.2"] - references: - - rsyslog.conf(8) man page - condition: all - rules: - - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' - - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' - -# 5 Access, Authentication and Authorization - - id: 3069 - title: "Ensure cron daemon is enabled" - description: "The cron daemon is used to execute batch jobs on the system." - rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." - remediation: "Run the following command to enable cron: systemctl enable cron" - compliance: - - cis: ["5.1.1"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:systemctl is-enabled cron -> r:^enabled$' - - - id: 3070 - title: "Ensure at/cron is restricted to authorized users" - description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." - rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." - remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" - compliance: - - cis: ["5.1.8"] - - cis_csc: ["16"] - condition: all - rules: - - 'f:/etc/cron.allow' - - 'f:/etc/at.allow' - - 'not f:/etc/cron.deny' - - 'not f:/etc/at.deny' - - 'c:stat -c%u-%g-%a /etc/cron.allow -> r:^0-0-600' - - 'c:stat -c%u-%g-%a /etc/at.allow -> r:^0-0-600' - - - id: 3071 - title: "Ensure permissions on /etc/ssh/sshd_config are configured" - description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." - rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." - remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" - compliance: - - cis: ["5.2.1"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:stat -c%u-%g-%a /etc/ssh/sshd_config -> r:^0-0-600' - - - id: 3072 - title: "Ensure SSH Protocol is set to 2" - description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." - rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" - compliance: - - cis: ["5.2.4"] - - cis_csc: ["14.4"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\s*\t*2' - - - id: 3073 - title: "Ensure SSH LogLevel is appropriate" - description: "INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." - rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" - references: - - https://www.ssh.com/ssh/sshd_config/ - compliance: - - cis: ["5.2.5"] - - cis_csc: ["6.2", "6.3"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:LogLevel\s+INFO|LogLevel\s+VERBOSE' - - - id: 3074 - title: "Ensure SSH X11 forwarding is disabled" - description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." - rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." - remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" - compliance: - - cis: ["5.2.6"] - - cis_csc: ["9.2"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:X11Forwarding\s+no' - - - id: 3075 - title: "Ensure SSH MaxAuthTries is set to 4 or less" - description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." - rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" - compliance: - - cis: ["5.2.7"] - - cis_csc: ["16.13"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && n:MaxAuthTries\s*\t*(\d+) compare <= 4' - - - id: 3076 - title: "Ensure SSH IgnoreRhosts is enabled" - description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." - rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" - compliance: - - cis: ["5.2.8"] - - cis_csc: ["9.2"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\s+yes' - - - id: 3077 - title: "Ensure SSH HostbasedAuthentication is disabled" - description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." - rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" - compliance: - - cis: ["5.2.9"] - - cis_csc: ["16.3"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\s+no' - - - id: 3078 - title: "Ensure SSH root login is disabled" - description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." - rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" - compliance: - - cis: ["5.2.10"] - - cis_csc: ["4.3"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\s+no' - -# 5.2 SSH Server Configuration - - - id: 3079 - title: "Ensure SSH PermitEmptyPasswords is disabled" - description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." - rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" - compliance: - - cis: ["5.2.11"] - - cis_csc: ["16.3"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitEmptyPasswords\s+no' - - - id: 3080 - title: "Ensure SSH PermitUserEnvironment is disabled" - description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." - rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" - compliance: - - cis: ["5.2.12"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitUserEnvironment\s+no' - - - id: 3081 - title: "Ensure SSH Idle Timeout Interval is configured" - description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." - rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" - compliance: - - cis: ["5.2.16"] - - cis_csc: ["16.11"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' - - 'f:/etc/ssh/sshd_config -> !r:^# && n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' - - - id: 3082 - title: "Ensure SSH access is limited" - description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." - rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." - remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " - compliance: - - cis: ["5.2.18"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' - - - id: 3083 - title: "Ensure SSH warning banner is configured" - description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." - rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" - compliance: - - cis: ["5.2.19"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:Banner\s*\t*/etc/issue.net|Banner\s\t*/etc/issue' - -# 5.3 Configure PAM - - - id: 3084 - title: "Ensure password creation requirements are configured" - description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" - rationale: "Strong passwords protect systems from being hacked through brute force methods." - remediation: "1) Run the following command to install the pam_pwquality module: apt-get install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." - compliance: - - cis: ["5.3.1"] - - cis_csc: ["4.4"] - condition: all - rules: - - 'c:dpkg -s libpam-pwquality -> r:install ok installed' - - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=\d' - - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' - - 'f:/etc/security/pwquality.conf -> !r:^# && r:dcredit' - - 'f:/etc/security/pwquality.conf -> !r:^# && r:ucredit' - - 'f:/etc/security/pwquality.conf -> !r:^# && r:ocredit' - - 'f:/etc/security/pwquality.conf -> !r:^# && r:lcredit' - - - id: 3085 - title: "Ensure lockout for failed password attempts is configured" - description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." - rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." - remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user. Notes: Use of the \"audit\" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization." - compliance: - - cis: ["5.3.2"] - - cis_csc: ["16.7"] - condition: all - rules: - - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d && r:unlock_time\s*=\s*\d\d\d+' - - - id: 3086 - title: "Ensure password reuse is limited" - description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." - rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." - remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." - compliance: - - cis: ["5.3.3"] - - cis_csc: ["16"] - condition: all - rules: - - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare >= 5' - -# 5.4 User Accounts and Environment - - - id: 3087 - title: "Ensure password expiration is 365 days or less" - description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." - rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." - remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." - compliance: - - cis: ["5.4.1.1"] - - cis_csc: ["4.4", "16"] - condition: all - rules: - - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' - - - id: 3088 - title: "Ensure minimum days between password changes is 7 or more" - description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." - rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." - remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." - compliance: - - cis: ["5.4.1.2"] - - cis_csc: ["4.4", "16"] - condition: all - rules: - - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' - - - id: 3089 - title: "Ensure password expiration warning days is 7 or more" - description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." - rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." - remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." - compliance: - - cis: ["5.4.1.3"] - - cis_csc: ["4.4", "16"] - condition: all - rules: - - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' - - - id: 3090 - title: "Ensure inactive password lock is 30 days or less" - description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." - rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." - remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." - compliance: - - cis: ["5.4.1.4"] - - cis_csc: ["4.4", "16"] - condition: all - rules: - - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' - - - id: 3091 - title: "Ensure default group for the root account is GID 0" - description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." - rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." - remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" - compliance: - - cis: ["5.4.3"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' - - - id: 3092 - title: "Ensure access to the su command is restricted" - description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su." - rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." - remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so Create a comma separated list of users in the sudo statement in the /etc/group file: sudo:x:10:root," - compliance: - - cis: ["5.6"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so' - - 'f:/etc/group -> !r:^# && r:sudo:\w+:\d+:\.' - -# 6.2 User and Group Settings - - - id: 3093 - title: "Ensure password fields are not empty" - description: "An account with an empty password field means that anybody may log in as that user without providing a password." - rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." - remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." - compliance: - - cis: ["6.2.1"] - - cis_csc: ["4.4"] - condition: none - rules: - - 'f:/etc/shadow -> r:^\w+::' - - - id: 3094 - title: "Ensure no legacy \"+\" entries exist in /etc/passwd" - description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." - rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." - remediation: "Remove any legacy + entries from /etc/passwd if they exist." - compliance: - - cis: ["6.2.2"] - - cis_csc: ["16.2"] - condition: none - rules: - - 'f:/etc/passwd -> !r:^# && r:^+:' - - - id: 3095 - title: "Ensure no legacy \"+\" entries exist in /etc/shadow" - description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." - rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." - remediation: "Remove any legacy + entries from /etc/shadow if they exist." - compliance: - - cis: ["6.2.3"] - - cis_csc: ["16.2"] - condition: none - rules: - - 'f:/etc/shadow -> !r:^# && r:^+:' - - - id: 3096 - title: "Ensure no legacy \"+\" entries exist in /etc/group" - description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." - rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." - remediation: "Remove any legacy + entries from /etc/group if they exist." - compliance: - - cis: ["6.2.4"] - - cis_csc: ["16.2"] - condition: none - rules: - - 'f:/etc/group -> !r:^# && r:^+:' - - - id: 3097 - title: "Ensure root is the only UID 0 account" - description: "Any account with UID 0 has superuser privileges on the system." - rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." - remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." - compliance: - - cis: ["6.2.5"] - - cis_csc: ["5.1"] - condition: none - rules: - - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' - - - id: 3098 - title: "Ensure shadow group is empty" - description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." - rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." - remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." - compliance: - - cis: ["6.2.20"] - - cis_csc: ["5.1"] - condition: none - rules: - - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/sca/debian/cis_debian9_L2.yml b/sca/debian/cis_debian9_L2.yml deleted file mode 100644 index f8c6fcab2..000000000 --- a/sca/debian/cis_debian9_L2.yml +++ /dev/null @@ -1,464 +0,0 @@ -# Security Configuration Assessment -# Level 2 CIS Checks for Debian Linux 9 -# Copyright (C) 2015-2020, Wazuh Inc. -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License (version 2) as published by the FSF - Free Software -# Foundation -# -# Based on: -# Center for Internet Security Debian Linux 9 Benchmark v1.0.0 - 12-21-2018 - -policy: - id: "cis_debian9_L2" - file: "cis_debian9_L2.yml" - name: "CIS benchmark for Debian/Linux 9 L2" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 9." - references: - - https://www.cisecurity.org/cis-benchmarks/ - -requirements: - title: "Check Debian version" - description: "Requirements for running the SCA scan against Debian/Ubuntu." - condition: all - rules: - - 'f:/etc/debian_version' - - 'f:/proc/sys/kernel/ostype -> Linux' - -checks: - - - id: 3500 - title: "Ensure separate partition exists for /var" - description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." - rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." - compliance: - - cis: ["1.1.6"] - - cis_csc: ["5.1"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var\s' - - - id: 3501 - title: "Ensure separate partition exists for /var/tmp" - description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." - rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." - compliance: - - cis: ["1.1.7"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'c:mount -> r:\s/var/tmp\s' - - - id: 3502 - title: "Ensure separate partition exists for /var/log" - description: "The /var/log directory is used by system services to store log data." - rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." - compliance: - - cis: ["1.1.11"] - - cis_csc: ["6.4"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var/log\s' - - - id: 3503 - title: "Ensure separate partition exists for /var/log/audit" - description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." - rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." - compliance: - - cis: ["1.1.12"] - - cis_csc: ["6.4"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/var/log/audit\s' - - - id: 3504 - title: "Ensure separate partition exists for /home" - description: "The /home directory is used to support disk storage needs of local users." - rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." - compliance: - - cis: ["1.1.13"] - - cis_csc: ["5.1"] - references: - - http://tldp.org/HOWTO/LVM-HOWTO/ - condition: all - rules: - - 'c:mount -> r:\s/home\s' - - - id: 3505 - title: "Disable Automounting" - description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." - rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." - remediation: "Run the following command to disable autofs: # systemctl disable autofs" - compliance: - - cis: ["1.1.22"] - - cis_csc: ["8.3", "8.5"] - condition: none - rules: - - 'c:systemctl is-enabled autofs -> r:^enabled' - -# 4 Additional Process Hardening - - id: 3506 - title: "Ensure SELinux or AppArmor are installed" - description: "SELinux and AppArmor provide Mandatory Access Controls." - rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." - remediation: "Run one of the following commands to install SELinux or apparmor: # apt-get install selinux-basics Or: # apt-get install apparmor apparmor-profiles apparmor-utils" - compliance: - - cis: ["1.6.3"] - - cis_csc: ["14.6"] - condition: any - rules: - - 'c:dpkg -s selinux-basics -> r:install ok installed' - - 'c:dpkg -s apparmor -> r:install ok installed' - -# 2 Services - - - id: 3507 - title: "Ensure CUPS is not enabled" - description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." - rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable cups: # systemctl disable cups" - compliance: - - cis: ["2.2.4"] - - cis_csc: ["9.2"] - references: - - 'http://www.cups.org' - condition: none - rules: - - 'c:systemctl is-enabled cups -> r:^enabled' - -# 4 Logging and Auditing - - - id: 3508 - title: "Ensure audit log storage size is configured" - description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." - rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." - remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." - compliance: - - cis: ["4.1.1.1"] - - cis_csc: ["6.4"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/auditd.conf' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' - - - id: 3509 - title: "Ensure system is disabled when audit logs are full" - description: "The auditd daemon can be configured to halt the system when the audit logs are full." - rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." - remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" - compliance: - - cis: ["4.1.1.2"] - - cis_csc: ["6.4"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/auditd.conf' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' - - - id: 3510 - title: "Ensure audit logs are not automatically deleted" - description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." - rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." - remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" - compliance: - - cis: ["4.1.1.3"] - - cis_csc: ["6.4"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/auditd.conf' - - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' - - - id: 3511 - title: "Ensure auditd service is enabled" - description: "Turn on the auditd daemon to record system events." - rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." - remediation: "Run the following command to enable auditd: # systemctl enable auditd" - compliance: - - cis: ["4.1.2"] - - cis_csc: ["6.2", "6.3"] - condition: all - rules: - - 'c:systemctl is-enabled auditd -> r:^enabled' - - - id: 3512 - title: "Ensure auditing for processes that start prior to auditd is enabled" - description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." - rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." - remediation: "Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\" Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." - compliance: - - cis: ["4.1.3"] - - cis_csc: ["6.2", "6.3"] - condition: all - rules: - - 'f:/etc/default/grub -> r:^GRUB_CMDLINE_LINUX\s*=\s*\.*audit\s*=\s*1\.*' - - - id: 3513 - title: "Ensure events that modify date and time information are collected" - description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"" - rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." - remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" - compliance: - - cis: ["4.1.4"] - - cis_csc: ["5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S adjtimex && r:-S settimeofday && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S clock_settime && r:-k time-change' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change' - - - id: 3514 - title: "Ensure events that modify user/group information are collected" - description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." - rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." - remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.5"] - - cis_csc: ["4.8"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/group && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity' - - - id: 3515 - title: "Ensure events that modify the system's network environment are collected" - description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." - rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" - remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale | -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale | -w /etc/issue -p wa -k system-locale | -w /etc/issue.net -p wa -k system-locale | -w /etc/hosts -p wa -k system-locale | -w /etc/sysconfig/network -p wa -k system-locale Notes: /etc/sysconfig/network is common to Red Hat and SUSE based distributions. You should expand or replace this coverage to any network configuration files on your system such as /etc/network on Debian based distributions. Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.6"] - - cis_csc: ["5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale' - - - id: 3516 - title: "Ensure events that modify the system's Mandatory Access Controls are collected (SELinux)" - description: "Monitor SELinux mandatory access control. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux directory." - rationale: "Changes to files in that directory could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." - remediation: "On systems using SELinux add the following line to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy | -w /usr/share/selinux/ -p wa -k MAC-policy. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.7"] - - cis_csc: ["5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/selinux/ && r:-p wa && r:-k MAC-policy' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/usr/share/selinux/ && r:-p wa && r:-k MAC-policy' - - - id: 3517 - title: "Ensure events that modify the system's Mandatory Access Controls are collected (AppArmor)" - description: "Monitor AppArmor mandatory access control. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/apparmor and /etc/apparmor.d directories." - rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." - remediation: "On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.7"] - - cis_csc: ["5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/apparmor/ && r:-p wa && r:-k MAC-policy' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy' - - - id: 3518 - title: "Ensure login and logout events are collected" - description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" - rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." - remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.8"] - - cis_csc: ["4.9, 16.11", "16.13"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins' - - - id: 3519 - title: "Ensure session initiation information is collected" - description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"" - rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." - remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.9"] - - cis_csc: ["4.9, 16.11", "16.13"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins' - - - id: 3520 - title: "Ensure discretionary access control permission modification events are collected" - description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" - rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." - remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.10"] - - cis_csc: ["5.5"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' - - - id: 3521 - title: "Ensure unsuccessful unauthorized file access attempts are collected" - description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" - rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." - remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.11"] - - cis_csc: ["14.9"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' - - - id: 3522 - title: "Ensure successful file system mounts are collected" - description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." - rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." - remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.13"] - - cis_csc: ["13"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' - - - id: 3523 - title: "Ensure file deletion events by users are collected" - description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." - rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." - remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.14"] - - cis_csc: ["6.2", "13"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' - - - id: 3524 - title: "Ensure changes to system administration scope (sudoers) is collected" - description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" - rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." - remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.15"] - - cis_csc: ["4.8"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope' - - - id: 3525 - title: "Ensure system administrator actions (sudolog) are collected" - description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." - rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." - remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.16"] - - cis_csc: ["4.9"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/var/log/sudo.log && r:-p wa && r:-k actions' - - - id: 3526 - title: "Ensure kernel module loading and unloading is collected" - description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." - rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." - remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b32 -S init_module -S delete_module -k modules. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." - compliance: - - cis: ["4.1.17"] - - cis_csc: ["5.1"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules' - - 'f:/etc/audit/audit.rules -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules' - - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S init_module && r:-S delete_module && r:-k modules' - - - id: 3527 - title: "Ensure the audit configuration is immutable" - description: "Set system audit so that audit rules cannot be modified with auditctl. Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." - rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." - remediation: "Add the following line to the end of the /etc/audit/audit.rules file: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." - compliance: - - cis: ["4.1.18"] - - cis_csc: ["6.2", "6.3"] - condition: all - rules: - - 'd:/etc/audit' - - 'f:/etc/audit/audit.rules' - - 'f:/etc/audit/audit.rules -> r:^\s*\t*-e 2$' - - - id: 3528 - title: "Ensure SSH X11 forwarding is disabled" - description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." - rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." - remediation: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." - compliance: - - cis: ["5.2.6"] - - cis_csc: ["9.2"] - condition: all - rules: - - 'f:/etc/ssh/sshd_config -> !r:^# && r:X11Forwarding\s+no' diff --git a/sca/generic/sca_unix_audit.yml b/sca/generic/sca_unix_audit.yml index a5473c27d..cd9657a87 100644 --- a/sca/generic/sca_unix_audit.yml +++ b/sca/generic/sca_unix_audit.yml @@ -29,7 +29,7 @@ variables: $pam_d_files: /etc/pam.d/common-password,/etc/pam.d/password-auth,/etc/pam.d/system-auth,/etc/pam.d/system-auth-ac,/etc/pam.d/passwd checks: - - id: 4000 + - id: 3000 title: "SSH Hardening: Port should not be 22" description: "The ssh daemon should not be listening on port 22 (the default value) for incoming connections." rationale: "Changing the default port you may reduce the number of successful attacks from zombie bots, an attacker or bot doing port-scanning can quickly identify your SSH port." @@ -41,7 +41,7 @@ checks: rules: - 'f:$sshd_file -> !r:^# && r:Port && !r:\s*\t*22$' - - id: 4001 + - id: 3001 title: "SSH Hardening: Protocol should be set to 2" description: "The SSH protocol should not be 1." rationale: "The Protocol parameter dictates which version of the SSH communication and encryption protocols are in use. Version 1 of the SSH protocol has weaknesses." @@ -53,7 +53,7 @@ checks: rules: - 'f:$sshd_file -> r:^\s*\t*Protocol\s*\t*2' - - id: 4002 + - id: 3002 title: "SSH Hardening: Root account should not be able to log in" description: "The option PermitRootLogin should be set to no." rationale: "The option PermitRootLogin specifies whether root can log in using ssh. If you want log in as root, you should use the option \"Match\" and restrict it to a few IP addresses." @@ -62,7 +62,7 @@ checks: rules: - 'f:$sshd_file -> r:^\s*PermitRootLogin\s*\t*no' - - id: 4003 + - id: 3003 title: "SSH Hardening: No Public Key authentication" description: "The option PubkeyAuthentication should be set yes." rationale: "Access only by public key. Generally people will use weak passwords and have poor password practices. Keys are considered stronger than password." @@ -74,7 +74,7 @@ checks: rules: - 'f:$sshd_file -> r:^\s*PubkeyAuthentication\s*\t*yes' - - id: 4004 + - id: 3004 title: "SSH Hardening: Password Authentication should be disabled" description: "The option PasswordAuthentication should be set to no." rationale: "The option PasswordAuthentication specifies whether we should use password-based authentication. Use public key authentication instead of passwords." @@ -86,7 +86,7 @@ checks: rules: - 'f:$sshd_file -> r:^\s*PasswordAuthentication\s*\t*no' - - id: 4005 + - id: 3005 title: "SSH Hardening: Empty passwords should not be allowed" description: "The option PermitEmptyPasswords should be set to no." rationale: "The option PermitEmptyPasswords specifies whether the server allows logging in to accounts with a null password. Accounts with null passwords are a bad practice." @@ -98,7 +98,7 @@ checks: rules: - 'f:$sshd_file -> r:^\s*PermitEmptyPasswords\s*\t*no' - - id: 4006 + - id: 3006 title: "SSH Hardening: Rhost or shost should not be used for authentication" description: "The option IgnoreRhosts should be set to yes." rationale: "The option IgnoreRhosts specifies whether rhosts or shosts files should not be used in authentication. For security reasons it is recommended to no use rhosts or shosts files for authentication." @@ -110,7 +110,7 @@ checks: rules: - 'f:$sshd_file -> r:^\s*\t*IgnoreRhosts\s*\t*yes' - - id: 4007 + - id: 3007 title: "SSH Hardening: Grace Time should be one minute or less." description: "The option LoginGraceTime should be set to 60 or less." rationale: "The option LoginGraceTime specifies how long in seconds after a connection request the server will wait before disconnecting if the user has not successfully logged in. 30 seconds is the recommended time for avoiding open connections without authenticate." @@ -122,7 +122,7 @@ checks: rules: - 'f:$sshd_file -> n:^\s*LoginGraceTime\s*\t*(\d+)s compare <= 60' - - id: 4008 + - id: 3008 title: "SSH Hardening: Wrong Maximum number of authentication attempts" description: "The option MaxAuthTries should be set to 4 or less." rationale: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. This should be set to 4." @@ -134,7 +134,7 @@ checks: rules: - 'f:$sshd_file -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' - - id: 4009 + - id: 3009 title: "SSH Hardening: Ensure SSH HostbasedAuthentication is disabled" description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv , along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." @@ -148,7 +148,7 @@ checks: rules: - 'f:$sshd_file -> r:^\s*\t*HostbasedAuthentication\s*\t*no' - - id: 4010 + - id: 3010 title: "Ensure retry option for passwords is less than 3" description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." rationale: "Strong passwords protect systems from being hacked through brute force methods." @@ -161,7 +161,7 @@ checks: rules: - 'f:$pam_d_files -> r:password && r:requisite|required && r:pam_cracklib.so|pam_pwquality.so && n:retry\s*=\s*(\d+) compare <= 3' - - id: 4011 + - id: 3011 title: "Ensure passwords are longer than 14 characters" description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." rationale: "Strong passwords protect systems from being hacked through brute force methods." @@ -174,7 +174,7 @@ checks: rules: - 'f:$pam_d_files -> r:pam_cracklib.so && n:minlen=(\d+) compare >= 14' - - id: 4012 + - id: 3012 title: "Ensure passwords contain at least one digit" description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." rationale: "Strong passwords protect systems from being hacked through brute force methods." @@ -187,7 +187,7 @@ checks: rules: - 'f:$pam_d_files -> r:pam_cracklib.so && r:dcredit\s*\t*=' - - id: 4013 + - id: 3013 title: "Ensure passwords contain at least one lowercase character" description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." rationale: "Strong passwords protect systems from being hacked through brute force methods." @@ -200,7 +200,7 @@ checks: rules: - 'f:$pam_d_files -> r:pam_cracklib.so && r:lcredit\s*\t*=' - - id: 4014 + - id: 3014 title: "Ensure passwords contain at least one uppercase character" description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." rationale: "Strong passwords protect systems from being hacked through brute force methods." @@ -213,7 +213,7 @@ checks: rules: - 'f:$pam_d_files -> r:pam_cracklib.so && r:ucredit\s*\t*=' - - id: 4015 + - id: 3015 title: "Ensure passwords contain at least one special character" description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." rationale: "Strong passwords protect systems from being hacked through brute force methods." @@ -226,7 +226,7 @@ checks: rules: - 'f:$pam_d_files -> r:pam_cracklib.so && r:ocredit\s*\t*=' - - id: 4016 + - id: 3016 title: "Ensure lockout for failed password attempts is configured" description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users." rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." @@ -235,7 +235,7 @@ checks: rules: - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d && r:unlock_time\s*=\s*\d\d\d+' - - id: 4017 + - id: 3017 title: "Ensure password hashing algorithm is SHA-512" description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." @@ -246,7 +246,7 @@ checks: rules: - 'f:$pam_d_files -> r:^password\.+pam_unix.so\.+sha512' - - id: 4018 + - id: 3018 title: "Ensure passwords in /etc/shadow are hashed with SHA-512 or SHA-256" description: "SHA-512 and SHA-256 are much stronger hashing algorithms than MD5." rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords." @@ -258,7 +258,7 @@ checks: rules: - 'f:/etc/shadow -> r:^\w+:\$1\$|^\w+:\$2\$|^\w+:\$md5\$|^\w+:\$md5\$|^\w+:\$__unix__\$' - - id: 4019 + - id: 3019 title: "Ensure password expiration is 365 days or less" description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." @@ -271,7 +271,7 @@ checks: rules: - 'f:/etc/login.defs -> n:^PASS_MAX_DAYS\s*\t*(\d+)$ compare <= 365' - - id: 4020 + - id: 3020 title: "Ensure SELinux or AppArmor are installed" description: "SELinux and AppArmor provide Mandatory Access Controls." rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." @@ -283,7 +283,7 @@ checks: - 'c:dpkg -s selinux-basics -> r:install ok installed' - 'c:dpkg -s apparmor -> r:install ok installed' - - id: 4021 + - id: 3021 title: "Ensure CUPS is not enabled" description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." @@ -296,7 +296,7 @@ checks: rules: - 'c:systemctl is-enabled cups -> r:^enabled' - - id: 4022 + - id: 3022 title: "Ensure auditd service is enabled" description: "Turn on the auditd daemon to record system events." rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." diff --git a/sca/rhel/5/cis_rhel5_linux.yml b/sca/rhel/5/cis_rhel5_linux.yml index 0d659b602..217ea8bda 100644 --- a/sca/rhel/5/cis_rhel5_linux.yml +++ b/sca/rhel/5/cis_rhel5_linux.yml @@ -11,7 +11,7 @@ # Center for Internet Security Benchmark for Red Hat Enterprise Linux 5 v2.2.0 - 03-02-2015 policy: - id: "cis_rhel5" + id: "cis_rhel5_linux" file: "cis_rhel5_linux.yml" name: "CIS Benchmark for Red Hat Enterprise Linux 5" description: "This document, Security Configuration Benchmark for Red Hat Enterprise Linux 5 provides prescriptive guidance for establishing a secure configuration posture for Red Hat Enterprise Linux (RHEL) versions 5.0 - 5.11 running on x86 platforms." @@ -34,7 +34,7 @@ variables: checks: # 1.1.1 /tmp: partition - - id: 4500 + - id: 3500 title: "Create Separate Partition for /tmp" description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code." @@ -49,7 +49,7 @@ checks: - 'c:mount -> r:\s/tmp\s' # 1.1.2 /tmp: nodev - - id: 4501 + - id: 3501 title: "Set nodev option for /tmp Partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." @@ -65,7 +65,7 @@ checks: - 'c:mount -> r:\s/tmp\s && r:nodev' # 1.1.3 /tmp: nosuid - - id: 4502 + - id: 3502 title: "Set nosuid option for /tmp Partition" description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp ." @@ -81,7 +81,7 @@ checks: - 'c:mount -> r:\s/tmp\s && r:nosuid' # 1.1.4 /tmp: noexec - - id: 4503 + - id: 3503 title: "Set noexec option for /tmp Partition" description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp ." @@ -97,7 +97,7 @@ checks: - 'c:mount -> r:\s/tmp\s && r:noexec' # 1.1.5 Build considerations - Partition scheme. - - id: 4504 + - id: 3504 title: "Create Separate Partition for /var" description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." @@ -112,7 +112,7 @@ checks: - 'c:mount -> r:\s/var\s' # 1.1.6 bind mount /var/tmp to /tmp - - id: 4505 + - id: 3505 title: "Bind Mount the /var/tmp directory to /tmp" description: "The /var/tmp directory is normally a standalone directory in the /var file system. Binding /var/tmp to /tmp establishes an unbreakable link to /tmp that cannot be removed (even by the root user). It also allows /var/tmp to inherit the same mount options that /tmp owns, allowing /var/tmp to be protected in the same /tmp is protected." rationale: "All programs that use /var/tmp and /tmp to read/write temporary files will always be written to the /tmp file system, preventing a user from running the /var file system out of space or trying to perform operations that have been blocked in the /tmp filesystem." @@ -126,7 +126,7 @@ checks: - 'c:mount -> r:\s/var/tmp\s' # 1.1.7 /var/log: partition - - id: 4506 + - id: 3506 title: "Create Separate Partition for /var/log" description: "The /var/log directory is used by system services to store log data ." rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." @@ -141,7 +141,7 @@ checks: - 'c:mount -> r:\s/var/log\s' # 1.1.8 /var/log/audit: partition - - id: 4507 + - id: 3507 title: "Create Separate Partition for /var/log/audit" description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." @@ -156,7 +156,7 @@ checks: - 'c:mount -> r:\s/var/log/audit\s' # 1.1.9 /home: partition - - id: 4508 + - id: 3508 title: "Create Separate Partition for /home" description: "The /home directory is used to support disk storage needs of local users." rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." @@ -171,7 +171,7 @@ checks: - 'c:mount -> r:\s/home\s' # 1.1.10 /home: nodev - - id: 4509 + - id: 3509 title: "Add nodev Option to /home" description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." @@ -187,7 +187,7 @@ checks: - 'c:mount -> r:\s/home\s && r:nodev' # 1.1.14 /dev/shm: nodev - - id: 4510 + - id: 3510 title: "Add nodev Option to /dev/shm Partition" description: "The nodev mount option specifies that the /dev/shm (temporary filesystem stored in memory) cannot contain block or character special devices." rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." @@ -203,7 +203,7 @@ checks: - 'c:mount -> r:\s/dev/shm\s && r:nodev' # 1.1.15 /dev/shm: nosuid - - id: 4511 + - id: 3511 title: "Add nosuid Option to /dev/shm Partition" description: "The nosuid mount option specifies that the /dev/shm (temporary filesystem stored in memory) will not execute setuid and setgid on executable programs as such, but rather execute them with the uid and gid of the user executing the program." rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." @@ -219,7 +219,7 @@ checks: - 'c:mount -> r:\s/dev/shm\s && r:nosuid' # 1.1.16 /dev/shm: noexec - - id: 4512 + - id: 3512 title: "Add noexec Option to /dev/shm Partition" description: "Set noexec on the shared memory partition to prevent programs from executing from there." rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." @@ -238,7 +238,7 @@ checks: # 1.2 Software Updates ########################################## # 1.2.5 Disable yum-updatesd (Scored) - - id: 4513 + - id: 3513 title: "Disable yum-updatesd" description: "The yum-updatesd utility provides notification of updates that are available for your system." rationale: "The yum-updatesd service may introduce unnecessary overhead and prevent other programs from running. When possible, replace this service with a cron job that calls yum directly." @@ -258,7 +258,7 @@ checks: # 1.4 Configure SELinux ############################################### # 1.4.1 enable selinux in /etc/grub.conf - - id: 4514 + - id: 3514 title: "Enable SELinux in /etc/grub.conf" description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters" rationale: "SELinux must be enabled at boot time in /etc/grub.conf to ensure that the controls it provides are not overwritten." @@ -274,7 +274,7 @@ checks: - 'f:/boot/grub/grub.conf -> r:selinux=0|enforcing=0' # 1.4.2 Set selinux state - - id: 4515 + - id: 3515 title: "Set the SELinux State" description: "Set SELinux to enable when the system is booted." rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." @@ -290,7 +290,7 @@ checks: - 'f:/etc/selinux/config -> r:^SELINUX=enforcing$' # 1.4.3 Set seliux policy - - id: 4516 + - id: 3516 title: "Set the SELinux Policy" description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." @@ -306,7 +306,7 @@ checks: - 'f:/etc/selinux/config -> r:^SELINUXTYPE=targeted$' # 1.4.4 Remove SETroubleshoot - - id: 4517 + - id: 3517 title: "Remove SETroubleshoot" description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." @@ -320,7 +320,7 @@ checks: - 'c:/sbin/chkconfig --list -> r:setroubleshoot && r::on' # 1.4.5 Disable MCS Translation service mcstrans - - id: 4518 + - id: 3518 title: "Disable MCS Translation Service (mcstrans)" description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" rationale: "Since this service is not used very often, disable it to reduce the amount of potentially vulnerable code running on the system." @@ -339,7 +339,7 @@ checks: # 1.5 Secure Boot Settings ############################################### # 1.5.3 Set Boot Loader Password (Scored) - - id: 4519 + - id: 3519 title: "Set Boot Loader Password" description: "Setting the boot loader password will require that the person who is rebooting system the must enter a password before being able to set command line boot parameters" rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." @@ -355,7 +355,7 @@ checks: - 'f:/boot/grub/grub.conf -> !r:^# && r:password --md5' # 1.5.4 Require Authentication for Single-User Mode (Scored) - - id: 4520 + - id: 3520 title: "Require Authentication for Single-User Mode" description: "Since /etc/init determines what run state the system is in, setting the entry in /etc/inittab will force single user authentication." rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." @@ -371,7 +371,7 @@ checks: - 'f:/etc/inittab -> r:^~:S:wait:/sbin/sulogin' # 1.5.5 Disable Interactive Boot (Scored) - - id: 4521 + - id: 3521 title: "Disable Interactive Boot" description: "The PROMPT option provides console users the ability to interactively boot the system and select which services to start on boot ." rationale: "Turn off the PROMPT option on the console to prevent console users from potentially overriding established security settings." @@ -390,7 +390,7 @@ checks: # 1.6 Additional Process Hardening ############################################### # 1.6.1 Restrict Core Dumps (Scored) - - id: 4522 + - id: 3522 title: "Restrict Core Dumps" description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid.dumpable variable to 0 will prevent setuid programs from dumping core." @@ -406,7 +406,7 @@ checks: - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' # 1.6.3 Enable Randomized Virtual Memory Region Placement (Scored) - - id: 4523 + - id: 3523 title: "Enable Randomized Virtual Memory Region Placement" description: "Set the system flag to force randomized virtual memory region placement." rationale: "Randomly placing virtual memory regions will make it difficult for to write memory page exploits as the memory placement will be consistently shifting." @@ -423,7 +423,7 @@ checks: - 'c:/sbin/sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' # 1.6.2 Configure ExecShield (Scored) - - id: 4524 + - id: 3524 title: "Configure ExecShield" description: "Execshield is made up of a number of kernel features to provide protection against buffer overflow attacks. These features include prevention of execution in memory data space, and special handling of text buffers." rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." @@ -441,7 +441,7 @@ checks: # 1.6.4 Enable XD/NX Support on 32-bit x86 Systems (Scored) # TODO # 1.6.5 Disable Prelink (Scored) - - id: 4525 + - id: 3525 title: "Disable Prelink" description: "Prelinking is a performance enhancing feature that decreases process start up time. It loads shared libraries into addresses for which the linking of required symbols has already been performed. After a binary has been prelinked, the addresses at which shared libraries is not changed, even if kernel.randomize_va_space is set to 1." rationale: "There is a bug in prelink that interferes with AIDE, the Linux file integrity checker. This has been fixed in RHEL6 (so prelink does not need to be disabled in RHEL6 systems)." @@ -459,7 +459,7 @@ checks: # 2.1 Remove Legacy Services ############################################### # 2.1.1 Remove telnet-server (Scored) - - id: 4526 + - id: 3526 title: "Remove telnet-server" description: "The telnet-server package contains the telnetd daemon, which accepts connections from users from other systems via the telnet protocol." rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Red Hat Linux distributions." @@ -476,7 +476,7 @@ checks: - 'c:rpm -qa telnet-server -> r:telnet-server' # Remove rsh-server (Scored) - - id: 4527 + - id: 3527 title: "Remove rsh-server" description: "The Berkeley rsh-server ( rsh , rlogin , rcp ) package contains legacy services that exchange credentials in clear-text." rationale: "These legacy service contain numerous security exposures and have been replaced with the more secure SSH package." @@ -491,7 +491,7 @@ checks: rules: - 'c:rpm -qa rsh-server -> r:rsh-server' - - id: 4528 + - id: 3528 title: "Remove NIS Client" description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client (ypbind) was used to bind a machine to an NIS server and receive the distributed configuration files" rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." @@ -508,7 +508,7 @@ checks: - 'c:rpm -qa ypbind -> r:ypbind' # 2.1.6 Remove NIS Server (Scored) - - id: 4529 + - id: 3529 title: "Remove NIS Server" description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used." @@ -525,7 +525,7 @@ checks: - 'c:rpm -qa ypserv -> r:ypserv' # 2.1.7 Remove tftp (Scored) - - id: 4530 + - id: 3530 title: "Remove tftp-server" description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is the server package used to define and support a TFTP server." rationale: "TFTP does not support authentication nor does it ensure the confidentiality of integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." @@ -542,7 +542,7 @@ checks: - 'c:rpm -qa tftpd -> r:tftpd' # 2.1.9 Remove talk (Scored) - - id: 4531 + - id: 3531 title: "Remove talk-server" description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initialization of talk sessions) is installed by default." rationale: "The software presents a security risk as it uses unencrypted protocols for communication." @@ -559,7 +559,7 @@ checks: # 3 Special Purpose Services ############################################### # 3.2 Set Daemon umask (Scored) - - id: 4532 + - id: 3532 title: "Set Daemon umask" description: "Set the default umask for all processes started at boot time. The settings in umask selectively turn off default permission when a file is created by a daemon process." rationale: "Setting the umask to 027 will make sure that files created by daemons will not be readable, writable or executable by any other than the group and owner of the daemon process and will not be writable by the group of the daemon process. The daemon process can manually override these settings if these files need additional permission." @@ -571,7 +571,7 @@ checks: - 'f:/etc/sysconfig/init -> umask 027' # 3.3 Remove X Windows (Scored) - - id: 4533 + - id: 3533 title: "Remove X Windows" description: "The X Windows system provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on." rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." @@ -586,7 +586,7 @@ checks: - 'not c:yum grouplist X?Window?System -> r:Installed Groups' # 3.1.1 Disable Avahi Server (Scored) - - id: 4534 + - id: 3534 title: "Disable Avahi Server" description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration." rationale: "Since servers are not normally used for printing, this service is not needed unless dependencies require it. If this is the case, disable the service to reduce the potential attack surface. If for some reason the service is required on the server, follow the recommendations in sub-sections 3.2.1 - 3.2.5 to secure it." @@ -600,7 +600,7 @@ checks: - 'c:/sbin/chkconfig --list -> r:avahi-daemon && r::on' # 3.8 Disable NFS and RPC (Not Scored) - - id: 4535 + - id: 3535 title: "Disable NFS and RPC" description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." rationale: "If the server does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." @@ -614,7 +614,7 @@ checks: - 'c:/sbin/chkconfig --list -> r:nfslock|rpcgssd|rpcidmapd|portmap && r::on' # 3.10 Remove FTP Server (Not Scored) - - id: 4536 + - id: 3536 title: "Remove FTP Server" description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." @@ -628,7 +628,7 @@ checks: - 'c:rpm -qa vsftpd -> r:vsftpd' # 3.11 Remove HTTP Server (Not Scored) - - id: 4537 + - id: 3537 title: "Remove HTTP Server" description: "HTTP or web servers provide the ability to host web site content. The default HTTP server shipped with Red Hat Linux is Apache." rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." @@ -642,7 +642,7 @@ checks: - 'c:rpm -qa httpd -> r:httpd' # 3.12 Remove Dovecot (IMAP and POP3 services) (Not Scored) - - id: 4538 + - id: 3538 title: "Remove Dovecot" description: "Dovecot is an open source IMAP and POP3 server for Linux based systems." rationale: "Unless POP3 and/or IMAP servers are to be provided to this server, it is recommended that the service be deleted to reduce the potential attack surface." @@ -656,7 +656,7 @@ checks: - 'c:rpm -qa dovecot -> r:dovecot' # 3.13 Remove Samba (Not Scored) - - id: 4539 + - id: 3539 title: "Remove Samba" description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol." rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." @@ -670,7 +670,7 @@ checks: - 'c:rpm -qa samba -> r:samba' # 3.14 Remove HTTP Proxy Server (Not Scored) - - id: 4540 + - id: 3540 title: "Remove HTTP Proxy Server" description: "The default HTTP proxy package shipped with Red Hat Linux is squid." rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." @@ -684,7 +684,7 @@ checks: - 'c:rpm -qa squid -> r:squid' # 3.15 Remove SNMP Server (Not Scored) - - id: 4541 + - id: 3541 title: "Remove SNMP Server" description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." rationale: "The SNMP server communicates using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used." @@ -704,7 +704,7 @@ checks: # 4.1 Modify Network Parameters (Host Only) ############################################### # 4.1.1 Disable IP Forwarding (Scored) - - id: 4542 + - id: 3542 title: "Disable IP Forwarding" description: "The net.ipv4.ip_forward flag is used to tell the server whether it can forward packets or not. If the server is not to be used as a router, set the flag to 0." rationale: "Setting the flag to 0 ensures that a server with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." @@ -721,7 +721,7 @@ checks: - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' # 4.1.2 Disable Send Packet Redirects (Scored) - - id: 4543 + - id: 3543 title: "Disable Send Packet Redirects" description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." @@ -744,7 +744,7 @@ checks: # 4.2 Modify Network Parameters (Host and Router) ############################################### # 4.2.1 Disable Source Routed Packet Acceptance (Scored) - - id: 4544 + - id: 3544 title: "Disable Source Routed Packet Acceptance" description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network." rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this server was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface." @@ -764,7 +764,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' # 4.2.2 Disable ICMP Redirect Acceptance (Scored) - - id: 4545 + - id: 3545 title: "Disable ICMP Redirect Acceptance" description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." @@ -784,7 +784,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' # 4.2.3 Disable Secure ICMP Redirect Acceptance (Scored) - - id: 4546 + - id: 3546 title: "Disable Secure ICMP Redirect Acceptance" description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." @@ -804,7 +804,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' # 4.2.4 Log Suspicious Packets (Scored) - - id: 4547 + - id: 3547 title: "Log Suspicious Packets" description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." @@ -823,7 +823,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' # 4.2.5 Enable Ignore Broadcast Requests (Scored) - - id: 4548 + - id: 3548 title: "Enable Ignore Broadcast Requests" description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address." @@ -840,7 +840,7 @@ checks: - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' # 4.2.6 Enable Bad Error Message Protection (Scored) - - id: 4549 + - id: 3549 title: "Enable Bad Error Message Protection" description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." @@ -857,7 +857,7 @@ checks: - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' # 4.2.7 Enable RFC-recommended Source Route Validation (Scored) - - id: 4550 + - id: 3550 title: "Enable RFC-recommended Source Route Validation" description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid." rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed." @@ -877,7 +877,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' # 4.2.8 Enable TCP SYN Cookies (Scored) - - id: 4551 + - id: 3551 title: "Enable TCP SYN Cookies" description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all." rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a server by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding." @@ -900,7 +900,7 @@ checks: # 6.1 Configure SSH ############################################### # 6.2.1 Set SSH Protocol to 2 (Scored) - - id: 4552 + - id: 3552 title: "Set SSH Protocol to 2" description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." @@ -919,7 +919,7 @@ checks: - 'f:$sshd_file -> r:^\s*\t*Protocol\s*\t*2' # 6.2.2 Set LogLevel to INFO (Scored) - - id: 4553 + - id: 3553 title: "Ensure SSH LogLevel is set to INFO" description: "The INFO parameter specifies that login and logout activity will be logged." rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." @@ -936,7 +936,7 @@ checks: - 'f:$sshd_file -> !r:^# && r:LogLevel\s*\t*INFO' # 6.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) - - id: 4554 + - id: 3554 title: "Ensure SSH MaxAuthTries is set to 4 or less" description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." @@ -951,7 +951,7 @@ checks: - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' # 6.2.6 Set SSH IgnoreRhosts to Yes (Scored) - - id: 4555 + - id: 3555 title: "Set SSH IgnoreRhosts to Yes" description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication ." rationale: "Setting this parameter forces users to enter a password when authenticating with ssh ." @@ -969,7 +969,7 @@ checks: - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' # 6.2.7 Set SSH HostbasedAuthentication to No (Scored) - - id: 4556 + - id: 3556 title: "Set SSH HostbasedAuthentication to No" description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv , along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf , disabling the ability to use .rhosts files in SSH provides an additional layer of protection." @@ -987,7 +987,7 @@ checks: - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' # 6.2.8 Disable SSH Root Login (Scored) - - id: 4557 + - id: 3557 title: "Disable SSH Root Login" description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1) . The default is no." rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" @@ -1005,7 +1005,7 @@ checks: - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' # 6.2.9 Set SSH PermitEmptyPasswords to No (Scored) - - id: 4558 + - id: 3558 title: "Set SSH PermitEmptyPasswords to No" description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" @@ -1029,7 +1029,7 @@ checks: # 9.2 Review User and Group Settings ############################################### # 9.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) - - id: 4559 + - id: 3559 title: "Verify No UID 0 Accounts Exist Other Than root" description: "Any account with UID 0 has superuser privileges on the system." rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 7.5 Restrict root Login to System Console." diff --git a/sca/rhel/6/cis_rhel6_linux.yml b/sca/rhel/6/cis_rhel6_linux.yml index 3e0ea4a64..20af057d5 100644 --- a/sca/rhel/6/cis_rhel6_linux.yml +++ b/sca/rhel/6/cis_rhel6_linux.yml @@ -11,7 +11,7 @@ # Center for Internet Security Benchmark for Red Hat Enterprise Linux 6 v2.1.0 - 12-27-2017 policy: - id: "cis_rhel6" + id: "cis_rhel6_linux" file: "cis_rhel6_linux.yml" name: "CIS Benchmark for Red Hat Enterprise Linux 6" description: "This document provides prescriptive guidance for establishing a secure configuration posture for Red Hat Enterprise Linux 6 systems running on x86 and x64 platforms. This document was tested against Red Hat Enterprise Linux 6.9." @@ -24,7 +24,6 @@ requirements: condition: any rules: - 'f:/etc/redhat-release -> r:^Red Hat Enterprise Linux && r:release 6' - - 'f:/etc/redhat-release -> r:^CentOS && r:release 6' - 'f:/etc/redhat-release -> r:^Cloud && r:release 6' - 'f:/etc/redhat-release -> r:^Oracle && r:release 6' - 'f:/etc/redhat-release -> r:^Better && r:release 6' @@ -34,98 +33,304 @@ variables: $sshd_file: /etc/ssh/sshd_config checks: +# 1.1.1.1 cramfs: filesystem + - id: 4000 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found' + - 'not c:lsmod -> r:cramfs' + +# 1.1.1.2 freevxfs: filesystem + - id: 4001 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install freevxfs /bin/true. Run the following command to unload the freevxfs module: rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v freevxfs -> r:install /bin/true|Module freevxfs not found' + - 'not c:lsmod -> r:freevxfs' + +# 1.1.1.3 jffs2: filesystem + - id: 4002 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install jffs2 /bin/true. Run the following command to unload the jffs2 module: rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v jffs2 -> r:install /bin/true|Module jffs2 not found' + - 'not c:lsmod -> r:jffs2' + +# 1.1.1.4 hfs: filesystem + - id: 4003 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfs /bin/true. Run the following command to unload the hfs module: rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v hfs -> r:install /bin/true|Module hfs not found' + - 'not c:lsmod -> r:hfs' +# 1.1.1.5 hfsplus: filesystem + - id: 4004 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfsplus /bin/true. Run the following command to unload the hfsplus module: rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v hfsplus -> r:install /bin/true|Module hfsplus not found' + - 'not c:lsmod -> r:hfsplus' +# 1.1.1.6 squashfs: filesystem + - id: 4005 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found' + - 'not c:lsmod -> r:squashfs' +# 1.1.1.7 udfs: filesystem + - id: 4006 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: rmmod udf" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v udf -> r:install /bin/true|Module udf not found' + - 'not c:lsmod -> r:udf' + +# 1.1.1.8 FAT: filesystem + - id: 4007 + title: "Ensure mounting of FAT filesystems is disabled" + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install vfat /bin/true. Run the following command to unload the vfat module: rmmod vfat" + compliance: + - cis: ["1.1.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found' + - 'not c:lsmod -> r:vfat' + # 1.1.2 /tmp: partition - - id: 5000 + - id: 4008 title: "Ensure separate partition exists for /tmp" description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." - rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - cis: ["1.1.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ condition: all rules: - 'c:mount -> r:\s/tmp\s' + # 1.1.3 /tmp: nodev - - id: 5001 + - id: 4009 title: "Ensure nodev option set on /tmp partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Run the following command to remount /tmp : # mount -o remount,nodev /tmp" + remediation: "Edit the /etc/fstabfile and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp:# mount -o remount,nodev /tmp" compliance: - cis: ["1.1.3"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/tmp\s && r:nodev' # 1.1.4 /tmp: nosuid - - id: 5002 + - id: 4010 title: "Ensure nosuid option set on /tmp partition" description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." - rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp ." - remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Run the following command to remount /tmp : # mount -o remount,nosuid /tmp" + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp" compliance: - cis: ["1.1.4"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/tmp\s && r:nosuid' # 1.1.5 /tmp: noexec - - id: 5003 + - id: 4011 title: "Ensure noexec option set on /tmp partition" description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." - rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp ." - remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Run the following command to remount /tmp : # mount -o remount,noexec /tmp" + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp" compliance: - cis: ["1.1.5"] - cis_csc: ["2"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/tmp\s && r:noexec' + + # 1.1.6 Build considerations - Partition scheme. - - id: 5004 + - id: 4012 title: "Ensure separate partition exists for /var" description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - cis: ["1.1.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ condition: all rules: - 'c:mount -> r:\s/var\s' - - - id: 5005 +# 1.1.7 bind mount /var/tmp to /tmp + - id: 4013 title: "Ensure separate partition exists for /var/tmp" description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - cis: ["1.1.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/var/tmp\s' +# 1.1.8 nodev set on /var/tmp + - id: 4014 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + +# 1.1.9 nosuid set on /var/tmp + - id: 4015 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + +# 1.1.10 noexec set on /var/tmp + - id: 4016 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + # 1.1.11 /var/log: partition - - id: 5006 + - id: 4017 title: "Ensure separate partition exists for /var/log" description: "The /var/log directory is used by system services to store log data ." rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - cis: ["1.1.11"] - cis_csc: ["6.3"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ condition: all @@ -133,7 +338,7 @@ checks: - 'c:mount -> r:\s/var/log\s' # 1.1.12 /var/log/audit: partition - - id: 5007 + - id: 4018 title: "Ensure separate partition exists for /var/log/audit" description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." @@ -141,6 +346,9 @@ checks: compliance: - cis: ["1.1.12"] - cis_csc: ["6.3"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ condition: all @@ -148,13 +356,16 @@ checks: - 'c:mount -> r:\s/var/log/audit\s' # 1.1.13 /home: partition - - id: 5008 + - id: 4019 title: "Ensure separate partition exists for /home" description: "The /home directory is used to support disk storage needs of local users." rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - cis: ["1.1.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ condition: all @@ -162,7 +373,7 @@ checks: - 'c:mount -> r:\s/home\s' # 1.1.14 /home: nodev - - id: 5009 + - id: 4020 title: "Ensure nodev option set on /home partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." @@ -171,12 +382,13 @@ checks: - cis: ["1.1.14"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/home\s && r:nodev' # 1.1.15 /dev/shm: nodev - - id: 5010 + - id: 4021 title: "Ensure nodev option set on /dev/shm partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." @@ -185,12 +397,13 @@ checks: - cis: ["1.1.15"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/dev/shm\s && r:nodev' # 1.1.16 /dev/shm: nosuid - - id: 5011 + - id: 4022 title: "Ensure nosuid option set on /dev/shm partition" description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." @@ -199,287 +412,795 @@ checks: - cis: ["1.1.16"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/dev/shm\s && r:nosuid' # 1.1.17 /dev/shm: noexec - - id: 5012 + - id: 4023 title: "Ensure noexec option set on /dev/shm partition" description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." - remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm : # mount -o remount,noexec /dev/shm" + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" compliance: - cis: ["1.1.17"] - cis_csc: ["2"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/dev/shm\s && r:noexec' -############################################### -# 1.4 Configure SELinux -############################################### -# 1.6.1.1 enable selinux in /etc/grub.conf - - id: 5013 - title: "Ensure SELinux is not disabled in bootloader configuration" - description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." - rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." - remediation: "Edit /boot/grub/grub.conf and remove all instances of selinux=0 and enforcing=0 on all kernel lines." +# 1.1.22 Disable Automounting + - id: 4024 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: # chkconfig autofs off" compliance: - - cis: ["1.6.1.1"] - - cis_csc: ["14.4"] + - cis: ["1.1.22"] + - cis_csc: ["8.3"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'f:/etc/grub.conf,/boot/grub/grub.conf -> r:selinux=0|enforcing=0' + - 'c:chkconfig --list autofs -> r:^\s*\t*autofs\.*on' -# 1.6.1.2 Set selinux state - - id: 5014 - title: "Ensure the SELinux state is enforcing" - description: "Set SELinux to enable when the system is booted." - rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." - remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + +############################################### +# 1.2 Configure Software Updates +############################################### + +# 1.2.2 Activate gpgcheck + - id: 4025 + title: "Ensure gpgcheck is globally activated" + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." compliance: - - cis: ["1.6.1.2"] - - cis_csc: ["14.4"] - - pci_dss: ["2.2.4"] - - nist_800_53: ["CM.1"] + - cis: ["1.2.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] condition: all rules: - - 'c:sestatus -> r:^SELinux status:\s+enabled$' - - 'c:sestatus -> r:^Current mode:\s+enforcing$' - - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' - - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + - 'f:/etc/yum.conf -> r:^gpgcheck=1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0' -# 1.6.1.3 Set selinux policy - - id: 5015 - title: "Ensure SELinux policy is configured" - description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." - rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." - remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + # 1.2.5 Disable the rhnsd Daemon (Not Scored) + - id: 4026 + title: "Disable the rhnsd Daemon" + description: "The rhnsd daemon polls the Red Hat Network web site for scheduled actions and, if there are, executes those actions." + rationale: "Patch management policies may require that organizations test the impact of a patch before it is deployed in a production environment. Having patches automatically deployed could have a negative impact on the environment. It is best to not allow an action by default but only after appropriate consideration has been made. It is recommended that the service be disabled unless the risk is understood and accepted or you are running your own satellite . This item is not scored because organizations may have addressed the risk." + remediation: "Run the following command to disable rhnsd : # chkconfig rhnsd off" compliance: - - cis: ["1.6.1.3"] - - pci_dss: ["2.2.4"] - - nist_800_53: ["CM.1"] + - cis: ["1.2.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - - 'c:sestatus -> r:^Loaded policy name:\s+targeted$' - - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + - 'c:chkconfig --list rhnsd -> r:^rhnsd\s*\t*0:off\s*\t*1:off\s*\t*2:off\s*\t*3:off\s*\t*4:off\s*\t*5:off\s*\t*6:off' -# 1.6.1.4 Remove SETroubleshoot - - id: 5016 - title: "Ensure SETroubleshoot is not installed" - description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user- friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." - rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." - remediation: "Run the following command to uninstall setroubleshoot: # yum remove setroubleshoot" + + + +############################################### +# 1.3 Filesystem Integrity Checking +############################################### + +# 1.3.1 install AIDE + - id: 4027 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install aide: yum install aide // Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" compliance: - - cis: ["1.6.1.4"] - - pci_dss: ["2.2.4"] - - nist_800_53: ["CM.1"] - condition: none + - cis: ["1.3.1"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all rules: - - 'c:rpm -qa setroubleshoot -> r:setroubleshoot' + - 'c:rpm -q aide -> r:aide-\S*' -# 1.6.1.5 Disable MCS Translation service mcstrans - - id: 5017 - title: "Ensure the MCS Translation Service (mcstrans) is not installed" - description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" - rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." - remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" +# 1.3.2 AIDE regular checks + - id: 4028 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following command: crontab -u root -e // Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. " compliance: - - cis: ["1.6.1.5"] - - pci_dss: ["2.2.4"] - - nist_800_53: ["CM.1"] - condition: none + - cis: ["1.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any rules: - - 'c:rpm -qa mcstrans -> r:mcstrans' + - 'c:crontab -u root -l -> r:aide' + - 'c:grep -r aide /etc/cron.* /etc/crontab -> r:aide' + ############################################### -# 1.4 Secure Boot Settings +# 1.4 Secure Boot Settings ############################################### +# 1.4.1 Configure bootloader + - id: 4029 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub/grub.conf and linked as /boot/grub/menu.lst and /etc/grub.conf ." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub/grub.conf # chmod og-rwx /boot/grub/grub.conf" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.conf -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + # 1.4.2 Set Boot Loader Password (Scored) - - id: 5018 + - id: 4030 title: "Ensure bootloader password is set" - description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters" - rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security." - remediation: "Create an encrypted password with grub-md5-crypt, copy and paste the into the global section of /boot/grub/grub.conf." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub-md5-crypt: # grub-md5-crypt Password: Retype Password: Copy and paste the into the global section of /boot/grub/grub.conf : password --md5 " compliance: - cis: ["1.4.2"] - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'f:/boot/grub/grub.cfg,/boot/grub/grub.conf -> !r:^# && r:password --md5' + - 'f:/boot/grub/grub.conf -> r:^password --md5\s\.+' -# 1.4.3 Require Authentication for Single-User Mode (Scored) - - id: 5019 +# 1.4.3 Single user authentication + - id: 4031 title: "Ensure authentication required for single user mode" description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." - remediation: "Edit /etc/sysconfig/init and set SINGLE to ' /sbin/sulogin ': SINGLE=/sbin/sulogin" + remediation: "Edit /etc/sysconfig/init and set SINGLE to ' /sbin/sulogin': SINGLE=/sbin/sulogin" compliance: - cis: ["1.4.3"] - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'f:/etc/sysconfig/init -> !r:^# && r:SINGLE\s*=\s*/sbin/sulogin' + - 'f:/etc/sysconfig/init -> r:SINGLE\s*=\s*/sbin/sulogin' -# 1.4.4 Disable Interactive Boot (Scored) - - id: 5020 +# 1.4.4 Ensure interactive boot is not enabled (Scored) + - id: 4032 title: "Ensure interactive boot is not enabled" - description: "Interactive boot allows console users to interactively select which services start on boot. The PROMPT option provides console users the ability to interactively boot the system and select which services to start on boot ." - rationale: "Turn off the PROMPT option on the console to prevent console users from potentially overriding established security settings." + description: "Interactive boot allows console users to interactively select which services start on boot. The PROMPT option provides console users the ability to interactively boot the system and select which services to start on boot . " + rationale: "Turn off the PROMPT option on the console to prevent console users from potentially overriding established security settings. " remediation: "Edit the /etc/sysconfig/init file and set PROMPT to ' no ': PROMPT=no" compliance: - cis: ["1.4.4"] - cis_csc: ["5.1"] - - pci_dss: ["2.2.4"] - - nist_800_53: ["CM.1"] condition: all rules: - - 'f:/etc/sysconfig/init -> r:^PROMPT\s*=\s*no$' + - 'f:/etc/sysconfig/init -> r:PROMPT\s*=\s*no' + ############################################### -# 1.5 Additional Process Hardening +# 1.5 Additional Process Hardening ############################################### # 1.5.1 Restrict Core Dumps (Scored) - - id: 5021 + - id: 4033 title: "Ensure core dumps are restricted" description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." - rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) )." - remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0; fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 and Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" compliance: - cis: ["1.5.1"] - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' - 'c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' +# 1.5.2 XD/NX enabled + - id: 4034 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + # 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) - - id: 5022 + - id: 4035 title: "Ensure address space layout randomization (ASLR) is enabled" description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 and set the active kernel parameter" + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" compliance: - cis: ["1.5.3"] - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' +# 1.5.4 Disable prelink + - id: 4036 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["3.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q prelink -> package prelink is not installed' + ############################################### -# 2 OS Services -############################################### -############################################### -# 2.1 Remove Legacy Services +# 1.6 Configure SELinux ############################################### -# 2.1.8 Remove telnet-server (Scored) - - id: 5023 - title: "Ensure telnet server is not enabled" - description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." - rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." - remediation: "Run the following command to disable telnet: # chkconfig telnet off" + +# 1.6.1.1 SELinux not disabled + - id: 4037 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /boot/grub/grub.conf and remove all instances of selinux=0 and enforcing=0 on all kernel lines" compliance: - - cis: ["2.1.8"] - - cis_csc: ["3.4", "9.1"] - - pci_dss: ["2.2.3"] + - cis: ["1.6.1.1"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:telnet-server && r::on' + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel\.*selinux=0|^\s*\t*kernel\.*enforcing=0' -# 2.1.6 Remove rsh-server (Scored) - - id: 5024 - title: "Ensure rsh server is not enabled" - description: "The Berkeley rsh-server ( rsh , rlogin , rexec ) package contains legacy services that exchange credentials in clear-text." - rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." - remediation: "Disable rsh, rlogin, and rexec." +# 1.6.1.2 Set selinux state + - id: 4038 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" compliance: - - cis: ["2.1.6"] - - cis_csc: ["3.4"] - - pci_dss: ["2.2.3"] + - cis: ["1.6.1.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:chkconfig --list -> r:rsh|rlogin|rexec && r::on' + - 'c:sestatus -> r:^SELinux status:\s+enabled' + - 'c:sestatus -> r:^Current mode:\s+enforcing' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing' + - 'f:/etc/selinux/config -> r:^SELINUX\s*=\s*enforcing' - -# 2.3.1 Remove NIS Client (Scored) - - id: 5025 - title: "Ensure NIS Client is not installed" - description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." - rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP)." - remediation: "Run the following command to uninstall ypbind : # yum remove ypbind" +# 1.6.1.3 Set selinux policy + - id: 4039 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" compliance: - - cis: ["2.3.1"] - - cis_csc: ["2"] - - pci_dss: ["2.2.3"] + - cis: ["1.6.1.3"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:rpm -qa ypbind -> r:ypbind' + - 'c:sestatus -> r:^Policy from config file:\s+targeted|^Policy from config file:\s+mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' -# 2.2.16 Remove NIS Server (Scored) - - id: 5026 - title: "Ensure NIS Server is not enabled" - description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." - rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP)." - remediation: "Run the following command to disable ypserv: # chkconfig ypserv off" +# 1.6.1.4 Remove SETroubleshoot + - id: 4040 + title: "Ensure SETroubleshoot is not installed" + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # yum remove setroubleshoot" compliance: - - cis: ["2.2.16"] - - cis_csc: ["9.4"] - - pci_dss: ["2.2.3"] + - cis: ["1.6.1.4"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:ypserv && r::on' + - 'c:rpm -qa setroubleshoot -> r:setroubleshoot' -# 2.1.9 Remove tftp-server (Scored) - - id: 5027 - title: "Ensure tftp server is not enabled" - description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is used to define and support a TFTP server." - rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." - remediation: "Run the following command to disable tftp: # chkconfig tftp off" +# 1.6.1.5 Disable MCS Translation service mcstrans + - id: 4041 + title: "Ensure the MCS Translation Service (mcstrans) is not installed" + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" compliance: - - cis: ["2.1.9"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["1.6.1.5"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:tftp && r::on' + - 'c:rpm -qa mcstrans -> r:mcstrans' -# 2.1.7 Remove talk-server (Scored) - - id: 5028 - title: "Ensure talk server is disabled" - description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." - rationale: "The software presents a security risk as it uses unencrypted protocols for communication." - remediation: "Run the following command to disable talk: # chkconfig talk off" +# 1.6.1.6 Ensure no unconfined daemons exist + - id: 4042 + title: "Ensure no unconfined daemons exist" + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." compliance: - - cis: ["2.1.7"] + - cis: ["1.6.1.6"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk' +# 1.6.2 Install SELinux + - id: 4043 + title: "Ensure SELinux is installed" + description: "SELinux provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install libselinux: yum install libselinux" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-\S+' + +############################################### +# 1.7 Warning Banners +############################################### +# 1.7.1.1 Configure message of the day (Scored) + - id: 4044 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + +# 1.7.1.2 Configure local login warning banner (Not Scored) + - id: 4045 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + +# 1.7.1.3 Configure remote login warning banner (Not Scored) + - id: 4046 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + +# 1.7.1.4 Configure /etc/motd permissions (Not Scored) + - id: 4047 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.7.1.5 Configure /etc/issue permissions (Scored) + - id: 4048 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' +# 1.7.1.6 Configure /etc/issue.net permissions (Not Scored) + - id: 4049 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.7.2 Ensure GDM login banner is configured (Scored) + - id: 4050 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults || Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message : [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' || Run the following command to update the system databases: dconf update" + compliance: + - cis: ["1.7.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'f:/etc/dconf/profile/gdm -> r:user-db:user' + - 'f:/etc/dconf/profile/gdm -> r:system-db:gdm' + - 'f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults' + - 'f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-enable=true' + - 'f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-text=\.+' + + +# 1.8 Ensure updates, patches, and additional security software are installed (Not Scored) + - id: 4051 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Site policy may mandate a testing period before install onto production systems for available updates. The audit and remediation here only cover security updates. Non-security updates can be audited with and comparing against site policy: # yum check-update" + compliance: + - cis: ["1.8"] + - cis_csc: ["4.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6","SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - 'c:yum check-update --security -> r:No packages needed for security' + +############################################### +# 2 OS Services +############################################### +############################################### +# 2.1 inetd Services +############################################### +# 2.1.1 Disable chargen services (Scored) + + - id: 4052 + title: "Ensure chargen services are not enabled" + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable chargen-dgram and chargen-stream: # chkconfig chargen-dgram off; # chkconfig chargen-stream off" + compliance: + - cis: ["2.1.1"] - cis_csc: ["9.1"] - pci_dss: ["2.2.3"] - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:talk && r::on' + - 'c:chkconfig --list chargen-dgram -> r:^\s*\t*chargen-dgram:\s*\t*on' + - 'c:chkconfig --list chargen-stream-> r:^\s*\t*chargen-stream:\s*\t*on' +# 2.1.2 Disable daytime services (Scored) + - id: 4053 + title: "Ensure daytime services are not enabled" + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable daytime-dgram and daytime-stream: # chkconfig daytime-dgram off; # chkconfig daytime-stream off" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list daytime-dgram -> r:^\s*\t*daytime-dgram:\s*\t*on' + - 'c:chkconfig --list daytime-stream -> r:^\s*\t*daytime-stream:\s*\t*on' + +# 2.1.3 Disable discard services (Scored) + - id: 4054 + title: "Ensure discard services are not enabled" + description: "discardis a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable discard-dgram and discard-stream: # chkconfig discard-dgram off; # chkconfig discard-stream off" + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list discard-dgram -> r:^\s*\t*discard-dgram:\s*\t*on' + - 'c:chkconfig --list discard-stream -> r:^\s*\t*discard-stream:\s*\t*on' + +# 2.1.4 Disable echo-dgram (Scored) + - id: 4055 + title: "Ensure echo services are not enabled" + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable echo-dgram and echo-stream: # chkconfig echo-dgram off; # chkconfig echo-stream off" + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list echo-dgram -> r:^\s*\t*echo-dgram:\s*\t*on' + - 'c:chkconfig --list echo-stream -> r:^\s*\t*echo-stream:\s*\t*on' + +# 2.1.5 Disable time-stream (Scored) + - id: 4056 + title: "Ensure time services are not enabled" + description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable time-dgram and time-stream: # chkconfig time-dgram off; # chkconfig time-stream off" + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list time-dgram -> r:^\s*\t*time-dgram:\s*\t*on' + - 'c:chkconfig --list time-stream -> r:^\s*\t*time-stream:\s*\t*on' + +# 2.1.6 Remove rsh-server (Scored) + - id: 4057 + title: "Ensure rsh server is not enabled" + description: "The Berkeley rsh-server ( rsh , rlogin , rexec ) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "Run the following commands to disable rsh, rlogin, and rexec: # chkconfig rsh off # chkconfig rlogin off # chkconfig rexec off" + compliance: + - cis: ["2.1.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rexec -> r:^\s*\t*rexec:\s*\t*on' + - 'c:chkconfig --list rlogin -> r:^\s*\t*rlogin:\s*\t*on' + - 'c:chkconfig --list rsh -> r:^\s*\t*rsh:\s*\t*on' + + +# 2.1.7 Remove talk server (Scored) + - id: 4058 + title: "Ensure talk server is not enabled" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable talk: # chkconfig talk off" + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list talk -> r:^\s*\t*talk:\s*\t*on' + +# 2.1.8 Remove telnet-server (Scored) + - id: 4059 + title: "Ensure telnet server is not enabled" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to disable telnet: # chkconfig telnet off" + compliance: + - cis: ["2.1.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list telnet -> r:^\s*\t*telnet:\s*\t*on' + +# 2.1.9 Ensure tftp server is not enabled (Scored) + - id: 4060 + title: "Ensure tftp server is not enabled" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Run the following command to disable tftp: # chkconfig tftp off" + compliance: + - cis: ["2.1.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list tftp -> r:^\s*\t*tftp:\s*\t*on' + +# 2.1.10 Remove rsync service (Scored) + - id: 4061 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # chkconfig rsyncd off" + compliance: + - cis: ["2.1.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rsync -> r:^\s*\t*rsync:\s*\t*on' + +# 2.1.11 Remove xinetd (Scored) + - id: 4062 + title: "Ensure xinetd is not enabled" + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to disable xinetd: # chkconfig xinetd off" + compliance: + - cis: ["2.1.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list xinetd -> r:^\s*\t*xinetd\.*on' + +############################################## +# 2.2 Remove Legacy Services ############################################### -# 2 Special Purpose Services -############################################### + +# 2.2.1.1 Ensure time synchronization is in use (Not Scored) + - id: 4063 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available run the following commands and verify either ntp or chrony is installed: # rpm -q ntp # rpm -q chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and verify that host based synchronization is in use." + compliance: + - cis: ["2.2.2.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'not c:rpm -q ntp -> r:^package ntp is not installed' + - 'not c:rpm -q chrony -> r:^package chrony is not installed' + +# 2.2.1.2 Configure Network Time Protocol (NTP) (Scored) + - id: 4064 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/ntp.conf to match the following: - restrict -4 default kod nomodify notrap nopeer noquery and - restrict -4 default kod nomodify notrap nopeer noquery. 2) Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': - OPTIONS='-u ntp:ntp'" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/ntpd -> r:^OPTIONS\s*=\s* && r:-u ntp:ntp' + +# 2.2.1.3 Configure Network Time Protocol (Chrony) (Scored) + - id: 4065 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/chrony.conf to match the following: - 1) Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/chronyd to include: - OPTIONS='-u chronyd'" + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' # 2.2.2 Remove X Windows (Scored) - - id: 5029 + - id: 4066 title: "Ensure X Window System is not installed" description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." @@ -489,57 +1210,132 @@ checks: - cis_csc: ["2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - 'c:rpm -qa xorg-x11* -> r:^xorg-x11' # 2.2.3 Disable Avahi Server (Scored) - - id: 5030 + - id: 4067 title: "Ensure Avahi Server is not enabled" - description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." - remediation: "Run the following command to disable avahi-daemon : # chkconfig avahi-daemon off" + remediation: "Run the following command to disable avahi-daemon: # chkconfig avahi-daemon off" compliance: - cis: ["2.2.3"] - cis_csc: ["9.1"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list avahi-daemon -> r:^\s*\t*avahi-daemon\.*on' + +# 2.2.4 Ensure CUPS is not enabled (Scored) + - id: 4068 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups : # chkconfig cups off" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list cups -> r:^\s*\t*cups\.*on' + +# 2.2.5 Remove DHCP Server (Scored) + - id: 4069 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dhcpd: # chkconfig dhcpd off" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp + condition: none + rules: + - 'c:chkconfig --list dhcpd -> r:^\s*\t*dhcpd\.*on' + +# 2.2.6 Remove LDAP Server (Scored) + - id: 4070 + title: "Ensure LDAP Server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # chkconfig slapd off" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on OpenLDAP is available at https://www.openldap.org condition: none rules: - - 'c:chkconfig --list -> r:avahi-daemon && r::on' + - 'c:chkconfig --list slapd -> r:^\s*\t*slapd\.*on' + + -# 2.2.7 Disable NFS and RPC (Not Scored) - - id: 5031 +# 2.2.7 Disable NFS and RPC (Scored) + - id: 4071 title: "Ensure NFS and RPC are not enabled" description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." - remediation: "Run the following commands to disable nfs and rpcbind: # chkconfig nfs off # chkconfig rpcbind off" + remediation: "Run the following commands to disable nfs, nfs-server and rpcbind: # chkconfig nfs off; # chkconfig rpcbind off" compliance: - cis: ["2.2.7"] - cis_csc: ["9.1"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:nfs|rpcbind && r::on' + - 'c:chkconfig --list nfs -> r:^\s*\t*nfs\.*on' + - 'c:chkconfig --list rpcbind -> r:^\s*\t*rpcbind\.*on' -# 2.2.9 Remove FTP Server (Not Scored) - - id: 5032 +# 2.2.8 Ensure DNS Server is not enabled (Scored) + - id: 4072 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named : # chkconfig named off" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list named -> r:^\s*\t*named\.*on' + +# 2.2.9 Remove FTP Server (Scored) + - id: 4073 title: "Ensure FTP Server is not enabled" description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." - rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." remediation: "Run the following command to disable vsftpd: # chkconfig vsftpd off" compliance: - cis: ["2.2.9"] - cis_csc: ["9.1"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:vsftpd && r::on' + - 'c:chkconfig --list vsftpd -> r:^\s*\t*vsftpd\.*on' # 2.2.10 Remove HTTP Server (Scored) - - id: 5033 + - id: 4074 title: "Ensure HTTP server is not enabled" description: "HTTP or web servers provide the ability to host web site content." rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." @@ -547,12 +1343,15 @@ checks: compliance: - cis: ["2.2.10"] - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:httpd && r::on' + - 'c:chkconfig --list httpd -> r:^\s*\t*httpd\.*on' # 2.2.11 Remove Dovecot (IMAP and POP3 services) (Scored) - - id: 5034 + - id: 4075 title: "Ensure IMAP and POP3 server is not enabled" description: "dovecot is an open source IMAP and POP3 server for Linux based systems." rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." @@ -562,12 +1361,13 @@ checks: - cis_csc: ["9.1"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:dovecot && r::on' + - 'c:chkconfig --list dovecot -> r:^\s*\t*dovecot\.*on' # 2.2.12 Remove Samba (Scored) - - id: 5035 + - id: 4076 title: "Ensure Samba is not enabled" description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." @@ -577,73 +1377,211 @@ checks: - cis_csc: ["9.1"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:smb && r::on' + - 'c:chkconfig --list smb -> r:^\s*\t*smb\.*on' # 2.2.13 Remove HTTP Proxy Server (Scored) - - id: 5036 + - id: 4077 title: "Ensure HTTP Proxy Server is not enabled" description: "Squid is a standard proxy server used in many distributions and environments." rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable squid : # chkconfig squid off" + remediation: "Run the following command to disable squid: # chkconfig squid off" compliance: - cis: ["2.2.13"] - cis_csc: ["9.1"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:squid && r::on' + - 'c:chkconfig --list squid -> r:^\s*\t*squid\.*on' -# 2.2.14 Remove SNMP Server (Scored) - - id: 5037 +# 2.2.14 Remove SNMP Server (Not Scored) + - id: 4078 title: "Ensure SNMP Server is not enabled" description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." - rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." remediation: "Run the following command to disable snmpd: # chkconfig snmpd off" compliance: - cis: ["2.2.14"] - cis_csc: ["9.1"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:chkconfig --list -> r:snmpd && r::on' + - 'c:chkconfig --list snmpd -> r:^\s*\t*snmpd\.*on' + +# 2.2.15 Ensure mail transfer agent is configured for local-only mode (Scored) + - id: 4079 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Restart postfix: # service postfix restart" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.+LISTEN' + +# 2.2.16 Remove NIS Server (Scored) + - id: 4080 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable ypserv: # chkconfig ypserv off" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list ypserv -> r:^\s*\t*ypserv\.*on' ############################################### -# 3 Network Configuration and Firewalls -############################################### -############################################### -# 3.1 Modify Network Parameters (Host Only) +# 2.3 Service Clients ############################################### -# 3.1.1 Disable IP Forwarding (Scored) - - id: 5038 - title: "Ensure IP forwarding is disabled" - description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." - rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 and run # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" +# 2.3.1 Remove NIS Client (Scored) + - id: 4081 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # yum remove ypbind" compliance: - - cis: ["3.1.1"] - - cis_csc: ["3", "11"] - - pci_dss: ["2.2.4"] + - cis: ["2.3.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:rpm -q ypbind -> package ypbind is not installed' -# 3.1.2 Disable Send Packet Redirects (Scored) - - id: 5039 +# 2.3.2 Ensure rsh client is not installed (Scored) + - id: 4082 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Run the following command to uninstall rsh : # yum remove rsh" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q rsh -> package rsh is not installed' + +# 2.3.3 Ensure talk client is not installed (Scored) + - id: 4083 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk : # yum remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q talk -> package talk is not installed' + +# 2.3.4 Ensure telnet client is not installed (Scored) + - id: 4084 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet : # yum remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q telnet -> package telnet is not installed' + +# 2.3.5 Ensure LDAP client is not installed (Scored) + - id: 4085 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # yum remove openldap-clients" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q openldap-clients -> package openldap-clients is not installed' + +############################################### +# 3 Network Configuration and Firewalls +############################################### +############################################### +# 3.1 Modify Network Parameters (Host Only) +############################################### +# 3.1.1 Disable IP Forwarding (Scored) + - id: 4086 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + +# 3.1.2 Disable Send Packet Redirects (Scored) + - id: 4087 title: "Ensure packet redirect sending is disabled" description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0 and set the active kernel parameters." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" compliance: - cis: ["3.1.2"] - cis_csc: ["3", "11"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' @@ -655,149 +1593,1070 @@ checks: # 3.2 Modify Network Parameters (Host and Router) ############################################### # 3.2.1 Disable Source Routed Packet Acceptance (Scored) - - id: 5040 + - id: 4088 title: "Ensure source routed packets are not accepted" - description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network." - rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 and set the active kernel parameters" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0; net.ipv4.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" compliance: - cis: ["3.2.1"] - cis_csc: ["3", "11"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + +# 3.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 4089 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + +# 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 4090 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0; net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + +# 3.2.4 Log Suspicious Packets (Scored) + - id: 4091 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1; net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + +# 3.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 4092 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + +# 3.2.6 Enable Bad Error Message Protection (Scored) + - id: 4093 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + +# 3.2.7 Enable RFC-recommended Source Route Validation (Scored) + - id: 4094 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1; net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + +# 3.2.8 Enable TCP SYN Cookies (Scored) + - id: 4095 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + +############################################### +# 3.3 IPv6 +############################################### +# 3.3.1 Ensure IPv6 router advertisements are not accepted (Not Scored) + - id: 4096 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0' + + +# 3.3.2 Ensure IPv6 redirects are not accepted (Not Scored) + - id: 4097 + title: "Ensure IPv6 redirects are not accepted" + description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." + rationale: "It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 || net.ipv6.conf.default.accept_redirects = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0' + +# 3.3.3 Ensure IPv6 is disabled (Not Scored) + - id: 4098 + title: "Ensure IPv6 is disabled" + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: "Edit /boot/grub/grub.conf to include ipv6.disable=1 on all kernel lines." + compliance: + - cis: ["3.3.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel && !r:ipv6.disable=1' + + +############################################### +# 3.4 TCP Wrappers +############################################### +# 3.4.1 Ensure TCP Wrappers is installed (Scored) + - id: 4099 + title: "Ensure TCP Wrappers is installed" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Run the following command to install tcp_wrappers: yum install tcp_wrappers" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:rpm -q tcp_wrappers -> r:^tcp_wrappers-' + - 'c:rpm -q tcp_wrappers-libs -> r:^tcp_wrappers-libs-' + +# 3.4.3 Ensure /etc/hosts.deny is configured (Scored) + - id: 4100 + title: "Ensure /etc/hosts.deny is configured" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: "Run the following command to create /etc/hosts.deny: echo 'ALL: ALL' >> /etc/hosts.deny" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.deny -> r:^ALL\s*:\s*ALL' + +# 3.4.4 Ensure permissions on /etc/hosts.allow are configured (Scored) + - id: 4101 + title: "Ensure permissions on /etc/hosts.allow are configured." + description: "The /etc/hosts.allow file contains networking information that is used by many applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : chown root:root /etc/hosts.allow and chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:stat /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)' + + +# 3.4.5 Ensure permissions on /etc/hosts.deny are configured (Scored) + - id: 4102 + title: "Ensure permissions on /etc/hosts.deny are configured." + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : chown root:root /etc/hosts.deny and chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +############################################### +# 3.5 Uncommon Network Protocols +############################################### +# 3.5.1 Ensure DCCP is disabled (Not Scored) + - id: 4103 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce +the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.5.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:install /bin/true' + - 'not c:lsmod -> r:dccp' + + + +# 3.5.2 Ensure SCTP is disabled (Not Scored) + - id: 4104 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.5.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:install /bin/true' + - 'not c:lsmod -> r:sctp' + + +# 3.5.3 Ensure RDS is disabled (Not Scored) + - id: 4105 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v rds -> r:install /bin/true' + - 'not c:lsmod -> r:rds' + + +# 3.5.4 Ensure TIPC is disabled (Not Scored) + - id: 4106 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.5.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v tipc -> r:install /bin/true' + - 'not c:lsmod -> r:tipc' + +############################################### +# 3.6 Firewall Configuration +############################################### +# 3.6.1 Ensure iptables is installed (Scored) + - id: 4107 + title: "Ensure iptables is installed" + description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables ." + rationale: "iptables is required for firewall management and configuration." + remediation: "Run the following command to install iptables : yum install iptables" + compliance: + - cis: ["3.6.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.1"] + condition: all + rules: + - 'c:rpm -q iptables -> r:iptables-' + +# 3.6.2 Ensure default deny firewall policy (Scored) + - id: 4108 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: iptables -P INPUT DROP; iptables -P OUTPUT DROP and iptables -P FORWARD DROP" + compliance: + - cis: ["3.6.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + +# 3.6.3 Ensure loopback traffic is configured (Scored) + - id: 4109 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.6.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + +############################################### +# 4 Logging and Auditing +############################################### + +############################################### +# 4.1 Configure System Accounting (auditd) +############################################### + +# 4.1.1.1 Ensure audit log storage size is configured (Not Scored) + - id: 4110 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file\s*=\s*\d+' + +# 4.1.1.2 Ensure system is disabled when audit logs are full (Scored) + - id: 4111 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^admin_space_left_action\s*=\s*halt' + +# 4.1.1.3 Ensure audit logs are not automatically deleted (Scored) + - id: 4112 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file_action\s*=\s*keep_logs' + +# 4.1.2 Ensure auditd service is enabled (Scored) + - id: 4113 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd : # chkconfig auditd on" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1","10.7"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:chkconfig --list auditd -> r:2:on && r:3:on && r:4:on && r:5:on' + + +# 4.1.3 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 4114 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "Edit /boot/grub/grub.conf to include audit=1 on all kernel lines. Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.6","10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel && !r:audit=1' + +# 4.1.4 Ensure events that modify date and time information are collected (Scored) + - id: 4115 + title: "Ensure events that modify date and time information are collected" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"." + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'f:/etc/audit/audit.rules -> r:-w /etc/localtime && r:-p wa && r:-k time-change' + +# 4.1.5 Ensure events that modify user/group information are collected (Scored) + - id: 4116 + title: "Ensure events that modify user/group information are collected" + description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity" + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /etc/group && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:-w /etc/passwd && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:-w /etc/gshadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:-w /etc/shadow && r:-p wa && r:-k identity' + - 'f:/etc/audit/audit.rules -> r:-w /etc/security/opasswd && r:-p wa && r:-k identity' + +# 4.1.6 Ensure events that modify the system's network environment are collected (Scored) + - id: 4117 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale" + compliance: + - cis: ["4.1.6"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/issue && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/issue.net && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/hosts && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network && r:-p wa && r:-k system-locale' + - 'f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale' + +# 4.1.7 Ensure events that modify the system's Mandatory Access Controls are collected (Scored) + - id: 4118 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or directory." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /etc/selinux/ && r:-p wa && r:-k MAC-policy' + - 'f:/etc/audit/audit.rules -> r:-w /usr/share/selinux/ && r:-p wa && r:-k MAC-policy' + +# 4.1.8 Ensure login and logout events are collected (Scored) + - id: 4119 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The /var/run/failock directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/lastlog -p wa -k logins -w /var/run/faillock/ -p wa -k logins" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5","16.10","16.4"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /var/log/lastlog && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:-w /var/run/faillock/ && r:-p wa && r:-k logins' + +# 4.1.9 Ensure session initiation information is collected (Scored) + - id: 4120 + title: "Ensure session initiation information is collected" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"." + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins" + compliance: + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5","16.10","16.4"] + - pci_dss: ["10.3"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /var/run/utmp && r:-p wa && r:-k session' + - 'f:/etc/audit/audit.rules -> r:-w /var/log/wtmp && r:-p wa && r:-k logins' + - 'f:/etc/audit/audit.rules -> r:-w /var/log/btmp && r:-p wa && r:-k logins' + +# 4.1.10 Ensure discretionary access control permission modification events are collected (Scored) + - id: 4121 + title: "Ensure discretionary access control permission modification events are collected" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 500) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem" + compliance: + - cis: ["4.1.10"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod' + +# 4.1.11 Ensure unsuccessful unauthorized file access attempts are collected (Scored) + - id: 4122 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 500), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access" + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access' + +# 4.1.13 Ensure successful file system mounts are collected (Scored) + - id: 4123 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=500 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts" + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k mounts' + + +# 4.1.14 Ensure file deletion events by users are collected (Scored) + - id: 4124 + title: "Ensure file deletion events by users are collected" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete" + compliance: + - cis: ["4.1.14"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4","PI1.5","CC7.1","CC7.2","CC7.3","CC8.1"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k delete' + +# 4.1.15 Ensure changes to system administration scope (sudoers) is collected (Scored) + - id: 4125 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope" + compliance: + - cis: ["4.1.15"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope' + - 'f:/etc/audit/audit.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope' + +# 4.1.16 Ensure system administrator actions (sudolog) are collected (Scored) + - id: 4126 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1","5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /var/log/sudo.log && r:-p wa && r:-k actions' + +# 4.1.17 Ensure kernel module loading and unloading is collected (Scored) + - id: 4127 + title: "Ensure kernel module loading and unloading is collected" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/audit/audit.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules' + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + +# 4.1.18 Ensure the audit configuration is immutable (Scored) + - id: 4128 + title: "Ensure the audit configuration is immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl . Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file. -e 2" + compliance: + - cis: ["4.1.18"] + - cis_csc: ["3","6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:tail -1 /etc/audit/audit.rules -> r:^-e 2' + + +############################################### +# 4.2 Configure Logging +############################################### + +# 4.2.1.1 Ensure rsyslog Service is enabled (Scored) + - id: 4129 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lackblogging instead." + remediation: "Run the following command to enable rsyslog : # chkconfig rsyslog on" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:chkconfig --list rsyslog -> r:2:on && r:3:on && r:4:on && r:5:on' +# 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 4130 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0600|^\$FileCreateMode 0640|^\$FileCreateMode 0440|^\$FileCreateMode 0400|^\$FileCreateMode 0040|^\$FileCreateMode 0000' + +# 4.2.1.4 Ensure rsyslog is configured to send logs to a remote log host (Scored) + - id: 4131 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + + + +# 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 4132 + title: "Ensure syslog-ng service is enabled" + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable syslog-ng : # chkconfig syslog-ng on" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:chkconfig --list syslog-ng -> r:2:on && r:3:on && r:4:on && r:5:on' + +# 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 4133 + title: "Ensure syslog-ng default file permissions configured" + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(0600\)|perm\(0640\)|perm\(0440\)|perm\(0400\)|perm\(0000\)' + +# 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 4134 + title: "Ensure syslog-ng is configured to send logs to a remote log host" + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp(\"logfile.example.com\" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng" + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:destination logserver' + - 'f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:log\.+source\.+destination' + +# 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 4135 + title: "Ensure rsyslog or syslog-ng is installed" + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # yum install rsyslog # yum install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'not c:rpm -q rsyslog -> package rsyslog is not installed' + - 'not c:rpm -q syslog-ng -> package syslog-ng is not installed' + + # 4.2.4 Ensure permissions on all logfiles are configured (Scored) + - id: 4136 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx {} +" + compliance: + - cis: ["4.2.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + +############################################### +# 5 System Access, Authentication and Authorization +############################################### +############################################### +# 5.2 Configure SSH +############################################### + +# 5.1.1 Ensure cron daemon is enabled (Scored) + - id: 4137 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # chkconfig crond on" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' - - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:chkconfig --list crond -> r:2:on && r:3:on && r:4:on && r:5:on' -# 3.2.2 Disable ICMP Redirect Acceptance (Scored) - - id: 5041 - title: "Ensure ICMP redirects are not accepted" - description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." - rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0 and set the active kernel parameters." +# 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 4138 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" compliance: - - cis: ["3.2.2"] - - cis_csc: ["3", "11"] + - cis: ["5.1.2"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' - - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' -# 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) - - id: 5042 - title: "Ensure secure ICMP redirects are not accepted" - description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." - rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" +# 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 4139 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" compliance: - - cis: ["3.2.3"] - - cis_csc: ["3", "11"] + - cis: ["5.1.3"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' - - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' -# 3.2.4 Log Suspicious Packets (Scored) - - id: 5043 - title: "Ensure suspicious packets are logged" - description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." - rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1 and set the active kernel parameters." +# 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 4140 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" compliance: - - cis: ["3.2.4"] - - cis_csc: ["6"] + - cis: ["5.1.4"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' - - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' -# 3.2.5 Enable Ignore Broadcast Requests (Scored) - - id: 5044 - title: "Ensure broadcast ICMP requests are ignored" - description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." - rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 and set the active kernel parameters." +# 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 4141 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" compliance: - - cis: ["3.2.5"] - - cis_csc: ["3", "11"] + - cis: ["5.1.5"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' -# 3.2.6 Enable Bad Error Message Protection (Scored) - - id: 5045 - title: "Ensure bogus ICMP responses are ignored" - description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." - rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." - remediation: "Set the net.ipv4.icmp_ignore_bogus_error_responses parameter to 1 in /etc/sysctl.conf: net.ipv4.icmp_ignore_bogus_error_responses=1" + +# 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 4142 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" compliance: - - cis: ["3.2.6"] + - cis: ["5.1.6"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\w00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' -# 3.2.7 Ensure Reverse Path Filtering is enabled (Scored) - - id: 5046 - title: "Ensure Reverse Path Filtering is enabled" - description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid." - rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed." - remediation: "Set the net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter parameters to 1 in /etc/sysctl.conf: net.ipv4.conf.all.rp_filter=1 net.ipv4.conf.default.rp_filter=1" +# 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 4143 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" compliance: - - cis: ["3.2.7"] + - cis: ["5.1.7"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' - - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' -# 3.2.8 Enable TCP SYN Cookies (Scored) - - id: 5047 - title: "Ensure TCP SYN Cookies is enabled" - description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent." - rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 and set the active kernel parameters." +# 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 4144 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" compliance: - - cis: ["3.2.8"] - - cis_csc: ["3", "11"] + - cis: ["5.1.8"] + - cis_csc: ["16"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:stat /etc/cron.deny -> r:No such file or directory$' + - 'c:stat /etc/at.deny -> r:No such file or directory$' + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' -############################################### -# 5 System Access, Authentication and Authorization -############################################### ############################################### # 5.2 Configure SSH ############################################### +# 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Scored) + - id: 4145 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: chown root:root /etc/ssh/sshd_config and chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + # 5.2.2 Set SSH Protocol to 2 (Scored) - - id: 5048 + - id: 4146 title: "Ensure SSH Protocol is set to 2" description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." @@ -808,13 +2667,13 @@ checks: - pci_dss: ["4.1"] - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'f:$sshd_file -> !r:^# && r:Protocol\s*\t*2' # 5.2.3 Set LogLevel to INFO (Scored) - - id: 5049 + - id: 4147 title: "Ensure SSH LogLevel is set to INFO" description: "The INFO parameter specifies that login and logout activity will be logged." rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." @@ -825,13 +2684,13 @@ checks: - pci_dss: ["4.1"] - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'f:$sshd_file -> !r:^# && r:LogLevel\s*\t*INFO' # 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) - - id: 5050 + - id: 4148 title: "Ensure SSH MaxAuthTries is set to 4 or less" description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." @@ -841,12 +2700,13 @@ checks: - cis_csc: ["16"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' # 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) - - id: 5051 + - id: 4149 title: "Ensure SSH IgnoreRhosts is enabled" description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." @@ -863,7 +2723,7 @@ checks: - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' # 5.2.7 Set SSH HostbasedAuthentication to No (Scored) - - id: 5052 + - id: 4150 title: "Ensure SSH HostbasedAuthentication is disabled" description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." @@ -874,13 +2734,13 @@ checks: - pci_dss: ["4.1"] - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' # 5.2.8 Disable SSH Root Login (Scored) - - id: 5053 + - id: 4151 title: "Ensure SSH root login is disabled" description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" @@ -891,13 +2751,13 @@ checks: - pci_dss: ["4.1"] - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' # 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) - - id: 5054 + - id: 4152 title: "Ensure SSH PermitEmptyPasswords is disabled" description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" @@ -913,14 +2773,487 @@ checks: rules: - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' +# 5.2.10 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 4153 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitUserEnvironment\s*\t*no' + +# 5.2.12 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 4154 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + +# 5.2.13 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 4155 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.13"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + +# 5.2.14 Ensure SSH access is limited (Scored) + - id: 4156 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. AllowGroups The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. DenyUsers The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. DenyGroups The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers ; AllowGroups ; DenyUsers and DenyGroups " + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1", "5.8"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'f:$sshd_file -> r:^\s*AllowUsers' + - 'f:$sshd_file -> r:^\s*AllowGroups' + - 'f:$sshd_file -> r:^\s*DenyUsers' + - 'f:$sshd_file -> r:^\s*DenyGroups' + +# 5.2.15 Ensure SSH warning banner is configured (Scored) + - id: 4157 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*Banner\s*\t*/etc/issue.net' + +############################################### +# 5.3 Configure PAM +############################################### +# 5.3.1 Ensure password creation requirements are configured (Scored) + - id: 4158 + title: "Ensure password creation requirements are configured" + description: "The pam_cracklib.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_cracklib.so and to conform to site policy: password requisite pam_cracklib.so try_first_pass retry=3 minlen=14 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1" + compliance: + - cis: ["5.3.1"] + - cis_csc: ["5.7", "16.12"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:grep pam_cracklib.so /etc/pam.d/password-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'c:grep pam_cracklib.so /etc/pam.d/system-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + +# 5.3.3 Ensure password reuse is limited (Scored) + - id: 4159 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=5 or password required pam_pwhistory.so remember=5" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + +# 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 4160 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.14"] + - pci_dss: ["3.6.1","8.2.1"] + - tsc: ["CC6.1","CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + - 'f:/etc/pam.d/system-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' +############################################### +# 5.4 User Accounts and Environment +############################################### +############################################### +# 5.4.1 Set Shadow Password Suite Parameters +############################################### +# 5.4.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 4161 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + +# 5.4.1.2 Ensure minimum days between password changes is 7 or more (Scored) + - id: 4162 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 and modify user parameters for all users with a password set to match: chage --mindays 7 " + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + +# 5.4.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 4163 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + +# 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 4164 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + +# 5.4.3 Ensure default group for the root account is GID 0 (Scored) + - id: 4165 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + +# 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 4166 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bashrc -> n:^\s*\t*umask\s+(\d+) compare >= 027' + - 'f:/etc/profile -> n:^\s*\t*umask\s+(\d+) compare >= 027' + - 'd:/etc/profile.d -> .sh -> n:^\s*\t*umask\s+(\d+) compare >= 027' + + +# 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 4167 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc and /etc/profile files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + +# 5.6 Ensure access to the su command is restricted (Scored) + - id: 4168 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo , which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + + ############################################### # 6 System Maintenance ############################################### +############################################### +# 6.1 System File Permissions +############################################### + + +# 6.1.2 Configure /etc/passwd permissions (Scored) + - id: 4169 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + +# 6.1.3 Configure /etc/shadow permissions (Scored) + - id: 4170 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 000 /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.4 Configure /etc/group permissions (Scored) + - id: 4171 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.5 Configure /etc/gshadow permissions (Scored) + - id: 4172 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chmod 000 /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.6 Configure /etc/passwd- permissions (Scored) + - id: 4173 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.7 Configure /etc/shadow- permissions (Scored) + - id: 4174 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:root /etc/shadow- # chmod 000 /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.8 Configure /etc/group- permissions (Scored) + - id: 4175 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.9 Configure /etc/gshadow- permissions (Scored) + - id: 4176 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 000 /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + ############################################### # 6.2 Review User and Group Settings ############################################### +# 6.2.1 Check passwords fields (Scored) + - id: 4177 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + +# 6.2.2 Delete legacy entries in /etc/passwd (Scored) + - id: 4178 + title: "Ensure no legacy \"+\" entries exist in /etc/passwd" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && r:^+:' + +# 6.2.3 Delete legacy entries in /etc/shadow (Scored) + - id: 4179 + title: "Ensure no legacy \"+\" entries exist in /etc/shadow" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^+:' + +# 6.2.4 Delete legacy entries in /etc/group (Scored) + - id: 4180 + title: "Ensure no legacy \"+\" entries exist in /etc/group" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:^+:' + # 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) - - id: 5055 + - id: 4181 title: "Ensure root is the only UID 0 account" description: "Any account with UID 0 has superuser privileges on the system." rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." @@ -931,7 +3264,13 @@ checks: - pci_dss: ["10.2.5"] - hipaa: ["164.312.b"] - nist_800_53: ["AU.14", "AC.7"] - - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] condition: none rules: - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + + + diff --git a/sca/rhel/7/cis_rhel7_linux.yml b/sca/rhel/7/cis_rhel7_linux.yml index d7c25d992..3bf1eed2c 100644 --- a/sca/rhel/7/cis_rhel7_linux.yml +++ b/sca/rhel/7/cis_rhel7_linux.yml @@ -8,10 +8,10 @@ # Foundation # # Based on: -# Center for Internet Security Red Hat Enterprise Linux 7 Benchmark v2.2.0 - 12-27-2017 +# Center for Internet Security Red Hat Enterprise Linux 7 Benchmark v3.0.1 - 09-21-2020 policy: - id: "cis_rhel7" + id: "cis_rhel7_linux" file: "cis_rhel7_linux.yml" name: "CIS Benchmark for Red Hat Enterprise Linux 7" description: "This document provides prescriptive guidance for establishing a secure configuration posture for Red Hat Enterprise Linux 7 systems running on x86 and x64 platforms. This document was tested against Red Hat Enterprise Linux 7.4." @@ -24,7 +24,6 @@ requirements: condition: any rules: - 'f:/etc/redhat-release -> r:^Red Hat Enterprise Linux && r:release 7' - - 'f:/etc/redhat-release -> r:^CentOS && r:release 7' - 'f:/etc/redhat-release -> r:^Cloud && r:release 7' - 'f:/etc/redhat-release -> r:^Oracle && r:release 7' - 'f:/etc/redhat-release -> r:^Better && r:release 7' @@ -35,1037 +34,3628 @@ variables: $sshd_file: /etc/ssh/sshd_config checks: -# 1.1.2 /tmp: partition - - id: 5500 - title: "Ensure separate partition exists for /tmp" + +# 1.1.1.1 cramfs: filesystem + - id: 4500 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/directory ending in .conf. Example: vim /etc/modprobe.d/cramfs.confand add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found' + - 'not c:lsmod -> r:cramfs' + +# 1.1.1.2 squashfs: filesystem + - id: 4501 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found' + - 'not c:lsmod -> r:squashfs' + +# 1.1.1.3 udf: filesystem + - id: 4502 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: rmmod udf" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v udf -> r:install /bin/true|Module udf not found' + - 'not c:lsmod -> r:udf' + +# 1.1.1.4 FAT: filesystem + - id: 4503 + title: "Ensure mounting of FAT filesystems is disabled" + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12, FAT16, and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "If utilizing UEFI the FAT filesystem format is required. If this case, ensure that the FAT filesystem is only used where appropriate. Run the following command: grep -E -i '\\svfat\\s' /etc/fstab And review that any output is appropriate for your environment. If not utilizing UEFI: Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following lines: Example: vim /etc/modprobe.d/fat.conf install fat /bin/true install vfat /bin/true install msdos /bin/true Run the following commands to unload the msdos, vfat, and fatmodules: # rmmod msdos # rmmod vfat # rmmod fat " + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found' + - 'not c:lsmod -> r:vfat' + - 'c:modprobe -n -v fat -> r:install /bin/true|Module fat not found' + - 'not c:lsmod -> r:fat' + - 'c:modprobe -n -v msdos -> r:install /bin/true|Module msdos not found' + - 'not c:lsmod -> r:msdos' + + + # 1.1.2 /tmp: partition + - id: 4504 + title: "Ensure /tmp is configured" description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." - rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code." - remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition for /tmp if not using tmpfs. Enable systemd /tmp mounting" + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Create or update an entry for /tmp in either /etc/fstab OR in a systemd tmp.mount file: If /etc/fstab is used: Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp: # mount -o remount,noexec,nodev,nosuid /tmp OR If systemd tmp.mount file is used: Run the following command to create the file /etc/systemd/system/tmp.mount if it doesn't exist: # [ ! -f /etc/systemd/system/tmp.mount ] && cp -v /usr/lib/systemd/system/tmp.mount /etc/systemd/system/ Edit the file /etc/systemd/system/tmp.mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to reload the systemd daemon:# systemctl daemon-reload Run the following command to unmask tmp.mount: # systemctl unmask tmp.mpunt Run the following command to enable and start tmp.mount: # systemctl enable --now tmp.mount" compliance: - cis: ["1.1.2"] + - cis_csc: ["9.4","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ - condition: all + condition: any rules: - 'c:mount -> r:\s/tmp\s' + - 'f:/etc/fstab -> r:\s/tmp\s' + - 'c:systemctl is-enabled tmp.mount -> r:enabled' + +# 1.1.3 /tmp: noexec + - id: 4505 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstabfile and add noexecto the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' -# 1.1.3 /tmp: nodev - - id: 5501 +# 1.1.4 /tmp: nodev + - id: 4506 title: "Ensure nodev option set on /tmp partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." - remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: Options=mode=1777,strictatime,noexec,nodev,nosuid" + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount" compliance: - - cis: ["1.1.3"] + - cis: ["1.1.4"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/tmp\s && r:nodev' -# 1.1.4 /tmp: nosuid - - id: 5502 +# 1.1.5 /tmp: nosuid + - id: 4507 title: "Ensure nosuid option set on /tmp partition" description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." - remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: Options=mode=1777,strictatime,noexec,nodev,nosuid" + remediation: "IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nosuid,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount" compliance: - - cis: ["1.1.4"] + - cis: ["1.1.5"] + - cis_csc: ["5.1","13"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/tmp\s && r:nosuid' -# 1.1.5 /tmp: noexec - - id: 5503 - title: "Ensure noexec option set on /tmp partition" + +# 1.1.6 /dev/shm: + - id: 4508 + title: "Ensure /dev/shm is configured " + description: "/dev/shm is a traditional shared memory concept. One program will create a memory portion, which other processes (if permitted) can access. Mounting tmpfs at /dev/shm is handled automatically by systemd." + rationale: "Any user can upload and execute files inside the /dev/shm similar to the /tmp partition. Configuring /dev/shm allows an administrator to set the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Edit /etc/fstab and add or edit the following line: tmpfs /dev/shm tmpfs defaults,noexec,nodev,nosuid,seclabel 0 0 Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm" + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s' + - 'f:/etc/fstab -> r:\s/dev/shm\s' + + + + +# 1.1.7 /dev/shm: noexec + - id: 4509 + title: "Ensure noexec option set on /dev/shm partition" description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." - rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." - remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: Options=mode=1777,strictatime,noexec,nodev,nosuid" + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" compliance: - - cis: ["1.1.5"] - - cis_csc: ["2"] + - cis: ["1.1.7"] + - cis_csc: ["2.6","13"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:mount -> r:\s/tmp\s && r:noexec' + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + +# 1.1.8 /dev/shm: nodev + - id: 4510 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' -# 1.1.6 Build considerations - Partition scheme. - - id: 5504 + +# 1.1.9 /dev/shm: nosuid + - id: 4511 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + + +# 1.1.10 Build considerations - Partition scheme. + - id: 4512 title: "Ensure separate partition exists for /var" description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - - cis: ["1.1.6"] + - cis: ["1.1.10"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ condition: all rules: - 'c:mount -> r:\s/var\s' -# 1.1.7 bind mount /var/tmp to /tmp - - id: 5505 +# 1.1.11 bind mount /var/tmp to /tmp + - id: 4513 title: "Ensure separate partition exists for /var/tmp" - description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications and is intended for temporary files that are preserved across reboots." rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - - cis: ["1.1.7"] + - cis: ["1.1.11"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/var/tmp\s' -# 1.1.11 /var/log: partition - - id: 5506 +# 1.1.12 noexec set on /var/tmp + - id: 4514 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. un the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.12"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + +# 1.1.13 nodev set on /var/tmp + - id: 4515 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + +# 1.1.14 nosuid set on /var/tmp + - id: 4516 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + +# 1.1.15 /var/log: partition + - id: 4517 title: "Ensure separate partition exists for /var/log" description: "The /var/log directory is used by system services to store log data ." rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - - cis: ["1.1.11"] - - cis_csc: ["6.3"] + - cis: ["1.1.15"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ condition: all rules: - 'c:mount -> r:\s/var/log\s' -# 1.1.12 /var/log/audit: partition - - id: 5507 +# 1.1.16 /var/log/audit: partition + - id: 4518 title: "Ensure separate partition exists for /var/log/audit" - description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - - cis: ["1.1.12"] + - cis: ["1.1.16"] - cis_csc: ["6.3"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ condition: all rules: - 'c:mount -> r:\s/var/log/audit\s' -# 1.1.13 /home: partition - - id: 5508 +# 1.1.17 /home: partition + - id: 4519 title: "Ensure separate partition exists for /home" description: "The /home directory is used to support disk storage needs of local users." rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." compliance: - - cis: ["1.1.13"] + - cis: ["1.1.17"] + - cis_csc: ["5.1","13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ condition: all rules: - 'c:mount -> r:\s/home\s' -# 1.1.14 /home: nodev - - id: 5509 + + + +# 1.1.18 /home: nodev + - id: 4520 title: "Ensure nodev option set on /home partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. # mount -o remount,nodev /home" compliance: - - cis: ["1.1.14"] + - cis: ["1.1.18"] + - cis_csc: ["5.1","13"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:mount -> r:\s/home\s && r:nodev' -# 1.1.15 /dev/shm: nodev - - id: 5510 - title: "Ensure nodev option set on /dev/shm partition" - description: "The nodev mount option specifies that the filesystem cannot contain special devices." - rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." - remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + + + + +# 1.1.23 Disable Automounting + - id: 4521 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: systemctl disable autofs" compliance: - - cis: ["1.1.15"] + - cis: ["1.1.23"] + - cis_csc: ["8.4","8.5"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: all + - tsc: ["CC5.2"] + condition: none rules: - - 'c:mount -> r:\s/dev/shm\s && r:nodev' + - 'c:systemctl is-enabled autofs -> r:enabled' -# 1.1.16 /dev/shm: nosuid - - id: 5511 - title: "Ensure nosuid option set on /dev/shm partition" - description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." - rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." - remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" +# 1.1.24 Disable USB Storage + - id: 4522 + title: "Disable USB Storage" + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf Add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage" compliance: - - cis: ["1.1.16"] + - cis: ["1.1.22"] + - cis_csc: ["8.4","8.5"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + - 'c:modprobe -n -v usb-storage -> r:install /bin/true' + - 'not c:lsmod -> r:install /bin/true' -# 1.1.17 /dev/shm: noexec - - id: 5512 - title: "Ensure noexec option set on /dev/shm partition" - description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." - rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." - remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + +############################################### +# 1.2 Configure Software Updates +############################################### + +# 1.2.3 Activate gpgcheck + - id: 4523 + title: "Ensure gpgcheck is globally activated" + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." compliance: - - cis: ["1.1.17"] - - cis_csc: ["2"] - - pci_dss: ["2.2.4"] - - nist_800_53: ["CM.1"] + - cis: ["1.2.3"] + - cis_csc: ["3.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] condition: all rules: - - 'c:mount -> r:\s/dev/shm\s && r:noexec' + - 'f:/etc/yum.conf -> r:gpgcheck=1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0' + + +# 1.2.5 Disable the rhnsd Daemon (Not Scored) + - id: 4524 + title: "Disable the rhnsd Daemon" + description: "The rhnsd daemon polls the Red Hat Network web site for scheduled actions and, if there are, executes those actions." + rationale: "Patch management policies may require that organizations test the impact of a patch before it is deployed in a production environment. Having patches automatically deployed could have a negative impact on the environment. It is best to not allow an action by default but only after appropriate consideration has been made. It is recommended that the service be disabled unless the risk is understood and accepted or you are running your own satellite . This item is not scored because organizations may have addressed the risk." + remediation: "Run the following command to stop and mask the rhnsd: # systemctl --now mask rhnsd" + compliance: + - cis: ["1.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: none + rules: + - 'c:systemctl is-enabled rhnsd -> r:^enabled' ############################################### -# 1.6 Configure SELinux +# 1.3 Configure sudo ############################################### -# 1.6.1.2 Set selinux state - - id: 5513 - title: "Ensure the SELinux state is enforcing" - description: "Set SELinux to enable when the system is booted." - rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." - remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" - compliance: - - cis: ["1.6.1.2"] - - cis_csc: ["14.4"] + +# 1.3.1 install sudo + - id: 4525 + title: "Ensure sudo is installed" + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo. # yum install sudo" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["4"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" condition: all rules: - - 'c:sestatus -> r:^SELinux status:\s+enabled$' - - 'c:sestatus -> r:^Current mode:\s+enforcing$' - - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' - - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + - 'c:rpm -q sudo -> r:sudo-\S*' -# 1.6.1.3 Set selinux policy - - id: 5514 - title: "Ensure SELinux policy is configured" - description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." - rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." - remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + +# 1.3.2 Configure sudo + - id: 4526 + title: "Ensure sudo commands use pty" + description: "sudo can be configured to run only from a pseudo-pty" + rationale: "Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing. This can be mitigated by configuring sudo to run other commands only from a pseudo-pty, whether I/O logging is turned on or not." + remediation: "Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults use_pty" compliance: - - cis: ["1.6.1.3"] + - cis: ["1.3.2"] + - cis_csc: ["4"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: all + - tsc: ["CC5.2"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: any rules: - - 'c:sestatus -> r:^Loaded policy name:\s+targeted$' - - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + - 'f:/etc/sudoers -> r:^\s*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d/ -> r:\. -> r:^\s*Defaults\s*\t*\s*use_pty' -# 1.6.1.4 Remove SETroubleshoot - - id: 5515 - title: "Ensure SETroubleshoot is not installed" - description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." - rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." - remediation: "Run the following command to uninstall s etroubleshoot: # yum remove setroubleshoot" +# 1.3.3 Ensure sudo log file exists + - id: 4527 + title: "Ensure sudo log file exists" + description: "sudo can use a custom log file" + rationale: "A sudo log file simplifies auditing of sudo commands" + remediation: "Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile='' Example:Defaults logfile=\"/var/log/sudo.log\"" compliance: - - cis: ["1.6.1.4"] + - cis: ["1.3.3"] + - cis_csc: ["6.3"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:rpm -qa setroubleshoot -> r:setroubleshoot' + - 'f:/etc/sudoers -> r:^\s*Defaults\s+logfile\s*=\s*"/var/log/sudo.log"' + - 'd:/etc/sudoers.d/ -> r:\. -> r:^\s*Defaults\s+logfile\s*=\s*"/var/log/sudo.log"' -# 1.6.1.5 Disable MCS Translation service mcstrans - - id: 5516 - title: "Ensure the MCS Translation Service (mcstrans) is not installed" - description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" - rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." - remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" + +############################################### +# 1.4 Filesystem Integrity Checking +############################################### + +# 1.4.1 install AIDE + - id: 4528 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: yum install aide // Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + +# 1.4.2 AIDE regular checks + - id: 4529 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check run the following command: crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. OR If aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simpleExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer " compliance: - - cis: ["1.6.1.5"] - - pci_dss: ["2.2.4"] - - nist_800_53: ["CM.1"] - condition: none + - cis: ["1.4.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any rules: - - 'c:rpm -qa mcstrans -> r:mcstrans' + - 'c:crontab -u root -l -> r:aide' + - 'c:grep -r aide /etc/cron.* /etc/crontab -> r:aide' + - 'c:systemctl is-enabled aidecheck.service -> r:enabled' + - 'c:systemctl is-enabled aidecheck.timer -> r:enabled' + - 'c:systemctl status aidecheck.timer -> r:enabled' ############################################### -# 1.4 Secure Boot Settings +# 1.5 Secure Boot Settings ############################################### -# 1.4.2 Set Boot Loader Password (Scored) - - id: 5517 + +# 1.5.1 Set Boot Loader Password (Scored) + - id: 4530 title: "Ensure bootloader password is set" description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." - remediation: "Create an encrypted password with grub2-setpassword: # grub2-setpassword" + remediation: "For newergrub2based systems (centOS/RHEL 7.2 and newer): Create an encrypted password with grub2-setpassword: # grub2-setpassword OR For older grub2based systems: create an encrypted password with grub2-mkpasswd-pbkdf2: # grub2-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is Add the following into /etc/grub.d/01_users or a custom /etc/grub.d configuration file: cat <\"password_pbkdf2 EOF Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" compliance: - - cis: ["1.4.2"] + - cis: ["1.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub2/user.cfg -> r:^GRUB2_PASSWORD\s*=\.+' + - 'f:/boot/grub2/grub.cfg -> r:^set superusers\s*=\.+' + - 'f:/boot/grub2/grub.cfg -> r:^password_pbkdf2 \.+' + + +# 1.5.2 Configure bootloader + - id: 4531 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub2/grub.cfg and linked as /etc/grub2.cfg . On newer grub2 systems the encrypted bootloader password is contained in /boot/grub2/user.cfg" + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/user.cfg # chmod og-rwx /boot/grub2/user.cfg" + compliance: + - cis: ["1.5.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub2/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat /boot/grub2/user.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|cannot stat' + +# 1.5.3 Single user authentication + - id: 4532 + title: "Ensure authentication required for single user mode" + description: "Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Edit /usr/lib/systemd/system/rescue.service and /usr/lib/systemd/system/emergency.service and set ExecStart to use /sbin/sulogin or /usr/sbin/sulogin: ExecStart=-/bin/sh -c \"/sbin/sulogin; /usr/bin/systemctl --fail --no-block default\" " + compliance: + - cis: ["1.5.3"] - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'f:/boot/grub2/grub.cfg -> r:^GRUB2_PASSWORD\s*=\.+' + - 'f:/usr/lib/systemd/system/rescue.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' + - 'f:/usr/lib/systemd/system/emergency.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' ############################################### -# 1.5 Additional Process Hardening +# 1.6 Additional Process Hardening ############################################### -# 1.5.1 Restrict Core Dumps (Scored) - - id: 5518 +# 1.6.1 Restrict Core Dumps (Scored) + - id: 4533 title: "Ensure core dumps are restricted" description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." - remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 and set the active kernel parameter" + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" compliance: - - cis: ["1.5.1"] - - cis_csc: ["13"] + - cis: ["1.6.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' - - 'c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:hard\s*\t*core\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' -# 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) - - id: 5519 +# 1.6.2 XD/NX enabled + - id: 4534 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.6.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'c:journalctl -> r:^kernel:\s+NX \(Execute Disable\) protection: active' + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + +# 1.6.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 4535 title: "Ensure address space layout randomization (ASLR) is enabled" description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 and set the active kernel parameter" + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" compliance: - - cis: ["1.5.3"] - - cis_csc: ["8.4"] + - cis: ["1.6.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' -############################################### -# 2 OS Services -############################################### -############################################### -# 2.2 Remove Legacy Services -############################################### -# 2.2.16 Remove NIS Server (Scored) - - id: 5520 - title: "Ensure NIS Server is not enabled" - description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." - rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" - remediation: "Run the following command to disable ypserv: # systemctl disable ypserv" +# 1.6.4 Disable prelink + - id: 4536 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal: # prelink -ua Run the following command to uninstall prelink: # yum remove prelink" compliance: - - cis: ["2.2.16"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["1.6.4"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled ypserv -> r:^enabled' + - 'c:rpm -q prelink -> r:package prelink is not installed' + +############################################### +# 1.7 Configure SELinux +############################################### -# 2.2.17 Remove rsh-server (Scored) - - id: 5521 - title: "Ensure rsh server is not enabled" - description: "The Berkeley rsh-server ( rsh , rlogin , rexec ) package contains legacy services that exchange credentials in clear-text." - rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." - remediation: "Run the following commands to disable rsh, rlogin, and rexec: # systemctl disable rsh.socket # systemctl disable rlogin.socket # systemctl disable rexec.socket " +# 1.7.1.1 Install SELinux + - id: 4537 + title: "Ensure SELinux is installed" + description: "SELinux provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install libselinux: # yum install libselinux" compliance: - - cis: ["2.2.17"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["1.7.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled rsh.socket -> r:^enabled' - - 'c:systemctl is-enabled rlogin.socket -> r:^enabled' - - 'c:systemctl is-enabled rexec.socket -> r:^enabled' + - 'c:rpm -q libselinux -> r:libselinux-\S+' -# 2.2.18 Remove talk server (Scored) - - id: 5522 - title: "Ensure talk server is not enabled" - description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." - rationale: "The software presents a security risk as it uses unencrypted protocols for communication." - remediation: "Run the following command to disable talk: # systemctl disable ntalk" + +# 1.7.1.2 SELinux not disabled + - id: 4538 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /etc/default/grub and remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\" GRUB_CMDLINE_LINUX=\"\" || Run the following command to update the grub2 configuration: grub2-mkconfig -o /boot/grub2/grub.cfg" compliance: - - cis: ["2.2.18"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["1.7.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:systemctl is-enabled ntalk -> r:^enabled' + - 'f:/boot/grub2/grub.cfg -> r:^\s*linux\.+selinux=0|linux\.+enforcing=0' -# 2.2.19 Remove telnet-server (Scored) - - id: 5523 - title: "Ensure telnet server is not enabled" - description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." - rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." - remediation: "Run the following command to disable telnet: # systemctl disable telnet.socket" + + +# 1.7.1.3 Set selinux policy + - id: 4539 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" compliance: - - cis: ["2.2.19"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["1.7.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled telnet.socket -> r:^enabled' + - 'c:sestatus -> r:^Loaded policy name:\s*\t*targeted$|^Loaded policy name:\s*\t*mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' -# 2.2.20 Remove tftp server (Scored) - - id: 5524 - title: "Ensure tftp server is not enabled" - description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is used to define and support a TFTP server." - rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." - remediation: "Run the following command to disable tftp: # systemctl disable tftp.socket" + + +# 1.7.1.4 Set selinux mode + - id: 4540 + title: "Ensure the SELinux mode is enforcing or permissive" + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. Disabled -Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future" + rationale: "Running SELinux in disabled modeis strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive" compliance: - - cis: ["2.2.20"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["1.7.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled tftp.socket -> r:^enabled' + - 'c:getenforce -> r:^Enforcing|^Permissive' + - 'f:/etc/selinux/config -> r:^SELINUX=enforcing|^SELINUX=permissive' -# 2.2.21 Remove rsync service (Scored) - - id: 5525 - title: "Ensure rsync service is not enabled" - description: "The rsyncd service can be used to synchronize files between systems over network links." - rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." - remediation: "Run the following command to disable rsync: # systemctl disable rsyncd" + +# 1.7.1.6 Ensure no unconfined services exist + - id: 4541 + title: "Ensure no unconfined services exist" + description: "Unconfined processes run in unconfined domains" + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules – it does not replace them" + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." compliance: - - cis: ["2.2.21"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["1.7.1.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: none rules: - - 'c:systemctl is-enabled rsyncd -> r:^enabled' + - 'c:ps -eZ -> r:unconfined_service_t' -# 2.3.1 Remove NIS Client (Scored) - - id: 5526 - title: "Ensure NIS Client is not installed" - description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." - rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." - remediation: "Run the following command to uninstall ypbind: # yum remove ypbind" + +# 1.7.1.7 Remove SETroubleshoot + - id: 4542 + title: "Ensure SETroubleshoot is not installed" + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # yum remove setroubleshoot" compliance: - - cis: ["2.3.1"] - - cis_csc: ["2"] - - pci_dss: ["2.2.3"] + - cis: ["1.7.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:rpm -qa ypbind -> r:ypbind' + - 'c:rpm -q setroubleshoot -> r:package setroubleshoot is not installed' -# 2.1.7 Remove xinetd (Scored) - - id: 5527 - title: "Ensure xinetd is not enabled" - description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." - rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." - remediation: "Run the following command to disable xinetd: # systemctl disable xinetd" + +# 1.7.1.8 Disable MCS Translation service mcstrans + - id: 4543 + title: "Ensure the MCS Translation Service (mcstrans) is not installed" + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" compliance: - - cis: ["2.1.7"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["1.7.1.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -q mcstrans -> r:package mcstrans is not installed' + + + +############################################### +# 1.8 Warning Banners +############################################### +# 1.8.1.1 Configure message of the day (Scored) + - id: 4544 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd" + compliance: + - cis: ["1.8.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] condition: none rules: - - 'c:systemctl is-enabled xinetd -> r:^enabled' + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' -# 2.1.1 Disable chargen services (Scored) - - id: 5528 - title: "Ensure chargen services are not enabled" - description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Run the following commands to disable chargen-dgram and chargen-stream: # chkconfig chargen-dgram off; # chkconfig chargen-stream off" +# 1.8.1.2 Configure local login warning banner (Not Scored) + - id: 4545 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version -or the operating system's name." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" compliance: - - cis: ["2.1.1"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] - - nist_800_53: ["CM.1"] + - cis: ["1.8.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] condition: none rules: - - 'c:chkconfig --list -> r:^\s*\t*chargen-dgram:\s*\t*on' - - 'c:chkconfig --list -> r:^\s*\t*chargen-stream:\s*\t*on' + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' -# 2.1.2 Disable daytime services (Scored) - - id: 5529 - title: "Ensure daytime services are not enabled" - description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Run the following commands to disable daytime-dgram and daytime-stream: # chkconfig daytime-dgram off; # chkconfig daytime-stream off" +# 1.8.1.3 Configure remote login warning banner (Not Scored) + - id: 4546 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" compliance: - - cis: ["2.1.2"] - - cis_csc: ["9.1"] + - cis: ["1.8.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] condition: none rules: - - 'c:chkconfig --list -> r:^\s*\t*daytime-dgram:\s*\t*on' - - 'c:chkconfig --list -> r:^\s*\t*daytime-stream:\s*\t*on' + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + +# 1.8.1.4 Configure /etc/motd permissions (Not Scored) + - id: 4547 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.8.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.8.1.5 Configure /etc/issue permissions (Scored) + - id: 4548 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.8.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' +# 1.8.1.6 Configure /etc/issue.net permissions (Not Scored) + - id: 4549 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.8.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + +# 1.9 Ensure updates, patches, and additional security software are installed + - id: 4550 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available packages # yum update --security Note: The audit and remediation here only cover security updates. Non-security updates can be audited with the following command and comparing the output against site policy: # yum check-update" + compliance: + - cis: ["1.9"] + - cis_csc: ["3.4","3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6","SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - 'c:yum check-update --security -> r:No packages needed for security' + + +# 1.10 Ensure GDM login banner is configured (Scored) + - id: 4551 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "If a graphical login is not required, it should be removed to reduce the attack surface of the system. If a graphical login is required, last logged in user display should be disabled, and a warning banner should be configured. Displaying the last logged in user eliminates half of the Userid/Password equation that an unauthorized person would need to log on. Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Run the following command to remove gdm: # yum remove gdm OR If GDM is required: Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/01-banner-message) [org/gnome/login-screen] banner-message-enable=true banner-message-text='' Example Banner Text: 'Authorized uses only. All activity may be monitored and reported. 'Edit or create the file /etc/dconf/db/gdm.d/and add the following: (This is typically /etc/dconf/db/gdm.d/00-login-screen) [org/gnome/login-screen] # Do not show the user list disable-user-list=true Run the following command to update the system databases: # dconf update" + compliance: + - cis: ["1.10"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'f:/etc/dconf/profile/gdm -> r:user-db:user' + - 'f:/etc/dconf/profile/gdm -> r:system-db:gdm' + - 'f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:banner-message-enable=true' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:banner-message-text=\.+' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:disable-user-list=true' + + + + + +############################################### +# 2 OS Services +############################################### +############################################### +# 2.1 inetd Services +############################################### + -# 2.1.3 Disable discard services (Scored) - - id: 5530 - title: "Ensure discard services are not enabled" - description: "discardis a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Run the following commands to disable discard-dgram and discard-stream: # chkconfig discard-dgram off; # chkconfig discard-stream off" +# 2.1.2 Ensure xinetd is not installed (Automated) + - id: 4552 + title: "Ensure daytime services are not enabled" + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed to reduce the attack surface area of the system. Note: If an xinetd service or services are required, ensure that any xinetd service not required is stopped and disabled" + remediation: "Run the following command to remove xinetd: # yum remove xinetd" compliance: - - cis: ["2.1.3"] - - cis_csc: ["9.1"] + - cis: ["2.1.2"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.3"] - nist_800_53: ["CM.1"] - condition: none + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all rules: - - 'c:chkconfig --list -> r:^\s*\t*discard-dgram:\s*\t*on' - - 'c:chkconfig --list -> r:^\s*\t*discard-stream:\s*\t*on' + - 'c:rpm -q xinetd-> r:package xinetd is not installed' + + +############################################### +# 2.2 Remove Legacy Services +############################################### + -# 2.1.4 Disable echo-dgram (Scored) - - id: 5531 - title: "Ensure echo services are not enabled" - description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Run the following commands to disable echo-dgram and echo-stream: # chkconfig echo-dgram off; # chkconfig echo-stream off" +# 2.2.1.1 Ensure time synchronization is in use (Manual) + - id: 4553 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On systems where host based time synchronization is not available, install chrony or NTP: to install chrony run the following command: # yum install chrony OR to install ntp: run the following command: # yum install ntp" compliance: - - cis: ["2.1.4"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'not c:rpm -q ntp -> r:^package ntp is not installed' + - 'not c:rpm -q chrony -> r:^package chrony is not installed' + +# 2.2.1.2 Ensure chrony is configured (Automated) + - id: 4554 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. Note: This recommendation only applies if chrony is in use on the system." + remediation: "1) Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . 2) Add or edit the OPTIONS in /etc/sysconfig/chronyd to include '-u chrony':OPTIONS=\"-u chrony\"" + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:chkconfig --list -> r:^\s*\t*echo-dgram:\s*\t*on' - - 'c:chkconfig --list -> r:^\s*\t*echo-stream:\s*\t*on' + - 'f:/etc/chrony.conf -> r:^server\.+$|^pool\.+$' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' -# 2.1.5 Disable time-stream (Scored) - - id: 5532 - title: "Ensure time services are not enabled" - description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." - rationale: "Disabling this service will reduce the remote attack surface of the system." - remediation: "Run the following commands to disable time-dgram and time-stream: # chkconfig time-dgram off; # chkconfig time-stream off" +# 2.2.1.3 Ensure ntp is configured (Automated) + - id: 4555 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/ntp.conf to match the following: - restrict -4 default kod nomodify notrap nopeer noquery and - restrict -4 default kod nomodify notrap nopeer noquery. 2) Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': - OPTIONS='-u ntp:ntp'" compliance: - - cis: ["2.1.4"] - - cis_csc: ["9.1"] - - pci_dss: ["2.2.3"] + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:chkconfig --list -> r:^\s*\t*time-dgram:\s*\t*on' - - 'c:chkconfig --list -> r:^\s*\t*time-stream:\s*\t*on' + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/ntpd -> r:^OPTIONS\s*=\s* && r:-u ntp:ntp' + - 'f:/usr/lib/systemd/system/ntpd.service -> r:^Execstart\s*=\s*/usr/sbin/ntpd\s+-u\s+ntp:ntp' # 2.2.2 Remove X Windows (Scored) - - id: 5533 - title: "Ensure X Window System is not installed" + - id: 4556 + title: " Ensure X11 Server components are not installed" description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." remediation: "Run the following command to remove the X Windows System packages: # yum remove xorg-x11*" compliance: - cis: ["2.2.2"] - - cis_csc: ["2"] + - cis_csc: ["2.6"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:rpm -qa xorg-x11* -> r:^xorg-x11' + - 'c:rpm -q xorg-x11-server* -> r:package xorg-x11 is not installed' -# 2.2.3 Disable Avahi Server (Scored) - - id: 5534 - title: "Ensure Avahi Server is not enabled" +# 2.2.3 Ensure Avahi Server is not installed (Automated) + - id: 4557 + title: " Ensure Avahi Server is not installed" description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." - rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." - remediation: "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi-autoipd and avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service; # yum remove avahi-autoipd avahi" compliance: - cis: ["2.2.3"] - - cis_csc: ["9.1"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q avahi-autoipd-> r:package avahi-autoipd is not installed' + - 'c:rpm -q avahi-> r:pacakge avahi is not installed' + +# 2.2.4 Ensure CUPS is not installed (Automated) + - id: 4558 + title: "Ensure CUPS is not installed" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # yum remove cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled avahi-daemon -> r:^enabled' + - 'c:rpm -q cups-> r:package cups is not installed' -# 2.2.5 Remove DHCP Server (Scored) - - id: 5535 - title: "Ensure DHCP Server is not enabled" +# 2.2.5 Ensure DHCP Server is not installed (Automated) + - id: 4559 + title: "Ensure DHCP Server is not installed" description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." - rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable dhcpd: # systemctl disable dhcpd" + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this the dhcp package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcpd: # yum remove dhcp" compliance: - cis: ["2.2.5"] - - cis_csc: ["9.1"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp - condition: none + condition: all rules: - - 'c:systemctl is-enabled dhcpd -> r:^enabled' + - 'c:rpm -q dhcp-> r:package dhcp is not installed' -# 2.2.6 Remove LDAP Server (Scored) - - id: 5536 - title: "Ensure LDAP Server is not enabled" +# 2.2.6 Ensure LDAP server is not installed (Automated) + - id: 4560 + title: "Ensure LDAP Server is not installed" description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." - rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable slapd: # systemctl disable dhcpd" + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to remove slapd: # yum remove openldap-servers" compliance: - cis: ["2.2.6"] - - cis_csc: ["9.1"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - More detailed documentation on OpenLDAP is available at https://www.openldap.org - condition: none + condition: all rules: - - 'c:systemctl is-enabled sladp -> r:^enabled' + - 'c:rpm -q openldap-servers-> r:package openldap-servers is not installed' -# 2.2.1.2 Configure Network Time Protocol (NTP) (Scored) - - id: 5537 - title: "Ensure ntp is configured" - description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." - rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." - remediation: "1) Add or edit restrict lines in /etc/ntp.conf to match the following: - restrict -4 default kod nomodify notrap nopeer noquery and - restrict -4 default kod nomodify notrap nopeer noquery. 2) Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': - OPTIONS='-u ntp:ntp'" + + +# 2.2.7 Ensure nfs-utils is not installed or the nfs-server service is masked (Automated) + - id: 4561 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # yum remove nfs-utils; OR if the nfs-package is required as a dependency: run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server" compliance: - - cis: ["2.2.1.2"] - - cis_csc: ["6.1"] + - cis: ["2.2.7"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: all + - tsc: ["CC5.2"] + condition: any rules: - - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' - - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' - - 'f:/etc/ntp.conf -> r:^server\.+$|^pool\.+$' - - 'f:/etc/sysconfig/ntpd -> r:^OPTIONS\s*=\s* && r:-u ntp:ntp' - - 'f:/usr/lib/systemd/system/ntpd.service -> r:^Execstart\s*=\s*/usr/sbin/ntpd\s+-u\s+ntp:ntp' + - 'c:rpm -q nfs-utils-> r:package nfs-utils is not installed' + - 'c:systemctl is-enabled nfs-server -> r:masked' -# 2.2.1.2 Configure Network Time Protocol (Chrony) (Scored) - - id: 5538 - title: "Ensure chrony is configured" - description: "chrony is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." - rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." - remediation: "1) Add or edit restrict lines in /etc/chrony.conf to match the following: - 1) Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/chronyd to include: - OPTIONS='-u chronyd'" +# 2.2.8 Ensure rpcbind is not installed or the rpcbind services are masked (Automated) + - id: 4562 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked" + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening" + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # yum remove nfs-utils; OR if the nfs-package is required as a dependency: run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server" compliance: - - cis: ["2.2.1.2"] - - cis_csc: ["6.1"] + - cis: ["2.2.8"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: all + - tsc: ["CC5.2"] + condition: any rules: - - 'f:/etc/chrony.conf -> r:^server\.+$|^pool\.+$' - - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' + - 'c:rpm -q rpcbind-> r:package rpcbind is not installed' + - 'not c:systemctl is-enabled rpcbind rpcbind.socket -> r:enabled' -# 2.2.7 Disable NFS and RPC (Scored) - - id: 5539 - title: "Ensure NFS and RPC are not enabled" - description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." - rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." - remediation: "Run the following commands to disable nfs, nfs-server and rpcbind: # systemctl disable nfs; # systemctl disable nfs-server; # systemctl disable rpcbind" + + +# 2.2.9 Ensure DNS Server is not installed (Automate) + - id: 4563 + title: " Ensure DNS Server is not installed " + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable named: # yum remove bind" compliance: - - cis: ["2.2.7"] - - cis_csc: ["9.1"] + - cis: ["2.2.9"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled nfs -> r:^enabled' - - 'c:systemctl is-enabled nfs-server -> r:^enabled' - - 'c:systemctl is-enabled rpcbind -> r:^enabled' + - 'c:rpm -q bind-> r:package bind is not installed' -# 2.2.9 Remove FTP Server (Scored) - - id: 5540 - title: "Ensure FTP Server is not enabled" - description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." - rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable vsftpd: # systemctl disable vsftpd" +# 2.2.10 Ensure FTP Server is not installed (Automated) + - id: 4564 + title: "Ensure FTP Server is not installed" + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)" + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # yum remove vsftpd" compliance: - - cis: ["2.2.9"] - - cis_csc: ["9.1"] + - cis: ["2.2.10"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled vsftpd -> r:^enabled' + - 'c:rpm -q vsftpd-> r:package vsftpd is not installed' -# 2.2.10 Remove HTTP Server (Scored) - - id: 5541 - title: "Ensure HTTP server is not enabled" +# 2.2.11 Ensure HTTP server is not installed (Automated) + - id: 4565 + title: "Ensure HTTP server is not installed" description: "HTTP or web servers provide the ability to host web site content." - rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable httpd: # systemctl disable httpd" + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable httpd: # yum remove httpd" compliance: - - cis: ["2.2.10"] - - cis_csc: ["9.1"] - condition: none + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled httpd -> r:^enabled' + - 'c:rpm -q httpd-> r:package httpd is not installed' -# 2.2.11 Remove Dovecot (IMAP and POP3 services) (Scored) - - id: 5542 - title: "Ensure IMAP and POP3 server is not enabled" +# 2.2.12 Ensure IMAP and POP3 server is not installed (Automated) + - id: 4566 + title: "Ensure IMAP and POP3 server is not installed" description: "dovecot is an open source IMAP and POP3 server for Linux based systems." - rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable dovecot: # systemctl disable dovecot" + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable dovecot: # yum remove dovecot" compliance: - - cis: ["2.2.11"] - - cis_csc: ["9.1"] + - cis: ["2.2.12"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled dovecot -> r:^enabled' + - 'c:rpm -q dovecot-> r:package dovecot is not installed' -# 2.2.12 Remove Samba (Scored) - - id: 5543 - title: "Ensure Samba is not enabled" +# 2.2.13 Ensure Samba is not installed (Automated) + - id: 4567 + title: "Ensure Samba is not installed" description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." - rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable smb: # systemctl disable smb" + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to disable smb: # yum remove samba" compliance: - - cis: ["2.2.12"] - - cis_csc: ["9.1"] + - cis: ["2.2.13"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled smb -> r:^enabled' + - 'c:rpm -q samba-> r:package samba is not installed' -# 2.2.13 Remove HTTP Proxy Server (Scored) - - id: 5544 - title: "Ensure HTTP Proxy Server is not enabled" +# 2.2.14 Ensure HTTP Proxy Server is not installed (Automated) + - id: 4568 + title: "Ensure HTTP Proxy Server is not installed" description: "Squid is a standard proxy server used in many distributions and environments." - rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." - remediation: "Run the following command to disable squid: # systemctl disable squid" + rationale: "If there is no need for a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # yum remove squid" compliance: - - cis: ["2.2.13"] - - cis_csc: ["9.1"] + - cis: ["2.2.14"] + - cis_csc: ["9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: none + - tsc: ["CC5.2"] + condition: all rules: - - 'c:systemctl is-enabled squid -> r:^enabled' + - 'c:rpm -q squid-> r:package squid is not installed' -# 2.2.14 Remove SNMP Server (Not Scored) - - id: 5545 - title: "Ensure SNMP Server is not enabled" +# 2.2.15 Ensure net-snmp is not installed (Automated) + - id: 4569 + title: "Ensure SNMP Server is not installed" description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." - rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." - remediation: "Run the following command to disable snmpd: # systemctl disable snmpd" + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3replaces the simple/clear text password sharing used in SNMPv2with more securely encoded parameters. If the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system." + remediation: "Run the following command to disable snmpd: # # yum remove net-snmp" compliance: - - cis: ["2.2.14"] - - cis_csc: ["9.1"] + - cis: ["2.2.15"] + - cis_csc: ["2.6",9.2"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q net-snmp-> r:package net-snmp is not installed' + +# 2.2.16 Ensure mail transfer agent is configured for local-only mode (Automated) + - id: 4570 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] condition: none rules: - - 'c:systemctl is-enabled snmpd -> r:^enabled' + - 'c:ss -lntu -> r:\.*:25\s* && !r:127.0.0.1:25\.*|::1:25\.*' -############################################### -# 3 Network Configuration and Firewalls -############################################### -############################################### -# 3.1 Modify Network Parameters (Host Only) -############################################### -# 3.1.1 Disable IP Forwarding (Scored) - - id: 5546 - title: "Ensure IP forwarding is disabled" - description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." - rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 and set the active kernel parameters." +# 2.2.17 Ensure rsync is not installed or the ervice is masked (Automated) + - id: 4571 + title: "Ensure rsync is not installed or the rsyncd service is masked" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to remove the rsync package: # yum remove rsync; OR run the following command to mask the rsyncd service: # systemctl --now mask rsyncd" compliance: - - cis: ["3.1.1"] - - cis_csc: ["3", "11"] - - pci_dss: ["2.2.4"] + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: any + rules: + - 'c:rpm -q rsync-> r:package rsync is not installed' + - 'c:systemctl is-enabled rsyncd-> r:masked' + + # 2.2.18 Ensure NIS server is not installed (Automated) + - id: 4572 + title: "Ensure NIS Server is not installed" + description: "The ypserv package provides the Network Information Service (NIS). This service, formally known as Yellow Pages, is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the ypservpackage be removed, and if required a more secure services be used." + remediation: "Run the following command to disable ypserv: # yum remove ypserv" + compliance: + - cis: ["2.2.18"] + - cis_csc: ["2.6","9.2"] + - pci_dss: ["2.2.3"] - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:rpm -q ypserv-> r:package ypserv is not installed' -# 3.1.2 Disable Send Packet Redirects (Scored) - - id: 5547 - title: "Ensure packet redirect sending is disabled" - description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." - rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0 and set the active kernel parameters. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + +# 2.2.19 Ensure telnet-server is not installed (Automated) + - id: 4573 + title: "Ensure telnet server is not installed" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to disable telnet: # yum remove telnet-server" compliance: - - cis: ["3.1.2"] - - cis_csc: ["3", "11"] - - pci_dss: ["2.2.4"] + - cis: ["2.2.19"] + - cis_csc: ["2.6","9.2"] + - pci_dss: ["2.2.3"] - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: all rules: - - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' - - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:rpm -q telnet-server-> r:package telnet-server is not installed' + + +############################################### +# 2.3 Service Clients +############################################### + +# 2.3.1 Ensure NIS Client is not installed (Automated) + - id: 4574 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # yum remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q ypbind -> r:package ypbind is not installed' + +# 2.3.2 Ensure rsh client is not installed (Automated) + - id: 4575 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh, rcp and rlogin ." + remediation: "Run the following command to uninstall rsh: # yum remove rsh" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q rsh -> r:^package rsh is not installed' + +# 2.3.3 Ensure talk client is not installed (Automated) + - id: 4576 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk: # yum remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q talk -> r:^package talk is not installed' + +# 2.3.4 Ensure telnet client is not installed (Automated) + - id: 4577 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet: # yum remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q telnet -> r:^package telnet is not installed' + +# 2.3.5 Ensure LDAP client is not installed (Automated) + - id: 4578 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients: # yum remove openldap-clients" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q openldap-clients -> r:^package openldap-clients is not installed' + +# 2.5 Ensure nonessential services are removed or masked (Manual) + - id: 4579 + title: "Ensure nonessential services are removed or masked" + description: "A network port is identified by its number, the associated IP address, and the type of the communication protocol such as TCP or UDP.A listening port is a network port on which an application or process listens on, acting as a communication endpoint. Each listening port can be open or closed (filtered) using a firewall. In general terms, an open port is a network port that accepts incoming packets from remote locations" + rationale: "Services listening on the system pose a potential risk as an attack vector. These services should be reviewed, and if not required, the service should be stopped, and the package containing the service should be removed. If required packages have a dependency, the service should be stopped and masked to reduce the attack surface of the system." + remediation: "Review the output of: # lsof -i -P -n | grep -v '(ESTABLISHED)'; to ensure that all services listed are required on the system. If a listed service is not required, remove the package containing the service. If the package containing the service is required, stop and mask the service. Run the following command to remove the package containing the service:# yum remove OR if required packages have a dependency: run the following command to stop and mask the service:# systemctl --now mask " + compliance: + - cis: ["2.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:lsof -i -P -n -> r:(ESTABLISHED)' + +############################################### +# 3 Network Configuration and Firewalls ############################################### -# 3.2 Modify Network Parameters (Host and Router) -############################################### -# 3.2.1 Disable Source Routed Packet Acceptance (Scored) - - id: 5548 +############################################### +# 3.1 Disable unused network protocols and devices +############################################### + +# 3.1.1 Disable IPv6 (Manual) + - id: 4580 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6be disabled to reduce the attack surface of the system." + remediation: "To disable IPv6 through the GRUB2 config: edit /etc/default/gruband add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX=\"ipv6.disable=1\" Run the following command to update the grub2 configuration:# grub2-mkconfig –o /boot/grub2/grub.cfg; OR to disable IPv6 through sysctl settings: set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: # net.ipv6.conf.all.disable_ipv6 = 1; # net.ipv6.conf.default.disable_ipv6 = 1; Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.disable_ipv6=1; # sysctl -w net.ipv6.conf.default.disable_ipv6=1; # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*linux && !r:ipv6.disable=1' + - 'c:sysctl net.ipv6.conf.all.disable_ipv6-> r:net.ipv6.conf.all.disable_ipv6\s*=\s*0' + - 'c:sysctl net.ipv6.conf.default.disable_ipv6-> r:net.ipv6.conf.default.disable_ipv6\s*=\s*0' + + +# 3.1.2 Ensure wireless interfaces are disabled (Manual) + - id: 4581 + title: "Ensure wireless interfaces are disabled" + description: "Wireless networking is used when wired networks are unavailable." + rationale: "If wireless is not to be used, wireless devices should be disabled to reduce the potential attack surface" + remediation: "Run the following command to disable any wireless interfaces: # ip link set down" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:iw list-> r:Interface' + +################################################## +# 3.2 Network Parameters (Host Only) +################################################## + + +# 3.2.1 Ensure IP forwarding is disabled (Automated) + - id: 4582 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following commands to restore the default parameters and set the active kernel parameters: # grep -Els '^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1' /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri 's/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/' $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'not c:grep -RhEs "^\s*net\.ipv4\.ip_forward\s*=\s*1" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf-> r:ip_forward' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + - 'not c:grep -RhEs "^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf-> r:forwarding' + + +# 3.2.2 Ensure packet redirect sending is disabled (Automated) + - id: 4583 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0 and set the active kernel parameters. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0' + +################################################## +# 3.3 Network Parameters (Host and Router) +################################################## + +# 3.3.1 Ensure source routed packets are not accepted (Automated) + - id: 4584 title: "Ensure source routed packets are not accepted" description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0; net.ipv4.conf.default.accept_source_route = 0 and set the active kernel parameters." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0; net.ipv4.conf.default.accept_source_route = 0 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" compliance: - - cis: ["3.2.1"] - - cis_csc: ["3", "11"] + - cis: ["3.3.1"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0' -# 3.2.2 Disable ICMP Redirect Acceptance (Scored) - - id: 5549 + +# 3.3.2 Ensure ICMP redirects are not accepted (Automated) + - id: 4585 title: "Ensure ICMP redirects are not accepted" description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0 and set the active kernel parameters." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" compliance: - - cis: ["3.2.2"] - - cis_csc: ["3", "11"] + - cis: ["3.3.2"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' -# 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) - - id: 5550 + +# 3.3.3 Ensure secure ICMP redirects are not accepted (Automated) + - id: 4586 title: "Ensure secure ICMP redirects are not accepted" description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0; net.ipv4.conf.default.secure_redirects = 0 and set the active kernel parameters." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0; net.ipv4.conf.default.secure_redirects = 0 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" compliance: - - cis: ["3.2.3"] - - cis_csc: ["3", "11"] + - cis: ["3.3.3"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0' -# 3.2.4 Log Suspicious Packets (Scored) - - id: 5551 +# 3.3.4 Ensure suspicious packets are logged (Automated) + - id: 4587 title: "Ensure suspicious packets are logged" description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1; net.ipv4.conf.default.log_martians = 1 and set the active kernel parameters." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1; net.ipv4.conf.default.log_martians = 1 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" compliance: - - cis: ["3.2.4"] - - cis_csc: ["6"] + - cis: ["3.3.4"] + - cis_csc: ["6.2","6.3"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1' -# 3.2.5 Enable Ignore Broadcast Requests (Scored) - - id: 5552 +# 3.3.5 Ensure broadcast ICMP requests are ignored (Automated) + - id: 4588 title: "Ensure broadcast ICMP requests are ignored" description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." - rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 and set the active kernel parameters." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 and set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" compliance: - - cis: ["3.2.5"] - - cis_csc: ["3", "11"] + - cis: ["3.3.5"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1' -# 3.2.6 Enable Bad Error Message Protection (Scored) - - id: 5553 +# 3.3.6 Ensure bogus ICMP responses are ignored (Automated) + - id: 4589 title: "Ensure bogus ICMP responses are ignored" description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1 and set the active kernel parameters." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1 and set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" compliance: - - cis: ["3.2.6"] - - cis_csc: ["3", "11"] + - cis: ["3.3.6"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1' -# 3.2.7 Enable RFC-recommended Source Route Validation (Scored) - - id: 5554 +# 3.3.7 Ensure Reverse Path Filtering is enabled (Automated) + - id: 4590 title: "Ensure Reverse Path Filtering is enabled" description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." - remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1; net.ipv4.conf.default.rp_filter = 1 and set the active kernel parameters." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1; net.ipv4.conf.default.rp_filter = 1 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" compliance: - - cis: ["3.2.7"] - - cis_csc: ["3", "11"] + - cis: ["3.3.7"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1' -# 3.2.8 Enable TCP SYN Cookies (Scored) - - id: 5555 +# 3.3.8 Ensure TCP SYN Cookies is enabled (Automated) + - id: 4591 title: "Ensure TCP SYN Cookies is enabled" description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent." rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." - remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 and set the active kernel parameters." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 and set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" compliance: - - cis: ["3.2.8"] - - cis_csc: ["3", "11"] + - cis: ["3.3.8"] + - cis_csc: ["5.1"] - pci_dss: ["2.2.4"] - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' - - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1' + +# 3.3.9 Ensure IPv6 router advertisements are not accepted (Automated) + - id: 4592 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0' + + + +############################################### +# 3.4 Uncommon Network Protocols +############################################### +# 3.4.1 Ensure DCCP is disabled (Automated) + - id: 4593 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:install /bin/true' + - 'not c:lsmod -> r:dccp' + + + +# 3.4.2 Ensure SCTP is disabled (Automated) + - id: 4594 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:install /bin/true' + - 'not c:lsmod -> r:sctp' + ############################################### -# 5 System Access, Authentication and Authorization +# 3.5 Firewall Configuration ############################################### ############################################### -# 5.2 Configure SSH +# 3.5.1 Configure firewalld ############################################### -# 5.2.2 Set SSH Protocol to 2 (Scored) - - id: 5556 - title: "Ensure SSH Protocol is set to 2" - description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." - rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" - compliance: - - cis: ["5.2.2"] - - cis_csc: ["3.4"] - - pci_dss: ["4.1"] - - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + +# 3.5.1.1 Ensure FirewallD is installed (Automated) +# 3.5.2.1 Ensure nftables is installed (Automated) +# 3.5.3.1.1 Ensure iptables packages are installed (Automated) +# 3 rules here: + - id: 4595 + title: "Ensure FirewallD or nftables or iptables-services is installed" + description: "firewalld is a firewall management tool for Linux operating systems. It provides firewall features by acting as a front-end for the Linux kernel's net filter framework via the iptables backend or provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the nftables utility. FirewallD replaces iptables as the default firewall management tool. Use the firewalld utility to configure a firewall for less complex firewalls. The utility is easy to use and covers the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can administer separate firewall zones with varying degrees of trust as defined in zone profiles." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + remediation: "Run the following command to install firewalld: # yum install firewalld iptables; OR to install nftables: # yum install nftables; OR to install iptables-services: # yum install iptables-services iptables" + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - 'not c:rpm -q iptables firewalld-> r:is not installed' + - 'not c:rpm -q nftables-> r:is not installed' + - 'not c:rpm -q iptables iptables-services-> r:is not installed' + +# 3.5.1.2 Ensure iptables-services package is not installed (Automated) +# 3.5.3.1.3 Ensure firewalld is not installed or stopped and masked(Automated) +# both of the rules are here + - id: 4596 + title: "Ensure iptables-services and FirewallD are not installed at the same time" + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both firewalld and the services included in the iptables-services package may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package: # systemctl stop iptables; # systemctl stop ip6tables; # yum remove iptables-services. OR Run the following command to remove firewalld: # yum remove firewalld OR Run the following command to stop and mask firewalld: # systemctl --now mask firewalld" + compliance: + - cis: ["3.5.1.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - 'c:rpm -q iptables-services firewalld-> r:is not installed' + - 'c:systemctl is-enabled firewalld-> r:masked' + + + +# 3.5.1.3 Ensure nftables is not installed or stopped and masked (Automated) +# 3.5.2.2 Ensure firewalld is not installed or stopped and masked (Automated) +# Both of the rules are here + - id: 4597 + title: "Ensure nftables and FirewallD are not installed at the same time or ensure one of them is stopped and masked" + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables.Note: Support for using nftables as the back-end for firewalld was added in release v0.6.0. In Fedora 19 Linux derivatives, firewalld utilizes iptables as its back-end by default." + rationale: "Running both firewalld and nftables may lead to conflict." + remediation: "Run the following command to remove nftables:# yum remove nftables; OR run the following command to stop and mask nftables: # systemctl --now mask nftables. OR Run the following command to remove firewalld: # yum remove firewalld OR Run the following command to stop and mask firewalld: # systemctl --now mask firewalld" + compliance: + - cis: ["3.5.1.3","3.5.3.1.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - 'c:rpm -q iptables-services nftables -> r:is not installed' + +# 3.5.2.3 Ensure iptables-services package is not installed (Automated) +# 3.5.3.1.2 Ensure nftables is not installed (Automated) +# Both of the rules are here + + - id: 4598 + title: "Ensure nftables and iptables-services are not installed at the same time or ensure one of them is stopped and masked" + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables.Note: Support for using nftables as the back-end for firewalld was added in release v0.6.0. In Fedora 19 Linux derivatives, firewalld utilizes iptables as its back-end by default." + rationale: "Running both nftables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables:# yum remove nftables; OR run the following command to stop and mask nftables: # systemctl --now mask nftables. OR Run the following command to remove iptables# # systemctl stop iptables; # systemctl stop ip6tables; # yum remove iptables-services" + compliance: + - cis: ["3.5.1.3","3.5.3.1.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - 'c:rpm -q firewalld nftables -> r:is not installed' + - 'c:systemctl is-enabled nftables-> r:masked' + - 'c:systemctl is-enabled firewalld-> r:masked' + + + +# 3.5.1.4 Ensure firewalld service is enabled and running (Automated) + - id: 4599 + title: "Ensure firewalld service is enabled and running" + description: "firewalld.serviceenables the enforcement of firewall rules configured through firewalld" + rationale: "Ensure that the firewalld.service is enabled and running to enforce firewall rules configured through firewalld" + remediation: "Run the following command to unmask firewalld: # systemctl unmask firewalld; Run the following command to enable and start firewalld: # systemctl --now enable firewalld" + compliance: + - cis: ["3.5.1.4"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] condition: all rules: - - 'f:$sshd_file -> !r:^# && r:Protocol\s*\t*2' + - 'c:systemctl is-enabled firewalld -> r:enabled' + - 'c:firewall-cmd --state-> r:running' -# 5.2.3 Set LogLevel to INFO (Scored) - - id: 5557 - title: "Ensure SSH LogLevel is set to INFO" - description: "The INFO parameter specifies that login and logout activity will be logged." - rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" - compliance: - - cis: ["5.2.3"] - - cis_csc: ["16"] - - pci_dss: ["4.1"] - - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + +############################################### +# 3.5.2 Configure nftables #################### +############################################### + +# 3.5.2.5 Ensure a table exists (Automated) + - id: 4600 + title: "Ensure a table exists" + description: "nTables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + remediation: "Run the following command to create a table in nftables: # nft create table inet
" + compliance: + - cis: ["3.5.2.5"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] condition: all rules: - - 'f:$sshd_file -> !r:^# && r:LogLevel\s*\t*INFO' + - 'c:nft list tables-> r:table' -# 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) - - id: 5558 - title: "Ensure SSH MaxAuthTries is set to 4 or less" - description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." - rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" +# 3.5.2.6 Ensure base chains exist (Automated) + - id: 4601 + title: "Ensure base chains exist" + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + remediation: "Run the following command to create the base chains: # nft createchain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } " compliance: - - cis: ["5.2.5"] - - cis_csc: ["16"] - - pci_dss: ["2.2.4"] - - nist_800_53: ["CM.1"] + - cis: ["3.5.2.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] condition: all rules: - - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'c:nft list ruleset-> r:type filter hook input priority 0' + - 'c:nft list ruleset-> r:type filter forward priority 0' + - 'c:nft list ruleset-> r:type filter hook output priority 0' + +# 3.5.2.7 Ensure loopback traffic is configured (Automated) + - id: 4602 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network" + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # nft add rule inet filter input iif lo accept; # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop; IF IPv6 is enabled: run the following command to implement the IPv6 loopback rules: # nft add rule inet filter input ip6 saddr::1 counter drop" + compliance: + - cis: ["3.5.2.7"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:nft list ruleset-> r:iif "lo" accept' + - 'c:nft list ruleset-> r:ip saddr 127.0.0.0/8 counter packets 0 bytes 0 drop' -# 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) - - id: 5559 - title: "Ensure SSH IgnoreRhosts is enabled" - description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." - rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" +# 3.5.2.8 Ensure outbound and established connections are configured (Manual) + - id: 4603 + title: "Ensure outbound and established connections are configured" + description: "Configure the firewall rules for new outbound and established connections." + rationale: "If rules are not in place for new outbound and established connections, all packets will be dropped by the default policy preventing network usage." + remediation: "Configure nftables in accordance with site policy. The following commands will implement a policy to allow all outbound connections and all established connections: # nft add rule inet filter input ip protocol tcp ct state established accept; # nft add rule inet filter input ip protocol udp ct state established accept; # nft add rule inet filter input ip protocol icmp ct state established accept; # nft add rule inet filter output ip protocol tcp ct state new,related,established accept; # nft add rule inet filter output ip protocol udp ct state new,related,established accept; # nft add rule inet filter output ip protocol icmp ct state new,related,established accept" compliance: - - cis: ["5.2.6"] - - cis_csc: ["9"] - - pci_dss: ["4.1"] - - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + - cis: ["3.5.2.8"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] condition: all rules: - - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' + - 'c:nft list ruleset-> r:ip protocol tcp ct state established accept' + - 'c:nft list ruleset-> r:ip protocol tcp udp state established accept' + - 'c:nft list ruleset-> r:ip protocol tcp icmp state established accept' + - 'c:nft list ruleset-> r:ip protocol tcp ct state established,related,new accept' + - 'c:nft list ruleset-> r:ip protocol tcp udp state established,related,new accept' + - 'c:nft list ruleset-> r:ip protocol tcp icmp state established,related,new accept' + + +# 3.5.2.9 Ensure default deny firewall policy (Automated) + - id: 4604 + title: "Ensure default deny firewall policy" + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; }" + compliance: + - cis: ["3.5.2.9"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:nft list ruleset-> r:type filter hook input priority 0; policy drop;' + - 'c:nft list ruleset-> r:type filter hook forward priority 0; policy drop;' + - 'c:nft list ruleset-> r:type filter hook output priority 0; policy drop;' + +# 3.5.2.10 Ensure nftables service is enabled (Automated) + - id: 4605 + title: "Ensure nftables service is enabled" + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service" + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conffile during boot or the starting of the nftables service" + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables" + compliance: + - cis: ["3.5.2.10"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:systemctl is-enabled nftables-> r:enabled' + - 'c:nft list ruleset-> r:type filter hook forward priority 0; policy drop;' + - 'c:nft list ruleset-> r:type filter hook output priority 0; policy drop;' + +# 3.5.2.11 Ensure nftables rules are permanent (Automated) + - id: 4606 + title: "Ensure nftables rules are permanent" + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames. The nftables service reads the /etc/sysconfig/nftables.conffile for a nftables file or files to include in the nftables ruleset. A nftables ruleset containing the input, forward, and output base chains allow network traffic to be filtered." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables" + rationale: "Changes made to nftables ruleset only affect the live system, you will also need to configure the nftables ruleset to apply on boot" + compliance: + - cis: ["3.5.2.11"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'f:/etc/sysconfig/nftables.conf-> r:^include "/etc/nftables/nftables.rules"' + - 'not f:/etc/sysconfig/nftables.conf-> r:#\s*include "/etc/nftables/nftables.rules"' -# 5.2.7 Set SSH HostbasedAuthentication to No (Scored) - - id: 5560 - title: "Ensure SSH HostbasedAuthentication is disabled" - description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." - rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + +############################################### +# 3.5.3 Configure iptables #################### +############################################### +############################################### +#3.5.3.2 Configure IPv4 iptabl +############################################### + +# 3.5.3.2.1 Ensure default deny firewall policy (Automated) + - id: 4607 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP" + compliance: + - cis: ["3.5.3.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + + +# 3.5.3.2.2 Ensure loopback traffic is configured (Automated) + - id: 4608 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" compliance: - - cis: ["5.2.7"] - - cis_csc: ["9"] - - pci_dss: ["4.1"] - - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + - cis: ["3.5.3.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] condition: all rules: - - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + +# 3.5.3.2.6 Ensure iptables is enabled and running (Automated) + - id: 4609 + title: "Ensure iptables is enabled and running" + description: "iptables.service is a utility for configuring and maintaining iptables." + rationale: "iptables.service willload the iptables rules saved in the file /etc/sysconfig/iptablesat boot, otherwise the iptables rules will be cleared during a re-boot of the system." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP; # ip6tables -P OUTPUT DROP; # ip6tables -PFORWARD DROP" + compliance: + - cis: ["3.5.3.2.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:systemctl is-enabled iptables -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:systemctl status iptables -> r:Active: active (running) since \w+ \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d' -# 5.2.8 Disable SSH Root Login (Scored) - - id: 5561 - title: "Ensure SSH root login is disabled" - description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." - rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" +############################################### +# 3.5.3.3 Configure IPv6 ip6tables +############################################### + +# 3.5.3.3.1 Ensure IPv6 default deny firewall policy (Automated) + - id: 4610 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP; # ip6tables -P OUTPUT DROP; # ip6tables -PFORWARD DROP" + compliance: + - cis: ["3.5.3.3.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L-> r:Chain INPUT (policy DROP)' + - 'c:ip6tables -L-> r:Chain FORWARD (policy DROP)' + - 'c:ip6tables -L-> r:Chain OUTPUT (policy DROP)' + + +# 3.5.3.3.2 Ensure IPv6 loopback traffic is configured (Automated) + - id: 4611 + title: "Ensure IPv6 loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic tothe loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure" + remediation: "Run the following commands to implement the loopback rules:# ip6tables -A INPUT -i lo -j ACCEPT# ip6tables -A OUTPUT -o lo -j ACCEPT# ip6tables -A INPUT -s::1 -j DROP" compliance: - - cis: ["5.2.8"] - - cis_csc: ["5.8"] - - pci_dss: ["4.1"] - - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + - cis: ["3.5.3.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] condition: all rules: - - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' + - 'c:ip6tables -L INPUT -v -n-> r:ACCEPT' + - 'c:ip6tables -L INPUT -v -n-> r:DROP' + - 'c:ip6tables -L OUTPUT -v -n-> r:ACCEPT' + +# 3.5.3.3.3 Ensure IPv6 outbound and established connections are configured (Manual) + - id: 4612 + title: "Ensure IPv6 outbound and established connections are configured" + description: "Configure the firewall rules for new outbound, and established IPv6 connections." + rationale: "If rules are not in place for new outbound, and established connections all packets will be dropped by the default policy preventing network usage" + remediation: "Configure iptables in accordance with site policy. The following commands will implement a policy to allow all outbound connections and all established connections:# ip6tables -AOUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT# ip6tables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT# ip6tables -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT# ip6tables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT# ip6tables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT# ip6tables -A INPUT -p icmp -m state --state ESTABLISHED -j ACCEPT" + compliance: + - cis: ["3.5.3.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L OUTPUT -v -n-> r:state NEW,ESTABLISHED' + - 'c:ip6tables -L INPUT -v -n-> r:state ESTABLISHED' -# 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) - - id: 5562 - title: "Ensure SSH PermitEmptyPasswords is disabled" - description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." - rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." - remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + +# 3.5.3.3.6 Ensure ip6tables is enabled and running (Automated) + - id: 4613 + title: "Ensure ip6tables is enabled and running" + description: "ip6tables.service is a utility for configuring and maintaining ip6tables." + rationale: "ip6tables.service will load the iptables rules saved in the file /etc/sysconfig/ip6tables at boot, otherwise the ip6tables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start ip6tables: # systemctl --now start ip6tables" compliance: - - cis: ["5.2.9"] - - cis_csc: ["16"] - - pci_dss: ["4.1"] - - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] - - nist_800_53: ["SC.8"] - - tsc: ["CC6.1", "CC6.7", "CC7.2"] + - cis: ["3.5.3.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] condition: all rules: - - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + - 'c:systemctl is-enabled ip6tables -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:systemctl status ip6tables -> r:Active: active (running) since \w+ \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d' + + ############################################### -# 6 System Maintenance +# 4 Logging and Auditing ############################################### ############################################### -# 6.2 Review User and Group Settings +# 4.1 Configure System Accounting (auditd) ############################################### -# 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) - - id: 5563 - title: "Ensure root is the only UID 0 account" - description: "Any account with UID 0 has superuser privileges on the system." - rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." - remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + +# 4.1.1.1 Ensure auditd is installed + - id: 4614 + title: "Ensure auditd is installed" + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # yum install audit audit-libs" + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1","10.7"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:rpm -q audit -> r:^audit-\S+' + - 'c:rpm -q audit-libs -> r:^audit-libs-\S+' + +# 4.1.1.2 Ensure auditd service is enabled (Scored) + - id: 4615 + title: "Ensure auditd service is enabled and running" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd" compliance: - - cis: ["6.2.5"] - - cis_csc: ["5.1"] - - pci_dss: ["10.2.5"] + - cis: ["4.1.1.2"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1","10.7"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled auditd -> r:^enabled' + - 'c:systemctl status auditd -> r:Active: active \(running\)' + + +# 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 4616 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected. Note: This recommendation is designed around the grub2 bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + remediation: "Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\" . Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.2.6","10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + +# 4.1.2.1 Ensure audit log storage size is configured (Not Scored) + - id: 4617 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.2.1"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file = \d+' + +# 4.1.2.2 Ensure audit logs are not automatically deleted (Scored) + - id: 4618 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.2.2"] + - cis_csc: ["6.2","6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + +# 4.1.2.3 Ensure system is disabled when audit logs are full (Scored) + - id: 4619 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.2.3"] + - cis_csc: ["6.2","6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt' + +# 4.1.2.4 Ensure audit_backlog_limit is sufficient + - id: 4620 + title: "Ensure audit_backlog_limit is sufficient" + description: "The backlog limit has a default setting of 64" + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more than 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected" + remediation: "Edit /etc/default/grub and add audit_backlog_limit= to GRUB_CMDLINE_LINUX: Example: GRUB_CMDLINE_LINUX=\"audit_backlog_limit=8192\" Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["4.1.2.4"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:audit_backlog_limit=' + + + +# 4.1.3 Ensure events that modify date and time information are collected (Scored) + - id: 4621 + title: "Ensure events that modify date and time information are collected" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"." + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/time-change.rules and add the following lines: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/time-change.rules and add the following lines: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.3"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/localtime && r:-p wa && r:-k time-change' + +# 4.1.4 Ensure events that modify user/group information are collected (Scored) + - id: 4622 + title: "Ensure events that modify user/group information are collected" + description: "Record events affecting the group, passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/identity.rules and add the following lines: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.4"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/group && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/passwd && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/gshadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/shadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/security/opasswd && r:-p wa && r:-k identity' + +# 4.1.5 Ensure events that modify the system's network environment are collected (Scored) + - id: 4623 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale " + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.5","6.2"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/issue && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/issue.net && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/hosts && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sysconfig/network && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale' + +# 4.1.6 Ensure events that modify the system's Mandatory Access Controls are collected (Scored) + - id: 4624 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/MAC-policy.rules and add the following lines: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy ." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/selinux/ && r:-p wa && r:-k MAC-policy' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /usr/share/selinux/ && r:-p wa && r:-k MAC-policy' + +# 4.1.7 Ensure login and logout events are collected (Scored) + - id: 4625 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The /var/run/faillock/ directory maintains records of login failures via the pam_faillock module. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/logins.rules and add the following lines: -w /var/log/lastlog -p wa -k logins -w /var/run/faillog/ -p wa -k logins IF the pam_faillock.so module is used: Also include the line: -w /var/run/faillock/ -p wa -k logins OR IF the pam_tally2.so module is used: Also include the line: -w /var/log/tallylog -p wa -k logins" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["4.9","16.11","16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/lastlog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/run/faillog/ && r:-p wa && r:-k logins' + +# 4.1.8 Ensure session initiation information is collected (Scored) + - id: 4626 + title: "Ensure session initiation information is collected" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"." + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/logins.rules and add the following lines: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins . Notes: The last command can be used to read /var/log/wtmp ( last with no parameters) and /var/run/utmp ( last -f /var/run/utmp ) Reloading the auditd config to set active settings may require a system reboot." + compliance: + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9","16.11","16.13"] + - pci_dss: ["10.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/run/utmp && r:-p wa && r:-k session' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/wtmp && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/btmp && r:-p wa && r:-k logins' + +# 4.1.9 Ensure discretionary access control permission modification events are collected (Scored) + - id: 4627 + title: "Ensure discretionary access control permission modification events are collected" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod, fchmod and fchmodat system calls affect the permissions associated with a file. The chown, fchown, fchownat and lchown system calls affect owner and group attributes on a file. The setxattr, lsetxattr, fsetxattr (set extended file attributes) and removexattr, lremovexattr, fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/perm_mod.rules and add the following lines: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/perm_mod.rules and add the following lines: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem . Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + +# 4.1.10 Ensure unsuccessful unauthorized file access attempts are collected (Scored) + - id: 4628 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open, openat ) and truncation ( truncate, ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/access.rules and add the following lines: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/access.rules and add the following lines: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access . Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + +# 4.1.12 Ensure successful file system mounts are collected (Scored) + - id: 4629 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/mount.rules and add the following lines: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/mounts.rules and add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts . Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' + + +# 4.1.13 Ensure file deletion events by users are collected (Scored) + - id: 4630 + title: "Ensure file deletion events by users are collected" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for ollowing system calls and tags them with the identifier \"delete\": unlink -remove a file unlinkat - remove a file attribute), rename (rename a file and renameat - rename a file attribute." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/delete.rules and add the following lines: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/delete.rules and add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete . Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["6.2","13"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4","PI1.5","CC7.1","CC7.2","CC7.3","CC8.1"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' + +# 4.1.14 Ensure changes to system administration scope (sudoers) is collected (Scored) + - id: 4631 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: "Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers or a file in the /etc/sudoers.d directory will be written to when the file or its attributes have changed." + rationale: "Changes in the /etc/sudoers file, or a file in the /etc/sudoers.d/ directory can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/scope.rules and add the following lines:: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope . Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope' + +# 4.1.15 Ensure system administrator actions (sudolog) are collected (Scored) + - id: 4632 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. The sudo log file is configured in /etc/sudoersor a file in /etc/sudoers.d. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to the sudo log file. Any time a command is executed, an audit event will be triggered as the sudo log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules . Example: vi /etc/audit/rules.d/action.rules and add the following lines: -w /var/log/sudo.log -p wa -k actions ." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.9","5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/sudo.log && r:-p wa && r:-k actions' + +# 4.1.16 Ensure kernel module loading and unloading is collected (Scored) + - id: 4633 + title: "Ensure kernel module loading and unloading is collected" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules. Example: vi /etc/audit/rules.d/modules.rules and add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b32 -S init_module -S delete_module -k modules For 64 bit systems Edit or create a file in the /etc/audit/rules.d/directory ending in .rules Example: vi /etc/audit/rules.d/modules.rules Add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b64 -S init_module -S delete_module -k modules " + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + +# 4.1.17 Ensure the audit configuration is immutable (Scored) + - id: 4634 + title: "Ensure the audit configuration is immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl . Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rulesand add the following line at the end of the file: -e 2" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-e 2' + + +############################################### +# 4.2 Configure Logging +############################################### + + +# 4.2.1.1 Ensure rsyslog is installed (Scored) + - id: 4635 + title: "Ensure rsyslog is installed" + description: "The rsyslog software is a recommended replacement to the original syslogd daemon. rsyslog provides improvements over syslogd, including: - connection-oriented (i.e. TCP) transmission of logs - The option to log to database formats - Encryption of log data en route to a central logging server" + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # yum install rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: any + rules: + - 'c:rpm -q rsyslog -> r:^rsyslog-\S+' + + +# 4.2.1.2 Ensure rsyslog Service is enabled (Scored) + - id: 4636 + title: "Ensure rsyslog Service is enabled and running" + description: "rsyslogneeds to be enabled and running to perform logging" + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lackblogging instead." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled rsyslog -> enabled' + - 'c:systemctl status rsyslog -> r:active \(running\)' + +# 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 4637 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\.*.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + +# 4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host (Scored) + - id: 4638 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["6.6","6.8"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + + +############################################### +# 4.2 Configure journald +############################################### + + +# 4.2.2.1 Ensure journald is configured to send logs to rsyslog + - id: 4639 + title: "Ensure journald is configured to send logs to rsyslog " + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.5"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog\s*=\s*yes' + +# 4.2.2.2 Ensure journald is configured to compress large log files + - id: 4640 + title: "Ensure journald is configured to compress large log files" + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Compress\s*=\s*yes' + +# 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk + - id: 4641 + title: "Ensure journald is configured to compress large log files" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Storage\s*=\s*persistent' + + + + # 4.2.3 Ensure permissions on all logfiles are configured (Scored) + - id: 4642 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected. Other/world should not have the ability to view this information. Group should not have the ability to modify this information." + remediation: "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx \"{}\" + -o -type d -exec chmod g-wx,o-rwx \"{}\" +" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + +#################################################### +# 5 Access, Authentication and Authorization +#################################################### +#################################################### +# 5.1 Configure time-based job schedulers +#################################################### +# 5.1.1 Ensure cron daemon is enabled and running (Automated) + - id: 4643 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # systemctl enable crond; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:systemctl is-enabled crond -> enabled' + - 'c:systemctl status crond -> r:Active: active \(running\) since \w+ \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d' + + +# 5.1.2 Ensure permissions on /etc/crontab are configured (Automated) + - id: 4644 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab; # chmod og-rwx /etc/crontab; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\w00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Automated) + - id: 4645 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly; # chmod og-rwx /etc/cron.hourly; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.4 Ensure permissions on /etc/cron.daily are configured (Automated) + - id: 4646 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily; # chmod og-rwx /etc/cron.daily; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Automated) + - id: 4647 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly; # chmod og-rwx /etc/cron.weekly; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Automated) + - id: 4648 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly; # chmod og-rwx /etc/cron.monthly; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\w00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.7 Ensure permissions on /etc/cron.d are configured (Automated) + - id: 4649 + title: "Ensure permissions on /etc/cron.d are configured" + description: "The /etc/cron.d/directory contains system cronjobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab, but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d; # chmod og-rwx /etc/cron.d; OR run the following command to remove cron: # yum remove cronie" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.8 Ensure cron is restricted to authorized users (Scored) + - id: 4650 + title: "Ensure cron is restricted to authorized users" + description: "If cronis installed in the system, configure /etc/cron.allowto allow specific users to use these services. If /etc/cron.allowdoes not exist, then /etc/cron.denyis checked. Any user not specifically defined in those files is allowed to use cron. By removing the file, only users in /etc/cron.alloware allowed to use cron." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allowfile to control who can run cronjobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.deny -> r:No such file or directory$' + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.9 Ensure at is restricted to authorized users (Automated) + - id: 4651 + title: "Ensure at is restricted to authorized users" + description: "If atis installed in the system, configure /etc/at.allowto allow specific users to use these services. If /etc/at.allowdoes not exist, then /etc/at.denyis checked. Any user not specifically defined in those files is allowed to use at. By removing the file, only users in /etc/at.alloware allowed to use at." + rationale: "On many systems, only the system administrator is authorized to schedule atjobs. Using the at.allowfile to control who can run atjobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.9"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/at.deny -> r:No such file or directory$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + + +############################################### +# 5.2 Configure SSH Server +############################################### +# 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Automated) + - id: 4652 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: chown root:root /etc/ssh/sshd_config and chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + + +# 5.2.2 Ensure permissions on SSH private host key files are configured (Automated) + - id: 4653 + title: "Ensure permissions on SSH private host key files are configured" + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated" + remediation: "Run the following commands to set permissions, ownership, and group on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod u-x,g-wx,o-rwx {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:ssh_keys {} \\;" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_rsa_key" -exec stat {} \;->^Access: \(0\d40/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ecdsa_key" -exec stat {} \;->^Access: \(0\d40/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ed25519_key" -exec stat {} \;->^Access: \(0\d400/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.2.3 Ensure permissions on SSH public host key files are configured (Automated) + - id: 4654 + title: "Ensure permissions on SSH private host key files are configured" + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod u-x,go-wx {} \\; #find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_rsa_key.pub" -exec stat {} \;->^Access: \(0\d444/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ecdsa_key.pub" -exec stat {} \;->^Access: \(0\d44/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ed25519_key.pub" -exec stat {} \;->^Access: \(0\d44/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + + +# 5.2.4 Ensure SSH access is limited (Scored) + - id: 4655 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. AllowGroups The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. DenyUsers The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. DenyGroups The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: # AllowUsers ; # AllowGroups ; # DenyUsers ; # DenyGroups " + compliance: + - cis: ["5.2.4"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'f:$sshd_file -> r:^\s*AllowUsers' + - 'f:$sshd_file -> r:^\s*AllowGroups' + - 'f:$sshd_file -> r:^\s*DenyUsers' + - 'f:$sshd_file -> r:^\s*DenyGroups' + +# 5.2.5 Ensure SSH LogLevel is appropriate (Automated) + - id: 4656 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field.VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: any + rules: + - 'f:$sshd_file -> r:^# && r:LogLevel\s*\t*INFO' + - 'f:$sshd_file -> r:^# && r:LogLevel\s*\t*VERBOSE' + + +# 5.2.6 Ensure SSH X11 forwarding is disabled (Automated) + - id: 4657 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - pci_dss: ["9.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*X11Forwarding\s*\t*no' + +# 5.2.7 Ensure SSH MaxAuthTries is set to 4 or less (Automated) + - id: 4658 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + + +# 5.2.8 Ensure SSH IgnoreRhosts is enabled (Automated) + - id: 4659 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' + +# 5.2.9 Ensure SSH HostbasedAuthentication is disabled (Automated) + - id: 4660 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' + +# 5.2.10 Ensure SSH root login is disabled (Automated) + - id: 4661 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' + +# 5.2.11 Ensure SSH PermitEmptyPasswords is disabled (Automated) + - id: 4662 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + +# 5.2.12 Ensure SSH PermitUserEnvironment is disabled (Automated) + - id: 4663 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*PermitUserEnvironment\s*\t*no' + +# 5.2.13 Ensure only strong Ciphers are used (Automated) + - id: 4664 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "This variable limits the ciphers that SSH can use during communication." + rationale: "Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised.: The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a 'Sweet32' attack; The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involvingLSB values, aka the 'Bar Mitzvah' issue; The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session; Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors; The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address" + remediation: "Edit the /etc/ssh/sshd_configfile add/modify the Ciphersline to contain a comma separated list of the site approved ciphersExample:Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["14.4"] + - pci_dss: ["12.3.8"] + condition: none + rules: + - 'c:sshd -T -> r:ciphers && r:3des-cbc|aes192-cbc|aes256-cbc|arcfour|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se' + + + +# 5.2.14 Ensure only strong MAC algorithms are used (Automated) + - id: 4665 + title: "Ensure only strong MAC algorithms are used" + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example:MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["14.4", "16.5"] + - pci_dss: ["12.3.8"] + condition: none + rules: + - 'c:sshd -T -> r:macs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com' + + +# 5.2.15 Ensure only strong Key Exchange algorithms are used (Automated) + - id: 4666 + title: "Ensure only strong Key Exchange algorithms are used" + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms.Example:'KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256'" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["14.4"] + - pci_dss: ["12.3.8"] + condition: none + rules: + - 'c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1' + + + +# 5.2.16 Ensure SSH Idle Timeout Interval is configured (Automated) + - id: 4667 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare >= 1' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare >= 1' + +# 5.2.17 Ensure SSH LoginGraceTime is set to one minute or less (Automated) + - id: 4668 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*LoginGraceTime\s*\t*(\d+) compare >= 1' + + +# 5.2.18 Ensure SSH warning banner is configured (Automated) + - id: 4669 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.18"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*Banner\s*\t*/etc/issue.net' + + +# 5.2.19 Ensure SSH PAM is enabled (Automated) + - id: 4670 + title: "Ensure SSH PAM is enabled" + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthenticationand PasswordAuthentication in addition to PAM account and session module processing for all authentication types" + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*UsePAM\s*yes' + + +# 5.2.20 Ensure SSH AllowTcpForwarding is disabled (Automated) + - id: 4671 + title: "Ensure SSH AllowTcpForwarding is disabled" + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines" + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors.SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no" + compliance: + - cis: ["5.2.20"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*AllowTcpForwarding\s*no' + + +# 5.2.21 Ensure SSH MaxStartups is configured (Automated) + - id: 4672 + title: "Ensure SSH MaxStartups is configured" + description: "The MaxStartupsparameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon" + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60" + compliance: + - cis: ["5.2.21"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*maxstartups\s*10:30:60' + + +# 5.2.22 Ensure SSH MaxSessions is limited (Automated) + - id: 4673 + title: "Ensure SSH MaxSessions is limited" + description: "The MaxSessionsparameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10" + compliance: + - cis: ["5.2.22"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*MaxSessions\s*10' + + + +############################################### +# 5.3 Configure PAM +############################################### +# 5.3.1 Ensure password creation requirements are configured (Automated) + - id: 4674 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy: minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy: minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy:password requisite pam_pwquality.so try_first_pass retry=3" + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> n:^\s*minclass\s+\t*=\s+\t*(\d+) compare >= 4' + - 'f:/etc/pam.d/password-auth -> n:try_first_pass retry=(\d+) compare <=3' + - 'f:/etc/pam.d/system-auth -> n:try_first_pass retry=(\d+) compare <=3' + +# 5.3.3 Ensure password hashing algorithm is SHA-512 (Automated) + - id: 4675 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these changes only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1","8.2.1"] + - tsc: ["CC6.1","CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + - 'f:/etc/pam.d/system-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + +# 5.3.4 Ensure password reuse is limited (Automated) + - id: 4676 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these changes only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=5 or password required pam_pwhistory.so remember=5" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + + +############################################### +# 5.4 User Accounts and Environment +############################################### +############################################### +# 5.4.1 Set Shadow Password Suite Parameters +############################################### +# 5.4.1.1 Ensure password expiration is 365 days or less (Automated) + - id: 4677 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + + +# 5.4.1.2 Ensure minimum days between password changes is configured (Automated) + - id: 4678 + title: "Ensure minimum days between password changes is configured" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs: PASS_MIN_DAYS 1 and modify user parameters for all users with a password set to match: chage --mindays 1 " + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + +# 5.4.1.3 Ensure password expiration warning days is 7 or more (Automated) + - id: 4679 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + +# 5.4.1.4 Ensure inactive password lock is 30 days or less (Automated) + - id: 4680 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + + +# 5.4.3 Ensure default group for the root account is GID 0 (Automated) + - id: 4681 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + + +# 5.4.4 Ensure default user shell timeout is configured (Automated) + - id: 4682 + title: " Ensure default user shell timeout is configured" + description: "TMOUT is an environmental setting that determines the timeout of a shell in seconds." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized user access to another user's shell session that has been left unattended. It also ends the inactive session and releases the resources associated with that session." + remediation: "Edit the /etc/bashrc and /etc/profile files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + +# 5.4.5 Ensure default user umask is configured (Automated) + - id: 4683 + title: "Ensure default user umask is configured" + description: "The user file-creation mode mask (umask) is use to determine the file permission for newly created directories and files. In Linux, the default permissions for any newly created directory is 0777 (rwxrwxrwx), and for any newly created file it is 0666 (rw-rw-rw-). The umask modifies the default Linux permissions by restricting (masking) these permissions. The umask is not simply subtracted, but is processed bitwise. Bits set in the umaskare cleared in the resulting file mode." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc, /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + + + +# 5.6 Ensure access to the su command is restricted (Automated) + - id: 4684 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + +############################################### +# 6 System Maintenance +############################################### +############################################### +# 6.1 System File Permissions +############################################### + + +# 6.1.2 Configure /etc/passwd permissions (Automated) + - id: 4685 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod u-x,g-wx,o-wx /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.3 Ensure permissions on /etc/shadow are configured (Automated) + - id: 4686 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 000 /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.4 Ensure permissions on /etc/group are configured (Automated) + - id: 4687 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod u-x,g-wx,o-wx /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.5 Ensure permissions on /etc/gshadow are configured (Automated) + - id: 4688 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chmod 000 /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.6 Ensure permissions on /etc/passwd-are configured (Automated) + - id: 4689 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.7 Ensure permissions on /etc/shadow-are configured (Automated) + - id: 4690 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:root /etc/shadow- # chmod 000 /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.8 Ensure permissions on /etc/group-are configured (Automated) + - id: 4691 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.9 Ensure permissions on /etc/gshadow-are configured (Automated) + - id: 4692 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 000 /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + + +############################################### +# 6.2 Review User and Group Settings +############################################### + + +# 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords (Automated) + - id: 4693 + title: "Ensure accounts in /etc/passwd use shadowed passwords" + description: "Local accounts can uses shadowed passwords. With shadowed passwords, The passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an xin the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack." + remediation: "f any accounts in the /etc/passwdfile do not have a single x in the password field, run the following command to set these accounts to use shadowed passwords:# sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwdInvestigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'not f:/etc/shadow -> !r:^# && r:\w\w:' + + +# 6.2.2 Ensure /etc/shadow password fields are not empty (Automated) + - id: 4694 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + +# 6.2.3 Ensure root is the only UID 0 account (Automated) + - id: 4695 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] - hipaa: ["164.312.b"] - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] condition: none rules: - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + +# 6.2.18 Ensure shadow group is empty (Automated) + - id: 4696 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group" + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily runa password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.18"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'not f:/etc/shadow -> !r:^# && r:^shadow:\.+:\.+:\.+:\.+' diff --git a/sca/rhel/8/cis_rhel8_linux.yml b/sca/rhel/8/cis_rhel8_linux.yml new file mode 100644 index 000000000..d91821883 --- /dev/null +++ b/sca/rhel/8/cis_rhel8_linux.yml @@ -0,0 +1,3455 @@ +# Security Configuration Assessment +# CIS Checks for RHEL 8 +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Red Hat Enterprise Linux 8 Benchmark v1.0 - 09-30-2019 + +policy: + id: "cis_rhel8_linux" + file: "cis_rhel8_linux.yml" + name: "CIS Benchmark for Red Hat Enterprise Linux 8" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Red Hat Enterprise Linux 8 systems running on x86 and x64 platforms. This document was tested against Red Hat Enterprise Linux 8" + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check RHEL8 family platform" + description: "Requirements for running the policy against RHEL 8 family." + condition: any + rules: + - 'f:/etc/redhat-release -> r:^Red Hat Enterprise Linux && r:release 8' + - 'f:/etc/redhat-release -> r:^Cloud && r:release 8' + - 'f:/etc/redhat-release -> r:^Oracle && r:release 8' + - 'f:/etc/redhat-release -> r:^Better && r:release 8' + - 'f:/etc/redhat-release -> r:^OpenVZ && r:release 8' +# - 'f:/etc/system-release -> r:^Amazon && r:release 2' + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + +############################################### +# 1 Initial setup +############################################### +############################################### +# 1.1 Filesystem Configuration +############################################### +# 1.1.1.1 cramfs: filesystem + - id: 5000 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf .Example: vim /etc/modprobe.d/cramfs.conf: and add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: # rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found' + - 'not c:lsmod -> r:cramfs' + + +# 1.1.1.2 vFAT: filesystem + - id: 5001 + title: "Ensure mounting of FAT filesystems is limited" + description: "The VFAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf . Example: vim /etc/modprobe.d/vfat.conf: install vfat /bin/true. Run the following command to unload the vfat module: # rmmod vfat" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found' + - 'not c:lsmod -> r:vfat' + + +# 1.1.1.3 squashfs: filesystem + - id: 5002 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf . Example: vim /etc/modprobe.d/squashfs.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found' + - 'not c:lsmod -> r:squashfs' + +# 1.1.1.4 udfs: filesystem + - id: 5003 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf. Example: vim /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:modprobe -n -v udf -> r:install /bin/true|Module udf not found' + - 'not c:lsmod -> r:udf' +# 1.1.2 /tmp: partition + - id: 5004 + title: "Ensure /tmp is configured" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + remediation: "Configure /etc/fstab as appropriate. example: \"tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,realtime 0 0\" OR Run the following commands to enable systemd /tmp mounting: # systemctl unmask tmp.mount # systemctl enable tmp.mount Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + +# 1.1.3 /tmp: nodev + - id: 5005 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nodev /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:nodev' + +# 1.1.4 /tmp: nosuid + - id: 5006 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nosuid /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:nosuid' + +# 1.1.5 /tmp: noexec + - id: 5007 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,noexec /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:noexec' + +# 1.1.6 Build considerations - Partition scheme. + - id: 5008 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + +# 1.1.7 bind mount /var/tmp to /tmp + - id: 5009 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + +# 1.1.8 nodev set on /var/tmp + - id: 5010 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:nodev' + + +# 1.1.9 nosuid set on /var/tmp + - id: 5011 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:nosuid' + +# 1.1.10 noexec set on /var/tmp + - id: 5012 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["5.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:noexec' + + + +# 1.1.11 /var/log: partition + - id: 5013 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data ." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.12 /var/log/audit: partition + - id: 5014 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.13 /home: partition + - id: 5015 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + + # 1.1.14 /home: nodev + - id: 5016 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/home\s && !r:nodev' + + # 1.1.15 /dev/shm: nodev + - id: 5017 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/dev/shm\s && !r:nodev' + + # 1.1.16 /dev/shm: nosuid + - id: 5018 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/dev/shm\s && !r:nosuid' + + # 1.1.17 /dev/shm: noexec + - id: 5019 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:mount -> r:\s/dev/shm\s && !r:noexec' + + # 1.1.22 Disable Automounting + - id: 5020 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs : systemctl disable autofs" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.4","8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled autofs -> enabled' + + # 1.1.23 Disable USB Storage (Scored) + - id: 5021 + title: "Disable USB Storage" + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb-storage.conf and add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: # rmmod usb-storage" + compliance: + - cis: ["1.1.23"] + - cis_csc: ["8.4","8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v usb-storage -> r:install /bin/true' + - 'not c:lsmod -> r:usb-storage' + + +############################################### +# 1.2 Configure Software Updates +############################################### + +# 1.2.2 Disable the rhnsd Daemon (Not Scored) + - id: 5022 + title: "Disable the rhnsd Daemon" + description: "The rhnsd daemon polls the Red Hat Network web site for scheduled actions and, if there are, executes those actions." + rationale: "Patch management policies may require that organizations test the impact of a patch before it is deployed in a production environment. Having patches automatically deployed could have a negative impact on the environment. It is best to not allow an action by default but only after appropriate consideration has been made. It is recommended that the service be disabled unless the risk is understood and accepted or you are running your own satellite . This item is not scored because organizations may have addressed the risk." + remediation: "Run the following command to disable rhnsd : # systemctl --now disable rhnsd" + compliance: + - cis: ["1.2.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:systemctl is-enabled rhnsd -> r:^disabled' + +# 1.2.4 Activate gpgcheck + - id: 5023 + title: "Ensure gpgcheck is globally activated" + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." + compliance: + - cis: ["1.2.4"] + - cis_csc: ["3.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + condition: all + rules: + - 'f:/etc/yum.conf -> r:gpgcheck=1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0' + +############################################### +# 1.3 Configure sudo +############################################### + +# 1.3.1 install sudo + - id: 5024 + title: "Ensure sudo is installed" + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo: # dnf install sudo" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q sudo -> r:sudo-\S*' + +# 1.3.2 Ensure sudo commands use pty (Scored) + - id: 5025 + title: "Ensure sudo commands use pty" + description: "sudo can be configured to run only from a pseudo-pty" + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + remediation: "edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'c:grep -r Default /etc/sudoers.d/ -> !r:# && r:\s*Defaults\s+use_pty' + +# 1.3.3 Ensure sudo log file exists (Scored) + - id: 5026 + title: "Ensure sudo log file exists" + description: "sudo can use a custom log file" + rationale: "A sudo log file simplifies auditing of sudo commands" + remediation: "edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults logfile=\"\"" + compliance: + - cis: ["1.3.3"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+logfile=' + - 'c:grep -r Default /etc/sudoers.d/ -> !r:# && r:\s*Defaults\s+logfile' + +############################################### +# 1.4 Filesystem Integrity Checking +############################################### + +# 1.4.1 install AIDE + - id: 5027 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install aide: # dnf install aide || Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: #aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - 'AIDE stable manual: http://aide.sourceforge.net/stable/manual.html' + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + +# 1.4.2 AIDE regular checks + - id: 5028 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: " Run the following commands: # cp ./config/aidecheck.service /etc/systemd/system/aidecheck.service # cp ./config/aidecheck.timer /etc/systemd/system/aidecheck.timer # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl reenable aidecheck.timer # systemctl restart aidecheck.timer # systemctl daemon-reload. OR Run the following command: crontab -u root -e // Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. " + compliance: + - cis: ["1.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4","PI1.5","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - 'https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service' + - 'https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer' + condition: any + rules: + - 'c:crontab -u root -l -> r:aide' + - 'c:grep -r aide /etc/cron.* /etc/crontab -> r:aide' + +############################################### +# 1.5 Secure Boot Settings +############################################### +# 1.5.1 Configure bootloader + - id: 5029 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg and grubenv stored in /boot/grub2/" + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/grubenv # chmod og-rwx /boot/grub2/grubenv" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub2/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat /boot/grub2/grubenv -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.5.2 Set Boot Loader Password (Scored) + - id: 5030 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub2-setpassword: # grub2-setpassword || Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["1.5.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub2/user.cfg -> r:^GRUB2_PASSWORD\s*=\.+' + +# 1.5.3 Single user authentication + - id: 5031 + title: "Ensure authentication required for single user mode" + description: "Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Edit /usr/lib/systemd/system/rescue.service and add/modify the following line: ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue Edit /usr/lib/systemd/system/emergency.service and add/modify the following line: ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/usr/lib/systemd/system/rescue.service -> r:ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue' + - 'f:/usr/lib/systemd/system/emergency.service -> r:ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency' + +############################################### +# 1.6 Additional Process Hardening +############################################### +# 1.6.1 Restrict Core Dumps (Scored) + - id: 5032 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file.The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5)). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0. If systemd-coredump is installed: edit /etc/systemd/coredump.conf and add/modify the following lines: Storage=none ProcessSizeMax=0 Run the command: # systemctl daemon-reload" + compliance: + - cis: ["1.6.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + +# 1.6.2 Ensure address space layout randomization (ASLR) is enabled (Scored) + - id: 5033 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + +############################################### +# 1.7 Configure SELinux +############################################### +# 1.7.1.1 Ensure SELinux is installed(Scored) + - id: 5034 + title: "Ensure SELinux is installed" + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux : # dnf install libselinux" + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-' + +# 1.7.1.2 SELinux not disabled + - id: 5035 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /etc/default/grub and remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\" GRUB_CMDLINE_LINUX=\"\" || Run the following command to update the grub2 configuration: grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + +# 1.7.1.3 Set selinux policy + - id: 5036 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.7.1.4 Set selinux state + - id: 5037 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled$' + - 'c:sestatus -> r:^Current mode:\s+enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + +# 1.7.1.5 Ensure no unconfined services exist (Scored) + - id: 5038 + title: "Ensure no unconfined services exist" + description: "Unconfined processes run in unconfined domains" + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules – it does not replace them" + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them. Notes: Occasionally certain daemons such as backup or centralized management software may require running unconfined. Any such software should be carefully analyzed and documented before such an exception is made." + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:ps -eZ -> r:unconfined_service_t' + + +# 1.7.1.6 Remove SETroubleshoot + - id: 5039 + title: "Ensure SETroubleshoot is not installed" + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa setroubleshoot -> r:setroubleshoot' + + +# 1.7.1.7 Disable MCS Translation service mcstrans + - id: 5040 + title: "Ensure the MCS Translation Service (mcstrans) is not installed" + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa mcstrans -> r:mcstrans' + +############################################### +# 1.8 Warning Banners +############################################### +# 1.8.1.1 Configure message of the day (Scored) + - id: 5041 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd" + compliance: + - cis: ["1.8.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + +# 1.8.1.2 Configure local login warning banner (Scored) + - id: 5042 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.8.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + +# 1.8.1.3 Configure remote login warning banner (Scored) + - id: 5043 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.8.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + +# 1.8.1.4 Configure /etc/motd permissions (Scored) + - id: 5044 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.8.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.8.1.5 Configure /etc/issue permissions (Scored) + - id: 5045 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.8.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.8.1.6 Configure /etc/issue.net permissions (Scored) + - id: 5046 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.8.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 1.8.2 Ensure GDM login banner is configured (Scored) + - id: 5047 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add the following in 3 lines: (1) [org/gnome/login-screen] (2) banner-message-enable=true (3) banner-message-text='Authorized uses only. All activity may be monitored and reported.'" + compliance: + - cis: ["1.8.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:[org/gnome/login-screen]' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:banner-message-enable=true' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:banner-message-text=' + +# 1.9 Ensure updates, patches, and additional security software are installed(Scored) + - id: 5048 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available security updates: # dnf update --security . Site policy may mandate a testing period before install onto production systems for available updates. The audit and remediation here only cover security updates. Non-security updates can be audited with and comparing against site policy: # dnf check-update" + compliance: + - cis: ["1.9"] + - cis_csc: ["3.4"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6","SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - 'c:yum check-update --security -> r:No packages needed for security' + + +# 1.10 Ensure system-wide crypto policy is not legacy (Scored) + - id: 5049 + title: "Ensure system-wide crypto policy is not legacy" + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457" + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies" + compliance: + - cis: ["1.10"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'https://access.redhat.com/articles/3642912#what-polices-are-provided-1' + condition: none + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + + +# 1.11 Ensure system-wide crypto policy is FUTURE or FIPS (Scored) + - id: 5050 + title: "Ensure system-wide crypto policy is FUTURE or FIPS" + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457 FUTURE: Is a conservative security level that is believed to withstand any near-term future attacks. This level does not allow the use of SHA-1 in signature algorithms. The RSA and Diffie-Hellman parameters are accepted if larger than 3071 bits. The level provides at least 128-bit security FIPS: Conforms to the FIPS 140-2 requirements. This policy is used internally by the fips-mode-setup(8) tool which can switch the system into the FIPS 140-2 compliance mode. The level provides at least 112-bit security" + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set FUTURE OR To switch the system to FIPS mode, run the following command: # fips-mode-setup --enable" + compliance: + - cis: ["1.11"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*FUTURE|^\s*FIPS' + +############################################### +# 2 OS Services +############################################### +############################################### +# 2.1 inetd Services +############################################### + # 2.1.1 Ensure xinetd is not installed (Scored) + - id: 5051 + title: "Ensure xinetd is not installed" + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to remove xinetd: # dnf remove xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q xinetd -> r:^package xinetd is not installed' + +############################################### +# 2.2 Remove Legacy Services +############################################### + +# 2.2.1.1 Ensure time synchronization is in use (Not Scored) + - id: 5052 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available install chrony: # dnf install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and verify that host based synchronization is in use." + compliance: + - cis: ["2.2.2.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:rpm -q chrony -> r:^chrony-' + +# 2.2.1.2 Configure Network Time Protocol (Chrony) (Scored) + - id: 5053 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Configure chrony to run as the chrony user" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'http://chrony.tuxfamily.org/' + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\s*\t*\.+|^pool\s*\t*\.+' + - 'not c:ps -ef -> r:\.+/chronyd\s*\t*$ && !r:^\s*\t*chrony\s*\t*' + +# 2.2.2 Ensure X Window System is not installed (Scored) + - id: 5054 + title: "Ensure X Window System is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # dnf remove xorg-x11*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa xorg-x11* -> r:^xorg-x11' + +# 2.2.3 Remove rsync service (Scored) + - id: 5055 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl --now disable rsyncd" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled rsyncd -> enabled' + +# 2.2.4 Disable Avahi Server (Scored) + - id: 5056 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl --now disable avahi-daemon" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled avahi-daemon -> enabled' + +# 2.2.5 Remove SNMP Server (Scored) + - id: 5057 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl --now disable snmpd" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled snmpd -> enabled' + +# 2.2.6 Remove HTTP Proxy Server (Scored) + - id: 5058 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl --now disable squid" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled squid -> enabled' + +# 2.2.7 Remove Samba (Scored) + - id: 5059 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable smb: # systemctl --now disable smb" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled smb -> enabled' + +# 2.2.8 Remove Dovecot (IMAP and POP3 services) (Scored) + - id: 5060 + title: "Ensure IMAP and POP3 server is not enabled" + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dovecot: # systemctl --now disable dovecot" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled dovecot -> enabled' + +# 2.2.9 Remove HTTP Server (Scored) + - id: 5061 + title: "Ensure HTTP server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable httpd: # systemctl --now disable httpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled httpd -> enabled' + +# 2.2.10 Remove FTP Server (Scored) + - id: 5062 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl --now disable vsftpd" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled vsftpd -> enabled' + +# 2.2.11 Ensure DNS Server is not enabled (Scored) + - id: 5063 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named : # systemctl --now disable named" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled named -> enabled' + + +# 2.2.12 Ensure NFS is not enabled (Scored) + - id: 5064 + title: "Ensure NFS is not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares, it is recommended that the NFS be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs: # systemctl --now disable nfs" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled nfs -> enabled' + +# 2.2.13 Ensure RPC is not enabled (Scored) + - id: 5065 + title: "Ensure RPC is not enabled" + description: "The rpcbind service maps Remote Procedure Call (RPC) services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service." + rationale: "If the system does not require rpc based services, it is recommended that rpcbind be disabled to reduce the remote attack surface." + remediation: "Run the following commands to disable nfs: # systemctl --now disable rpcbind" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled rpcbind -> enabled' + +# 2.2.14 Remove LDAP Server (Scored) + - id: 5066 + title: "Ensure LDAP Server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl --now disable slapd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on OpenLDAP is available at https://www.openldap.org + condition: none + rules: + - 'c:systemctl is-enabled slapd -> enabled' + +# 2.2.15 Remove DHCP Server (Scored) + - id: 5067 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dhcpd: # systemctl --now disable dhcpd" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp + condition: none + rules: + - 'c:systemctl is-enabled dhcpd -> enabled' + +# 2.2.16 Ensure CUPS is not enabled (Scored) + - id: 5068 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups : # systemctl --now disable cups" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'More detailed documentation on CUPS is available at the project homepage at http://www.cups.org.' + condition: none + rules: + - 'c:systemctl is-enabled cups -> enabled' + + +# 2.2.17 Remove NIS Server (Scored) + - id: 5069 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable ypserv: # systemctl --now disable ypserv" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:systemctl is-enabled ypserv -> enabled' + +# 2.2.18 Ensure mail transfer agent is configured for local-only mode (Scored) + - id: 5070 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.18"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1","AC.4","SC.7"] + - tsc: ["CC5.2","CC6.4","CC6.6","CC6.7"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25\.* && !r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + +############################################### +# 2.3 Service Clients +############################################### + +# 2.3.1 Remove NIS Client (Scored) + - id: 5071 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # dnf remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:rpm -qa ypbind -> r:ypbind' + +# 2.3.2 Ensure telnet client is not installed (Scored) + - id: 5072 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet : # dnf remove telnet" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q telnet -> r:^package telnet is not installed' + +# 2.3.3 Ensure LDAP client is not installed (Scored) + - id: 5073 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # dnf remove openldap-clients" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q openldap-clients -> r:^package openldap-clients is not installed' + + +############################################### +# 3 Network Configuration +############################################### +############################################### +# 3.1 Network Parameters (Host Only) +############################################### +# 3.1.1 Ensure IP forwarding is disabled (Scored) + - id: 5074 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following commands to restore the default parameters and set the active kernel parameters: # grep -Els \"^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" \"s/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1 && # grep -Els \"^\\s*net\\.ipv6\\.conf\\.all\\.forwarding\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv6\\.conf\\.all\\.forwarding\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv6.conf.all.forwarding=0; sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:grep -Rh -E -s ^\s*net.ipv4.ip_forward /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.ip_forward\s*=\s*1' + - 'c:grep -Rh -E -s ^\s*net.ipv6.conf.all.forwarding /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv6.conf.all.forwarding\s*=\s*1' + - 'c:sysctl net.ipv4.ip_forward -> r:^\s*net.ipv4.ip_forward\s*=\s*1' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:^\s*net.ipv6.conf.all.forwarding\s*=\s*1' + + +# 3.1.2 Ensure packet redirect sending is disabled (Scored) + - id: 5075 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 .Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh net.ipv4.conf.all.send_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.send_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.default.send_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.send_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^\s*net.ipv4.conf.all.send_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^\s*net.ipv4.conf.default.send_redirects\s*=\s*0' + +############################################### +# 3.2 Network Parameters (Host and Router) +############################################### +# 3.2.1 Ensure source routed packets are not accepted (Scored) + - id: 5076 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0 and Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0; # sysctl -w net.ipv4.conf.default.accept_source_route=0; # sysctl -w net.ipv6.conf.all.accept_source_route=0; # sysctl -w net.ipv6.conf.default.accept_source_route=0; # sysctl -w net.ipv4.route.flush=1; # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.all.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.default.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0|No such file or directory' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0|No such file or directory' + - 'c:grep -Rh net.ipv6.conf.all.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.default.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0' + + + + +# 3.2.2 Ensure ICMP redirects are not accepted (Scored) + - id: 5077 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects and net.ipv6.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0; # sysctl -w net.ipv4.conf.default.accept_redirects=0; # sysctl -w net.ipv6.conf.all.accept_redirects=0; # sysctl -w net.ipv6.conf.default.accept_redirects=0; # sysctl -w net.ipv4.route.flush=1 and # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^\s*net.ipv4.conf.default.accept_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.all.accept_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.default.accept_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.accept_redirects\s*=\s*0' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.all.accept_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.default.accept_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0' + + +# 3.2.3 Ensure secure ICMP redirects are not accepted (Scored) + - id: 5078 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 and net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0; # sysctl -w net.ipv4.conf.default.secure_redirects=0 and # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.all.secure_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0' + - 'c:grep -Rh net.ipv4.conf.default.secure_redirects /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0' + +# 3.2.4 Ensure suspicious packets are logged (Scored) + - id: 5079 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 and net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1; # sysctl -w net.ipv4.conf.default.log_martians=1 and # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^\s*net.ipv4.conf.all.log_martians\s*=\s*1' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^\s*net.ipv4.conf.default.log_martians\s*=\s*1' + - 'c:grep -Rh net.ipv4.conf.all.log_martians /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.all.log_martians\s*=\s*1' + - 'c:grep -Rh net.ipv4.conf.default.log_martians /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv4.conf.default.log_martians\s*=\s*1' + +# 3.2.5 Ensure broadcast ICMP requests are ignored (Scored) + - id: 5080 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Run the following command to restore the default parameters and set the active kernel parameters: # grep -Els \"^\\s*net\\.ipv4\\.icmp_echo_ignore_broadcasts\\s*=\\s*0\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf \"s/^\\s*(net\\.ipv4\\.icmp_echo_ignore_broadcasts\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.icmp_echo_ignore_broadcasts=1; sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1' + - 'not c:grep -E -s -Rh ^\s*net.ipv4.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*0' + +# 3.2.6 Ensure bogus ICMP responses are ignored (Scored) + - id: 5081 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Run the following commands to restore the default parameters and set the active kernel parameters: # grep -Els \"^\\s*net\\.ipv4\\.icmp_ignore_bogus_error_responses\\s*=\\s*0 /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.icmp_ignore_bogus_error_responses\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1; sysctl -w net.ipv4.route.flush=1\"" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1' + - 'not c:grep -E -s -Rh ^\s*net.ipv4.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*0' + +# 3.2.7 Ensure Reverse Path Filtering is enabled (Scored) + - id: 5082 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Run the following command to restore the default net.ipv4.conf.all.rp_filter = 1 parameter and set the active kernel parameter: # grep -Els \"^\\s*net\\.ipv4\\.conf\\.all\\.rp_filter\\s*=\\s*0\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.net.ipv4.conf\\.all\\.rp_filter\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.conf.all.rp_filter=1; sysctl -w net.ipv4.route.flush=1 .Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.default.rp_filter=1 and Run the following commands to set the active kernel parameter: # sysctl -w net.ipv4.conf.default.rp_filter=1 and # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^\s*net.ipv4.conf.all.rp_filter\s*=\s*1' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^\s*net.ipv4.conf.default.rp_filter\s*=\s*1' + - 'not c:grep -E -s -Rh ^\s*net.ipv4.conf.all.rp_filter /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.conf.all.rp_filter\s*=\s*0' + - 'c:grep -E -s -Rh ^\s*net.ipv4.conf.default.rp_filter /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.conf.default.rp_filter\s*=\s*1' + +# 3.2.8 Ensure TCP SYN Cookies is enabled (Scored) + - id: 5083 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Run the following command to restore the default parameter and set the active kernel parameters: grep -Els \"^\\s*net\\.ipv4\\.tcp_syncookies\\s*=\\s*[02]*\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.tcp_syncookies\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.tcp_syncookies=1; sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^\s*net.ipv4.tcp_syncookies\s*=\s*1' + - 'not c:grep -E -r -Rh ^\s*net.ipv4.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:^\s*net.ipv4.tcp_syncookies\s*=\s*[02]' + +# 3.2.9 Ensure IPv6 router advertisements are not accepted (Scored) + - id: 5084 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems do not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 . Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0; # sysctl -w net.ipv6.conf.default.accept_ra=0 and # sysctl -w net.ipv6.route.flush=1;" + compliance: + - cis: ["3.2.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^\s*net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^\s*net.ipv6.conf.default.accept_ra\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.all.accept_ra /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh net.ipv6.conf.default.accept_ra /etc/sysctl.conf /etc/sysctl.d/* -> r:^\s*net.ipv6.conf.default.accept_ra\s*=\s*0' + + + +############################################### +# 3.3 Uncommon Network Protocols +############################################### +# 3.3.1 Ensure DCCP is disabled (Scored) + - id: 5085 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery" + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf. Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:^\s*install\s*/bin/true|Module dccp not found' + - 'not c:lsmod -> r:dccp' + +# 3.3.2 Ensure SCTP is disabled (Scored) + - id: 5086 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf .Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:^\s*install\s*/bin/true|Module sctp not found' + - 'not c:lsmod -> r:sctp' + +# 3.3.3 Ensure RDS is disabled (Scored) + - id: 5087 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf .Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.3.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v rds -> r:^\s*install\s*/bin/true|Module rds not found' + - 'not c:lsmod -> r:rds' + + +# 3.3.4 Ensure TIPC is disabled (Scored) + - id: 5088 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf .Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:modprobe -n -v tipc -> r:^\s*install\s*/bin/true|Module tipc not found' + - 'not c:lsmod -> r:tipc' + +############################################### +# 3.4 Firewall Configuration +############################################### +############################################### +# 3.4.1 Ensure Firewall software is installed +############################################### +# 3.4.1.1 Ensure a Firewall package is installed (Scored) + - id: 5089 + title: "Ensure a Firewall package is installed" + description: "A Firewall package should be selected. Most firewall configuration utilities operate as a front end to nftables or iptables." + rationale: "A Firewall package is required for firewall management and configuration." + remediation: "Run one of the following commands to install a Firewall package. For firewalld: dnf install firewalld .For nftables: # dnf install nftables. For iptables: # dnf install iptables" + compliance: + - cis: ["3.4.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC6.6"] + condition: any + rules: + - 'c:rpm -q firewalld -> r:^firewalld-' + - 'c:rpm -q nftables -> r:^nftables-' + - 'c:rpm -q iptables -> r:^iptables-' + +############################################### +# 3.4.2 Configure firewalld +############################################### + +# 3.4.2.1 Ensure firewalld service is enabled and running (Scored) + - id: 5090 + title: "Ensure firewalld service is enabled and running" + description: "Ensure that the firewalld service is enabled to protect your system" + rationale: "firewalld (Dynamic Firewall Manager) tool provides a dynamically managed firewall. The tool enables network/firewall zones to define the trust level of network connections and/or interfaces. It has support both for IPv4 and IPv6 firewall settings. Also, it supports Ethernet bridges and allow you to separate between runtime and permanent configuration options. Finally, it supports an interface for services or applications to add firewall rules directly" + remediation: "Run the following command to enable and start firewalld: # systemctl --now enable firewalld" + compliance: + - cis: ["3.4.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:systemctl is-enabled firewalld -> enabled' + - 'c:firewall-cmd --state -> r:running' + +# 3.4.2.2 Ensure iptables is not enabled (Scored) + - id: 5091 + title: "Ensure iptables is not enabled" + description: "IPtables is an application that allows a system administrator to configure the IPv4 and IPv6 tables, chains and rules provided by the Linux kernel firewall. IPtables is installed as a dependency with firewalld." + rationale: "Running firewalld and IPtables concurrently may lead to conflict, therefore IPtables should be stopped and masked when using firewalld." + remediation: "Run the following command to stop and mask iptables: systemctl --now mask iptables" + compliance: + - cis: ["3.4.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:systemctl status iptables -> r:Loaded:\s*disabled|Loaded:\s*masked|could not be found' + - 'c:systemctl status iptables -> r:Active:\s*inactive\s*\(dead\)|could not be found' + - 'c:systemctl is-enabled iptables -> !r:enabled' + +# 3.4.2.3 Ensure nftables is not enabled (Scored) + - id: 5092 + title: "Ensure nftables is not enabled" + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables. nftables are installed as a dependency with firewalld." + rationale: "Running firewalld and nftables concurrently may lead to conflict, therefore nftables should be stopped and masked when using firewalld." + remediation: "Run the following command to mask and stop nftables: systemctl --now mask nftables" + compliance: + - cis: ["3.4.2.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:systemctl status nftables -> r:Loaded:\s*disabled|Loaded:\s*masked|could not be found' + - 'c:systemctl status nftables -> r:Active:\s*inactive\s*\(dead\)|could not be found' + - 'c:systemctl is-enabled nftables -> !r:^enabled' + +############################################### +# 3.4.3 Configure nftables +############################################### + +# 3.4.3.1 Ensure iptables are flushed (Not Scored) + - id: 5093 + title: "Ensure iptables are flushed" + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables" + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded." + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F and For ip6tables: # ip6tables -F" + compliance: + - cis: ["3.4.3.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: none + rules: + - 'c:iptables -L -> !r:^\s*Chain|^\s*target && r:\s*\S+' + - 'c:ip6tables -L -> !r:^\s*Chain|^\s*target && r:\s*\S+' + +# 3.4.3.2 Ensure a table exists (Scored) + - id: 5094 + title: "Ensure a table exists" + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + remediation: "Run the following command to create a table in nftables: # nft create table inet
.Example: # nft create table inet filter" + compliance: + - cis: ["3.4.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list tables -> r:\w+' + + +# 3.4.3.3 Ensure base chains exist (Scored) + - id: 5095 + title: "Ensure base chains exist" + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } . Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0\\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }" + compliance: + - cis: ["3.4.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list ruleset -> r:hook input' + - 'c:nft list ruleset -> r:hook forward' + - 'c:nft list ruleset -> r:hook output' + +# 3.4.3.6 Ensure default deny firewall policy (Scored) + - id: 5096 + title: "Ensure default deny firewall policy" + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept , the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } . Example: # nft chain inet filter input { policy drop \\; } ; # nft chain inet filter forward { policy drop \\; } and # nft chain inet filter output { policy drop \\; }" + compliance: + - cis: ["3.4.3.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list ruleset -> r:hook input && r:policy drop' + - 'c:nft list ruleset -> r:hook forward && r:policy drop' + - 'c:nft list ruleset -> r:hook output && r:policy drop' + +# 3.4.3.7 Ensure nftables service is enabled (Scored) + - id: 5097 + title: "Ensure nftables service is enabled" + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting of the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl --now enable nftables" + compliance: + - cis: ["3.4.3.7"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:systemctl is-enabled nftables -> r:^enabled' + +############################################### +# 3.4.4 Configure iptables +############################################### +############################################### +# 3.4.4.1 Configure IPv4 iptables +############################################### +# 3.4.4.1.1 Ensure default deny firewall policy (Scored) + - id: 5098 + title: "Configure IPv4 iptables" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP; # iptables -P OUTPUT DROP; # iptables -P FORWARD DROP" + compliance: + - cis: ["3.4.4.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + +# 3.4.4.1.2 Ensure loopback traffic is configured (Scored) + - id: 5099 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.4.4.1.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + +############################################### +# 3.4.4.2 Configure IPv6 ip6tables +############################################### +# 3.4.4.2.1 Ensure IPv6 default deny firewall policy (Scored) + - id: 5100 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP; # ip6tables -P OUTPUT DROP; # ip6tables -P FORWARD DROP" + compliance: + - cis: ["3.4.4.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:ip6tables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:ip6tables -L -> r:Chain OUTPUT \(policy DROP\)' + +# 3.4.4.2.2 Ensure IPv6 loopback traffic is configured (Scored) + - id: 5101 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP" + compliance: + - cis: ["3.4.4.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + +# 3.5 Ensure wireless interfaces are disabled (Scored) + - id: 5102 + title: "Ensure wireless interfaces are disabled" + description: "Wireless networking is used when wired networks are unavailable. Red Hat Enterprise Linux contains a wireless tool kit to allow system administrators to configure and use wireless networks." + rationale: "If wireless is not to be used, wireless devices can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable any wireless interfaces: # nmcli radio all off . Disable any wireless interfaces in your network configuration." + compliance: + - cis: ["3.5"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.6"] + references: + - nmcli(1) - Linux man page + condition: all + rules: + - 'c:nmcli radio wifi -> r:^disabled' + - 'c:nmcli radio wwan -> r:^disabled' + + +# 3.6 Disable IPv6 (Not Scored) + - id: 5103 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system." + remediation: "Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX=\"ipv6.disable=1\" .Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["3.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.6","CC5.2"] + condition: all + rules: + - 'f:/boot/grub2/grubenv -> r:^\s*kernelopts=\.+ipv6.disable=1' + + # 4.2.1.1 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 5104 + title: "Ensure rsyslog is installed" + description: "The rsyslog software is a recommended replacement to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:rpm -q rsyslog -> r:^rsyslog-' + + + +############################################### +# 4 Logging and Auditing +############################################### +############################################### +# 4.1 Configure System Accounting (auditd) +############################################### + +# 4.1.1.1 Ensure auditd is installed (Scored) + - id: 5105 + title: "Ensure auditd is installed" + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit audit-libs" + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:rpm -q audit audit-libs -> r:^audit-' + +# 4.1.1.2 Ensure auditd service is enabled (Scored) + - id: 5106 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd : # systemctl --now enable auditd" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1","10.7"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled auditd -> enabled' + + +# 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 5107 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX : GRUB_CMDLINE_LINUX=\"audit=1\" . Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.2.6","10.7"] + - nist_800_53: ["AU.2"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d","32.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts= && !r:audit=1' + + +# 4.1.1.4 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 5108 + title: "Ensure audit_backlog_limit is sufficient" + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more than 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Edit /etc/default/grub and add audit_backlog_limit= to GRUB_CMDLINE_LINUX: Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg" + compliance: + - cis: ["4.1.1.4"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts= && n:audit_backlog_limit=(\d+) compare >= 8192' + +# 4.1.2.1 Ensure audit log storage size is configured (Not Scored) + - id: 5109 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.2.1"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file\s*=\s*\d+' + +# 4.1.2.2 Ensure audit logs are not automatically deleted (Scored) + - id: 5110 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file_action\s*=\s*keep_logs' + +# 4.1.2.3 Ensure system is disabled when audit logs are full (Scored) + - id: 5111 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^admin_space_left_action\s*=\s*halt' + +## 4.1.3 Ensure changes to system administration scope (sudoers) is collected (Scored) + - id: 5112 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"" + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope" + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> .rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d -> .rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope' + + +# 4.1.4 Ensure login and logout events are collected (Scored) + - id: 5113 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/log/lastlog -p wa -k logins -w /var/run/faillock/ -p wa -k logins" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["4.9","16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7","AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/lastlog -p wa -k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/run/faillock/ -p wa -k logins' + +# 4.1.5 Ensure session initiation information is collected (Scored) + - id: 5114 + title: "Ensure session initiation information is collected" + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier \"logins.\"." + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins" + compliance: + compliance: + - cis: ["4.1.5"] + - cis_csc: ["4.9","16.13"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7","AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/run/utmp -p wa -k session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/wtmp -p wa -k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/btmp -p wa -k logins' + +# 4.1.6 Ensure events that modify date and time information are collected (Scored) + - id: 5115 + title: "Ensure events that modify date and time information are collected" + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\"." + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2","10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b32 -S clock_settime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S adjtimex -S settimeofday -S stime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S clock_settime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/localtime -p wa -k time-change' + +# 4.1.7 Ensure events that modify the system's Mandatory Access Controls are collected (Scored) + - id: 5116 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/selinux/ -p wa -k MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /usr/share/selinux/ -p wa -k MAC-policy' + +# 4.1.8 Ensure events that modify the system's network environment are collected (Scored) + - id: 5117 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"" + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/issue -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/issue.net -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/hosts -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/sysconfig/network -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/sysconfig/network-scripts/ -p wa -k system-locale' + +# 4.1.9 Ensure discretionary access control permission modification events are collected (Scored) + - id: 5118 + title: "Ensure discretionary access control permission modification events are collected" + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\"" + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem" + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod' + +# 4.1.10 Ensure unsuccessful unauthorized file access attempts are collected (Scored) + - id: 5119 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\"" + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access" + compliance: + - cis: ["4.1.10"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access' + +# 4.1.11 Ensure events that modify user/group information are collected (Scored) + - id: 5120 + title: "Ensure events that modify user/group information are collected" + description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity" + compliance: + - cis: ["4.1.11"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/group -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/passwd -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/gshadow -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/shadow -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/security/opasswd -p wa -k identity' + +# 4.1.12 Ensure successful file system mounts are collected (Scored) + - id: 5121 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts" + compliance: + - cis: ["4.1.12"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts' + +# 4.1.14 Ensure file deletion events by users are collected (Scored) + - id: 5122 + title: "Ensure file deletion events by users are collected" + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\"." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete" + compliance: + - cis: ["4.1.14"] + - cis_csc: ["13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["PI1.4","PI1.5","CC7.1","CC7.2","CC7.3","CC8.1"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete' + +# 4.1.15 Ensure kernel module loading and unloading is collected (Scored) + - id: 5123 + title: "Ensure kernel module loading and unloading is collected" + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\"." + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b32 -S init_module -S delete_module -k modules -a always,exit -F arch=b64 -S init_module -S delete_module -k modules" + compliance: + - cis: ["4.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14","AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /sbin/insmod -p x -k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /sbin/rmmod -p x -k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /sbin/modprobe -p x -k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S init_module -S delete_module -k modules' + +# 4.1.16 Ensure system administrator actions (sudolog) are collected (Scored) + - id: 5124 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.16"] + - cis_csc: ["4.9"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14","AC.6","AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2","35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /var/log/sudo.log -p wa -k actions' + +# 4.1.17 Ensure the audit configuration is immutable (Scored) + - id: 5125 + title: "Ensure the audit configuration is immutable" + description: "Set system audit so that audit rules cannot be modified with auditctl . Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line: -e 2 at the end of the file" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:tail -1 /etc/audit/rules.d/99-finalize.rules -> -e 2' + + +# 4.2.1.2 Ensure rsyslog Service is enabled (Scored) + - id: 5126 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable rsyslog : # systemctl --now enable rsyslog" + compliance: + - cis: ["4.2.1.2"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.2","CC6.3","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'c:systemctl is-enabled rsyslog -> enabled' + +# 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 5127 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2","CC7.2"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0' + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d20|^\$FileCreateMode 0\d00' + +# 4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host (Scored) + - id: 5128 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["6.6","6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + +# 4.2.2.1 Ensure journald is configured to send logs to rsyslog (Scored) + - id: 5129 + title: "Ensure journald is configured to send logs to rsyslog" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.5"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1","AU.9","AU.4"] + - tsc: ["CC5.2","CC7.2"] + references: + - 'https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf' + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + +# 4.2.2.2 Ensure journald is configured to compress large log files (Scored) + - id: 5130 + title: "Ensure journald is configured to compress large log files" + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Compress\s*=\s*yes' + +# 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk (Scored) + - id: 5131 + title: "Ensure journald is configured to write logfiles to persistent disk" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["6.2","6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1","AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Storage\s*=\s*persistent' + + # 4.2.3 Ensure permissions on all logfiles are configured (Scored) + - id: 5132 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx {} +" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1","10.5.2"] + - nist_800_53: ["CM.1","AU.9"] + - tsc: ["CC5.2","CC7.2"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + +############################################### +# 5 Access, Authentication and Authorization +############################################### +############################################### +# 5.1 Configure cron +############################################### +# 5.1.1 Ensure cron daemon is enabled (Scored) + - id: 5133 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # systemctl --now enable crond" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:systemctl is-enabled crond -> enabled' + +# 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 5134 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 5135 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 5136 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 5137 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 5138 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 5139 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 5140 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow : # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.deny -> r:No such file or directory$' + - 'c:stat /etc/at.deny -> r:No such file or directory$' + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +############################################### +# 5.2 Configure SSH +############################################### +# 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Scored) + - id: 5141 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config : # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2.2 Ensure SSH access is limited (Scored) + - id: 5142 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. AllowGroups The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. DenyUsers The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. DenyGroups The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers ; AllowGroups ; DenyUsers and DenyGroups " + compliance: + - cis: ["5.2.2"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowGroups' + - 'f:/etc/ssh/sshd_config -> r:^\s*DenyUsers' + - 'f:/etc/ssh/sshd_config -> r:^\s*DenyGroups' + +# 5.2.3 Ensure permissions on SSH private host key files are configured (Scored) + - id: 5143 + title: "Ensure permissions on SSH private host key files are configured" + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated" + remediation: "Run the following commands to set ownership and permissions on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:root {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod 0600 {} \\;" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/ssh_host_rsa_key -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ecdsa_key -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ed25519_key -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + +# 5.2.4 Ensure permissions on SSH public host key files are configured (Scored) + - id: 5144 + title: "Ensure permissions on SSH public host key files are configured" + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod 0644 {} \\; #find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/ssh_host_rsa_key.pub -> r:^Access: \(0\d\d\d/\w\w\w\w\w\w-\w\w-\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ecdsa_key.pub -> r:^Access: \(0\d\d\d/\w\w\w\w\w\w-\w\w-\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ed25519_key.pub -> r:^Access: \(0\d\d\d/\w\w\w\w\w\w-\w\w-\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + +# 5.2.5 Ensure SSH LogLevel is appropriate (Scored) + - id: 5145 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - https://www.ssh.com/ssh/sshd_config/ + condition: all + rules: + - 'c:sshd -T -> r:^\s*LogLevel\s+VERBOSE|^\s*loglevel\s+INFO' + + +# 5.2.6 Ensure SSH X11 forwarding is disabled (Scored) + - id: 5146 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*X11Forwarding\s*\t*no' + + + # 5.2.7 Ensure SSH MaxAuthTries is set to 4 or less (Scored) + - id: 5147 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + +# 5.2.8 Ensure SSH IgnoreRhosts is enabled (Scored) + - id: 5148 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Ignorerhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:ignorerhosts\s*\t*yes' + +# 5.2.9 Ensure SSH HostbasedAuthentication is disabled (Scored) + - id: 5149 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:HostbasedAuthentication\s*\t*no' + +# 5.2.10 Ensure SSH root login is disabled (Scored) + - id: 5150 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:PermitRootLogin\s*\t*no' + +# 5.2.11 Ensure SSH PermitEmptyPasswords is disabled (Scored) + - id: 5151 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + +# 5.2.12 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 5152 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*PermitUserEnvironment\s*\t*no' + +# 5.2.13 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 5153 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'c:sshd -T -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + +# 5.2.14 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 5154 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + +# 5.2.15 Ensure SSH warning banner is configured (Scored) + - id: 5155 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*Banner\s*\t*/etc/issue.net' + +# 5.2.16 Ensure SSH PAM is enabled (Scored) + - id: 5156 + title: "Ensure SSH PAM is enabled" + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*usepam\s+yes' + +# 5.2.17 Ensure SSH AllowTcpForwarding is disabled (Scored) + - id: 5157 + title: "Ensure SSH AllowTcpForwarding is disabled" + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - https://www.ssh.com/ssh/tunneling/example + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowTcpForwarding\s+no' + + + # 5.2.19 Ensure SSH MaxSessions is set to 4 or less (Scored) + - id: 5158 + title: "Ensure SSH MaxSessions is set to 4 or less" + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 4" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*MaxSessions\s+(\d+) compare <= 4' + +# 5.2.20 Ensure system-wide crypto policy is not over-ridden (Scored) + - id: 5159 + title: "Ensure system-wide crypto policy is not over-ridden" + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH" + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgoritms and GSSAPIKexAlgorithsm" + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd; # systemctl reload sshd" + compliance: + - cis: ["5.2.20"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'f:/etc/sysconfig/sshd -> !r:^\s*CRYPTO_POLICY=' + +############################################### +# 5.3 Configure authselect +############################################### +# 5.3.1 Create custom authselect profile (Scored) + - id: 5160 + title: "Create custom authselect profile" + description: "A custom profile can be created by copying and customizing one of the default profiles. The default profiles include: sssd, winbind, or the nis." + rationale: "A custom profile is required to customize many of the pam options" + remediation: "Run the following command to create a custom authselect profile: # authselect create-profile -b .Example: # authselect create-profile custom-profile -b sssd --symlink-meta" + compliance: + - cis: ["5.3.1"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:authselect current -> r:^Profile ID: custom/' + +# 5.3.3 Ensure authselect includes with-faillock (Scored) + - id: 5161 + title: "Ensure authselect includes with-faillock" + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than deny consecutive failed authentications. It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following command to include the with-faillock option: # authselect select with-faillock Example: # authselect select custom/custom-profile with-sudo with-faillock without-nullok" + compliance: + - cis: ["5.3.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:authselect current -> r:with-faillock' + - 'f:/etc/authselect/authselect.conf -> r:with-faillock' + +############################################### +# 5.4 Configure PAM +############################################### +# 5.4.1 Ensure password creation requirements are configured (Scored) + - id: 5162 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. retry=3 - Allow 3 tries before sending back a failure. minlen=14 - password must be 14 characters or more Either of the following can be used to enforce complex passwords: minclass=4 - provide at least four classes of characters for the new password OR dcredit=-1 - provide at least one digit ucredit=-1 - provide at least one uppercase character ocredit=-1 - provide at least one special character lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy: minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy: minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 -1 = -1 Run the following to update the system-auth and password-auth files: CP=$(authselect current | awk 'NR == 1 {print $3}' | grep custom/) for FN in system-auth password-auth; do [[ -n $CP ]] && PTF=/etc/authselect/$CP/$FN || PTF=/etc/authselect/$FN [[ -z $(grep -E '^\\s*password\\s+requisite\\s+pam_pwquality.so\\s+.*enforce-for-root\\s*.*$' $PTF) ]] && sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce-for-root/' $PTF [[ -n $(grep -E '^\\s*password\\s+requisite\\s+pam_pwquality.so\\s+.*\\s+retry=\\S+\\s*.*$' $PTF) ]] && sed -ri '/pwquality/s/retry=\\S+/retry=3/' $PTF || sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' $PTF done authselect apply-changes" + compliance: + - cis: ["5.4.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass' + - 'f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass' + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + +# 5.4.2 Ensure lockout for failed password attempts is configured (Scored) + - id: 5163 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. deny= - Number of attempts before the account is locked. unlock_time= - Time in seconds before the account is unlocked. Set the lockout number and unlock time to follow local site policy." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Set password lockouts and unlock times to conform to site policy. Run the following to update the system-auth and password-auth files. This script will update/add the deny=5 and unlock_time=900 options. This script should be modified as needed to follow local site policy.CP=$(authselect current | awk \"NR == 1 {print $3}\" | grep custom/) for FN in system-auth password-auth; do [[ -n $CP ]] && PTF=/etc/authselect/$CP/$FN || PTF=/etc/authselect/$FN [[ -n $(grep -E \"^\\s*auth\\s+required\\s+pam_faillock.so\\s+.*deny=\\S+\\s*.*$\" $PTF) ]] && sed -ri \"/pam_faillock.so/s/deny=\\S+/deny=5/g\" $PTF || sed -ri \"s/^\\^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)(.*[^{}])(\\{.*\\}|)$/\\1\\2 deny=5 \\3/\" $PTF [[ -n $(grep -E \"^\\s*auth\\s+required\\s+pam_faillock.so\\s+.*unlock_time=\\S+\\s*.*$\" $PTF) ]] && sed -ri \"/pam_faillock.so/s/unlock_time=\\S+/unlock_time=900/g\" $PTF || sed -ri \"s/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)(.*[^{}])(\\{.*\\}|)$/\\1\\2 unlock_time=900 \\3/\" $PTF done authselect apply-changes" + compliance: + - cis: ["5.4.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^\s*auth\.+required\.+pam_faillock.so\.+ && n:deny=(\d+) compare <= 5 && n:unlock_time=(\d+) compare >= 900' + - 'f:/etc/pam.d/system-auth -> r:^\s*auth\.+required\.+pam_faillock.so\.+ && n:deny=(\d+) compare <= 5 && n:unlock_time=(\d+) compare >= 900' + + +# 5.4.3 Ensure password reuse is limited (Scored) + - id: 5164 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users\" old passwords and can be checked to ensure that users are not recycling recent passwords. remember=<5> - Number of old passwords to remember" + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: CP=$(authselect current | awk \"NR == 1 {print $3}\" | grep custom/) [[ -n $CP ]] && PTF=/etc/authselect/$CP/system-auth || PTF=/etc/authselect/system-auth [[ -n $(grep -E \"^\\s*password\\s+(sufficient\\s+pam_unix|requi(red|site)\\s+pam_pwhistory).so\\s+ ([^#]+\\s+)*remember=\\S+\\s*.*$\" $PTF) ]] && sed -ri \"s/^\\s*(password\\s+(requisite|sufficient)\\s+(pam_pwquality\\.so|pam_unix\\.so)\\s+)(.*)(remember=\\S+\\s*)(.*)$/\\1\\4 remember=5 \\6/\" $PTF || sed -ri \"s/^\\s*(password\\s+(requisite|sufficient)\\s+(pam_pwquality\\.so|pam_unix\\.so)\\s+)(.*)$/\\1\\4 remember=5/\" $PTF authselect apply-changes" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+requisite\.+pam_pwquality\.so\.+ && n:remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so\.+ && n:remember=(\d+) compare >= 5' + +# 5.4.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 5165 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Run the following script to dd or modify the pam_unix.so lines in the password-auth and system-auth files to include the sha512 option: CP=$(authselect current | awk 'NR == 1 {print $3}' | grep custom/) for FN in system-auth password-auth; do [[ -z $(grep -E '^\\s*password\\s+sufficient\\s+pam_unix.so\\s+.*sha512\\s*.*$' $PTF) ]] && sed -ri 's/^\\s*(password\\s+sufficient\\s+pam_unix.so\\s+)(.*)$/\\1\\2 sha512/' $PTF done authselect apply-changes" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1","8.2.1"] + - tsc: ["CC6.1","CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so && r:sha512' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so && r:sha512' + +############################################### +# 5.5 User Accounts and Environment +############################################### +############################################### +# 5.5.1 Set Shadow Password Suite Parameters +############################################### +# 5.5.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 5166 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.5.1.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + +# 5.5.1.2 Ensure minimum days between password changes is 7 or more (Scored) + - id: 5167 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 and modify user parameters for all users with a password set to match: chage --mindays 7 " + compliance: + - cis: ["5.5.1.2"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + +# 5.5.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 5168 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.5.1.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + +# 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 5169 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + +# 5.5.3 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 5170 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: readonly TMOUT=900 ; export TMOUT . Note that setting the value to readonly prevents unwanted modification during runtime." + compliance: + - cis: ["5.5.3"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> !r:^# && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not c:grep -Rh TMOUT /etc/profile /etc/profile.d/*.sh -> !r:^# && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> !r:^# && n:readonly TMOUT\s*=\s*(\d+)\s*; compare <= 900 && r:export TMOUT\s*$' + - 'c:grep -Rh TMOUT /etc/profile /etc/profile.d/*.sh -> !r:^# && n:readonly TMOUT\s*=\s*(\d+)\s*; compare <= 900 && r:export TMOUT\s*$' + +# 5.5.4 Ensure default group for the root account is GID 0 (Scored) + - id: 5171 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.5.4"] + - cis_csc: ["5.1"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + +# 5.5.5 Ensure default user umask is 027 or more restrictive (Scored) + - id: 5172 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.5.5"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + +# 5.7 Ensure access to the su command is restricted (Scored) + - id: 5173 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo , which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.7"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:# && r:auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + +############################################### +# 6 System Maintenance +############################################### +############################################### +# 6.1 System File Permissions +############################################### +# 6.1.2 Configure /etc/passwd permissions (Scored) + - id: 5174 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.3 Configure /etc/shadow permissions (Scored) + - id: 5175 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/ shadow: # chown root:root /etc/shadow # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + +# 6.1.4 Configure /etc/group permissions (Scored) + - id: 5176 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.5 Configure /etc/gshadow permissions (Scored) + - id: 5177 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chown root:shadow /etc/gshadow # chmod o-rwx,g-rw /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + +# 6.1.6 Configure /etc/passwd- permissions (Scored) + - id: 5178 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 600 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.7 Configure /etc/shadow- permissions (Scored) + - id: 5179 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:shadow /etc/shadow- # chmod u-x,go-rwx /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + +# 6.1.8 Configure /etc/group- permissions (Scored) + - id: 5180 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + +# 6.1.9 Configure /etc/gshadow- permissions (Scored) + - id: 5181 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-rw /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + + +############################################### +# 6.2 Review User and Group Settings +############################################### +# 6.2.1 Check passwords fields (Scored) + - id: 5182 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + +# 6.2.2 Delete legacy entries in /etc/passwd (Scored) + - id: 5183 + title: "Ensure no legacy \"+\" entries exist in /etc/passwd" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && r:^+:' + + # 6.2.4 Delete legacy entries in /etc/shadow (Scored) + - id: 5184 + title: "Ensure no legacy \"+\" entries exist in /etc/shadow" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^+:' + +# 6.2.5 Delete legacy entries in /etc/group (Scored) + - id: 5185 + title: "Ensure no legacy \"+\" entries exist in /etc/group" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/group if they exist." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:^+:' + +# 6.2.6 Verify No UID 0 Accounts Exist Other Than root (Scored) + - id: 5186 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7","32.2"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + + + + + + + + + + + + + + diff --git a/sca/sles/11/cis_sles11_linux.yml b/sca/sles/11/cis_sles11_linux.yml index 39c65fa27..f322906e2 100644 --- a/sca/sles/11/cis_sles11_linux.yml +++ b/sca/sles/11/cis_sles11_linux.yml @@ -31,7 +31,7 @@ variables: checks: # Section 1.1 - Filesystem Configuration - - id: 6000 + - id: 7000 title: "Ensure separate partition exists for /tmp" description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." @@ -44,7 +44,7 @@ checks: rules: - 'c:mount -> r:\s/tmp\s' - - id: 6001 + - id: 7001 title: "Ensure nodev option set on /tmp partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." @@ -57,7 +57,7 @@ checks: rules: - 'c:mount -> r:\s/tmp\s && r:nodev' - - id: 6002 + - id: 7002 title: "Ensure nosuid option set on /tmp partition" description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." @@ -71,7 +71,7 @@ checks: - 'c:mount -> r:\s/tmp\s && r:nosuid' # 1.1.5 /tmp: noexec - - id: 6003 + - id: 7003 title: "Ensure noexec option set on /tmp partition" description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." @@ -86,7 +86,7 @@ checks: - 'c:mount -> r:\s/tmp\s && r:noexec' # 1.1.6 Build considerations - Partition scheme. - - id: 6004 + - id: 7004 title: "Ensure separate partition exists for /var" description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." @@ -99,7 +99,7 @@ checks: rules: - 'c:mount -> r:\s/var\s' - - id: 6005 + - id: 7005 title: "Ensure separate partition exists for /var/log" description: "The /var/log directory is used by system services to store log data." rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." @@ -114,7 +114,7 @@ checks: - 'c:mount -> r:\s/var/log\s' # 1.1.12 /var/log/audit: partition - - id: 6006 + - id: 7006 title: "Ensure separate partition exists for /var/log/audit" description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog ) consume space in the same partition as auditd, it may not perform as desired." @@ -129,7 +129,7 @@ checks: - 'c:mount -> r:\s/var/log/audit\s' # 1.1.13 /home: partition - - id: 6007 + - id: 7007 title: "Ensure separate partition exists for /home" description: "The /home directory is used to support disk storage needs of local users." rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." @@ -142,7 +142,7 @@ checks: rules: - 'c:mount -> r:\s/home\s' - - id: 6008 + - id: 7008 title: "Ensure nodev option set on /home partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." @@ -156,7 +156,7 @@ checks: - 'c:mount -> r:\s/home\s && r:nodev' # 1.1.15 /dev/shm: nodev - - id: 6009 + - id: 7009 title: "Ensure nodev option set on /dev/shm partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." @@ -170,7 +170,7 @@ checks: - 'c:mount -> r:\s/dev/shm\s && r:nodev' # 1.1.16 /dev/shm: nosuid - - id: 6010 + - id: 7010 title: "Ensure nosuid option set on /dev/shm partition" description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." @@ -184,7 +184,7 @@ checks: - 'c:mount -> r:\s/dev/shm\s && r:nosuid' # 1.1.17 /dev/shm: noexec - - id: 6011 + - id: 7011 title: "Ensure noexec option set on /dev/shm partition" description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." @@ -202,7 +202,7 @@ checks: # 1.4 Secure Boot Settings ############################################### # 1.4.2 Set Boot Loader Password (Scored) - - id: 6012 + - id: 7012 title: "Ensure bootloader password is set" description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." @@ -220,7 +220,7 @@ checks: # 1.5 Additional Process Hardening ############################################### # 1.5.1 Restrict Core Dumps (Scored) - - id: 6013 + - id: 7013 title: "Ensure core dumps are restricted" description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." @@ -235,7 +235,7 @@ checks: - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' # 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) - - id: 6014 + - id: 7014 title: "Ensure address space layout randomization (ASLR) is enabled" description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." @@ -255,7 +255,7 @@ checks: # 2.1 Remove Legacy Services ############################################### # Section 2.1 - inetd Services - - id: 6015 + - id: 7015 title: "Ensure chargen services are not enabled" description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -267,7 +267,7 @@ checks: rules: - 'c:chkconfig --list -> r:chargen:|chargen-udp: && r::on' - - id: 6016 + - id: 7016 title: "Ensure daytime services are not enabled" description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -280,7 +280,7 @@ checks: - 'c:chkconfig --list -> r:daytime:|daytime-udp: && r::on' - - id: 6017 + - id: 7017 title: "Ensure discard services are not enabled" description: "discard is a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -292,7 +292,7 @@ checks: rules: - 'c:chkconfig --list -> r:discard:|discard-udp: && r::on' - - id: 6018 + - id: 7018 title: "Ensure echo services are not enabled" description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -304,7 +304,7 @@ checks: rules: - 'c:chkconfig --list -> r:echo:|echo-udp: && r::on' - - id: 6019 + - id: 7019 title: "Ensure time services are not enabled" description: "timeis a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -316,7 +316,7 @@ checks: rules: - 'c:chkconfig --list -> r:time:|time-udp: && r::on' - - id: 6020 + - id: 7020 title: "Ensure rsh server is not enabled" description: "The Berkeley rsh-server ( rsh , rlogin , rexec ) package contains legacy services that exchange credentials in clear-text." rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." @@ -330,7 +330,7 @@ checks: rules: - 'c:chkconfig --list -> r:rexec:|rlogin:|rsh: && r::on' - - id: 6021 + - id: 7021 title: "Ensure talk server is not enabled" description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." rationale: "The software presents a security risk as it uses unencrypted protocols for communication." @@ -344,7 +344,7 @@ checks: rules: - 'c:chkconfig --list -> r:talk: && r::on' - - id: 6022 + - id: 7022 title: "Ensure telnet server is not enabled" description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." @@ -358,7 +358,7 @@ checks: rules: - 'c:chkconfig --list -> r:telnet: && r::on' - - id: 6023 + - id: 7023 title: "Ensure tftp server is not enabled" description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package atftp is used to define and support a TFTP server." rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." @@ -372,7 +372,7 @@ checks: rules: - 'c:chkconfig --list -> r:tftp: && r::on' - - id: 6024 + - id: 7024 title: "Ensure rsync service is not enabled" description: "The rsyncd service can be used to synchronize files between systems over network links." rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." @@ -388,7 +388,7 @@ checks: ############################################### # 2 Special Purpose Services ############################################### - - id: 6025 + - id: 7025 title: "Ensure ntp is configured" description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://tools.ietf.org/html/rfc958. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." @@ -406,7 +406,7 @@ checks: - 'f:/etc/sysconfig/ntp -> r:NTPD_OPTIONS= && r:-u && r:ntp:ntp' # 2.2.2 Remove X Windows (Scored) - - id: 6026 + - id: 7026 title: "Ensure X Window System is not installed" description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." @@ -421,7 +421,7 @@ checks: - 'c:rpm -qa xorg-x11* -> r:^xorg-x11' # 2.2.3 Disable Avahi Server (Scored) - - id: 6027 + - id: 7027 title: "Ensure Avahi Server is not enabled" description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." @@ -435,7 +435,7 @@ checks: rules: - 'c:chkconfig --list -> r:avahi-daemon && r::on' - - id: 6028 + - id: 7028 title: "Ensure DHCP Server is not enabled" description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." @@ -448,7 +448,7 @@ checks: - 'c:chkconfig --list -> r:dhcpd && r::on' # 2.2.7 Disable NFS and RPC (Not Scored) - - id: 6029 + - id: 7029 title: "Ensure NFS and RPC are not enabled" description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." @@ -462,7 +462,7 @@ checks: rules: - 'c:chkconfig --list -> r:nfs|rpcbind && r::on' - - id: 6030 + - id: 7030 title: "Ensure DNS Server is not enabled" description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." @@ -476,7 +476,7 @@ checks: rules: - 'c:chkconfig --list -> r:named && r::on' - - id: 6031 + - id: 7031 title: "Ensure FTP Server is not enabled" description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." @@ -491,7 +491,7 @@ checks: - 'c:chkconfig --list -> r:vsftpd && r::on' # 2.2.10 Remove HTTP Server (Not Scored) - - id: 6032 + - id: 7032 title: "Ensure HTTP server is not enabled" description: "HTTP or web servers provide the ability to host web site content." rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface. Notes: Several httpd servers exist and can use other service names. apache, apache2, lighttpd, and nginx are example services that provide an HTTP server. These and other services should also be audited." @@ -503,7 +503,7 @@ checks: rules: - 'c:chkconfig --list -> r:apache2 && r::on' - - id: 6033 + - id: 7033 title: "Ensure IMAP and POP3 server is not enabled" description: "cyrus is an open source IMAP and POP3 server for Linux based systems." rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." @@ -518,7 +518,7 @@ checks: - 'c:chkconfig --list -> r:cyrus && r::on' # 2.2.12 Remove Samba (Not Scored) - - id: 6034 + - id: 7034 title: "Ensure Samba is not enabled" description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." @@ -532,7 +532,7 @@ checks: rules: - 'c:chkconfig --list -> r:smb && r::on' - - id: 6035 + - id: 7035 title: "Ensure HTTP Proxy Server is not enabled" description: "Squid is a standard proxy server used in many environments." rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." @@ -546,7 +546,7 @@ checks: rules: - 'c:chkconfig --list -> r:squid && r::on' - - id: 6036 + - id: 7036 title: "Ensure SNMP Server is not enabled" description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." @@ -556,11 +556,11 @@ checks: - cis_csc: ["9.1"] - pci_dss: ["2.2.2"] - nist_800_53: ["CM.1"] - condition: node + condition: none rules: - 'c:chkconfig --list -> r:snmpd && r::on' - - id: 6037 + - id: 7037 title: "Ensure NIS Server is not enabled" description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used." @@ -575,7 +575,7 @@ checks: - 'c:chkconfig --list -> r:ypserv && r::on' # Section 2.3 - Service Clients - - id: 6038 + - id: 7038 title: "Ensure NIS Client is not installed" description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." @@ -596,7 +596,7 @@ checks: # 3.1 Modify Network Parameters (Host Only) ############################################### # 3.1.1 Disable IP Forwarding (Scored) - - id: 6039 + - id: 7039 title: "Ensure IPv4 forwarding is disabled" description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." @@ -612,7 +612,7 @@ checks: - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*0$' # 3.1.2 Disable Send Packet Redirects (Scored) - - id: 6040 + - id: 7040 title: "Ensure packet redirect sending is disabled" description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." @@ -633,7 +633,7 @@ checks: # 3.2 Modify Network Parameters (Host and Router) ############################################### # 3.2.1 Disable Source Routed Packet Acceptance (Scored) - - id: 6041 + - id: 7041 title: "Ensure source routed packets are not accepted" description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." @@ -651,7 +651,7 @@ checks: - 'c:/sbin/sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*0$' # 3.2.2 Disable ICMP Redirect Acceptance (Scored) - - id: 6042 + - id: 7042 title: "Ensure ICMP redirects are not accepted" description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." @@ -669,7 +669,7 @@ checks: - 'c:/sbin/sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*0$' # 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) - - id: 6043 + - id: 7043 title: "Ensure secure ICMP redirects are not accepted" description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." @@ -686,7 +686,7 @@ checks: - 'c:/sbin/sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*0$' - 'c:/sbin/sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*0$' - - id: 6044 + - id: 7044 title: "Ensure suspicious packets are logged" description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." @@ -704,7 +704,7 @@ checks: - 'c:/sbin/sysctl net.ipv4.conf.default.log_martians -> r:=\s*1$' # 3.2.5 Enable Ignore Broadcast Requests (Scored) - - id: 6045 + - id: 7045 title: "Ensure broadcast ICMP requests are ignored" description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." @@ -720,7 +720,7 @@ checks: - 'c:/sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*1$' # 3.2.6 Enable Bad Error Message Protection (Scored) - - id: 6046 + - id: 7046 title: "Ensure bogus ICMP responses are ignored" description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." @@ -736,7 +736,7 @@ checks: - 'c:/sbin/sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*1$' # 3.2.7 Ensure Reverse Path Filtering is enabled (Scored) - - id: 6047 + - id: 7047 title: "Ensure Reverse Path Filtering is enabled" description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." @@ -754,7 +754,7 @@ checks: - 'c:/sbin/sysctl net.ipv4.conf.default.rp_filter -> r:=\s*1$' # 3.2.8 Enable TCP SYN Cookies (Scored) - - id: 6048 + - id: 7048 title: "Ensure TCP SYN Cookies is enabled" description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." @@ -776,7 +776,7 @@ checks: # 5.2 Configure SSH ############################################### # 5.2.2 Set SSH Protocol to 2 (Scored) - - id: 6049 + - id: 7049 title: "Ensure SSH Protocol is set to 2" description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." @@ -793,7 +793,7 @@ checks: - 'f:$sshd_file -> !r:^# && r:^\s*\t*Protocol\s*\t*2' # 5.2.3 Set LogLevel to INFO (Scored) - - id: 6050 + - id: 7050 title: "Ensure SSH LogLevel is set to INFO" description: "The INFO parameter specifies that login and logout activity will be logged." rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field." @@ -810,7 +810,7 @@ checks: - 'f:$sshd_file -> !r:^# && r:LogLevel\.+INFO' # 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) - - id: 6051 + - id: 7051 title: "Ensure SSH MaxAuthTries is set to 4 or less" description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." @@ -825,7 +825,7 @@ checks: - 'f:$sshd_file -> n:^MaxAuthTries\s+(\d+) compare <= 4' # 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) - - id: 6052 + - id: 7052 title: "Ensure SSH IgnoreRhosts is enabled" description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." @@ -842,7 +842,7 @@ checks: - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\.+yes' # 5.2.7 Set SSH HostbasedAuthentication to No (Scored) - - id: 6053 + - id: 7053 title: "Ensure SSH HostbasedAuthentication is disabled" description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv , along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." @@ -859,7 +859,7 @@ checks: - 'f:$sshd_file -> r:^\s*\t*HostbasedAuthentication\.+no' # 5.2.8 Disable SSH Root Login (Scored) - - id: 6054 + - id: 7054 title: "Ensure SSH root login is disabled" description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." rationale: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no. Rationale: Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" @@ -876,7 +876,7 @@ checks: - 'f:$sshd_file -> r:^\s*\t*PermitRootLogin\.+no' # 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) - - id: 6055 + - id: 7055 title: "Ensure SSH PermitEmptyPasswords is disabled" description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" @@ -899,7 +899,7 @@ checks: # 6.2 Review User and Group Settings ############################################### # 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) - - id: 6056 + - id: 7056 title: "Ensure root is the only UID 0 account" description: "Any account with UID 0 has superuser privileges on the system." rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." @@ -915,7 +915,7 @@ checks: rules: - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' - - id: 6057 + - id: 7057 title: "Ensure password fields are not empty" description: "An account with an empty password field means that anybody may log in as that user without providing a password." rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." diff --git a/sca/sles/12/cis_sles12_linux.yml b/sca/sles/12/cis_sles12_linux.yml index ea4233431..f990d07dc 100644 --- a/sca/sles/12/cis_sles12_linux.yml +++ b/sca/sles/12/cis_sles12_linux.yml @@ -30,7 +30,7 @@ variables: checks: # Section 1.1 - Filesystem Configuration - - id: 6500 + - id: 7500 title: "Ensure separate partition exists for /tmp" description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." @@ -43,7 +43,7 @@ checks: rules: - 'c:mount -> r:\s/tmp\s' - - id: 6501 + - id: 7501 title: "Ensure nodev option set on /tmp partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." @@ -56,7 +56,7 @@ checks: rules: - 'c:mount -> r:\s/tmp\s && r:nodev' - - id: 6502 + - id: 7502 title: "Ensure nosuid option set on /tmp partition" description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." @@ -70,7 +70,7 @@ checks: - 'c:mount -> r:\s/tmp\s && r:nosuid' # 1.1.5 /tmp: noexec - - id: 6503 + - id: 7503 title: "Ensure noexec option set on /tmp partition" description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." @@ -85,7 +85,7 @@ checks: - 'c:mount -> r:\s/tmp\s && r:noexec' # 1.1.6 Build considerations - Partition scheme. - - id: 6504 + - id: 7504 title: "Ensure separate partition exists for /var" description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." @@ -98,7 +98,7 @@ checks: rules: - 'c:mount -> r:\s/var\s' - - id: 6505 + - id: 7505 title: "Ensure separate partition exists for /var/log" description: "The /var/log directory is used by system services to store log data." rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." @@ -113,7 +113,7 @@ checks: - 'c:mount -> r:\s/var/log\s' # 1.1.12 /var/log/audit: partition - - id: 6506 + - id: 7506 title: "Ensure separate partition exists for /var/log/audit" description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog ) consume space in the same partition as auditd, it may not perform as desired." @@ -128,7 +128,7 @@ checks: - 'c:mount -> r:\s/var/log/audit\s' # 1.1.13 /home: partition - - id: 6507 + - id: 7507 title: "Ensure separate partition exists for /home" description: "The /home directory is used to support disk storage needs of local users." rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." @@ -142,7 +142,7 @@ checks: - 'c:mount -> r:\s/home\s' # 1.1.14 /home: nodev - - id: 6508 + - id: 7508 title: "Ensure nodev option set on /home partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." @@ -156,7 +156,7 @@ checks: - 'c:mount -> r:\s/home\s && r:nodev' # 1.1.15 /dev/shm: nodev - - id: 6509 + - id: 7509 title: "Ensure nodev option set on /dev/shm partition" description: "The nodev mount option specifies that the filesystem cannot contain special devices." rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." @@ -170,7 +170,7 @@ checks: - 'c:mount -> r:\s/dev/shm\s && r:nodev' # 1.1.16 /dev/shm: nosuid - - id: 6510 + - id: 7510 title: "Ensure nosuid option set on /dev/shm partition" description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." @@ -184,7 +184,7 @@ checks: - 'c:mount -> r:\s/dev/shm\s && r:nosuid' # 1.1.17 /dev/shm: noexec - - id: 6511 + - id: 7511 title: "Ensure noexec option set on /dev/shm partition" description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." @@ -202,7 +202,7 @@ checks: # 1.5 Additional Process Hardening ############################################### # 1.5.1 Restrict Core Dumps (Scored) - - id: 6512 + - id: 7512 title: "Ensure core dumps are restricted" description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." @@ -217,7 +217,7 @@ checks: - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' # 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) - - id: 6513 + - id: 7513 title: "Ensure address space layout randomization (ASLR) is enabled" description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." @@ -238,7 +238,7 @@ checks: # 2.1 Remove Legacy Services ############################################### # Section 2.1 - inetd Services - - id: 6514 + - id: 7514 title: "Ensure chargen services are not enabled" description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -250,7 +250,7 @@ checks: rules: - 'c:chkconfig --list -> r:chargen:|chargen-udp: && r::on' - - id: 6515 + - id: 7515 title: "Ensure daytime services are not enabled" description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -262,7 +262,7 @@ checks: rules: - 'c:chkconfig --list -> r:daytime:|daytime-udp && r::on' - - id: 6516 + - id: 7516 title: "Ensure discard services are not enabled" description: "discard is a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -274,7 +274,7 @@ checks: rules: - 'c:chkconfig --list -> r:discard:|discard-udp: && r::on' - - id: 6517 + - id: 7517 title: "Ensure echo services are not enabled" description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -286,7 +286,7 @@ checks: rules: - 'c:chkconfig --list -> r:echo:|echo-udp: && r::on' - - id: 6518 + - id: 7518 title: "Ensure time services are not enabled" description: "timeis a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." rationale: "Disabling this service will reduce the remote attack surface of the system." @@ -298,7 +298,7 @@ checks: rules: - 'c:chkconfig --list -> r:time:|time-udp && r::on' - - id: 6519 + - id: 7519 title: "Ensure rsh server is not enabled" description: "The Berkeley rsh-server (rsh, rlogin, rexec) package contains legacy services that exchange credentials in clear-text." rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." @@ -312,7 +312,7 @@ checks: rules: - 'c:chkconfig --list -> r:rexec:|rlogin:|rsh: && r::on' - - id: 6520 + - id: 7520 title: "Ensure talk server is not enabled" description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." rationale: "The software presents a security risk as it uses unencrypted protocols for communication." @@ -326,7 +326,7 @@ checks: rules: - 'c:chkconfig --list -> r:talk: && r::on' - - id: 6521 + - id: 7521 title: "Ensure telnet server is not enabled" description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." @@ -340,7 +340,7 @@ checks: rules: - 'c:chkconfig --list -> r:telnet: && r::on' - - id: 6522 + - id: 7522 title: "Ensure tftp server is not enabled" description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package atftp is used to define and support a TFTP server." rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." @@ -354,7 +354,7 @@ checks: rules: - 'c:chkconfig --list -> r:tftp: && r::on' - - id: 6523 + - id: 7523 title: "Ensure rsync service is not enabled" description: "The rsyncd service can be used to synchronize files between systems over network links." rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." @@ -367,7 +367,7 @@ checks: rules: - 'c:chkconfig --list -> r:rsync: && r::on' - - id: 6524 + - id: 7524 title: "Ensure xinetd is not enabled" description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." @@ -382,7 +382,7 @@ checks: ############################################### # 2 Special Purpose Services ############################################### - - id: 6525 + - id: 7525 title: "Ensure ntp is configured" description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://tools.ietf.org/html/rfc958. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." @@ -400,7 +400,7 @@ checks: - 'f:/etc/sysconfig/ntp -> r:NTPD_OPTIONS= && r:-u && r:ntp:ntp' # 2.2.2 Remove X Windows (Scored) - - id: 6526 + - id: 7526 title: "Ensure X Window System is not installed" description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." @@ -415,7 +415,7 @@ checks: - 'c:rpm -qa xorg-x11* -> r:^xorg-x11' # 2.2.3 Disable Avahi Server (Scored) - - id: 6527 + - id: 7527 title: "Ensure Avahi Server is not enabled" description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." @@ -429,7 +429,7 @@ checks: rules: - 'c:systemctl is-enabled avahi-daemon -> r:enabled' - - id: 6528 + - id: 7528 title: "Ensure DHCP Server is not enabled" description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." @@ -442,7 +442,7 @@ checks: - 'c:systemctl is-enabled dhcpd -> r:enabled' # 2.2.7 Disable NFS and RPC (Not Scored) - - id: 6529 + - id: 7529 title: "Ensure NFS and RPC are not enabled" description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." @@ -457,7 +457,7 @@ checks: - 'c:systemctl is-enabled nfs -> r:enabled' - 'c:systemctl is-enabled rpcbind -> r:enabled' - - id: 6530 + - id: 7530 title: "Ensure DNS Server is not enabled" description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." @@ -471,7 +471,7 @@ checks: rules: - 'c:systemctl is-enabled named -> r:enabled' - - id: 6531 + - id: 7531 title: "Ensure FTP Server is not enabled" description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." @@ -486,7 +486,7 @@ checks: - 'c:systemctl is-enabled vsftpd -> r:enabled' # 2.2.10 Remove HTTP Server (Not Scored) - - id: 6532 + - id: 7532 title: "Ensure HTTP server is not enabled" description: "HTTP or web servers provide the ability to host web site content." rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." @@ -498,7 +498,7 @@ checks: rules: - 'c:systemctl is-enabled apache2 -> r:enabled' - - id: 6533 + - id: 7533 title: "Ensure IMAP and POP3 server is not enabled" description: "dovecot is an open source IMAP and POP3 server for Linux based systems." rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." @@ -513,7 +513,7 @@ checks: - 'c:systemctl is-enabled dovecot -> r:enabled' # 2.2.12 Remove Samba (Not Scored) - - id: 6534 + - id: 7534 title: "Ensure Samba is not enabled" description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." @@ -527,7 +527,7 @@ checks: rules: - 'c:systemctl is-enabled smb -> r:enabled' - - id: 6535 + - id: 7535 title: "Ensure HTTP Proxy Server is not enabled" description: "Squid is a standard proxy server used in many distributions and environments." rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." @@ -541,7 +541,7 @@ checks: rules: - 'c:systemctl is-enabled squid -> r:enabled' - - id: 6536 + - id: 7536 title: "Ensure SNMP Server is not enabled" description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." @@ -555,7 +555,7 @@ checks: rules: - 'c:systemctl is-enabled snmpd -> r:enabled' - - id: 6537 + - id: 7537 title: "Ensure NIS Server is not enabled" description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" @@ -570,7 +570,7 @@ checks: - 'c:systemctl is-enabled ypserv -> r:enabled' # Section 2.3 - Service Clients - - id: 6538 + - id: 7538 title: "Ensure NIS Client is not installed" description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." @@ -591,7 +591,7 @@ checks: # 3.1 Modify Network Parameters (Host Only) ############################################### # 3.1.1 Disable IP Forwarding (Scored) - - id: 6539 + - id: 7539 title: "Ensure IP forwarding is disabled" description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." @@ -607,7 +607,7 @@ checks: - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' # 3.1.2 Disable Send Packet Redirects (Scored) - - id: 6540 + - id: 7540 title: "Ensure packet redirect sending is disabled" description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." @@ -628,7 +628,7 @@ checks: # 3.2 Modify Network Parameters (Host and Router) ############################################### # 3.2.1 Disable Source Routed Packet Acceptance (Scored) - - id: 6541 + - id: 7541 title: "Ensure source routed packets are not accepted" description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." @@ -646,7 +646,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' # 3.2.2 Disable ICMP Redirect Acceptance (Scored) - - id: 6542 + - id: 7542 title: "Ensure ICMP redirects are not accepted" description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." @@ -664,7 +664,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' # 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) - - id: 6543 + - id: 7543 title: "Ensure secure ICMP redirects are not accepted" description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." @@ -681,7 +681,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' - - id: 6544 + - id: 7544 title: "Ensure suspicious packets are logged" description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." @@ -699,7 +699,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' # 3.2.5 Enable Ignore Broadcast Requests (Scored) - - id: 6545 + - id: 7545 title: "Ensure broadcast ICMP requests are ignored" description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." @@ -715,7 +715,7 @@ checks: - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' # 3.2.6 Enable Bad Error Message Protection (Scored) - - id: 6546 + - id: 7546 title: "Ensure bogus ICMP responses are ignored" description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." @@ -731,7 +731,7 @@ checks: - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' # 3.2.7 Ensure Reverse Path Filtering is enabled (Scored) - - id: 6547 + - id: 7547 title: "Ensure Reverse Path Filtering is enabled" description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." @@ -749,7 +749,7 @@ checks: - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' # 3.2.8 Enable TCP SYN Cookies (Scored) - - id: 6548 + - id: 7548 title: "Ensure TCP SYN Cookies is enabled" description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." @@ -771,7 +771,7 @@ checks: # 5.2 Configure SSH ############################################### # 5.2.2 Set SSH Protocol to 2 (Scored) - - id: 6549 + - id: 7549 title: "Ensure SSH Protocol is set to 2" description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." @@ -788,7 +788,7 @@ checks: - 'f:$sshd_file -> !r:^\s*\t*# && r:Protocol\s*\t*2$' # 5.2.3 Set LogLevel to INFO (Scored) - - id: 6550 + - id: 7550 title: "Ensure SSH LogLevel is set to INFO" description: "The INFO parameter specifies that login and logout activity will be logged." rationale: "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field." @@ -805,7 +805,7 @@ checks: - 'f:$sshd_file -> !r:^\s*\t*# && r:LogLevel\s*\t*INFO' # 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) - - id: 6551 + - id: 7551 title: "Ensure SSH MaxAuthTries is set to 4 or less" description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." @@ -820,7 +820,7 @@ checks: - 'f:$sshd_file -> !r:^\s*\t*# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' # 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) - - id: 6552 + - id: 7552 title: "Ensure SSH IgnoreRhosts is enabled" description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." rationale: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" @@ -837,7 +837,7 @@ checks: - 'f:$sshd_file -> !r:^\s*\t*# && r:IgnoreRhosts\s*\t*yes' # 5.2.7 Set SSH HostbasedAuthentication to No (Scored) - - id: 6553 + - id: 7553 title: "Ensure SSH HostbasedAuthentication is disabled" description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv , along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." @@ -854,7 +854,7 @@ checks: - 'f:$sshd_file -> !r:^\s*\t*# && r:HostbasedAuthentication\s*\t*no' # 5.2.8 Disable SSH Root Login (Scored) - - id: 6554 + - id: 7554 title: "Ensure SSH root login is disabled" description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" @@ -871,7 +871,7 @@ checks: - 'f:$sshd_file -> !r:^\s*\t*# && r:PermitRootLogin\s*\t*no' # 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) - - id: 6555 + - id: 7555 title: "Ensure SSH PermitEmptyPasswords is disabled" description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" @@ -894,7 +894,7 @@ checks: # 6.2 Review User and Group Settings ############################################### # 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) - - id: 6556 + - id: 7556 title: "Ensure root is the only UID 0 account" description: "Any account with UID 0 has superuser privileges on the system." rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." @@ -910,7 +910,7 @@ checks: rules: - 'f:/etc/passwd -> !r:^\s*\t*# && !r:^\s*\t*root: && r:^\w+:\w+:0:' - - id: 6557 + - id: 7557 title: "Ensure password fields are not empty" description: "An account with an empty password field means that anybody may log in as that user without providing a password." rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." diff --git a/sca/sunos/cis_solaris11.yml b/sca/sunos/cis_solaris11.yml index 26012d30a..0d5df36b8 100644 --- a/sca/sunos/cis_solaris11.yml +++ b/sca/sunos/cis_solaris11.yml @@ -13,7 +13,7 @@ policy: id: "cis_solaris11" file: "cis_solaris11.yml" - name: "CIS benchmark for Oracle Solaris 11" + name: "CIS Benchmark for Oracle Solaris 11" description: "This document, CIS Oracle Solaris 11 Benchmark v1.1.0, provides prescriptive guidance for establishing a secure configuration posture for Oracle Solaris 11 on both x86 and SPARC platforms. This guide was tested against Solaris 11 11/11 release, updated to the Software Repository Update 5 (SRU5). As of the publication of this document, Solaris 11 11/11 SRU5 is the latest available support update for the Solaris 11 OS. The recommendations included in this document may need to be adjusted for future Solaris 11 updates." references: - https://www.cisecurity.org/cis-benchmarks/ @@ -27,7 +27,7 @@ requirements: checks: # 2 Disable Unnecessary Services - - id: 7000 + - id: 8000 title: "Disable Local-only Graphical Login Environment" description: "The graphical login service provides the capability of logging into the system using an X- windows type interface from the console. If graphical login access for the console is required, leave the service in local-only mode." rationale: "This service should be disabled if it is not required." @@ -38,7 +38,7 @@ checks: rules: - 'c:svcs -xv svc:/application/graphical-login/gdm:default -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7001 + - id: 8001 title: "Configure sendmail Service for Local-Only Mode" description: "In Solaris 11, the sendmail service is set to local only mode by default. This means that users on remote systems cannot connect to the sendmail service, eliminating the possibility of a remote exploit attack against some future sendmail vulnerability. Leaving sendmail in local-only mode permits mail to be sent out from the local system. If the local system will not be processing or sending any mail, this service can be disabled. However, if sendmail is disabled completely, email messages sent to the root account (such as cron job output or audit service warnings) will fail to be delivered. An alternative approach is to disable the sendmail service and create a cron job to process all mail that is queued on the local system, sending it to a relay host defined in the sendmail.cf file. It is recommended that sendmail be left in local-only mode unless there is a specific requirement to completely disable it." rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." @@ -49,7 +49,7 @@ checks: rules: - 'c:netstat -an -> r:.25\s*\t*|:25\s*\t* && !r:127.0.0.1|::1' - - id: 7002 + - id: 8002 title: "Disable RPC Encryption Key" description: "The keyserv service is only required for sites that are using the Secure RPC mechanism. The most common use for Secure RPC on Solaris machines is \"secure NFS\", which uses the Secure RPC mechanism to provide higher levels of security than the standard NFS protocols. (\"Secure NFS\" is unrelated to Kerberos authentication as a mechanism for providing higher levels of NFS security. \"Kerberized\" NFS does not require the keyserv service to be running.)" rationale: "This service should be disabled if it is not required." @@ -60,7 +60,7 @@ checks: rules: - 'c:svcs -xv svc:/network/rpc/keyserv -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7003 + - id: 8003 title: "Disable NIS Server Services" description: "The NIS server software is not installed by default and is only required on systems that are acting as an NIS server for the local site. Typically there are only a small number of NIS servers on any given network. These services are disabled by default unless the system has been previously configured to act as a NIS server." rationale: "As RPC-based services such as NIS may use non-secure authentication and share sensitive network object information with systems and applications using RPC-based services, this service should be disabled. Users are encouraged to use LDAP as a name service in place of NIS." @@ -72,7 +72,7 @@ checks: - 'c:svcs -xv svc:/network/nis/server -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - 'c:svcs -xv svc:/network/nis/domain -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7004 + - id: 8004 title: "Disable NIS Client Services" description: "If the local site is not using the NIS naming service to distribute system and user configuration information, this service may be disabled. This service is disabled by default unless the NIS service has been installed and configured on the system." rationale: "As RPC-based services such as NIS may use non-secure authentication and share sensitive network object information with systems and applications using RPC-based service, NIS client daemons should be disabled. Users are encouraged to use LDAP as a name service in place of NIS." @@ -84,7 +84,7 @@ checks: - 'c:svcs -xv svc:/network/nis/client -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - 'c:svcs -xv svc:/network/nis/domain -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7005 + - id: 8005 title: "Disable Kerberos TGT Expiration Warning" description: "The Kerberos TGT warning service is used to warn users when their Kerberos tickets are about expire or to renew those tickets before they expire. This service is not used if Kerberos has not been configured. This service is configured to be \"local only\" by default." rationale: "This service should be disabled if it is not required." @@ -95,7 +95,7 @@ checks: rules: - 'c:svcs -xv svc:/network/security/ktkt_warn -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7006 + - id: 8006 title: "Disable Generic Security Services (GSS)" description: "The GSS API is a security abstraction layer that is designed to make it easier for developers to integrate with different authentication schemes. It is most commonly used in applications for sites that use Kerberos for network authentication, though it can also allow applications to interoperate with other authentication schemes." rationale: "GSS does not expose anything external to the system as it is configured to use TLI (protocol = ticotsord) by default. This service should be disabled if it is not required." @@ -106,7 +106,7 @@ checks: rules: - 'c:svcs -xv svc:/network/rpc/gss -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7007 + - id: 8007 title: "Disable Removable Volume Manager" description: "The HAL-aware removable volume manager in the Solaris 11 OS automatically mounts external devices for users whenever the device is attached to the system. These devices include CD-R, CD-RW, floppies, DVD, USB and 1394 mass storage devices. See the rmvolmgr(1M) manual page for more details." rationale: "Allowing users to mount and access data from removable media devices makes it easier for malicious programs and data to be imported onto the network. It also introduces the risk that sensitive data may be transferred off the system without a log record. By adding rmvolmgr to the .xinitrc file, user-isolated instances of rmvolmgr can be run via a session startup script. In such cases, the rmvolmgr instance will not allow management of volumes that belong to other than the owner of the startup script. When a user logs onto the workstation console (/dev/console), any instance of user-initiated rmvolmgr will only own locally connected devices, such as CD-ROMs or flash memory hardware, locally connected to USB or FireWire ports." @@ -118,7 +118,7 @@ checks: - 'c:svcs -xv svc:/system/filesystem/rmvolmgr -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - 'c:svcs -xv svc:/network/rpc/smserver -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7008 + - id: 8008 title: "Disable automount Service" description: "The automount daemon is normally used to automatically mount NFS file systems from remote file servers when needed. However, the automount daemon can also be configured to mount local (loopback) file systems as well, which may include local user home directories, depending on the system configuration." rationale: "This service should be disabled if it is not required." @@ -129,7 +129,7 @@ checks: rules: - 'c:svcs -xv svc:/system/filesystem/autofs -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7009 + - id: 8009 title: "Disable Apache Service" description: "The Apache service provides an instance of the Apache web server." rationale: "This service should be disabled if it is not required." @@ -142,7 +142,7 @@ checks: rules: - 'c:svcs -xv svc:/network/http:apache22 -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7010 + - id: 8010 title: "Disable Local-only RPC Port Mapping Service" description: "Remote Procedure Call (RPC) is used by many services within the Solaris 11 operating system. Some of these services allow external connections to use the service (e.g. NFS, NIS). By default, the Solaris 11 OS configures this service to be local only." rationale: "RPC-based services typically have weak or non-existent authentication and yet may share very sensitive information, which is vulnerable to network traffic sniffers. Unless one of these services is required on this host, RPC-based tools should be fully disabled." @@ -153,7 +153,7 @@ checks: rules: - 'c:svcs -xv svc:/network/rpc/bind -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' - - id: 7011 + - id: 8011 title: "Configure TCP Wrappers" description: "TCP Wrappers is a host-based access control system that allows administrators to control who has access to various network services based on the IP address of the remote end of the connection. TCP Wrappers also provide logging information via syslog about both successful and unsuccessful connections." rationale: "TCP Wrappers provides granular control over what services can be accessed over the network. Its logs show attempted access to services from non-authorized systems, which can help identify unauthorized access attempts." @@ -168,7 +168,7 @@ checks: - 'f:/etc/hosts.allow' - 'f:/etc/hosts.deny' - - id: 7012 + - id: 8012 title: "Disable Telnet Service" description: "The telnet daemon, which accepts connections from users from other systems via the telnet protocol and can be used for remote shell access." rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh protocol provides an encrypted session and stronger security." @@ -180,7 +180,7 @@ checks: - 'c:svcs -xv svc:/network/telnet -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' # 3 Kernel Tuning - - id: 7013 + - id: 8013 title: "Restrict Core Dumps to Protected Directory" description: "The action described in this section creates a protected directory to store core dumps and also causes the system to create a log entry whenever a regular process dumps core." rationale: "Core dumps, particularly those from set-UID and set-GID processes, may contain sensitive data." @@ -194,7 +194,7 @@ checks: - 'c:coreadm -> r:per-process setid core dumps: disabled' - 'c:stat -c%u-%g-%a /var/cores -> r:^\d-\d-700' - - id: 7014 + - id: 8014 title: "Enable Stack Protection" description: "Buffer overflow exploits have been the basis for many highly publicized compromises and defacements of large numbers of Internet connected systems. Many of the automated tools in use by system attackers exploit well-known buffer overflow problems in vendor- supplied and third party software." rationale: "Enabling stack protection prevents certain classes of buffer overflow attacks and is a significant security enhancement. However, this does not protect against buffer overflow attacks that do not execute code on the stack (such as return-to-libc exploits). While most of the Solaris OS is already configured to employ a non-executable stack, this setting is still recommended to provide a more comprehensive solution for both Solaris and other software that may be installed." @@ -207,7 +207,7 @@ checks: - 'f:/etc/system -> r:\s*\t*noexec_user_stack\s*\t*=\s*\t*1' - 'f:/etc/system -> r:\s*\t*noexec_user_stack_log\s*\t*=\s*\t*1' - - id: 7015 + - id: 8015 title: "Enable Strong TCP Sequence Number Generation" description: "The variable TCP_STRONG_ISS defines the mechanism used for TCP initial sequence number generation. If an attacker can predict the next sequence number, it is possible to inject fraudulent packets into the data stream to hijack the session." rationale: "The RFC 1948 method is widely accepted as the strongest mechanism for TCP packet generation. This makes remote session hijacking attacks more difficult, as well as any other network-based attack that relies on predicting TCP sequence number information. It is theoretically possible that there may be a small performance hit in connection setup time when this setting is used, but there are no publicly available benchmarks that establish this." @@ -220,7 +220,7 @@ checks: - 'c:ipadm show-prop -p _strong_iss -co current tcp -> r:2' # 4 Auditing and Logging - - id: 7016 + - id: 8016 title: "Create CIS Audit Class" description: "To group a set of related audit events, the Solaris Audit service provides the ability for sites to define their own audit classes that contain just those events that the site wants to audit." rationale: "To simplify administration, a CIS specific audit class should be created." @@ -231,7 +231,7 @@ checks: rules: - 'f:/etc/security/audit_class -> 0x0100000000000000:cis:CIS Solaris Benchmark' - - id: 7017 + - id: 8017 title: "Enable Auditing of Incoming Network Connections" description: "The Solaris Audit service can be configured to record incoming network connections to any listening service running on the system." rationale: "This recommendation will provide an audit trail that contains information related to incoming network connections. While this functionality can be enabled using service- specific mechanisms, using the Solaris Audit service provides a more centralized and complete window into incoming network activity." @@ -246,7 +246,7 @@ checks: - 'f:/etc/security/audit_event -> r:^\d+:AUE_SOCKCONNECT:\.+cis\.*' - 'f:/etc/security/audit_event -> r:^\d+:AUE_inetd_connect:\.+cis\.*' - - id: 7018 + - id: 8018 title: "Enable Auditing of File Metadata Modification Events" description: "The Solaris Audit service can be configured to record file metadata modification events for every process running on the system. This will allow the auditing service to determine when file ownership, permissions and related information is changed." rationale: "This recommendation will provide an audit trail that contains information related to changes of file metadata. The Solaris Audit service is used to provide a more centralized and complete window into activities such as these." @@ -263,7 +263,7 @@ checks: - 'f:/etc/security/audit_event -> r:^\d+:AUE_ACLSET:\.+cis\.*' - 'f:/etc/security/audit_event -> r:^\d+:AUE_FACLSET:\.+cis\.*' - - id: 7019 + - id: 8019 title: "Enable Auditing of Process and Privilege Events" description: "The Solaris Audit service can be configured to record the use of privileges by processes running on the system. This will capture events such as the setting of UID and GID values, setting of privileges, as well as the use of functionality such as chroot(2)." rationale: "This recommendation will provide an audit trail that contains information related to the use of privileges by processes running on the system. The Solaris Audit service is used to provide a more centralized and complete window into activities such as these." @@ -287,7 +287,7 @@ checks: - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETSID:\.+cis\.*' - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETPGID:\.+cis\.*' - - id: 7020 + - id: 8020 title: "Configure Solaris Auditing" description: "Solaris auditing service keeps a record of how a system is being used. Solaris auditing can be configured to record different classes of events based upon site policy. This recommendation will set and verify a consensus-developed auditing policy. That said, all organizations are encouraged to tailor this policy based upon their specific needs. For more information on the Solaris auditing service including how to filter and view events, see the Oracle Solaris product documentation. The \"cis\" class is a \"custom class\" that CIS recommends creating that includes specifically those events that are of interest (defined in the sections above). In addition to those events, this recommendation also includes auditing of login and logout (lo) events, administrative (ad) events, file transfer (ft) events, and command execution (ex) events. This recommendation also configures the Solaris auditing service to capture and report command line arguments (for command execution events) and the zone name in which a command was executed (for global and non-global zones). Further, this recommendation sets a disk utilization threshold of 1%. If this threshold is crossed (for the volume that includes /var/audit), then a warning e-mail will be sent to advise the system administrators that audit events may be lost if the disk becomes full. Finally, this recommendation will also ensure that new audit trails are created at the start of each new day (to help keep the size of the files small to facilitate analysis)." rationale: "The consensus settings described in this section are an effort to log interesting system events without consuming excessive amounts of resources logging significant but usually uninteresting system calls." @@ -305,7 +305,7 @@ checks: - 'f:/var/spool/cron/crontabs/root -> r:/usr/sbin/audit -n' # 5 File/Directory Permissions/Access - - id: 7021 + - id: 8021 title: "Default Service File Creation Mask" description: "The default system file creation mask applies to processes that are started by init - including most system services. To ensure that files are not created with write access to anyone other than their owner, the default file creation mask should be set to 022. Some sites with more stringent security requirements may prefer to set this value to 077 to eliminate all permissions for group and world. Note that changing this value from the Solaris default of 022 may negatively impact services that may not be able to operate with a stricter setting." rationale: "The default file creation mask should be set to 022 to avoid unnecessarily giving files write access to group or world." @@ -317,7 +317,7 @@ checks: - 'c:svcprop -p umask/umask svc:/system/environment:init -> 022' # 6 System Access, Authentication, and Authorization - - id: 7022 + - id: 8022 title: "Disable \"nobody\" Access for RPC Encryption Key Storage Service" description: "This action listed prevents keyserv from using default keys for the nobody user, effectively stopping the nobody user from accessing information via Secure RPC." rationale: "If login by the user nobody is allowed for secure RPC, there is an increased risk of system compromise. If keyserv holds a private key for the nobody user, it will be used by key_encryptsession to compute a magic phrase which can be easily recovered by a malicious user." @@ -329,7 +329,7 @@ checks: - 'f:/etc/default/keyserv' - 'f:/etc/default/keyserv -> !r:^# && r:ENABLE_NOBODY_KEYS\s*\t*=\s*\t*NO' - - id: 7023 + - id: 8023 title: "Disable X11 Forwarding for SSH" description: "The 'X11 Forwarding' parameter defined within the /etc/ssh/sshd_config file specifies whether or not X11 Forwarding via SSH is enabled on the server: The Secure Shell service provides an encrypted 'tunnel' for the data traffic passing through it. While commonly used to substitute for clear-text, CLI-based remote connections such as telnet, Secure Shell can be used to forward an 'X Window' session through the encrypted tunnel, allowing the remote user to have a GUI interface." rationale: "As enabling X11Forwarding on the host can permit a malicious user to secretly open another X11 connection to another remote client during the session and perform unobtrusive activities such as keystroke monitoring, if the X11 services are not required for the system's intended function, it should be disabled or restricted as appropriate to the user's needs." @@ -340,7 +340,7 @@ checks: rules: - 'f:/etc/ssh/sshd_config -> !r:^# && r:X11Forwarding\s+no' - - id: 7024 + - id: 8024 title: "Limit Consecutive Login Attempts for SSH" description: "The 'MaxAuthTries' parameter in the /etc/ssh/sshd_config file specifies the maximum number of authentication attempts permitted per connection. By restricting the number of failed authentication attempts before the server terminates the connection, malicious users are blocked from gaining access to the host by using repetitive brute-force login exploits." rationale: "By setting the authentication login limit to a low value this will disconnect the attacker and force a reconnect, which severely limits the speed of such brute force attacks." @@ -351,7 +351,7 @@ checks: rules: - 'f:/etc/ssh/sshd_config -> !r:^# && n:MaxAuthTries\s*\t*(\d+) compare <= 3' - - id: 7025 + - id: 8025 title: "Disable Rhost-based Authentication for SSH" description: "The IgnoreRhosts parameter specifies that existing .rhosts and .shosts files, which may apply to application rather than user logins, will not be used in RhostsRSAAuthentication or HostbasedAuthentication." rationale: "Setting this parameter forces users to enter a password when authenticating with SSH." @@ -362,7 +362,7 @@ checks: rules: - 'f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\s+yes' - - id: 7026 + - id: 8026 title: "Disable root login for SSH" description: "The PermitRootLogin value (in /etc/ssh/sshd_config) allows for direct root login by a remote user/application to resources on the local host." rationale: "By default, it is not possible for the root account to log directly into the system console because the account is configured as a role. This setting therefore does not significantly alter the security posture of the system unless the root account is changed from this default and configured to be a normal user." @@ -373,7 +373,7 @@ checks: rules: - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\s+no' - - id: 7027 + - id: 8027 title: "Blocking Authentication Using Empty/Null Passwords for SSH" description: "The PermitEmptyPasswords value allows for direct login through SSH without a password by a remote user/application to resources on the local host in the same way a standard remote login would." rationale: "Permitting login without a password is inherently risky." @@ -384,7 +384,7 @@ checks: rules: - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitEmptyPasswords\s+no' - - id: 7028 + - id: 8028 title: "Disable Host-based Authentication for Login-based Services" description: "The .rhosts files are used for automatic login to remote hosts and contain username and hostname combinations. The .rhosts files are unencrypted (usually group- or world- readable) and present a serious risk in that a malicious user could use the information within to gain access to a remote host with the privileges of the original application or user." rationale: "The use of .rhosts authentication is an old and insecure protocol and can be replaced with public-key authentication using Secure Shell. As automatic authentication settings in the .rhosts files can provide a malicious user with sensitive system credentials, the use of .rhosts files should be disabled. It should be noted that by default the Solaris services that use this file, including rsh and rlogin, are disabled by default." @@ -396,7 +396,7 @@ checks: - 'f:/etc/pam.conf -> r:^#\s*\t*rlogin && r:auth && r:sufficient && r:pam_rhosts_auth.so.1' - 'f:/etc/pam.conf -> r:^#\s*\t*rsh && r:auth && r:sufficient && r:pam_rhosts_auth.so.1' - - id: 7029 + - id: 8029 title: "Set Delay between Failed Login Attempts to 4" description: "The SLEEPTIME variable in the /etc/default/login file controls the number of seconds to wait before printing the \"login incorrect\" message when a bad password is provided." rationale: "As an immediate return of an error message, coupled with the capability to try again may facilitate automatic and rapid-fire brute-force password attacks by a malicious user, this delay time should be set as appropriate to the needs of the user." @@ -407,7 +407,7 @@ checks: rules: - 'f:/etc/default/login -> !r:^# && n:^SLEEPTIME\s*\t*=\s*\t*(\d+) compare >= 4' - - id: 7030 + - id: 8030 title: "Remove Autologin Capabilities from the GNOME desktop" description: "The GNOME Display Manager is used for login session management. See the manual page gdm(1) for more information. By default, GNOME automatic login is defined in pam.conf(4) to allow users to access the system without a password." rationale: "As automatic logins are a known security risk for other than \"kiosk\" types of systems, GNOME automatic login should be disabled in pam.conf(4)." @@ -418,7 +418,7 @@ checks: rules: - 'f:/etc/pam.conf -> !r:^# && r:gdm-autologin' - - id: 7031 + - id: 8031 title: "Set Default Screen Lock for GNOME Users" description: "The timeout parameter dictates the invocation of a password-protected screen saver after a specified time of keyboard and mouse inactivity, specific to the xscreensaver application used in the GNOME windowing environment." rationale: "As a screensaver timeout provides protection for a desktop that has not been locked by the user upon his/her departure, to help prevent session hijacking, this value should be set as appropriate to the needs of the user." @@ -432,7 +432,7 @@ checks: - 'f:/usr/share/X11/app-defaults/XScreensaver -> r:^*locktimeout:\s*\t*\d+:\d+:\d+' - 'f:/usr/share/X11/app-defaults/XScreensaver -> r:^*lock:\s*\t*true' - - id: 7032 + - id: 8032 title: "Restrict at/cron to Authorized Users" description: "The cron.allow and at.allow files contain a list of users who are allowed to run the crontab and at commands to submit jobs to be run at scheduled intervals." rationale: "On many systems, only the system administrator needs the ability to schedule jobs. Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs. Much more effective access controls for the cron system can be obtained by using Role-Based Access Controls (RBAC)." @@ -448,7 +448,7 @@ checks: - 'f:/etc/cron.d/at.allow' - 'c:wc -l /etc/cron.d/at.allow -> r:\s*0\s' - - id: 7033 + - id: 8033 title: "Restrict root Login to System Console" description: "Privileged access to the system via root must be accountable to a particular user." rationale: "Use an authorized mechanism such as RBAC and the su command to provide administrative access to unprivileged accounts. These mechanisms provide an audit trail in the event of problems." @@ -459,7 +459,7 @@ checks: rules: - 'f:/etc/default/login -> !r:^# && r:CONSOLE|console && r:=\s*\t*/dev/console' - - id: 7034 + - id: 8034 title: "Set Retry Limit for Account Lockout" description: "The RETRIES parameter is the number of failed login attempts a user is allowed before being disconnected from the system and forced to reconnect. When LOCK_AFTER_RETRIES is set in /etc/security/policy.conf, then the user's account is locked after this many failed retries (the account can only be unlocked by the administrator using the command: passwd -u ). The account lockout threshold (RETRIES parameter) restricts the number of failed login attempts allowed before requiring the offending account be locked. The lockout requirement will help block malicious users from gaining access to the host via automated, repetitive brute-force login exploits--trying different passwords until one fits a user name." rationale: "Setting the failed login limit to an appropriate value locks the user account, which will severely limit the speed of such attacks, making it much more likely that the attacker's pattern will be noticed and the offending source address and/or port blocked, so this should be set according to the needs of the user." @@ -471,7 +471,7 @@ checks: - 'f:/etc/default/login -> !r:^# && r:retries|RETRIES && n:=\s*\t*(\d+) compare <=3' - 'f:/etc/security/policy.conf -> !r:^# && r:LOCK_AFTER_RETRIES|lock_after_retries && r:=\s*\t*yes' - - id: 7035 + - id: 8035 title: "Secure the GRUB Menu (Intel)" description: "GRUB is a boot loader for x64 based systems that permits loading an OS image from any location. Oracle x64 systems support the use of a GRUB Menu password for the console." rationale: "The flexibility that GRUB provides creates a security risk if its configuration is modified by an unauthorized user. The failsafe menu entry needs to be secured in the same environments that require securing the systems firmware to avoid unauthorized removable media boots. Setting the GRUB Menu password helps prevent attackers with physical access to the system console from booting off some external device (such as a CD- ROM or floppy) and subverting the security of the system. The actions described in this section will ensure you cannot get to failsafe or any of the GRUB command line options without first entering the password." @@ -484,7 +484,7 @@ checks: - 'f:/rpool/boot/grub/menu.lst -> r:^password\s*--md5' # 7 User Accounts and Environment - - id: 7036 + - id: 8036 title: "Set Password Expiration Parameters on Active Accounts" description: "The characteristics of an operating system that make 'user identification' via password a secure and workable solution is the combination of settings chosen. By requiring that a series of password-choices be security-centric, it reduces the risk of a malicious user breaking the password through dictionary/brute force attacks or fortuitous guessing based upon 'social engineering.' A basic password security strategy is requiring a new password to be chosen every 45-90 days, so that repeated attempts to gain entry by brute-force tactics will fail when a new password is chosen, which requires starting over again to break the new password." rationale: "The commands for this item set all active accounts (except the root account) to force password changes every 91 days (13 weeks), and then prevent password changes for seven days (one week), thereafter. Users will begin receiving warnings 28 days (4 weeks) before their password expires. Sites also have the option of expiring idle accounts after a certain number of days (see the on-line manual page for the usermod command, particularly the -f option)." @@ -497,7 +497,7 @@ checks: - 'f:/etc/default/passwd -> !r:^# && r:minweeks|MINWEEKS && n:=\s*\t*(\d+) compare == 1' - 'f:/etc/default/passwd -> !r:^# && r:warnweeks|WARNWEEKS && n:=\s*\t*(\d+) compare == 4' - - id: 7037 + - id: 8037 title: "Set Strong Password Creation Policies" description: "The variables in the /etc/default/passwd file indicate various strategies for creating differences required between an old and a new password. As requiring users to select a specific numbers of differences between the characters in the existing password and the new one can strengthen the password by increasing the symbol-set space, to further increase the difficulty of breaking any password by brute-force attacks, these values should be set as appropriate to the needs of the user." rationale: "Administrators may wish to add site-specific dictionaries to the DICTIONLIST parameter. Warning: Sites often have differing opinions on the optimal value of the HISTORY parameter (how many previous passwords to remember per user in order to prevent re- use). The values specified here are in compliance with NSA/DISA requirements. If this is too restrictive for your site, you may wish to set a HISTORY value of 4 and a MAXREPEATS of 2. Consult your local security rules for guidance." @@ -519,7 +519,7 @@ checks: - 'f:/etc/default/passwd -> !r:^# && r:dictiondbdir|DICTIONDBDIR && r:=\s*\t*/var/passwd' - 'f:/etc/default/passwd -> !r:^# && r:dictionlist|DICTIONLIST && r:=\s*\t*/usr/share/lib/dict/words' - - id: 7038 + - id: 8038 title: "Set Default umask for users" description: "The default umask(1) determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod(1) command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files (.profile, .cshrc, etc.) in their home directories." rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would allow files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." @@ -530,7 +530,7 @@ checks: rules: - 'f:/etc/default/login -> !r:^# && r:UMASK|umask && r:=\s*\t*027' - - id: 7039 + - id: 8039 title: "Set Default File Creation Mask for FTP Users" description: "If FTP is permitted, set a strong, default file creation mask to apply to files created by the FTP server." rationale: "Many users assume that the FTP server will use their system file creation mask; generally it does not. This setting ensures that files transmitted over FTP use a strong file creation mask." @@ -541,7 +541,7 @@ checks: rules: - 'f:/etc/proftpd.conf -> !r:^# && r:Umask && r:\s*\t*027' - - id: 7040 + - id: 8040 title: "Set \"mesg n\" as Default for All Users" description: "The \"mesg n\" command blocks attempts to use the write or talk commands to contact users at their terminals, but has the side effect of slightly strengthening permissions on the user's tty device." rationale: "Since write and talk are no longer widely used at most sites, the incremental security increase is worth the loss of functionality." @@ -554,7 +554,7 @@ checks: - 'f:/etc/profile -> r:^mesg\s*\t*n' # 8 Warning Banners - - id: 7041 + - id: 8041 title: "Create Warnings for Standard Login Services" description: "The contents of the /etc/issue file are displayed prior to the login prompt on the system's console and serial devices and also prior to logins via telnet and Secure Shell. The contents of the /etc/motd file are generally displayed after all successful logins, regardless from where the user is logging in." rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. As implementing a logon banner to deter inappropriate use and can provide a foundation for legal action against abuse, this warning content should be set as appropriate. Consult with your organization's legal counsel for the appropriate wording as the examples below are for demonstration purposes only." @@ -567,7 +567,7 @@ checks: - 'f:/etc/motd -> r:Authorized users only. All activity may be monitored and reported' - 'c:stat -c%u-%g-%a /etc/issue -> r:^0-0-644' - - id: 7042 + - id: 8042 title: "Enable a Warning Banner for the SSH Service" description: "The contents of the Banner string in the /etc/ssh/sshd_config file are sent to the remote user before authentication is allowed, requiring that the user read the legal caution." remediation: "Perform the following to implement the recommended state: # awk '/^#Banner/ { $1 = \"Banner\" } { print }' /etc/ssh/sshd_config > /etc/ssh/sshd_config.CIS # mv /etc/ssh/sshd_config.CIS /etc/ssh/sshd_config # svcadm restart svc:/network/ssh" @@ -577,7 +577,7 @@ checks: rules: - 'f:/etc/ssh/sshd_config -> !r:^# && r:Banner\s*/etc/issue' - - id: 7043 + - id: 8043 title: "Enable a Warning Banner for the GNOME Service" description: "The GNOME Display Manager is used for login session management. See the manual page gdm(1) for more information on configuration of the settings, which can be user- or group specific." rationale: "The remediation action for this item sets a pre-login warning message for GDM users. Additional methods can be employed to display a similar message to a user post- authentication. For more information, see the Oracle Solaris 11 Security Guidelines document." @@ -589,7 +589,7 @@ checks: - 'f:/etc/gdm/Init/Default' - 'f:/etc/gdm/Init/Default -> r:^/usr/bin/zenity\s\.' - - id: 7044 + - id: 8044 title: "Enable a Warning Banner for the FTP service" description: "The action for this item sets a warning message for FTP users before they log in." rationale: "Warning Banners inform users who are attempting to access the system of their legal status regarding using the system. The text below is a generic sample only, so consult with your organization's legal counsel for the appropriate wording." @@ -600,7 +600,7 @@ checks: rules: - 'f:/etc/proftpd.conf -> !r:^# && r:DisplayConnect\s*\t*/etc/issue' - - id: 7045 + - id: 8045 title: "Check that the Banner Setting for telnet is Null" description: "The BANNER variable in the file /etc/default/telnetd can be used to display text before the telnet login prompt. Traditionally, it has been used to display the OS level of the target system." rationale: "The warning banner provides information that can be used in reconnaissance for an attack. By default, this file is distributed with the BANNER variable set to null. It is not necessary to create a separate warning banner for telnet if a warning is set in the /etc/issue file. As telnet is an insecure protocol, it is strongly recommend that it be disabled and all remote administrative/user connections take place by Secure Shell." @@ -612,10 +612,10 @@ checks: - 'f:/etc/default/telnetd -> !r:^# && r:BANNER\s*\t*=\s*\t*\.' # 9 System Maintenance - - id: 7046 + - id: 8046 title: "Verify System Account Default Passwords" description: "There are a number of accounts provided with the Solaris OS that are used to manage applications and are not intended to provide an interactive shell. These accounts are delivered either in a locked or non-login state. Oracle does not support nor recommend changing the passwords associated with these accounts." - rationale: "System accounts, such as bin, lpd, and sys have special purposes and privileges. By default, these accounts are configured as either locked or non-login. This status should be verified to ensure that these accounts have not accidentially or intentionally been enabled." + rationale: "System accounts, such as bin, lpd, and sys have special purposes and privileges. By default, these accounts are configured as either locked or non-login. This status should be verified to ensure that these accounts have not accidentally or intentionally been enabled." remediation: "To lock a single account, use the command: # passwd -d [username] # passwd -l [username] To configure a single account to be non-login, use the command: # passwd -d [username] # passwd -N [username]" compliance: - cis: ["9.3"] @@ -650,7 +650,7 @@ checks: - 'f:/etc/shadow -> r:^upnp: && !r::NL:|:NP:' - 'f:/etc/shadow -> r:^zfssnap: && !r::NL:|:NP:' - - id: 7047 + - id: 8047 title: "Ensure Password Fields are Not Empty" description: "An account with an empty password field means that anybody may log in as that user without providing a password at all (assuming that the value PASSREQ=NO is set in /etc/default/login)." rationale: "All accounts must have passwords, be configured as \"Non-login,\" or be locked." @@ -661,7 +661,7 @@ checks: rules: - 'f:/etc/shadow -> r:^\w+::' - - id: 7048 + - id: 8048 title: "Verify No UID 0 Accounts Exist Other than root" description: "Any account with UID 0 has superuser rights on the system." rationale: "This access must be limited to only the default root role and be made accessible from the system console only. Administrative access granted to an unprivileged account should use an approved mechanism such as RBAC." @@ -672,7 +672,7 @@ checks: rules: - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' - - id: 7049 + - id: 8049 title: "Ensure root PATH Integrity" description: "The root user can execute any command on the system and could be tricked into executing programs if the PATH is not set correctly." rationale: "Including the current working directory (.) or any other writable directory in root's executable path makes it likely that an attacker can gain superuser access by forcing an administrator operating as root to execute a malcode, such as a Trojan horse program." @@ -691,7 +691,7 @@ checks: - 'f:/root/.profile -> r::$' - 'f:/root/.bashrc -> r::$' - - id: 7050 + - id: 8050 title: "Check That Users Are Assigned Home Directories" description: "passwd(4) defines a home directory that each user is placed in upon login. If there is no defined home directory, a user will be placed in / and will not be able to write any files or have local environment variables set." rationale: "All users must be assigned a home directory in passwd(4)." diff --git a/sca/windows/cis_win10_enterprise_L1.yml b/sca/windows/cis_win10_enterprise.yml similarity index 65% rename from sca/windows/cis_win10_enterprise_L1.yml rename to sca/windows/cis_win10_enterprise.yml index 4d83565b9..5926423eb 100644 --- a/sca/windows/cis_win10_enterprise_L1.yml +++ b/sca/windows/cis_win10_enterprise.yml @@ -1,5 +1,5 @@ # Security Configuration Assessment -# CIS Checks for Windows 10 Enterprise L1 +# CIS Checks for Windows 10 Enterprise # Copyright (C) 2015-2020, Wazuh Inc. # # This program is free software; you can redistribute it @@ -9,25 +9,26 @@ # # Based on: # Center for Internet Security Benchmark v1.5.0 for Microsoft Windows 10 Release 1803 v1.5.0 - 03-06-2019 +# CIS Microsoft Windows 10 Enterprise (Release 1903) Benchmark v1.7.1 - 02-05-2020 policy: - id: "cis_win10_enterprise_L1" - file: "cis_win10_enterprise_L1.yml" - name: "CIS benchmark for Windows 10 Enterprise (Release 1803)" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows (L1)." + id: "cis_win10_enterprise" + file: "cis_win10_enterprise.yml" + name: "CIS Benchmark for Windows 10 Enterprise (Release 1803)" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows." references: - https://www.cisecurity.org/cis-benchmarks/ requirements: title: "Check that the Windows platform is Windows 10" - description: "Requirements for running the CIS benchmark Domain Controller L1 under Windows 10" + description: "Requirements for running the CIS benchmark Domain Controller under Windows 10" condition: all rules: - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows 10' checks: # 2.3 Security Options - - id: 13000 + - id: 15500 title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'" description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably in order to meet the requirements of compliance standards that apply to their information systems." @@ -35,13 +36,15 @@ checks: compliance: - cis: ["2.3.1.2"] - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] references: - 'CCE-35487-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> r:^3$' - - id: 13001 + - id: 15501 title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'" description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domainbased password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." @@ -49,27 +52,35 @@ checks: compliance: - cis: ["2.3.1.4"] - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-32929-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' - - id: 13002 + - id: 15502 title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'" description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled." rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Shut down system immediately if unable to log security audits." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings" compliance: - cis: ["2.3.2.1"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-35533-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' - - id: 13003 + - id: 15503 title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'" description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. The recommended state for this setting is: Disabled." rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." @@ -77,13 +88,14 @@ checks: compliance: - cis: ["2.3.2.2"] - cis_csc: ["6"] + - pci_dss: ["10.7"] references: - 'CCE-33046-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' - - id: 13004 + - id: 15504 title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators and Interactive Users'" description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators and Interactive Users." rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." @@ -91,13 +103,33 @@ checks: compliance: - cis: ["2.3.4.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-34355-8' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 2' + + - id: 15505 + title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'" + description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." + rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, in a high security environment, you should allow only Administrators, not users, to do this, because printer driver installation may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers." + compliance: + - cis: ["2.3.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4","2.2.5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3","CC5.2"] + references: + - 'CCE-33958-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' + - - id: 13005 + - id: 15506 title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'" description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -105,13 +137,17 @@ checks: compliance: - cis: ["2.3.6.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-34892-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' - - id: 13006 + - id: 15507 title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'" description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -119,13 +155,17 @@ checks: compliance: - cis: ["2.3.6.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35273-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' - - id: 13007 + - id: 15508 title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'" description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -133,27 +173,33 @@ checks: compliance: - cis: ["2.3.6.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-34893-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' - - id: 13008 + - id: 15509 title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'" - description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled." + description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that can not automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled. Note: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." remediation: "Remediation: To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Disable machine account password changes." compliance: - cis: ["2.3.6.4"] - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] references: - 'CCE-34986-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' - - id: 13009 + - id: 15510 title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'" description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)" @@ -161,13 +207,17 @@ checks: compliance: - cis: ["2.3.6.6"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35177-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' - - id: 13010 + - id: 15511 title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'" description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." @@ -175,13 +225,19 @@ checks: compliance: - cis: ["2.3.7.1"] - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-35099-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' - - id: 13011 + - id: 15512 title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'" description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit" rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." @@ -189,6 +245,8 @@ checks: compliance: - cis: ["2.3.7.4"] - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] references: - 'CCE-34900-1' condition: all @@ -196,7 +254,24 @@ checks: - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' - - id: 13012 + - id: 15513 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'" + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information. Logon information for domain accounts can be cached locally to allow users to log on even if a Domain Controller cannot be contacted. This policy setting determines the number of unique users for whom logon information is cached locally. If this value is set to 0, the logon cache feature is disabled. An attacker who is able to access the file system of the server could locate this cached information and use a brute force attack to determine user passwords. The recommended state for this setting is: 4 or fewer logon(s)." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally. If the number is set to 4, then the computer caches logon information for 4 users. When a 5th user logs on to the computer, the server overwrites the oldest cached logon session. Users who access the computer console will have their logon credentials cached on that computer. An attacker who is able to access the file system of the computer could locate this cached information and use a brute force attack to attempt to determine user passwords. To mitigate this type of attack, Windows encrypts the information and obscures its physical location." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)" + compliance: + - cis: ["2.3.7.7"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'CCE-34901-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> n:^(\d+) compare <= 4' + + + - id: 15514 title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'" description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." rationale: "Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." @@ -204,13 +279,15 @@ checks: compliance: - cis: ["2.3.7.8"] - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] references: - 'CCE-35274-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare => 5 && n:^(\d+) compare <= 14' - - id: 13013 + - id: 15515 title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher" description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." @@ -218,13 +295,15 @@ checks: compliance: - cis: ["2.3.7.9"] - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] references: - 'CCE-34988-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$' - - id: 13014 + - id: 15516 title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'" description: "This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the \"Microsoft network client and server: Digitally sign communications (four related settings)\" section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -232,13 +311,17 @@ checks: compliance: - cis: ["2.3.8.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35222-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' - - id: 13015 + - id: 15517 title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'" description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -246,13 +329,17 @@ checks: compliance: - cis: ["2.3.8.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-34908-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' - - id: 13016 + - id: 15518 title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'" description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." @@ -260,13 +347,17 @@ checks: compliance: - cis: ["2.3.8.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-33717-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' - - id: 13017 + - id: 15519 title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s)'" description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. A value of 0 appears to allow sessions to persist indefinitely. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s), but not 0." rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." @@ -274,13 +365,15 @@ checks: compliance: - cis: ["2.3.9.1"] - cis_csc: ["3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] references: - 'CCE-34909-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' - - id: 13018 + - id: 15520 title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'" description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -288,13 +381,17 @@ checks: compliance: - cis: ["2.3.9.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35065-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' - - id: 13019 + - id: 15521 title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'" description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -302,13 +399,17 @@ checks: compliance: - cis: ["2.3.9.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35182-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' - - id: 13020 + - id: 15522 title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'" description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." @@ -316,13 +417,15 @@ checks: compliance: - cis: ["2.3.9.4"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-34911-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' - - id: 13021 + - id: 15523 title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher" description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client. Configuring this setting to Required from client also conforms to the benchmark." rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." @@ -330,13 +433,15 @@ checks: compliance: - cis: ["2.3.9.5"] - cis_csc: ["14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-35299-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' - - id: 13022 + - id: 15524 title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'" description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" @@ -344,13 +449,15 @@ checks: compliance: - cis: ["2.3.10.2"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-34631-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' - - id: 13023 + - id: 15525 title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'" description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" @@ -358,13 +465,15 @@ checks: compliance: - cis: ["2.3.10.3"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-34723-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' - - id: 13024 + - id: 15526 title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'" description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." @@ -372,13 +481,14 @@ checks: compliance: - cis: ["2.3.10.4"] - cis_csc: ["16.14"] + - pci_dss: ["3.1"] references: - 'CCE-33718-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' - - id: 13025 + - id: 15527 title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'" description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." @@ -386,13 +496,15 @@ checks: compliance: - cis: ["2.3.10.5"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-35367-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' - - id: 13026 + - id: 15528 title: "Ensure 'Network access: Named Pipes that can be accessed anonymously' is set to 'None'" description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: (i.e. None)." rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." @@ -400,13 +512,16 @@ checks: compliance: - cis: ["2.3.10.6"] - cis_csc: ["14.1", "14.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-34965-4' - condition: all + condition: any rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> None' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:\S+' - - id: 13027 + - id: 15529 title: "Ensure 'Network access: Remotely accessible registry paths'" description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called Network access: Remotely accessible registry paths and subpaths in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2)." rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." @@ -414,13 +529,15 @@ checks: compliance: - cis: ["2.3.10.7"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-33976-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications Software\\Microsoft\\Windows NT\\CurrentVersion' - - id: 13028 + - id: 15530 title: "Ensure 'Network access: Remotely accessible registry paths and sub-paths'" description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called Network access: Remotely accessible registry paths, the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value. The recommended state for this setting is: System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog" rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." @@ -428,13 +545,15 @@ checks: compliance: - cis: ["2.3.10.8"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-35300-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server|Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog' - - id: 13029 + - id: 15531 title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'" description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." @@ -442,13 +561,15 @@ checks: compliance: - cis: ["2.3.10.9"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-33563-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' - - id: 13030 + - id: 15532 title: "Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow'" description: "This policy setting allows you to restrict remote RPC connections to SAM. The recommended state for this setting is: Administrators: Remote Access: Allow. Note: A Windows 10 R1607, Server 2016 or newer OS is required to access and set this value in Group Policy." rationale: "To ensure that an unauthorized user cannot anonymously list local account names or groups and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" @@ -456,11 +577,13 @@ checks: compliance: - cis: ["2.3.10.10"] - cis_csc: ["5.1", "9.1", "9.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> restrictremotesam -> r:O:BAG:BAD:\(A;;RC;;;BA\)' - - id: 13031 + - id: 15533 title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'" description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)." rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data" @@ -468,13 +591,15 @@ checks: compliance: - cis: ["2.3.10.11"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-34651-0' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> None' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> \S+' - - id: 13032 + - id: 15534 title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'" description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)." rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." @@ -482,13 +607,15 @@ checks: compliance: - cis: ["2.3.10.12"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1.3"] + - tsc: ["CC6.4"] references: - 'CCE-33719-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' - - id: 13033 + - id: 15535 title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'" description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." @@ -496,13 +623,17 @@ checks: compliance: - cis: ["2.3.11.1"] - cis_csc: ["14", "16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-33141-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' - - id: 13034 + - id: 15536 title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'" description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." rationale: "NULL sessions are less secure because by definition they are unauthenticated." @@ -510,13 +641,17 @@ checks: compliance: - cis: ["2.3.11.2"] - cis_csc: ["14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35410-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' - - id: 13035 + - id: 15537 title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'" description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called HomeGroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." @@ -524,13 +659,17 @@ checks: compliance: - cis: ["2.3.11.3"] - cis_csc: ["16.9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35411-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' - - id: 13036 + - id: 15538 title: "Ensure 'Network security: Configure encryption types allowed for Kerberos' is set to 'AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'" description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it. For the purposes of scoring we have allowed the use of RC4_HMAC_MD5 as an optional setting" rationale: "The strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." @@ -538,13 +677,17 @@ checks: compliance: - cis: ["2.3.11.4"] - cis_csc: ["16.14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35786-3' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> 2147483644' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:2147483640|2147483644' - - id: 13037 + - id: 15539 title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'" description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." @@ -552,13 +695,15 @@ checks: compliance: - cis: ["2.3.11.5"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-35225-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' - - id: 13038 + - id: 15540 title: "Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'" description: "This policy setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Microsoft network server: Disconnect clients when logon hours expire (Rule 2.3.9.4). The recommended state for this setting is: Enabled. Note: This recommendation is unscored because there is not a documented registry value that corresponds to it. We still strongly encourage that it be configured as Enabled, to ensure that logon hours (when configured) are properly enforced." rationale: "If this setting is disabled, a user could remain connected to the computer outside of their allotted logon hours." @@ -566,13 +711,15 @@ checks: compliance: - cis: ["2.3.11.6"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-34993-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' - - id: 13039 + - id: 15541 title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'" description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: - Join a domain - Authenticate between Active Directory forests - Authenticate to down-level domains - Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP - Authenticate to computers that are not in the domain The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM" rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (nonR2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." @@ -580,13 +727,17 @@ checks: compliance: - cis: ["2.3.11.7"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35302-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' - - id: 13040 + - id: 15542 title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher" description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." @@ -594,13 +745,17 @@ checks: compliance: - cis: ["2.3.11.8"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-33802-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> 1' - - id: 13041 + - id: 15543 title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." @@ -608,13 +763,17 @@ checks: compliance: - cis: ["2.3.11.9"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35447-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' - - id: 13042 + - id: 15544 title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." @@ -622,13 +781,36 @@ checks: compliance: - cis: ["2.3.11.10"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35108-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' - - id: 13043 + + - id: 15545 + title: "Ensure 'System cryptography: Force strong key protection for user keys stored on the computer' is set to 'User is prompted when the key is first used' or higher" + description: "This policy setting determines whether users' private keys (such as their S-MIME keys) require a password to be used. The recommended state for this setting is: User is prompted when the key is first used. Configuring this setting to User must enter a password each time they use a key also conforms to the benchmark." + rationale: "If a user's account is compromised or their computer is inadvertently left unsecured the malicious user can use the keys stored for the user to access protected resources. You can configure this policy setting so that users must provide a password that is distinct from their domain password every time they use a key. This configuration makes it more difficult for an attacker to access locally stored user keys, even if the attacker takes control of the user's computer and determines their logon password." + remediation: "To establish the recommended configuration via GP, set the following UI path to User is prompted when the key is first used (configuring to User must enter a password each time they use a key also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System cryptography: Force strong key protection for user keys stored on the computer." + compliance: + - cis: ["2.3.14.1"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-35007-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography -> ForceKeyProtection -> n:^(\d+) compare >= 1' + + + + - id: 15546 title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'" description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." @@ -641,7 +823,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' - - id: 13044 + - id: 15547 title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'" description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." @@ -649,13 +831,15 @@ checks: compliance: - cis: ["2.3.15.2"] - cis_csc: ["14.4", "14.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-35232-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' - - id: 13045 + - id: 15548 title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'" description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named Administrator because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. - If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." @@ -663,117 +847,122 @@ checks: compliance: - cis: ["2.3.17.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-35338-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' - - id: 13046 - title: "Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled'" - description: "This policy setting controls whether User Interface Accessibility (UIAccess or UIA) programs can automatically disable the secure desktop for elevation prompts used by a standard user. The recommended state for this setting is: Disabled." - rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting allows the administrator to perform operations that require elevated privileges while connected via Remote Assistance. This increases security in that organizations can use UAC even when end user support is provided remotely. However, it also reduces security by adding the risk that an administrator might allow an unprivileged user to share elevated privileges for an application that the administrator needs to use during the Remote Desktop session." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop." - compliance: - - cis: ["2.3.17.2"] - - cis_csc: ["16"] - references: - - 'CCE-35458-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableUIADesktopToggle -> 0' - - id: 13047 + - id: 15549 title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'" description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop." rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." remediation: "To establish the recommended configuration via GP, set the following UI path to Prompt for consent on the secure desktop: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode." compliance: - - cis: ["2.3.17.3"] + - cis: ["2.3.17.2"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-33784-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> 2' - - id: 13048 + - id: 15550 title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'" description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." remediation: "To establish the recommended configuration via GP, set the following UI path to Automatically deny elevation requests: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for standard users." compliance: - - cis: ["2.3.17.4"] + - cis: ["2.3.17.3"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-33785-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' - - id: 13049 + - id: 15551 title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'" description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Detect application installations and prompt for elevation." compliance: - - cis: ["2.3.17.5"] + - cis: ["2.3.17.4"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-35429-0' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' - - id: 13050 + - id: 15552 title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'" description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: - …\\Program Files\\, including subfolders - …\\Windows\\system32\\ - …\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows) Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: - To set the foreground window. - To drive any application window using SendInput function. - To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. - To set journal hooks. - To uses AttachThreadInput to attach a thread to a higher integrity input queue." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations." compliance: - - cis: ["2.3.17.6"] + - cis: ["2.3.17.5"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-35401-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' - - id: 13051 + - id: 15553 title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'" description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Run all administrators in Admin Approval Mode." compliance: - - cis: ["2.3.17.7"] + - cis: ["2.3.17.6"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-33788-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' - - id: 13052 + - id: 15554 title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'" description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Switch to the secure desktop when prompting for elevation." compliance: - - cis: ["2.3.17.8"] + - cis: ["2.3.17.7"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-33815-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' - - id: 13053 + - id: 15555 title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'" description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %Windir% - %Windir%\\system32 - HKEY_LOCAL_MACHINE\\Software The recommended state for this setting is: Enabled." rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations." compliance: - - cis: ["2.3.17.9"] + - cis: ["2.3.17.8"] + - pci_dss: ["6.5.8"] + - tsc: ["CC6.1"] references: - 'CCE-35459-7' condition: all @@ -781,7 +970,41 @@ checks: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' # 5 System Services - - id: 13054 + + + - id: 15556 + title: "Ensure 'Bluetooth Audio Gateway Service (BTAGService)' is set to 'Disabled'" + description: "Service supporting the audio gateway role of the Bluetooth Handsfree Profile. The recommended state for this setting is: Disabled." + rationale: "Bluetooth technology has inherent security risks - especially prior to the v2.1 standard. Wireless Bluetooth traffic is not well encrypted (if at all), so in a high-security environment, it should not be permitted, in spite of the added inconvenience of not being able to use Bluetooth devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Bluetooth Audio Gateway Service Note: This service was first introduced in Windows 10 Release 1803. It appears to have replaced the older Bluetooth Handsfree Service (BthHFSrv), which was removed from Windows in that release (it is not simply a rename, but a different service)." + compliance: + - cis: ["5.1"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTAGService -> Start -> 4' + + + + + - id: 15557 + title: "Ensure 'Bluetooth Support Service (bthserv)' is set to 'Disabled'" + description: "The Bluetooth service supports discovery and association of remote Bluetooth devices. The recommended state for this setting is: Disabled." + rationale: "Bluetooth technology has inherent security risks - especially prior to the v2.1 standard. Wireless Bluetooth traffic is not well encrypted (if at all), so in a high-security environment, it should not be permitted, in spite of the added inconvenience of not being able to use Bluetooth devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Bluetooth Support Service" + compliance: + - cis: ["5.2"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\bthserv -> Start -> 4' + + + - id: 15558 title: "Ensure 'Computer Browser (Browser)' is set to 'Disabled' or 'Not Installed'" description: "Maintains an updated list of computers on the network and supplies this list to computers designated as browsers. The recommended state for this setting is: Disabled or Not Installed. Note: In Windows 8.1 and Windows 10, this service is bundled with the SMB 1.0/CIFS File Sharing Support optional feature. As a result, removing that feature (highly recommended unless backward compatibility is needed to XP/2003 and older Windows OSes - see Stop using SMB1 | Storage at Microsoft) will also remediate this recommendation. The feature is not installed by default starting with Windows 10 R1709." rationale: "This is a legacy service - its sole purpose is to maintain a list of computers and their network shares in the environment (i.e. \"Network Neighborhood\"). If enabled, it generates a lot of unnecessary traffic, including \"elections\" to see who gets to be the \"master browser\". This noisy traffic could also aid malicious attackers in discovering online machines, because the service also allows anyone to \"browse\" for shared resources without any authentication. This service used to be running by default in older Windows versions (e.g. Windows XP), but today it only remains for backward compatibility for very old software that requires it." @@ -789,12 +1012,44 @@ checks: compliance: - cis: ["5.3"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: any rules: - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser' - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser -> Start -> 4' - - id: 13055 + + - id: 15559 + title: "Ensure 'Downloaded Maps Manager (MapsBroker)' is set to 'Disabled'" + description: "Windows service for application access to downloaded maps. This service is started on- demand by application accessing downloaded maps." + rationale: "Mapping technologies can unwillingly reveal your location to attackers and other software that picks up the information. In addition, automatic downloads of data from 3rd-party sources should be minimized when not needed. Therefore this service should not be needed in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Downloaded Maps Manager" + compliance: + - cis: ["5.4"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MapsBroker -> Start -> 4' + + - id: 15560 + title: "Ensure 'Geolocation Service (lfsvc)' is set to 'Disabled'" + description: "This service monitors the current location of the system and manages geofences (a geographical location with associated events). The recommended state for this setting is: Disabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Geolocation Service" + compliance: + - cis: ["5.5"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lfsvc -> Start -> 4' + + + - id: 15561 title: "Ensure 'IIS Admin Service (IISADMIN)' is set to 'Disabled' or 'Not Installed'" description: "Enables the server to administer the IIS metabase. The IIS metabase stores configuration for the SMTP and FTP services. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services). Note #2: An organization may choose to selectively grant exceptions to web developers to allow IIS (or another web server) on their workstation, in order for them to locally test & develop web pages. However, the organization should track those machines and ensure the security controls and mitigations are kept up to date, to reduce risk of compromise." rationale: "Hosting a website from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. If proper security mitigations are not followed, the chance of successful attack increases significantly. Note: This security concern applies to any web server application installed on a workstation, not just IIS." @@ -802,12 +1057,14 @@ checks: compliance: - cis: ["5.6"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: any rules: - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IISADMIN' - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IISADMIN -> Start -> 4' - - id: 13056 + - id: 15562 title: "Ensure 'Infrared monitor service (irmon)' is set to 'Disabled'" description: "Detects other Infrared devices that are in range and launches the file transfer application. The recommended state for this setting is: Disabled." rationale: "Infrared connections can potentially be a source of data compromise - especially via the automatic \"file transfer application\" functionality. Enterprise-managed systems should utilize a more secure method of connection than infrared." @@ -815,11 +1072,13 @@ checks: compliance: - cis: ["5.7"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\irmon -> Start -> 4' - - id: 13057 + - id: 15563 title: "Ensure 'Internet Connection Sharing (ICS) (SharedAccess) ' is set to 'Disabled'" description: "Provides network access translation, addressing, name resolution and/or intrusion prevention services for a home or small office network. The recommended state for this setting is: Disabled." rationale: "Internet Connection Sharing (ICS) is a feature that allows someone to \"share\" their Internet connection with other machines on the network - it was designed for home or small office environments where only one machine has Internet access - it effectively turns that machine into an Internet router. This feature causes the bridging of networks and likely bypassing other, more secure pathways. It should not be used on any enterprise-managed system." @@ -827,11 +1086,29 @@ checks: compliance: - cis: ["5.8"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess -> Start -> 4' - - id: 13058 + + - id: 15564 + title: "Ensure 'Link-Layer Topology Discovery Mapper (lltdsvc)' is set to 'Disabled'" + description: "Creates a Network Map, consisting of PC and device topology (connectivity) information, and metadata describing each PC and device. The recommended state for this setting is: Disabled." + rationale: "The feature that this service enables could potentially be used for unauthorized discovery and connection to network devices. Disabling the service helps to prevent responses to requests for network topology discovery in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Link-Layer Topology Discovery Mapper" + compliance: + - cis: ["5.9"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lltdsvc -> Start -> 4' + + + - id: 15565 title: "Ensure 'LxssManager (LxssManager)' is set to 'Disabled' or 'Not Installed'" description: "The LXSS Manager service supports running native ELF binaries. The service provides the infrastructure necessary for ELF binaries to run on Windows. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Windows Subsystem for Linux)." rationale: "The Linux SubSystem (LXSS) Manager allows full system access to Linux applications on Windows, including the file system. While this can certainly have some functionality and performance benefits for running those applications, it also creates new security risks in the event that a hacker injects malicious code into a Linux application. For best security, it is preferred to run Linux applications on Linux, and Windows applications on Windows." @@ -839,12 +1116,14 @@ checks: compliance: - cis: ["5.10"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: any rules: - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager' - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager -> Start -> 4' - - id: 13059 + - id: 15566 title: "Ensure 'Microsoft FTP Service (FTPSVC)' is set to 'Disabled' or 'Not Installed'" description: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\LxssManager" rationale: "Hosting an FTP server (especially a non-secure FTP server) from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. Note: This security concern applies to any FTP server application installed on a workstation, not just IIS." @@ -852,12 +1131,157 @@ checks: compliance: - cis: ["5.11"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: any rules: - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTPSVC' - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTPSVC -> Start -> 4' - - id: 13060 + + + - id: 15567 + title: "Ensure 'Microsoft iSCSI Initiator Service (MSiSCSI)' is set to 'Disabled'" + description: "Manages Internet SCSI (iSCSI) sessions from this computer to remote target devices. The recommended state for this setting is: Disabled." + rationale: "This service is critically necessary in order to directly attach to an iSCSI device. However, iSCSI itself uses a very weak authentication protocol (CHAP), which means that the passwords for iSCSI communication are easily exposed, unless all of the traffic is isolated and/or encrypted using another technology like IPsec. This service is generally more appropriate for servers in a controlled environment then on workstations requiring high security." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Microsoft iSCSI Initiator Service" + compliance: + - cis: ["5.12"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSiSCSI -> Start -> 4' + + - id: 15568 + title: "Ensure 'Peer Name Resolution Protocol (PNRPsvc)' is set to 'Disabled'" + description: "Enables serverless peer name resolution over the Internet using the Peer Name Resolution Protocol (PNRP). The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Name Resolution Protocol" + compliance: + - cis: ["5.15"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PNRPsvc -> Start -> 4' + + - id: 15569 + title: "Ensure 'Peer Networking Grouping (p2psvc)' is set to 'Disabled'" + description: "Enables multi-party communication using Peer-to-Peer Grouping. The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Networking Grouping" + compliance: + - cis: ["5.16"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\p2psvc -> Start -> 4' + + - id: 15570 + title: "Ensure 'Peer Networking Identity Manager (p2pimsvc)' is set to 'Disabled'" + description: "Provides identity services for the Peer Name Resolution Protocol (PNRP) and Peer-to-Peer Grouping services. The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Networking Identity Manager" + compliance: + - cis: ["5.17"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\p2pimsvc -> Start -> 4' + + - id: 15571 + title: "Ensure 'PNRP Machine Name Publication Service (PNRPAutoReg)' is set to 'Disabled'" + description: "This service publishes a machine name using the Peer Name Resolution Protocol. Configuration is managed via the netsh context ‘p2p pnrp peer'. The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\PNRP Machine Name Publication Service" + compliance: + - cis: ["5.18"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PNRPAutoReg -> Start -> 4' + + - id: 15572 + title: "Ensure 'Problem Reports and Solutions Control Panel Support (wercplsupport)' is set to 'Disabled'" + description: "This service provides support for viewing, sending and deletion of system-level problem reports for the Problem Reports and Solutions control panel. The recommended state for this setting is: Disabled." + rationale: "This service is involved in the process of displaying/reporting issues & solutions to/from Microsoft. In a high security environment, preventing this information from being sent can help reduce privacy concerns for sensitive corporate information." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Problem Reports and Solutions Control Panel Support" + compliance: + - cis: ["5.19"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wercplsupport -> Start -> 4' + + - id: 15573 + title: "Ensure 'Remote Access Auto Connection Manager (RasAuto)' is set to 'Disabled'" + description: "Creates a connection to a remote network whenever a program references a remote DNS or NetBIOS name or address." + rationale: "The function of this service is to provide a \"demand dial\" type of functionality. In a high security environment, it is preferred that any remote \"dial\" connections (whether they be legacy dial-in POTS or VPN) are initiated by the user, not automatically by the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Access Auto Connection Manager" + compliance: + - cis: ["5.20"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasAuto -> Start -> 4' + + - id: 15574 + title: "Ensure 'Remote Desktop Configuration (SessionEnv)' is set to 'Disabled'" + description: "Remote Desktop Configuration service (RDCS) is responsible for all Remote Desktop related configuration and session maintenance activities that require SYSTEM context. These include per-session temporary folders, RD themes, and RD certificates. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, Remote Desktop access is an increased security risk. For these environments, only local console access should be permitted." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Configuration" + compliance: + - cis: ["5.21"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SessionEnv -> Start -> 4' + + - id: 15575 + title: "Ensure 'Remote Desktop Services (TermService)' is set to 'Disabled'" + description: "Allows users to connect interactively to a remote computer. Remote Desktop and Remote Desktop Session Host Server depend on this service. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, Remote Desktop access is an increased security risk. For these environments, only local console access should be permitted." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Services" + compliance: + - cis: ["5.22"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService -> Start -> 4' + + - id: 15576 + title: "Ensure 'Remote Desktop Services UserMode Port Redirector (UmRdpService)' is set to 'Disabled'" + description: "Allows the redirection of Printers/Drives/Ports for RDP connections. The recommended state for this setting is: Disabled." + rationale: "In a security-sensitive environment, it is desirable to reduce the possible attack surface - preventing the redirection of COM, LPT and PnP ports will reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer within an RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Services UserMode Port Redirector" + compliance: + - cis: ["5.23"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UmRdpService -> Start -> 4' + + + - id: 15577 title: "Ensure 'Remote Procedure Call (RPC) Locator (RpcLocator)' is set to 'Disabled'" description: "In Windows 2003 and older versions of Windows, the Remote Procedure Call (RPC) Locator service manages the RPC name service database. In Windows Vista and newer versions of Windows, this service does not provide any functionality and is present for application compatibility. The recommended state for this setting is: Disabled." rationale: "This is a legacy service that has no value or purpose other than application compatibility for very old software. It should be disabled unless there is a specific old application still in use on the system that requires it." @@ -865,11 +1289,28 @@ checks: compliance: - cis: ["5.24"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RpcLocator -> Start -> 4' - - id: 13061 + - id: 15578 + title: "Ensure 'Remote Registry (RemoteRegistry)' is set to 'Disabled'" + description: "Enables remote users to modify registry settings on this computer. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, exposing the registry to remote access is an increased security risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Registry" + compliance: + - cis: ["5.25"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteRegistry -> Start -> 4' + + + - id: 15579 title: "Ensure 'Routing and Remote Access (RemoteAccess)' is set to 'Disabled'" description: "Offers routing services to businesses in local area and wide area network environments. The recommended state for this setting is: Disabled." rationale: "This service's main purpose is to provide Windows router functionality - this is not an appropriate use of workstations in an enterprise managed environment." @@ -877,11 +1318,29 @@ checks: compliance: - cis: ["5.26"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteAccess -> Start -> 4' - - id: 13062 + + - id: 15580 + title: "Ensure 'Server (LanmanServer)' is set to 'Disabled'" + description: "Supports file, print, and named-pipe sharing over the network for this computer. If this service is stopped, these functions will be unavailable. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, a secure workstation should only be a client, not a server. Sharing workstation resources for remote access increases security risk as the attack surface is notably higher." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Server" + compliance: + - cis: ["5.27"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer -> Start -> 4' + + + - id: 15581 title: "Ensure 'Simple TCP/IP Services (simptcp)' is set to 'Disabled' or 'Not Installed'" description: "Supports the following TCP/IP services: Character Generator, Daytime, Discard, Echo, and Quote of the Day. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Simple TCPIP services (i.e. echo, daytime etc))." rationale: "The Simple TCP/IP Services have very little purpose in a modern enterprise environment - allowing them might increase exposure and risk for attack." @@ -889,12 +1348,30 @@ checks: compliance: - cis: ["5.28"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: any rules: - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\simptcp' - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\simptcp -> Start -> 4' - - id: 13063 + - id: 15582 + title: "Ensure 'SNMP Service (SNMP)' is set to 'Disabled' or 'Not Installed'" + description: "Enables Simple Network Management Protocol (SNMP) requests to be processed by this computer. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Simple Network Management Protocol (SNMP))." + rationale: "Features that enable inbound network connections increase the attack surface. In a high security environment, management of secure workstations should be handled locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\SNMP Service" + compliance: + - cis: ["5.29"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP -> Start -> 4' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP' + + + - id: 15583 title: "Ensure 'SSDP Discovery (SSDPSRV)' is set to 'Disabled'" description: "Discovers networked devices and services that use the SSDP discovery protocol, such as UPnP devices. Also announces SSDP devices and services running on the local computer. The recommended state for this setting is: Disabled." rationale: "Universal Plug n Play (UPnP) is a real security risk - it allows automatic discovery and attachment to network devices. Notes that UPnP is different than regular Plug n Play (PnP). Workstations should not be advertising their services (or automatically discovering and connecting to networked services) in a security-conscious enterprise managed environment." @@ -902,11 +1379,13 @@ checks: compliance: - cis: ["5.30"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SSDPSRV -> Start -> 4' - - id: 13064 + - id: 15584 title: "Ensure 'UPnP Device Host (upnphost)' is set to 'Disabled'" description: "Allows UPnP devices to be hosted on this computer. The recommended state for this setting is: Disabled." rationale: "Universal Plug n Play (UPnP) is a real security risk - it allows automatic discovery and attachment to network devices. Notes that UPnP is different than regular Plug n Play (PnP). Workstations should not be advertising their services (or automatically discovering and connecting to networked services) in a security-conscious enterprise managed environment." @@ -914,11 +1393,13 @@ checks: compliance: - cis: ["5.31"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\upnphost -> Start -> 4' - - id: 13065 + - id: 15585 title: "Ensure 'Web Management Service (WMSvc)' is set to 'Disabled' or 'Not Installed'" description: "The Web Management Service enables remote and delegated management capabilities for administrators to manage for the Web server, sites and applications present on the machine. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services - Web Management Tools - IIS Management Service)." rationale: "Remote web administration of IIS on a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. If proper security mitigations are not followed, the chance of successful attack increases significantly." @@ -926,12 +1407,44 @@ checks: compliance: - cis: ["5.32"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: any rules: - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMSvc' - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMSvc -> Start -> 4' - - id: 13066 + + - id: 15586 + title: "Ensure 'Windows Error Reporting Service (WerSvc)' is set to 'Disabled'" + description: "Allows errors to be reported when programs stop working or responding and allows existing solutions to be delivered. Also allows logs to be generated for diagnostic and repair services. The recommended state for this setting is: Disabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Error Reporting Service" + compliance: + - cis: ["5.33"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WerSvc -> Start -> 4' + + - id: 15587 + title: "Ensure 'Windows Event Collector (Wecsvc)' is set to 'Disabled'" + description: "This service manages persistent subscriptions to events from remote sources that support WS-Management protocol. This includes Windows Vista event logs, hardware and IPMI- enabled event sources. The service stores forwarded events in a local Event Log. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, remote connections to secure workstations should be minimized, and management functions should be done locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Event Collector" + compliance: + - cis: ["5.34"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Wecsvc -> Start -> 4' + + + - id: 15588 title: "Ensure 'Windows Media Player Network Sharing Service (WMPNetworkSvc)' is set to 'Disabled' or 'Not Installed'" description: "Shares Windows Media Player libraries to other networked players and media devices using Universal Plug and Play. The recommended state for this setting is: Disabled or Not Installed" rationale: "Network sharing of media from Media Player has no place in an enterprise managed environment." @@ -939,12 +1452,14 @@ checks: compliance: - cis: ["5.35"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: any rules: - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMPNetworkSvc' - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMPNetworkSvc -> Start -> 4' - - id: 13067 + - id: 15589 title: "Ensure 'Windows Mobile Hotspot Service (icssvc)' is set to 'Disabled'" description: "Provides the ability to share a cellular data connection with another device. The recommended state for this setting is: Disabled." rationale: "The capability to run a mobile hotspot from a domain-connected computer could easily expose the internal network to wardrivers or other hackers." @@ -952,11 +1467,58 @@ checks: compliance: - cis: ["5.36"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\icssvc -> Start -> 4' - - id: 13068 + + + - id: 15590 + title: "Ensure 'Windows Push Notifications System Service (WpnService)' is set to 'Disabled'" + description: "This service runs in session 0 and hosts the notification platform and connection provider which handles the connection between the device and WNS server. The recommended state for this setting is: Disabled. Note: In the first two releases of Windows 10 (R1507 & R1511), the display name of this service was initially named Windows Push Notifications Service - but it was renamed to Windows Push Notifications System Service starting with Windows 10 R1607." + rationale: "Windows Push Notification Services (WNS) is a mechanism to receive 3rd-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Push Notifications System Service" + compliance: + - cis: ["5.37"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WpnService -> Start -> 4' + + - id: 15591 + title: "Ensure 'Windows PushToInstall Service (PushToInstall)' is set to 'Disabled'" + description: "This service manages Apps that are pushed to the device from the Windows Store App running on other devices or the web. The recommended state for this setting is: Disabled." + rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows PushToInstall Service (PushToInstall)" + compliance: + - cis: ["5.38"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PushToInstall -> Start -> 4' + + - id: 15592 + title: "Ensure 'Windows Remote Management (WS-Management) (WinRM)' is set to 'Disabled'" + description: "Windows Remote Management (WinRM) service implements the WS-Management protocol for remote management. WS-Management is a standard web services protocol used for remote software and hardware management. The WinRM service listens on the network for WS-Management requests and processes them. The recommended state for this setting is: Disabled." + rationale: "Features that enable inbound network connections increase the attack surface. In a high security environment, management of secure workstations should be handled locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Remote Management (WS-Management)" + compliance: + - cis: ["5.39"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinRM -> Start -> 4' + + + - id: 15593 title: "Ensure 'World Wide Web Publishing Service (W3SVC)' is set to 'Disabled' or 'Not Installed'" description: "Provides Web connectivity and administration through the Internet Information Services Manager. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services - World Wide Web Services). Note #2: An organization may choose to selectively grant exceptions to web developers to allow IIS (or another web server) on their workstation, in order for them to locally test & develop web pages. However, the organization should track those machines and ensure the security controls and mitigations are kept up to date, to reduce risk of compromise." rationale: "Hosting a website from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. If proper security mitigations are not followed, the chance of successful attack increases significantly. Note: This security concern applies to any web server application installed on a workstation, not just IIS." @@ -964,12 +1526,14 @@ checks: compliance: - cis: ["5.40"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: any rules: - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC' - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC -> Start -> 4' - - id: 13069 + - id: 15594 title: "Ensure 'Xbox Accessory Management Service (XboxGipSvc)' is set to 'Disabled'" description: "This service manages connected Xbox Accessories. The recommended state for this setting is: Disabled." rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." @@ -977,60 +1541,56 @@ checks: compliance: - cis: ["5.41"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XboxGipSvc -> Start -> 4' - - id: 13070 - title: "Ensure 'Xbox Game Monitoring (xbgm)' is set to 'Disabled'" - description: "This service supports Xbox Game Monitoring. The recommended state for this setting is: Disabled." - rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Game Monitoring" - compliance: - - cis: ["5.42"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\xbgm -> Start -> 4' - - - id: 13071 + - id: 15595 title: "Ensure 'Xbox Live Auth Manager (XblAuthManager)' is set to 'Disabled'" description: "Provides authentication and authorization services for interacting with Xbox Live. The recommended state for this setting is: Disabled." rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Live Auth Manager" compliance: - - cis: ["5.43"] + - cis: ["5.42"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XblAuthManager -> Start -> 4' - - id: 13072 + - id: 15596 title: "Ensure 'Xbox Live Game Save (XblGameSave)' is set to 'Disabled'" description: "This service syncs save data for Xbox Live save enabled games. The recommended state for this setting is: Disabled." rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Live Game Save" compliance: - - cis: ["5.44"] + - cis: ["5.43"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XblGameSave -> Start -> 4' - - id: 13073 + - id: 15597 title: "Ensure 'Xbox Live Networking Service (XboxNetApiSvc)' is set to 'Disabled'" description: "This service supports the Windows.Networking.XboxLive application programming interface. The recommended state for this setting is: Disabled." rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Live Networking Service" compliance: - - cis: ["5.45"] + - cis: ["5.44"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XboxNetApiSvce -> Start -> 4' # 9 Windows Firewall with Advanced Security - - id: 13074 + - id: 15598 title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -1038,13 +1598,15 @@ checks: compliance: - cis: ["9.1.1"] - cis_csc: ["9.2", "9.4"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-33160-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' - - id: 13075 + - id: 15599 title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'" description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -1052,13 +1614,15 @@ checks: compliance: - cis: ["9.1.2"] - cis_csc: ["9.2", "9.4"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-33063-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' - - id: 13076 + - id: 15600 title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'" description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." @@ -1066,26 +1630,30 @@ checks: compliance: - cis: ["9.1.3"] - cis_csc: ["9.2", "9.4"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-33098-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' - - id: 13077 + - id: 15601 title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'" description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification" compliance: - cis: ["9.1.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-33062-1' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' - - id: 13078 + - id: 15602 title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log'" description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log" rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1093,13 +1661,19 @@ checks: compliance: - cis: ["9.1.5"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-34176-8' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' - - id: 13079 + - id: 15603 title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16,384 KB or greater'" description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1107,13 +1681,19 @@ checks: compliance: - cis: ["9.1.6"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35083-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' - - id: 13080 + - id: 15604 title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1121,13 +1701,19 @@ checks: compliance: - cis: ["9.1.7"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35252-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' - - id: 13081 + - id: 15605 title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1135,13 +1721,19 @@ checks: compliance: - cis: ["9.1.8"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35306-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' - - id: 13082 + - id: 15606 title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -1149,13 +1741,15 @@ checks: compliance: - cis: ["9.2.1"] - cis_csc: ["9.2", "9.4"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-33066-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' - - id: 13083 + - id: 15607 title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'" description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -1163,13 +1757,15 @@ checks: compliance: - cis: ["9.2.2"] - cis_csc: ["9.2", "9.4"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-33161-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' - - id: 13084 + - id: 15608 title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'" description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." @@ -1177,26 +1773,30 @@ checks: compliance: - cis: ["9.2.3"] - cis_csc: ["9.2", "9.4"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-33162-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' - - id: 13085 + - id: 15609 title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'" description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification" compliance: - cis: ["9.2.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-33065-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' - - id: 13086 + - id: 15610 title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log'" description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1204,13 +1804,19 @@ checks: compliance: - cis: ["9.2.5"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-33437-5' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' - - id: 13087 + - id: 15611 title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16,384 KB or greater'" description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1218,13 +1824,19 @@ checks: compliance: - cis: ["9.2.6"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-34356-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' - - id: 13088 + - id: 15612 title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1232,13 +1844,19 @@ checks: compliance: - cis: ["9.2.7"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-33436-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' - - id: 13089 + - id: 15613 title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1246,13 +1864,19 @@ checks: compliance: - cis: ["9.2.8"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-34177-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' - - id: 13090 + - id: 15614 title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service" @@ -1260,13 +1884,15 @@ checks: compliance: - cis: ["9.3.1"] - cis_csc: ["9.2", "9.4"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-35703-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' - - id: 13091 + - id: 15615 title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'" description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -1274,13 +1900,15 @@ checks: compliance: - cis: ["9.3.2"] - cis_csc: ["9.2", "9.4"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-33069-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' - - id: 13092 + - id: 15616 title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'" description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." @@ -1288,26 +1916,30 @@ checks: compliance: - cis: ["9.3.3"] - cis_csc: ["9.2", "9.4"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-33070-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' - - id: 13093 + - id: 15617 title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'" description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No" rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification" compliance: - cis: ["9.3.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-33068-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' - - id: 13094 + - id: 15618 title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'" description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." rationale: "When in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." @@ -1315,13 +1947,15 @@ checks: compliance: - cis: ["9.3.5"] - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-35537-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' - - id: 13095 + - id: 15619 title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'" description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." @@ -1329,13 +1963,15 @@ checks: compliance: - cis: ["9.3.6"] - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-33099-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' - - id: 13096 + - id: 15620 title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log'" description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1343,13 +1979,19 @@ checks: compliance: - cis: ["9.3.7"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35117-1' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' - - id: 13097 + - id: 15621 title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16,384 KB or greater'" description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1357,13 +1999,19 @@ checks: compliance: - cis: ["9.3.8"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35421-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' - - id: 13098 + - id: 15622 title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1371,13 +2019,19 @@ checks: compliance: - cis: ["9.3.9"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35116-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' - - id: 13099 + - id: 15623 title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1385,6 +2039,12 @@ checks: compliance: - cis: ["9.3.10"] - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-33734-5' condition: all @@ -1392,47 +2052,67 @@ checks: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' # 18 Administrative templates (Computer) - - id: 13100 + - id: 15624 title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'" description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera" compliance: - cis: ["18.1.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-35799-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' - - id: 13101 + - id: 15625 title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'" description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show" compliance: - cis: ["18.1.1.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-35800-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' - - id: 13102 - title: "Ensure 'Allow input personalization' is set to 'Disabled'" + - id: 15626 + title: "Ensure 'Allow users to enable online speech recognition services' is set to 'Disabled'" description: "This policy enables the automatic learning component of input personalization that includes speech, inking, and typing. Automatic learning enables the collection of speech and handwriting patterns, typing history, contacts, and recent calendar information. It is required for the use of Cortana. Some of this collected information may be stored on the user's OneDrive, in the case of inking and typing; some of the information will be uploaded to Microsoft to personalize speech. The recommended state for this setting is: Disabled." rationale: "If this setting is Enabled sensitive information could be stored in the cloud or sent to Microsoft." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Regional and Language Options\\Allow input personalization" + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow users to enable online speech recognition services" compliance: - cis: ["18.1.2.2"] - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-41387-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization -> 0' - - id: 13103 + - id: 15627 + title: "Ensure 'Allow Online Tips' is set to 'Disabled'" + description: "This policy setting configures the retrieval of online tips and help for the Settings app. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow Online Tips Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanel.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["1.3.4"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips -> 0' + + - id: 15628 title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1440,11 +2120,14 @@ checks: compliance: - cis: ["18.2.1"] - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName -> C:\\Program Files\\LAPS\\CSE\\AdmPwd.dll' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' - - id: 13104 + - id: 15629 title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1452,11 +2135,13 @@ checks: compliance: - cis: ["18.2.2"] - cis_csc: ["16.2", "16.10"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' - - id: 13105 + - id: 15630 title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1464,11 +2149,13 @@ checks: compliance: - cis: ["18.2.3"] - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' - - id: 13106 + - id: 15631 title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1476,11 +2163,13 @@ checks: compliance: - cis: ["18.2.4"] - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' - - id: 13107 + - id: 15632 title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1488,11 +2177,13 @@ checks: compliance: - cis: ["18.2.5"] - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' - - id: 13108 + - id: 15633 title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1500,11 +2191,13 @@ checks: compliance: - cis: ["18.2.6"] - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' - - id: 13109 + - id: 15634 title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled'" description: "This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1." rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." @@ -1512,13 +2205,15 @@ checks: compliance: - cis: ["18.3.1"] - cis_csc: ["5.8", "4.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-35486-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 0' - - id: 13110 + - id: 15635 title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver'" description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service (MRxSmb10), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver. Note: Do not, under any circumstances, configure this overall setting as Disabled, as doing so will delete the underlying registry entry altogether, which will cause serious problems." rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." @@ -1526,11 +2221,13 @@ checks: compliance: - cis: ["18.3.2"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 4' - - id: 13111 + - id: 15636 title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'" description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled." rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." @@ -1538,11 +2235,13 @@ checks: compliance: - cis: ["18.3.3"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' - - id: 13112 + - id: 15637 title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'" description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled." rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." @@ -1550,23 +2249,31 @@ checks: compliance: - cis: ["18.3.4"] - cis_csc: ["8.4", "8.3"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' - - id: 13113 - title: "Ensure 'Turn on Windows Defender protection against Potentially Unwanted Applications' is set to 'Enabled'" - description: "Enabling this Windows Defender feature will protect against Potentially Unwanted Applications (PUA), which are sneaky unwanted application bundlers or their bundled applications to deliver adware or malware." - rationale: "This opt-in feature is free and could prevent malicious software from being installed." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Turn on Windows Defender protection against Potentially Unwanted Applications." + - id: 15638 + title: "Ensure 'NetBT NodeType configuration' is set to 'Enabled: P-node (recommended)'" + description: "This setting determines which method NetBIOS over TCP/IP (NetBT) uses to register and resolve names. The available methods are: The B-node (broadcast) method only uses broadcasts. The P-node (point-to-point) method only uses name queries to a name server (WINS). The M-node (mixed) method broadcasts first, then queries a name server (WINS) if broadcast failed. The H-node (hybrid) method queries a name server (WINS) first, then broadcasts if the query failed. The recommended state for this setting is: Enabled: P-node (recommended) (point-to- point). Note: Resolution through LMHOSTS or DNS follows these methods. If the NodeType registry value is present, it overrides any DhcpNodeType registry value. If neither NodeType nor DhcpNodeType is present, the computer uses B-node (broadcast) if there are no WINS servers configured for the network, or H-node (hybrid) if there is at least one WINS server configured." + rationale: "In order to help mitigate the risk of NetBIOS Name Service (NBT-NS) poisoning attacks, setting the node type to P-node (point-to-point) will prevent the system from sending out NetBIOS broadcasts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: P-node (recommended) : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\NetBT NodeType configuration" compliance: - cis: ["18.3.5"] - - cis_csc: ["8.4", "8.3"] + - cis_csc: ["9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> MpEnablePus -> 1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NodeType -> 2' - - id: 13114 + - id: 15639 title: "Ensure 'WDigest Authentication' is set to 'Disabled'" description: "When WDigest authentication is enabled, Lsass.exe retains a copy of the user's plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server." rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." @@ -1574,13 +2281,15 @@ checks: compliance: - cis: ["18.3.6"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-35815-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' - - id: 13115 + - id: 15640 title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'" description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group." rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." @@ -1588,13 +2297,15 @@ checks: compliance: - cis: ["18.4.1"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-35438-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' - - id: 13116 + - id: 15641 title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes" @@ -1602,13 +2313,17 @@ checks: compliance: - cis: ["18.4.2"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["A1.1","CC6.1","CC7.2"] references: - 'CCE-33790-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' - - id: 13117 + - id: 15642 title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." @@ -1616,13 +2331,34 @@ checks: compliance: - cis: ["18.4.3"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["A1.1","CC6.1","CC7.2"] references: - 'CCE-33816-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' - - id: 13118 + - id: 15643 + title: "Ensure 'MSS: (DisableSavePassword) Prevent the dial-up password from being saved' is set to 'Enabled'" + description: "When you dial a phonebook or VPN entry in Dial-Up Networking, you can use the \"Save Password\" option so that your Dial-Up Networking password is cached and you will not need to enter it on successive dial attempts. For security, administrators may want to prevent users from caching passwords. The recommended state for this setting is: Enabled." + rationale: "An attacker who steals a mobile user's computer could automatically connect to the organization's network if the Save This Password check box is selected for the dial-up or VPN networking entry used to connect to your organization's network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(DisableSavePassword) Prevent the dial-up password from being saved. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.4"] + - cis_csc: ["9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters -> DisableSavePassword -> 1' + + + - id: 15644 title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'" description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." @@ -1630,13 +2366,37 @@ checks: compliance: - cis: ["18.4.5"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] references: - 'CCE-34597-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' - - id: 13119 + + - id: 15645 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'" + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.6"] + - cis_csc: ["9"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-35469-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + + + + - id: 15646 title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'" description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." @@ -1644,13 +2404,39 @@ checks: compliance: - cis: ["18.4.7"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["A1.1","CC6.1","CC7.2"] references: - 'CCE-35405-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' - - id: 13120 + + + - id: 15647 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'" + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.8"] + - cis_csc: ["9"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-34614-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + + + + - id: 15648 title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'" description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: - Search folders specified in the system path first, and then search the current working folder. - Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled." rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." @@ -1658,13 +2444,19 @@ checks: compliance: - cis: ["18.4.9"] - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-34022-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' - - id: 13121 + - id: 15649 title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'" description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." @@ -1672,13 +2464,52 @@ checks: compliance: - cis: ["18.4.10"] - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] references: - 'CCE-34619-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' - - id: 13122 + - id: 15650 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.11"] + - cis_csc: ["9"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-34622-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + + - id: 15651 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.12"] + - cis_csc: ["9"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-34623-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + + + - id: 15652 title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'" description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less." rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." @@ -1686,39 +2517,47 @@ checks: compliance: - cis: ["18.4.13"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.7"] references: - 'CCE-35406-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' - - id: 13123 - title: "Set 'NetBIOS node type' to 'P-node' (Ensure NetBT Parameter 'NodeType' is set to '0x2 (2)')" - description: "This parameter determines which method NetBIOS over TCP/IP (NetBT) will use to register and resolve names. - A B-node (broadcast) system only uses broadcasts. - A P-node (point-to-point) system uses only name queries to a name server (WINS). - An M-node (mixed) system broadcasts first, then queries the name server (WINS). - An H-node (hybrid) system queries the name server (WINS) first, then broadcasts. The recommended state for this setting is: NodeType - 0x2 (2) (P-node / point-to-point)." - rationale: "In order to help mitigate the risk of NetBIOS Name Service (NBT-NS) poisoning attacks, setting the node type to P-node will prevent the system from sending out NetBIOS broadcasts." - remediation: "To establish the recommended configuration, set the following Registry value to 0x2 (2) (DWORD): HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NetBT\\Parameters:NodeType" - compliance: - - cis: ["18.5.4.1"] - - cis_csc: ["9"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NetBT\Parameters -> NodeType -> 2' - - id: 13124 + - id: 15653 title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'" description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled." rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution" compliance: - - cis: ["18.5.4.2"] + - cis: ["18.5.4.1"] - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-34055-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 0' - - id: 13125 + - id: 15654 + title: "Ensure 'Enable Font Providers' is set to 'Disabled'" + description: "This policy setting determines whether Windows is allowed to download fonts and font catalog data from an online font provider. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment the IT department should be managing the changes to the system configuration, to ensure all changes are tested and approved." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Fonts\\Enable Font Providers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.5.1"] + - cis_csc: ["3", "13"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders -> 0' + + + + - id: 15655 title: "Ensure 'Enable insecure guest logons' is set to 'Disabled'" description: "This policy setting determines if the SMB client will allow insecure guest logons to an SMB server. The recommended state for this setting is: Disabled." rationale: "Insecure guest logons are used by file servers to allow unauthenticated access to shared folders." @@ -1726,25 +2565,85 @@ checks: compliance: - cis: ["18.5.8.1"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth -> 0' - - id: 13126 - title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'" - description: "You can use this procedure to controls user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." - rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit installation and configuration of Network Bridge on your DNS domain network" + - id: 15656 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." compliance: - - cis: ["18.5.11.2"] + - cis: ["18.5.9.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-34262-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' + + - id: 15657 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.2"] + - cis_csc: ["9"] + - tsc: ["CC6.3"] + references: + - 'CCE-34073-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' + + + - id: 15658 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'" + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services. Note: This Group Policy path is provided by the Group Policy template P2P- pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.10.2"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33208-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + + + - id: 15659 + title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'" + description: "You can use this procedure to controls user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." + rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit installation and configuration of Network Bridge on your DNS domain network" + compliance: + - cis: ["18.5.11.2"] - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] references: - 'CCE-33107-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' - - id: 13127 + - id: 15660 title: "Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled'" description: "Although this legacy setting traditionally applied to the use of Internet Connection Sharing (ICS) in Windows 2000, Windows XP & Server 2003, this setting now freshly applies to the Mobile Hotspot feature in Windows 10 & Server 2016. The recommended state for this setting is: Enabled." rationale: "Non-administrators should not be able to turn on the Mobile Hotspot feature and open their Internet connectivity up to nearby mobile devices." @@ -1752,11 +2651,13 @@ checks: compliance: - cis: ["18.5.11.3"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI -> 0' - - id: 13128 + - id: 15661 title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'" description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled." rationale: "Allowing regular users to set a network location increases the risk and attack surface." @@ -1764,13 +2665,15 @@ checks: compliance: - cis: ["18.5.11.4"] - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] references: - 'CCE-35554-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' - - id: 13129 + - id: 15662 title: "Ensure 'Hardened UNC Paths' is set to 'Enabled, with \"Require Mutual Authentication\" and \"Require Integrity\" set for all NETLOGON and SYSVOL shares'" description: "This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with Require Mutual Authentication and Require Integrity set for all NETLOGON and SYSVOL shares. Note: If the environment exclusively contains Windows 8.0 / Server 2012 (non-R2) or newer systems, then the \"Privacy\" setting may (optionally) also be set to enable SMB encryption. However, using SMB encryption will render the targeted share paths completely inaccessible by older OSes, so only use this additional option with caution and thorough testing." rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template (NetworkProvider.admx/adml) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Note: A reboot may be required after the setting is applied to a client machine to access the above paths." @@ -1778,26 +2681,85 @@ checks: compliance: - cis: ["18.5.14.1"] - cis_csc: ["3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1, RequireIntegrity=1' - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1, RequireIntegrity=1' - - id: 13130 - title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled'" - description: "This policy setting prevents computers from establishing multiple simultaneous connections to either the Internet or to a Windows domain. The recommended state for this setting is: Enabled." - rationale: "Blocking simultaneous connections can help prevent a user unknowingly allowing network traffic to flow between the Internet and the enterprise managed network." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Minimize the number of simultaneous connections to the Internet or a Windows Domain" + + - id: 15663 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')" + description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)" + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components reduces a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." + compliance: + - cis: ["18.5.19.2.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + + - id: 15664 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'" + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.20.1"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-34326-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + + - id: 15665 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'" + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.20.2"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35606-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + + + - id: 15666 + title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled: 3 = Prevent Wi-Fi when on Ethernet'" + description: "This policy setting prevents computers from establishing multiple simultaneous connections to either the Internet or to a Windows domain. The recommended state for this setting is: Enabled: 3 = Prevent Wi-Fi when on Ethernet ." + rationale: "Preventing bridged network connections can help prevent a user unknowingly allowing traffic to route between internal and external networks, which risks exposure to sensitive internal data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3 = Prevent Wi-Fi when on Ethernet: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Minimize the number of simultaneous connections to the Internet or a Windows Domain" compliance: - cis: ["18.5.21.1"] - cis_csc: ["12"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35242-7' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> 3' - - id: 13131 + - id: 15667 title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled'" description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." @@ -1805,13 +2767,17 @@ checks: compliance: - cis: ["18.5.21.2"] - cis_csc: ["12"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35375-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' - - id: 13132 + - id: 15668 title: "Ensure 'Allow Windows to automatically connect to suggested open hotspots, to networks shared by contacts, and to hotspots offering paid services' is set to 'Disabled'" description: "This policy setting determines whether users can enable the following WLAN settings: Connect to suggested open hotspots, Connect to networks shared by my contacts, and Enable paid services. - Connect to suggested open hotspots enables Windows to automatically connect users to open hotspots it knows about by crowdsourcing networks that other people using Windows have connected to. - Connect to networks shared by my contacts enables Windows to automatically connect to networks that the user's contacts have shared with them, and enables users on this device to share networks with their contacts. - Enable paid services enables Windows to temporarily connect to open hotspots to determine if paid services are available. The recommended state for this setting is: Disabled." rationale: "Automatically connecting to an open hotspot or network can introduce the system to a rogue network with malicious intent." @@ -1819,13 +2785,17 @@ checks: compliance: - cis: ["18.5.23.2.1"] - cis_csc: ["15.4", "15.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-41378-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config -> AutoConnectAllowedOEM -> 0' - - id: 13133 + - id: 15669 title: "Ensure 'Include command line in process creation events' is set to 'Disabled'" description: "This policy setting determines what information is logged in security audit events when a new process has been created. The recommended state for this setting is: Disabled." rationale: "When this policy setting is enabled, any user who has read access to the security events can read the command-line arguments for any successfully created process. Command-line arguments may contain sensitive or private information such as passwords or user data." @@ -1833,13 +2803,15 @@ checks: compliance: - cis: ["18.8.3.1"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-35802-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 0' - - id: 13134 + - id: 15670 title: "Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled'" description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled." rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." @@ -1847,11 +2819,30 @@ checks: compliance: - cis: ["18.8.4.2"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' - - id: 13135 + - id: 15671 + title: "Ensure 'Turn On Virtualization Based Security: Secure Launch Configuration' is set to 'Enabled'" + description: "Secure Launch protects the Virtualization Based Security environment from exploited vulnerabilities in device firmware. The recommended state for this setting is: Enabled ." + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Secure Launch Configuration" + compliance: + - cis: ["18.8.5.6"] + - cis_csc: ["16.14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> ConfigureSystemGuardLaunch -> 1' + + + - id: 15672 title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'" description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: - Good: The driver has been signed and has not been tampered with. - Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. - Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. - Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware bootstart driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." rationale: "This policy setting helps reduce the impact of malware that has already infected your system." @@ -1859,13 +2850,16 @@ checks: compliance: - cis: ["18.8.14.1"] - cis_csc: ["8"] + - pci_dss: ["5.1.1"] + - nist_800_53: ["SI.3"] + - tsc: ["CC6.8"] references: - 'CCE-33231-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' - - id: 13136 + - id: 15673 title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'" description: "The \"Do not apply during periodic background processing\" option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart." rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." @@ -1873,13 +2867,16 @@ checks: compliance: - cis: ["18.8.21.2"] - cis_csc: ["3.7", "5.4", "5.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-35384-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' - - id: 13137 + - id: 15674 title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'" description: "The \"Process even if the Group Policy objects have not changed\" option updates and reapplies policies even if the policies have not changed." rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." @@ -1887,13 +2884,15 @@ checks: compliance: - cis: ["18.8.21.3"] - cis_csc: ["3.7", "5.4", "5.5"] + - pci_dss: ["11.5.1"] + - tsc: ["PI1.4","PI1.5","CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] references: - 'CCE-35384-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' - - id: 13138 + - id: 15675 title: "Ensure 'Continue experiences on this device' is set to 'Disabled'" description: "This policy setting determines whether the Windows device is allowed to participate in cross-device experiences (continue experiences)." rationale: "A cross-device experience is when a system can access app and send messages to other devices. In an enterprise managed environment only trusted systems should be communicating within the network. Access to any other system should be prohibited." @@ -1901,11 +2900,13 @@ checks: compliance: - cis: ["18.8.21.4"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp -> 0' - - id: 13139 + - id: 15676 title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'" description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers." rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." @@ -1917,9 +2918,27 @@ checks: - 'CCE-35776-4' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy -> 0' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' - - id: 13140 + - id: 15677 + title: "Ensure 'Turn off access to the Store' is set to 'Enabled'" + description: "This policy setting specifies whether to use the Store service for finding an application to open a file with an unhandled file type or protocol association. When a user opens a file type or protocol that is not associated with any applications on the computer, the user is given the choice to select a local application or use the Store service to find an application. The recommended state for this setting is: Enabled." + rationale: "The Store service is a retail outlet built into Windows, primarily for consumer use. In an enterprise managed environment the IT department should be managing the installation of all applications to reduce the risk of the installation of vulnerable software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off access to the Store. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ICM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35626-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> 1' + + + + - id: 15678 title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'" description: "This policy setting specifies whether to use the Store service for finding an application to open a file with an unhandled file type or protocol association. When a user opens a file type or protocol that is not associated with any applications on the computer, the user is given the choice to select a local application or use the Store service to find an application." rationale: "The Store service is a retail outlet built into Windows, primarily for consumer use. In an enterprise managed environment the IT department should be managing the installation of all applications to reduce the risk of the installation of vulnerable software." @@ -1927,13 +2946,66 @@ checks: compliance: - cis: ["18.8.22.1.2"] - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-35781-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' - - id: 13141 + + - id: 15679 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'" + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-32945-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + + - id: 15680 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'" + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35784-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + + - id: 15681 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33153-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + + + - id: 15682 title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'" description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet." rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." @@ -1941,217 +3013,579 @@ checks: compliance: - cis: ["18.8.22.1.7"] - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-33783-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' - - id: 13142 + + - id: 15683 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33216-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' + + - id: 15684 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.9"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33817-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + + - id: 15685 + title: "Ensure 'Turn off the \"Order Prints\" picture task' is set to 'Enabled'" + description: "This policy setting specifies whether the \"Order Prints Online\" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.10"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-34061-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + + - id: 15686 + title: "Ensure 'Turn off the \"Publish to Web\" task for files and folders' is set to 'Enabled'" + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.11"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33246-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + + - id: 15687 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.12"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33957-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + + - id: 15688 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.13"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33255-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + + - id: 15689 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.14"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-34260-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + + + + - id: 15690 + title: "Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'" + description: "This policy setting allows you to set support for Kerberos to attempt authentication using the certificate for the device to the domain. Support for device authentication using certificate will require connectivity to a DC in the device account domain which supports certificate authentication for computer accounts. The recommended state for this setting is: Enabled: Automatic." + rationale: "Having stronger device authentication with the use of certificates is strongly encouraged over standard username and password authentication. Having this set to Automatic will allow certificate based authentication to be used whenever possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Automatic: Computer Configuration\\Policies\\Administrative Templates\\System\\Kerberos\\Support device authentication using certificate. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Kerberos.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.25.1"] + - cis_csc: ["1.6", "1.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-41396-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled -> 1' + + + - id: 15691 + title: "Ensure 'Enumeration policy for external devices incompatible with Kernel DMA Protection' is set to 'Enabled: Block All'" + description: "This policy is intended to provide additional security against external DMA-capable devices. It allows for more control over the enumeration of external DMA-capable devices that are not compatible with DMA Remapping/device memory isolation and sandboxing. The recommended state for this setting is: Enabled: Block All ." + rationale: "Device memory sandboxing allows the OS to leverage the I/O Memory Management Unit (IOMMU) of a device to block unpermitted I/O, or memory access, by the peripheral." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block All: Computer Configuration\\Policies\\Administrative Templates\\System\\Kernel DMA Protection\\Enumeration policy for external devices incompatible with Kernel DMA Protection" + compliance: + - cis: ["18.8.26.1"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33783-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection -> DeviceEnumerationPolicy -> 0' + + + - id: 15692 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'" + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.1"] + - cis_csc: ["16.5", "16.11"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35101-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + + + - id: 15693 title: "Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'" description: "This policy prevents the user from showing account details (email address or user name) on the sign-in screen." rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the workstation through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Block user from showing account details on sign-in" compliance: - - cis: ["18.8.27.1"] + - cis: ["18.8.28.1"] - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin -> 1' - - id: 13143 + + + - id: 15694 title: "Ensure 'Do not display network selection UI' is set to 'Enabled'" description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen." rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not display network selection UI" compliance: - - cis: ["18.8.27.2"] + - cis: ["18.8.28.2"] - cis_csc: ["5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-33822-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' - - id: 13144 + - id: 15695 title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'" description: "This policy setting prevents connected users from being enumerated on domain-joined computers." rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not enumerate connected users on domain-joined computers" compliance: - - cis: ["18.8.27.3"] + - cis: ["18.8.28.3"] - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-35207-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' - - id: 13145 + - id: 15696 title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'" description: "This policy setting allows local users to be enumerated on domain-joined computers." rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Enumerate local users on domain-joined computers" compliance: - - cis: ["18.8.27.4"] + - cis: ["18.8.28.4"] - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-34838-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' - - id: 13146 + - id: 15697 title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'" description: "This policy setting allows you to prevent app notifications from appearing on the lock screen." rationale: "App notifications might display sensitive business or personal data." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off app notifications on the lock screen" compliance: - - cis: ["18.8.27.5"] + - cis: ["18.8.28.5"] - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-34837-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' - - id: 13147 + - id: 15698 title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'" description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled." rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in" compliance: - - cis: ["18.8.27.6"] + - cis: ["18.8.28.6"] - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-35291-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' - - id: 13148 + - id: 15699 title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'" description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work." rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn on convenience PIN sign-in" compliance: - - cis: ["18.8.27.7"] + - cis: ["18.8.28.7"] - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-35095-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' - - id: 13149 + + - id: 15700 + title: "Ensure 'Allow Clipboard synchronization across devices' is set to 'Disabled'" + description: "This policy setting determines whether published User Activities can be uploaded to the cloud. The recommended state for this setting is: Disabled ." + rationale: "In high security environments, clipboard data should stay local to the system and not synced across devices, as it may contain very sensitive information that must be contained locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow Clipboard synchronization across devices" + compliance: + - cis: ["18.8.31.1"] + - cis_csc: ["5.1","13.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-34972-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCrossDeviceClipboard -> 0' + + + - id: 15701 + title: "Ensure 'Allow upload of User Activities' is set to 'Disabled'" + description: "This policy setting determines whether published User Activities can be uploaded to the cloud. The recommended state for this setting is: Disabled ." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow upload of User Activities" + compliance: + - cis: ["18.8.31.2"] + - cis_csc: ["5.1","13.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> UploadUserActivities -> 0' + + + + - id: 15702 title: "Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'" description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems." rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, on battery and in a sleep state." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (on battery)" compliance: - - cis: ["18.8.33.6.1"] + - cis: ["18.8.34.6.1"] - cis_csc: ["9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex -> 0' - - id: 13150 + - id: 15703 title: "Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'" description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems." rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, plugged in and in a sleep state." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (plugged in)" compliance: - - cis: ["18.8.33.6.2"] + - cis: ["18.8.34.6.2"] - cis_csc: ["9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex -> 0' - - id: 13151 + - id: 15704 title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'" description: "Dictates whether or not Windows is allowed to use standby states when sleeping the computer." rationale: "System sleep states (S1-S3) keep power to the RAM which may contain secrets, such as the BitLocker volume encryption key. An attacker finding a computer in sleep states (S1-S3) could directly attack the memory of the computer and gain access to the secrets through techniques such as RAM reminisce and direct memory access (DMA)." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow standby states (S1-S3) when sleeping (on battery)" compliance: - - cis: ["18.8.33.6.5"] + - cis: ["18.8.34.6.5"] - cis_csc: ["13.2", "13.6"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-33782-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' - - id: 13152 + - id: 15705 title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'" description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep." rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in)" compliance: - - cis: ["18.8.33.6.6"] + - cis: ["18.8.34.6.6"] - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-35462-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' - - id: 13153 + - id: 15706 title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'" description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests." rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Offer Remote Assistance" compliance: - - cis: ["18.8.35.1"] + - cis: ["18.8.36.1"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-33801-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' - - id: 13154 + - id: 15707 title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'" description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer." rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Solicited Remote Assistance" compliance: - - cis: ["18.8.35.2"] + - cis: ["18.8.36.2"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-35331-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' - - id: 13155 + - id: 15708 title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'" description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers." rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Enable RPC Endpoint Mapper Client Authentication" compliance: - - cis: ["18.8.36.1"] + - cis: ["18.8.37.1"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-35392-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' - - id: 13156 + - id: 15709 title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'" description: "This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers. This policy setting impacts all RPC applications. In a domain environment this policy setting should be used with caution as it can impact a wide range of functionality including group policy processing itself. Reverting a change to this policy setting can require manual intervention on each affected machine. This policy setting should never be applied to a Domain Controller. A client will be considered an authenticated client if it uses a named pipe to communicate with the server or if it uses RPC Security. RPC Interfaces that have specifically requested to be accessible by unauthenticated clients may be exempt from this restriction, depending on the selected value for this policy setting. -- None allows all RPC clients to connect to RPC Servers running on the machine on which the policy setting is applied. -- Authenticated allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. Exemptions are granted to interfaces that have requested them. -- Authenticated without exceptions allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. No exceptions are allowed. This value has the potential to cause serious problems and is not recommended.'" rationale: "Unauthenticated RPC communication can create a security vulnerability." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients" compliance: - - cis: ["18.8.36.2"] + - cis: ["18.8.37.2"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-35391-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' - - id: 13157 + + - id: 15710 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'" + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.47.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + + - id: 15711 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'" + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.47.11.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33662-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + + - id: 15712 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'" + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.49.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33823-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + + - id: 15713 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.50.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + references: + - 'CCE-33661-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + + - id: 15714 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'" + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled. The recommended state for this setting is: Disabled." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.52.1.2"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + references: + - 'CCE-35135-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + +# 18.9 Windows Components + + + + - id: 15715 + title: "Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'" + description: "Manages a Windows app's ability to share data between users who have installed the app. Data is shared through the SharedLocal folder. This folder is available through the Windows.Storage API. The recommended state for this setting is: Disabled." + rationale: "Users of a system could accidentally share sensitive data with other users on the same system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Allow a Windows app to share application data between users. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.1"] + - cis_csc: ["14.4", "14.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-41397-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData -> 0' + + + - id: 15716 + title: "Ensure 'Let Windows apps activate with voice while the system is locked' is set to 'Enabled: Force Deny'" + description: "This policy setting specifies whether Windows apps can be activated by voice (apps and Cortana) while the system is locked. The recommended state for this setting is: Enabled: Force Deny ." + rationale: "Access to any computer resource should not be allowed when the device is locked." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Force Deny: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Privacy\\Let Windows apps activate with voice while the system is locked Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppPrivacy.admx/adml that is included with the Microsoft Windows 10 Release 1903 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.1"] + - cis_csc: ["14.4"] + references: + - 'CCE-38354-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy -> LetAppsActivateWithVoiceAboveLock -> 2' + + - id: 15717 title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'" description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it." rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." @@ -2159,13 +3593,15 @@ checks: compliance: - cis: ["18.9.6.1"] - cis_csc: ["16.9"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] references: - 'CCE-35803-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' - - id: 13158 + - id: 15718 title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'" description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones." rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." @@ -2173,13 +3609,16 @@ checks: compliance: - cis: ["18.9.8.1"] - cis_csc: ["8.3", "8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-35289-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' - - id: 13159 + - id: 15719 title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'" description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." @@ -2187,13 +3626,16 @@ checks: compliance: - cis: ["18.9.8.2"] - cis_csc: ["8.3", "8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-34771-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' - - id: 13160 + - id: 15720 title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'" description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives." rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." @@ -2201,13 +3643,16 @@ checks: compliance: - cis: ["18.9.8.3"] - cis_csc: ["8.3", "8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-33791-5' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> ff' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' - - id: 13161 + - id: 15721 title: "Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'" description: "This policy setting determines whether enhanced anti-spoofing is configured for devices which support it." rationale: "Enterprise managed environments are now supporting a wider range of mobile devices, increasing the security on these devices will help protect against unauthorized access on your network." @@ -2215,11 +3660,29 @@ checks: compliance: - cis: ["18.9.10.1.1"] - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing -> 1' - - id: 13162 + + - id: 15722 + title: "Ensure 'Allow Use of Camera' is set to 'Disabled'" + description: "This policy setting controls whether the use of Camera devices on the machine are permitted. The recommended state for this setting is: Disabled." + rationale: "Cameras in a high security environment can pose serious privacy and data exfiltration risks - they should be disabled to help mitigate that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Camera\\Allow Use of Camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Camera.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.12.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera -> 0' + + + - id: 15723 title: "Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'" description: "This policy setting turns off experiences that help consumers make the most of their devices and Microsoft account." rationale: "Having apps silently install in an enterprise managed environment is not good security practice - especially if the apps send data back to a 3rd party." @@ -2227,11 +3690,15 @@ checks: compliance: - cis: ["18.9.13.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures -> 1' - - id: 13163 + - id: 15724 title: "Ensure 'Require pin for pairing' is set to 'Enabled'" description: "This policy setting controls whether or not a PIN is required for pairing to a wireless display device." rationale: "If this setting is not configured or disabled then a PIN would not be required when pairing wireless display devices to the system, increasing the risk of unauthorized use." @@ -2239,11 +3706,16 @@ checks: compliance: - cis: ["18.9.14.1"] - cis_csc: ["15.8", "15.9"] - condition: all + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: any rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> 2' - - id: 13164 + - id: 15725 title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'" description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences." rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." @@ -2251,13 +3723,15 @@ checks: compliance: - cis: ["18.9.15.1"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-32965-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' - - id: 13165 + - id: 15726 title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'" description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application." rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." @@ -2265,13 +3739,29 @@ checks: compliance: - cis: ["18.9.15.2"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-35194-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' - - id: 13166 + - id: 15727 + title: "Ensure 'Prevent the use of security questions for local accounts' is set to 'Enabled'" + description: "This policy setting controls whether security questions can be used to reset local account passwords. The security question feature does not apply to domain accounts, only local accounts on the workstation. The recommended state for this setting is: Enabled ." + rationale: "Users could establish security questions that are easily guessed or sleuthed by observing the user’s social media accounts, making it easier for a malicious actor to change the local user account password and gain access to the computer as that user account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled:Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Prevent the use of security questions for local accounts" + compliance: + - cis: ["18.9.15.3"] + - cis_csc: ["16"] + references: + - 'CCE-36512-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> NoLocalPasswordResetQuestions -> 1' + + - id: 15728 title: "Ensure 'Allow Telemetry' is set to 'Enabled: 0 - Security [Enterprise Only]' or 'Enabled: 1 - Basic'" description: "This policy setting determines the amount of diagnostic and usage data reported to Microsoft: - A value of 0 - Security [Enterprise Only] will send minimal data to Microsoft. This data includes Malicious Software Removal Tool (MSRT) & Windows Defender data, if enabled, and telemetry client settings. Setting a value of 0 applies to enterprise, EDU, IoT and server devices only. Setting a value of 0 for other devices is equivalent to choosing a value of 1. - A value of 1 - Basic sends only a basic amount of diagnostic and usage data. Note that setting values of 0 or 1 will degrade certain experiences on the device. - A value of 2 - Enhanced sends enhanced diagnostic and usage data. - A value of 3 - Full sends the same data as a value of 2, plus additional diagnostics data, including the files and content that may have caused the problem. Windows 10 telemetry settings apply to the Windows operating system and some first party apps. This setting does not apply to third party apps running on Windows 10. The recommended state for this setting is: Enabled: 0 - Security [Enterprise Only] or Enabled: 1 - Basic." rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." @@ -2279,13 +3769,35 @@ checks: compliance: - cis: ["18.9.16.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-41400-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> r:^0$|^1$' - - id: 13167 + + - id: 15729 + title: "Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage'" + description: "This policy setting controls whether the Connected User Experience and Telemetry service can automatically use an authenticated proxy to send data back to Microsoft. The recommended state for this setting is: Enabled: Disable Authenticated Proxy usage." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Authenticated Proxy usage: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy -> 1' + + + - id: 15730 title: "Ensure 'Do not show feedback notifications' is set to 'Enabled'" description: "This policy setting allows an organization to prevent its devices from showing feedback questions from Microsoft." rationale: "Users should not be sending any feedback to 3rd party vendors in an enterprise managed environment." @@ -2293,11 +3805,15 @@ checks: compliance: - cis: ["18.9.16.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications -> 1' - - id: 13168 + - id: 15731 title: "Ensure 'Toggle user control over Insider builds' is set to 'Disabled'" description: "This policy setting determines whether users can access the Insider build controls in the Advanced Options for Windows Update. These controls are located under \"Get Insider builds,\" and enable users to make their devices available for downloading and installing Windows preview software." rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." @@ -2305,13 +3821,17 @@ checks: compliance: - cis: ["18.9.16.4"] - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-41380-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview -> 0' - - id: 13169 + - id: 15732 title: "Ensure 'Download Mode' is NOT set to 'Enabled: Internet'" description: "This policy setting specifies the download method that Delivery Optimization can use in downloads of Windows Updates, Apps and App updates. The following methods are supported: - 0 = HTTP only, no peering. - 1 = HTTP blended with peering behind the same NAT. - 2 = HTTP blended with peering across a private group. Peering occurs on devices in the same Active Directory Site (if exist) or the same domain by default. When this option is selected, peering will cross NATs. To create a custom group use Group ID in combination with Mode 2. - 3 = HTTP blended with Internet Peering. - 99 = Simple download mode with no peering. Delivery Optimization downloads using HTTP only and does not attempt to contact the Delivery Optimization cloud services. - 100 = Bypass mode. Do not use Delivery Optimization and use BITS instead." rationale: "Due to privacy concerns and security risks, updates should only be downloaded directly from Microsoft, or from a trusted machine on the internal network that received its updates from a trusted source and approved by the network administrator." @@ -2319,11 +3839,17 @@ checks: compliance: - cis: ["18.9.17.1"] - cis_csc: ["4.5", "3.4", "3.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] condition: all rules: - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization -> DODownloadMode -> r:^3$' - - id: 13170 + - id: 15733 title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -2331,13 +3857,19 @@ checks: compliance: - cis: ["18.9.26.1.1"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-34169-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' - - id: 13171 + - id: 15734 title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -2345,13 +3877,19 @@ checks: compliance: - cis: ["18.9.26.1.2"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-33975-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' - - id: 13172 + - id: 15735 title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -2359,13 +3897,19 @@ checks: compliance: - cis: ["18.9.26.2.1"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35090-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' - - id: 13173 + - id: 15736 title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -2373,13 +3917,19 @@ checks: compliance: - cis: ["18.9.26.2.2"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-33428-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' - - id: 13174 + - id: 15737 title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -2387,13 +3937,19 @@ checks: compliance: - cis: ["18.9.26.3.1"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-34170-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' - - id: 13175 + - id: 15738 title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -2401,13 +3957,19 @@ checks: compliance: - cis: ["18.9.26.3.2"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35091-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' - - id: 13176 + - id: 15739 title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -2415,13 +3977,19 @@ checks: compliance: - cis: ["18.9.26.4.1"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-33729-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' - - id: 13177 + - id: 15740 title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -2429,13 +3997,19 @@ checks: compliance: - cis: ["18.9.26.4.2"] - cis_csc: ["6.3", "6.4"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35288-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' - - id: 13178 + - id: 15741 title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'" description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer." rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." @@ -2443,13 +4017,19 @@ checks: compliance: - cis: ["18.9.30.2"] - cis_csc: ["8.4", "8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-33608-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' - - id: 13179 + - id: 15742 title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'" description: "Without heap termination on corruption, legacy plug-in applications may continue to function when a File Explorer session has become corrupt. Ensuring that heap termination on corruption is active will prevent this." rationale: "Allowing an application to function after its session has become corrupt increases the risk posture to the system." @@ -2457,13 +4037,16 @@ checks: compliance: - cis: ["18.9.30.3"] - cis_csc: ["8.4", "8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-33745-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' - - id: 13180 + - id: 15743 title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'" description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows." rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." @@ -2471,13 +4054,16 @@ checks: compliance: - cis: ["18.9.30.4"] - cis_csc: ["8.4", "8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-33764-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' - - id: 13181 + - id: 15744 title: "Ensure 'Prevent the computer from joining a homegroup' is set to 'Enabled'" description: "By default, users can add their computer to a HomeGroup on a home network." rationale: "While resources on a domain-joined computer cannot be shared with a HomeGroup, information from the domain-joined computer can be leaked to other computers in the HomeGroup." @@ -2485,13 +4071,49 @@ checks: compliance: - cis: ["18.9.35.1"] - cis_csc: ["14.1", "14.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-34776-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HomeGroup -> DisableHomeGroup -> 1' - - id: 13182 + + - id: 15745 + title: "Ensure 'Turn off location' is set to 'Enabled'" + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.39.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33743-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + + - id: 15746 + title: "Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'" + description: "This policy setting allows backup and restore of cellular text messages to Microsoft's cloud services. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Messaging\\Allow Message Service Cloud Sync Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Messaging.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.43.1"] + - cis_csc: ["9.1", "9.2", "13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync -> 0' + + + - id: 15747 title: "Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'" description: "This setting determines whether applications and services on the device can utilize new consumer Microsoft account authentication via the Windows OnlineID and WebAccountManager APIs." rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used on their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." @@ -2499,11 +4121,60 @@ checks: compliance: - cis: ["18.9.44.1"] - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth -> 1' - - id: 13183 + + + - id: 15748 + title: "Ensure 'Allow Address bar drop-down list suggestions' is set to 'Disabled'" + description: "This setting determines whether the Address bar drop-down functionality is available in Microsoft Edge. The recommended state for this setting is: Disabled." + rationale: "Having Address bar drop-down list suggestions sent out to be processed is considered a privacy concern." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Allow Address bar drop-down list suggestions. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.45.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\ServiceUI -> ShowOneBox -> 0' + + - id: 15749 + title: "Ensure 'Allow Adobe Flash' is set to 'Disabled'" + description: "This setting lets you decide whether employees can run Adobe Flash in Microsoft Edge. The recommended state for this setting is: Disabled." + rationale: "Adobe Flash is a very insecure product and has been a frequent attack vector on the web. In more highly security-sensitive environments, Adobe Flash should be disabled completely to eliminate this attack vector. Note: This setting will not prevent or remove Adobe Flash usage from other web browsers, so we recommend also uninstalling Adobe Flash completely from all systems in highly security-sensitive environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Allow Adobe Flash. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.45.2"] + - cis_csc: ["7.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Addons -> FlashPlayerEnabled -> 0' + + - id: 15750 + title: "Ensure 'Allow InPrivate Browsing' is set to 'Disabled'" + description: "This setting lets you decide whether employees can browse using InPrivate website browsing. The recommended state for this setting is: Disabled." + rationale: "Even though web filter logs can monitor traffic to and from websites, it is always a good practice to try and keep multiple source of logs. It can also be helpful to keep user from privately browsing in order to troubleshoot malicious site visits if a machine has become compromised." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Allow InPrivate Browsing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was named Turn off InPrivate browsing, but it was renamed starting with the Windows 10 Release 1607 & Server 2016 Administrative Templates." + compliance: + - cis: ["18.9.45.3"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> AllowInPrivate -> 0' + + + - id: 15751 title: "Ensure 'Configure cookies' is set to 'Enabled: Block only 3rd-party cookies' or higher" description: "This setting lets you configure how your company deals with cookies. The recommended state for this setting is: Enabled: Block only 3rd-party cookies. Configuring this setting to Enabled: Block all cookies also conforms to the benchmark." rationale: "Cookies can pose a serious privacy concern, although many websites depend on them for operation. It is recommended when possible to block 3rd party cookies in order to reduce tracking." @@ -2511,11 +4182,15 @@ checks: compliance: - cis: ["18.9.45.4"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> Cookies -> r:^0$|^1$' - - id: 13184 + - id: 15752 title: "Ensure 'Configure Password Manager' is set to 'Disabled'" description: "This setting lets you decide whether employees can save their passwords locally, using Password Manager." rationale: "Using Password Manager can potentially makes it easier for an unauthorized user who gains access to the user's desktop (including a coworker who sits down at a user's desk soon after the user walks away and forgets to lock their workstation), to log in to sites as the user, without needing to know or enter the password." @@ -2523,11 +4198,50 @@ checks: compliance: - cis: ["18.9.45.5"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> FormSuggest Passwords -> no' - - id: 13185 + + + - id: 15753 + title: "Ensure 'Configure Pop-up Blocker' is set to 'Enabled'" + description: "This setting lets you decide whether to turn on Pop-up Blocker and whether to allow pop- ups to appear in secondary windows. The recommended state for this setting is: Enabled." + rationale: "The Pop-up Blocker serves an important purpose by blocking malicious popups and helping prevent the machine from being compromised." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Configure Pop-up Blocker. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was named Turn off Pop-up Blocker, but it was renamed starting with the Windows 10 Release 1607 & Server 2016 Administrative Templates." + compliance: + - cis: ["18.9.45.6"] + - cis_csc: ["7"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> AllowPopups -> r:yes' + + - id: 15754 + title: "Ensure 'Configure search suggestions in Address bar' is set to 'Disabled'" + description: "This setting lets you decide whether search suggestions should appear in the Address bar of Microsoft Edge. The recommended state for this setting is: Disabled." + rationale: "Having search suggestions sent out to be processed is considered a privacy concern." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Configure search suggestions in Address bar. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1507 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1507 Administrative Templates, this setting was named Stops address bar from showing search suggestions. In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was renamed to Turn off address bar search suggestions, but it was finally renamed to Configure search suggestions in Address bar starting with the Windows 10 Release 1607 & Server 2016 Administrative Templates." + compliance: + - cis: ["18.9.45.7"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\SearchScopes -> ShowSearchSuggestionsGlobal -> 0' + + + - id: 15755 title: "Ensure 'Configure the Adobe Flash Click-to-Run setting' is set to 'Enabled'" description: "This setting controls whether Adobe Flash (within the Microsoft Edge web browser) will require the user to click on the Flash element before the browser will display the Flash content." rationale: "Adobe Flash is a very insecure product and has been a frequent attack vector on the web. However, disabling it completely may not be a practical option for many organizations, as it is still used frequently on many websites. This feature at least makes Adobe Flash content \"opt-in\", so the user has to choose to click on each specific piece of Flash content before it will run." @@ -2535,11 +4249,48 @@ checks: compliance: - cis: ["18.9.45.8"] - cis_csc: ["7.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Security -> FlashClickToRunMode -> 1' - - id: 13186 + + + - id: 15756 + title: "Ensure 'Prevent access to the about:flags page in Microsoft Edge' is set to 'Enabled'" + description: "This policy setting lets you decide whether employees can access the about:flags page, which is used to change developer settings and to enable experimental features. The recommended state for this setting is: Enabled." + rationale: "Users should not have access to developer settings and experimental features. Vulnerabilities could be introduced if these settings are not properly managed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Prevent access to the about:flags page in Microsoft Edge. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.45.9"] + - cis_csc: ["3"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> PreventAccessToAboutFlagsInMicrosoftEdge -> 1' + + - id: 15757 + title: "Ensure 'Prevent using Localhost IP address for WebRTC' is set to 'Enabled'" + description: "This setting lets you decide whether an employee's LocalHost IP address shows while making phone calls using the WebRTC protocol. The recommended state for this setting is: Enabled." + rationale: "WebRTC is a Real-Time Communications open source project supported by all major browsers. Allowing a system's local IP address to be shared may be considered a privacy concern." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Prevent using Localhost IP address for WebRTC. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was named Don't allow WebRTC to share the LocalHost IP address, but it was renamed starting with the Windows 10 Release 1607 & Server 2016 Administrative Templates." + compliance: + - cis: ["18.9.45.10"] + - cis_csc: ["7.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> HideLocalHostIP -> 1' + + + - id: 15758 title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'" description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client." rationale: "Enabling this setting prevents users from accidentally uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client." @@ -2547,282 +4298,550 @@ checks: compliance: - cis: ["18.9.52.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-33826-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' - - id: 13187 + + + - id: 15759 + title: "Ensure 'Turn off Push To Install service' is set to 'Enabled'" + description: "This policy setting controls whether users can push Apps to the device from the Windows Store App running on other devices or the web. The recommended state for this setting is: Enabled." + rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Push to Install\\Turn off Push To Install service. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PushToInstall.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.57.1"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall -> 1' + + - id: 15760 + title: "Ensure 'Allow users to connect remotely by using Remote Desktop Services' is set to 'Disabled'" + description: "This policy setting allows you to configure remote access to computers by using Remote Desktop Services. The recommended state for this setting is: Disabled." + rationale: "Any account with the Allow log on through Remote Desktop Services user right can log on to the remote console of the computer. If you do not restrict access to legitimate users who need to log on to the console of the computer, unauthorized users could download and execute malicious code to elevate their privileges." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Allow users to connect remotely by using Remote Desktop Services. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Allow users to connect remotely using Terminal Services, but it was renamed to Allow users to connect remotely using Remote Desktop Services in the Windows 7 & Server 2008 R2 Administrative Templates. It was renamed again to Allow users to connect remotely by using Remote Desktop Services in the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.58.3.2.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-35255-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDenyTSConnections -> 1' + + - id: 15761 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.1"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-34496-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + + - id: 15762 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.3"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-34698-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + + - id: 15763 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'" + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.4"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-34790-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + + - id: 15764 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'" + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.58.3.10.1"] + - cis_csc: ["16.5", "16.11"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - https://workbench.cisecurity.org/benchmarks/766 + - 'CCE-35595-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare != 0' + + - id: 15765 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'" + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.10.2"] + - cis_csc: ["16.5", "16.11"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-35599-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + + + - id: 15766 title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'" description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer." rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Connection Client\\Do not allow passwords to be saved" compliance: - - cis: ["18.9.58.2.2"] + - cis: ["18.9.59.2.2"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] references: - 'CCE-34506-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' - - id: 13188 + - id: 15767 title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'" description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them." rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow drive redirection" compliance: - - cis: ["18.9.58.3.3.2"] + - cis: ["18.9.59.3.3.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-34697-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' - - id: 13189 + - id: 15768 title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'" description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client." rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Always prompt for password upon connection" compliance: - - cis: ["18.9.58.3.9.1"] + - cis: ["18.9.59.3.9.1"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-33960-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' - - id: 13190 + - id: 15769 title: "Ensure 'Require secure RPC communication' is set to 'Enabled'" description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests." rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require secure RPC communication" compliance: - - cis: ["18.9.58.3.9.2"] + - cis: ["18.9.59.3.9.2"] - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-35723-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' - - id: 13191 + - id: 15770 title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'" description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption." rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level" compliance: - - cis: ["18.9.58.3.9.5"] + - cis: ["18.9.59.3.9.5"] - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-35578-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' - - id: 13192 + - id: 15771 title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'" description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff." rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not delete temp folders upon exit" compliance: - - cis: ["18.9.58.3.11.1"] + - cis: ["18.9.59.3.11.1"] - cis_csc: ["14.4", "14.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-34136-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' - - id: 13193 + - id: 15772 title: "Ensure 'Do not use temporary folders per session' is set to 'Disabled'" description: "By default, Remote Desktop Services creates a separate temporary folder on the RD Session Host server for each active session that a user maintains on the RD Session Host server. The temporary folder is created on the RD Session Host server in a Temp folder under the user's profile folder and is named with the sessionid. This temporary folder is used to store individual temporary files. To reclaim disk space, the temporary folder is deleted when the user logs off from a session." rationale: "Disabling this setting keeps the cached data independent for each session, both reducing the chance of problems from shared cached data between sessions, and keeping possibly sensitive data separate to each user session." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not use temporary folders per session" compliance: - - cis: ["18.9.58.3.11.2"] + - cis: ["18.9.59.3.11.2"] - cis_csc: ["14.4", "14.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-34531-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> 1' - - id: 13194 + - id: 15773 title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'" description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer." rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\RSS Feeds\\Prevent downloading of enclosures" compliance: - - cis: ["18.9.59.1"] + - cis: ["18.9.60.1"] - cis_csc: ["7.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-34822-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' - - id: 13195 + + + - id: 15774 + title: "Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'" + description: "This policy setting allows search and Cortana to search cloud sources like OneDrive and SharePoint. The recommended state for this setting is: Enabled: Disable Cloud Search." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Cloud Search: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cloud Search. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.60.2"] + - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch -> 0' + + + + - id: 15775 title: "Ensure 'Allow Cortana' is set to 'Disabled'" description: "This policy setting specifies whether Cortana is allowed on the device." rationale: "If Cortana is enabled, sensitive information could be contained in search history and sent out to Microsoft." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cortana" compliance: - - cis: ["18.9.60.3"] + - cis: ["18.9.61.3"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-41421-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortana -> 0' - - id: 13196 + - id: 15776 title: "Ensure 'Allow Cortana above lock screen' is set to 'Disabled'" description: "This policy setting determines whether or not the user can interact with Cortana using speech while the system is locked." rationale: "Access to any computer resource should not be allowed when the device is locked." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cortana above lock screen" compliance: - - cis: ["18.9.60.4"] + - cis: ["18.9.61.4"] - cis_csc: ["16.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortanaAboveLock -> 0' - - id: 13197 + - id: 15777 title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'" description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files." rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow indexing of encrypted files" compliance: - - cis: ["18.9.60.5"] + - cis: ["18.9.61.5"] - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-35314-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' - - id: 13198 + - id: 15778 title: "Ensure 'Allow search and Cortana to use location' is set to 'Disabled'" description: "This policy setting specifies whether search and Cortana can provide location aware search and Cortana results." rationale: "In an enterprise managed environment, allowing Cortana and Search to have access to location data is unnecessary. Organizations likely do not want this information shared out" remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow search and Cortana to use location" compliance: - - cis: ["18.9.60.6"] + - cis: ["18.9.61.6"] - cis_csc: ["9.1", "9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-41372-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowSearchToUseLocation -> 0' - - id: 13199 + + - id: 15779 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'" + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.65.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + + - id: 15780 + title: "Ensure 'Turn off the Store application' is set to 'Enabled'" + description: "This setting denies or allows access to the Store application. The recommended state for this setting is: Enabled. Note: Per Microsoft TechNet and MSKB 3135657, this policy setting does not apply to any Windows 10 editions other than Enterprise and Education." + rationale: "Only applications approved by an IT department should be installed. Allowing users to install 3rd party applications can lead to missed patches and potential zero day vulnerabilities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off the Store application. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinStoreUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates, or by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.68.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - https://docs.microsoft.com/en-us/windows/client-management/group-policies-for-enterprise-and-education-editions + - https://support.microsoft.com/en-us/help/3135657/can-t-disable-windows-store-in-windows-10-pro-through-group-policy + - 'CCE-35811-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RemoveWindowsStore -> 1' + + + - id: 15781 title: "Ensure 'Turn off Automatic Download and Install of updates' is set to 'Disabled'" description: "This setting enables or disables the automatic download and installation of Windows Store app updates." rationale: "Keeping your system properly patched can help protect against 0 day vulnerabilities." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off Automatic Download and Install of updates" compliance: - - cis: ["18.9.68.3"] + - cis: ["18.9.69.3"] - cis_csc: ["3.1", "3.4", "3.5", "4.5", "5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35807-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> AutoDownload -> 4' - - id: 13200 + - id: 15782 title: "Ensure 'Turn off the offer to update to the latest version of Windows' is set to 'Enabled'" description: "Enables or disables the Windows Store offer to update to the latest version of Windows." rationale: "Unplanned OS upgrades can lead to more preventable support calls. The IT department should be managing and approving all upgrades and updates." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off the offer to update to the latest version of Windows" compliance: - - cis: ["18.9.68.4"] + - cis: ["18.9.69.4"] - cis_csc: ["3.1", "3.4", "3.5", "4.5", "5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35809-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableOSUpgrade -> 1' - - id: 13201 + + + - id: 15783 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'" + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to \"Windows Defender Antivirus Cloud Protection Service\". Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Join Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.3.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + + - id: 15784 + title: "Ensure 'Configure Watson events' is set to 'Disabled'" + description: "This policy setting allows you to configure whether or not Watson events are sent. The recommended state for this setting is: Disabled." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission. Preventing this information from being sent can help reduce privacy concerns." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Reporting\\Configure Watson events. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.9.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-33880-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' + + + - id: 15785 title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'" description: "This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to \"Windows Defender Antivirus Cloud Protection Service\". This setting can only be set by Group Policy." rationale: "The decision on whether or not to participate in Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS" compliance: - - cis: ["18.9.76.3.1"] + - cis: ["18.9.77.3.1"] - cis_csc: ["8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-33833-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' - - id: 13202 + - id: 15786 title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'" description: "This policy setting allows you to configure behavior monitoring for Windows Defender Antivirus." rationale: "When running an antivirus solution such as Windows Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring" compliance: - - cis: ["18.9.76.7.1"] + - cis: ["18.9.77.7.1"] - cis_csc: ["8.1", "8.6"] + - pci_dss: ["5.2"] references: - 'CCE-33865-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection -> DisableBehaviorMonitoring -> 0' - - id: 13203 + - id: 15787 title: "Ensure 'Scan removable drives' is set to 'Enabled'" description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan." rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Scan removable drives" compliance: - - cis: ["18.9.76.10.1"] + - cis: ["18.9.77.10.1"] - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-33888-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' - - id: 13204 + - id: 15788 title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'" description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac)." rationale: "Incoming e-mails should be scanned by an antivirus solution such as Windows Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Turn on e-mail scanning" compliance: - - cis: ["18.9.76.10.2"] + - cis: ["18.9.77.10.2"] - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-33906-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' - - id: 13205 + - id: 15789 title: "Ensure 'Configure Attack Surface Reduction rules' is set to 'Enabled'" description: "This policy setting controls the state for the Attack Surface Reduction (ASR) rules." rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploitseeking malware to infect machines." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Windows Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules" compliance: - - cis: ["18.9.76.13.1.1"] + - cis: ["18.9.77.13.1.1"] - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules -> 1' - - id: 13206 + - id: 15790 title: "Ensure 'Configure Attack Surface Reduction rules: Set the state for each ASR rule' is 'configured'" description: "This policy setting sets the Attack Surface Reduction rules. The recommended state for this setting is: 26190899-1602-49e8-8b27-eb1d0a1ce869 - 1 (Block Office communication application from creating child processes) 3b576869-a4ec-4529-8536-b80a7769e899 - 1 (Block Office applications from creating executable content) 5beb7efe-fd9a-4556-801d-275e5ffc04cc - 1 (Block execution of potentially obfuscated scripts) 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84 - 1 (Block Office applications from injecting code into other processes) 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c - 1 (Block Adobe Reader from creating child processes) 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b - 1 (Block Win32 API calls from Office macro) 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 - 1 (Block credential stealing from the Windows local security authority subsystem (lsass.exe)) b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4 - 1 (Block untrusted and unsigned processes that run from USB) be9ba2d9-53ea-4cdc-84e5-9b1eeee46550 - 1 (Block executable content from email client and webmail) d3e037e1-3eb8-44c8-a917-57927947596d - 1 (Block JavaScript or VBScript from launching downloaded executable content) d4f940ab-401b-4efc-aadc-ad5f3c50688a - 1 (Block Office applications from creating child processes)" rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploitseeking malware to infect machines." remediation: "To establish the recommended configuration via GP, set the following UI path so that 26190899-1602-49e8-8b27-eb1d0a1ce869, 3b576869-a4ec-4529-8536-b80a7769e899, 5beb7efe-fd9a-4556-801d-275e5ffc04cc, 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84, 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c, 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b, 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2, b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4, be9ba2d9-53ea-4cdc-84e5-9b1eeee46550, d3e037e1-3eb8-44c8-a917-57927947596d and d4f940ab-401b-4efc-aadc-ad5f3c50688a are each set to a value of 1: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Windows Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules: Set the state for each ASR rule." compliance: - - cis: ["18.9.76.13.1.2"] + - cis: ["18.9.77.13.1.2"] - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 -> 1' @@ -2837,45 +4856,54 @@ checks: - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 9E6C4E1F-7D60-472F-bA1A-A39EF669E4B2 -> 1' - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 -> 1' - - id: 13207 + - id: 15791 title: "Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'" description: "This policy setting controls Windows Defender Exploit Guard network protection." rationale: "This setting can help prevent employees from using any application to access dangerous domains that may host phishing scams, exploit-hosting sites, and other malicious content on the Internet." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Windows Defender Exploit Guard\\Network Protection\\Prevent users and apps from accessing dangerous websites" compliance: - - cis: ["18.9.76.13.3.1"] + - cis: ["18.9.77.13.3.1"] - cis_csc: ["7"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection -> 1' - - id: 13208 + - id: 15792 title: "Ensure 'Turn off Windows Defender AntiVirus' is set to 'Disabled'" description: "This policy setting turns off Windows Defender Antivirus. If the setting is configured to Disabled, Windows Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software." rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Windows Defender Antivirus. Organizations that choose to purchase a reputable 3rd-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Turn off Windows Defender AntiVirus" compliance: - - cis: ["18.9.76.14"] + - cis: ["18.9.77.15"] - cis_csc: ["8.1", "8.6"] + - pci_dss: ["5.2"] references: - 'CCE-33478-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware -> 0' - - id: 13209 + - id: 15793 title: "Ensure 'Prevent users from modifying settings' is set to 'Enabled'" description: "This policy setting prevent users from making changes to the Exploit protection settings area in the Windows Defender Security Center." rationale: "Only authorized IT staff should be able to make changes to the exploit protection settings in order to ensure the organizations specific configuration is not modified." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Security Center\\App and browser protection\\Prevent users from modifying settings" compliance: - - cis: ["18.9.79.2.1"] + - cis: ["18.9.99.2.1"] - cis_csc: ["8.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride -> 1' - - id: 13210 + - id: 15794 title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'" description: "This policy setting allows you to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled." rationale: "Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." @@ -2883,6 +4911,9 @@ checks: compliance: - cis: ["18.9.80.1.1"] - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-34026-5' condition: all @@ -2890,7 +4921,7 @@ checks: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 1' - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel -> Block' - - id: 13211 + - id: 15795 title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled'" description: "This setting lets you decide whether to turn on SmartScreen Filter. SmartScreen Filter provides warning messages to help protect your employees from potential phishing scams and malicious software." rationale: "SmartScreen serves an important purpose as it helps to warn users of possible malicious sites and files. Allowing users to turn off this setting can make the browser become more vulnerable to compromise." @@ -2898,11 +4929,17 @@ checks: compliance: - cis: ["18.9.80.2.1"] - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> EnabledV9 -> 1' - - id: 13212 + - id: 15796 title: "Ensure 'Prevent bypassing Windows Defender SmartScreen prompts for files' is set to 'Enabled'" description: "This setting lets you decide whether employees can override the SmartScreen Filter warnings about downloading unverified files." rationale: "SmartScreen will warn an employee if a file is potentially malicious. Enabling this setting prevents these warnings from being bypassed." @@ -2910,11 +4947,17 @@ checks: compliance: - cis: ["18.9.80.2.2"] - cis_csc: ["7"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> PreventOverrideAppRepUnknown -> 1' - - id: 13213 + - id: 15797 title: "Ensure 'Prevent bypassing Windows Defender SmartScreen prompts for sites' is set to 'Enabled'" description: "This setting lets you decide whether employees can override the SmartScreen Filter warnings about potentially malicious websites." rationale: "SmartScreen will warn an employee if a website is potentially malicious. Enabling this setting prevents these warnings from being bypassed." @@ -2922,11 +4965,17 @@ checks: compliance: - cis: ["18.9.80.2.3"] - cis_csc: ["7"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> PreventOverride -> 1' - - id: 13214 + - id: 15798 title: "Ensure 'Enables or disables Windows Game Recording and Broadcasting' is set to 'Disabled'" description: "This setting enables or disables the Windows Game Recording and Broadcasting features." rationale: "If this setting is allowed users could record and broadcast session info to external sites which is a privacy concern." @@ -2934,11 +4983,30 @@ checks: compliance: - cis: ["18.9.82.1"] - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR -> AllowGameDVR -> 0' - - id: 13215 + + + - id: 15799 + title: "Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'" + description: "This policy setting determines whether suggested apps in Windows Ink Workspace are allowed. The recommended state for this setting is: Disabled." + rationale: "This Microsoft feature is designed to collect data and suggest apps based on that data collected. Disabling this setting will help ensure your data is not shared with any third party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow suggested apps in Windows Ink Workspace. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.84.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace -> 0' + + + - id: 15800 title: "Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Disabled' but not 'Enabled: On'" description: "This policy setting determines whether Windows Ink items are allowed above the lock screen." rationale: "Allowing any apps to be accessed while system is locked is not recommended. If this feature is permitted, it should only be accessible once a user authenticates with the proper credentials." @@ -2946,11 +5014,13 @@ checks: compliance: - cis: ["18.9.84.2"] - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> r:^0$|^1$' - - id: 13216 + - id: 15801 title: "Ensure 'Allow user control over installs' is set to 'Disabled'" description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user." rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." @@ -2958,13 +5028,15 @@ checks: compliance: - cis: ["18.9.85.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-35431-6' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' - - id: 13217 + - id: 15802 title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'" description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure." rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." @@ -2972,13 +5044,33 @@ checks: compliance: - cis: ["18.9.85.2"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-35400-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' - - id: 13218 + + - id: 15803 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'" + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.85.3"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35086-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + + + - id: 15804 title: "Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled'" description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system." rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." @@ -2986,13 +5078,15 @@ checks: compliance: - cis: ["18.9.86.1"] - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] references: - 'CCE-33891-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' - - id: 13219 + - id: 15805 title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'" description: "This policy setting enables logging of all PowerShell script input to the Microsoft-WindowsPowerShell/Operational event log." rationale: "There are potential risks of capturing passwords in the PowerShell logs. This setting should only be needed for debugging purposes, and not in normal operation, it is important to ensure this is set to Disabled." @@ -3000,11 +5094,12 @@ checks: compliance: - cis: ["18.9.95.1"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 0' - - id: 13220 + - id: 15806 title: "Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'" description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts." rationale: "If this setting is enabled there is a risk that passwords could get stored in plain text in the PowerShell_transcript output file." @@ -3012,11 +5107,12 @@ checks: compliance: - cis: ["18.9.95.2"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 0' - - id: 13221 + - id: 15807 title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication." rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." @@ -3024,13 +5120,17 @@ checks: compliance: - cis: ["18.9.97.1.1"] - cis_csc: ["16.13", "16.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35258-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' - - id: 13222 + - id: 15808 title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network." rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." @@ -3038,13 +5138,17 @@ checks: compliance: - cis: ["18.9.97.1.2"] - cis_csc: ["16.5", "16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-34458-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' - - id: 13223 + - id: 15809 title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication." rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." @@ -3052,13 +5156,17 @@ checks: compliance: - cis: ["18.9.97.1.3"] - cis_csc: ["16.5", "16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-34778-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' - - id: 13224 + - id: 15810 title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client." rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." @@ -3066,41 +5174,90 @@ checks: compliance: - cis: ["18.9.97.2.1"] - cis_csc: ["16.5", "16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-34779-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' - - id: 13225 + + + - id: 15811 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.97.2.2"] + - cis_csc: ["3.4", "4.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-33146-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + + + - id: 15812 title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port." rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM" + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow unencrypted traffic" compliance: - cis: ["18.9.97.2.3"] - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35054-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' - - id: 13226 + - id: 15813 title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network." rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow unencrypted traffic" + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Disallow WinRM from storing RunAs credentials" compliance: - cis: ["18.9.97.2.4"] - cis_csc: ["16.5", "16.13"] + - pci_dss: ["12.3.8"] references: - 'CCE-35416-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' - - id: 13227 + - id: 15814 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'" + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.98.1"] + - cis_csc: ["3.4", "4.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-33740-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + + + - id: 15815 title: "Ensure 'Manage preview builds' is set to 'Enabled: Disable preview builds'" description: "This policy setting determines whether users can access the Windows Insider Program controls in Settings -> Update and Security. These controls enable users to make their devices available for downloading and installing preview (beta) builds of Windows software." rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." @@ -3108,12 +5265,16 @@ checks: compliance: - cis: ["18.9.101.1.1"] - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuilds -> 1' - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue -> 0' - - id: 13228 + - id: 15816 title: "Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: Semi-Annual Channel, 180 or more days'" description: "This policy setting determines the level of Preview Build or Feature Updates to receive, and when. The Windows readiness level for each new Windows 10 Feature Update is classified in one of 5 categories, depending on your organizations level of comfort with receiving them: - Preview Build - Fast: Devices set to this level will be the first to receive new builds of Windows with features not yet available to the general public. Select Fast to participate in identifying and reporting issues to Microsoft, and provide suggestions on new functionality. - Preview Build - Slow: Devices set to this level receive new builds of Windows before they are available to the general public, but at a slower cadence than those set to Fast, and with changes and fixes identified in earlier builds. - Release Preview: Receive builds of Windows just before Microsoft releases them to the general public. - Semi-Annual Channel (Targeted): Receive feature updates when they are released to the general public. - Semi-Annual Channel: Feature updates will arrive when they are declared SemiAnnual Channel. This usually occurs about 4 months after Semi-Annual Channel (Targeted), indicating that Microsoft, Independent Software Vendors (ISVs), partners and customer believe that the release is ready for broad deployment." rationale: "Forcing new features without prior testing in your environment could cause software incompatibilities as well as introducing new bugs into the operating system. In an enterprise managed environment, it is generally preferred to delay Feature Updates until thorough testing and a deployment plan is in place. This recommendation delays the automatic installation of new features as long as possible." @@ -3121,13 +5282,16 @@ checks: compliance: - cis: ["18.9.101.1.2"] - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates -> 1' - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays -> n:^(\d+) compare >= 180' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> BranchReadinessLevel -> 32' - - id: 13229 + - id: 15817 title: "Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'" description: "This settings controls when Quality Updates are received." rationale: "Quality Updates can contain important bug fixes and/or security patches, and should be installed as soon as possible." @@ -3135,12 +5299,18 @@ checks: compliance: - cis: ["18.9.101.1.3"] - cis_csc: ["3.4", "3.5", "4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdates -> 1' - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdatesPeriodInDays -> 0' - - id: 13230 + - id: 15818 title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'" description: "This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: - 2 - Notify for download and auto install (Notify before downloading any updates) - 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) - 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) - 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended))" rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." @@ -3148,13 +5318,19 @@ checks: compliance: - cis: ["18.9.101.2"] - cis_csc: ["3.4", "3.5", "4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] references: - 'CCE-35111-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' - - id: 13231 + - id: 15819 title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'" description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS." rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." @@ -3162,13 +5338,19 @@ checks: compliance: - cis: ["18.9.101.3"] - cis_csc: ["3.4", "3.5", "4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] references: - 'CCE-35111-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' - - id: 13232 + - id: 15820 title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'" description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation." rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." @@ -3176,6 +5358,12 @@ checks: compliance: - cis: ["18.9.101.4"] - cis_csc: ["3.4", "3.5", "4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] references: - 'CCE-33813-7' condition: all diff --git a/sca/windows/cis_win10_enterprise_L2.yml b/sca/windows/cis_win10_enterprise_L2.yml deleted file mode 100644 index adc9f8777..000000000 --- a/sca/windows/cis_win10_enterprise_L2.yml +++ /dev/null @@ -1,1159 +0,0 @@ -# Security Configuration Assessment -# CIS Checks for Windows 10 Enterprise L2 -# Copyright (C) 2015-2020, Wazuh Inc. -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License (version 2) as published by the FSF - Free Software -# Foundation -# -# Based on: -# Center for Internet Security Benchmark v1.5.0 for Microsoft Windows 10 Release 1803 v1.5.0 - 03-06-2019 - -policy: - id: "cis_win10_enterprise_L2" - file: "cis_win10_enterprise_L2.yml" - name: "CIS benchmark for Windows 10 Enterprise (Release 1803)" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows (L2)." - references: - - https://www.cisecurity.org/cis-benchmarks/ - -requirements: - title: "Check that the Windows platform is Windows 10" - description: "Requirements for running the CIS benchmark Domain Controller L2 under Windows 10" - condition: all - rules: - - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows 10' - -checks: -# 2.3 Security Options - - id: 13500 - title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'" - description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." - rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, in a high security environment, you should allow only Administrators, not users, to do this, because printer driver installation may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers." - compliance: - - cis: ["2.3.4.2"] - - cis_csc: ["5.1"] - references: - - 'CCE-33958-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' - - - id: 13501 - title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'" - description: "This policy setting determines whether a user can log on to a Windows domain using cached account information. Logon information for domain accounts can be cached locally to allow users to log on even if a Domain Controller cannot be contacted. This policy setting determines the number of unique users for whom logon information is cached locally. If this value is set to 0, the logon cache feature is disabled. An attacker who is able to access the file system of the server could locate this cached information and use a brute force attack to determine user passwords. The recommended state for this setting is: 4 or fewer logon(s)." - rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally. If the number is set to 4, then the computer caches logon information for 4 users. When a 5th user logs on to the computer, the server overwrites the oldest cached logon session. Users who access the computer console will have their logon credentials cached on that computer. An attacker who is able to access the file system of the computer could locate this cached information and use a brute force attack to attempt to determine user passwords. To mitigate this type of attack, Windows encrypts the information and obscures its physical location." - remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)" - compliance: - - cis: ["2.3.7.7"] - - cis_csc: ["16"] - references: - - 'CCE-34901-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> n:^(\d+) compare <= 4' - - - id: 13502 - title: "Ensure 'System cryptography: Force strong key protection for user keys stored on the computer' is set to 'User is prompted when the key is first used' or higher" - description: "This policy setting determines whether users' private keys (such as their S-MIME keys) require a password to be used. The recommended state for this setting is: User is prompted when the key is first used. Configuring this setting to User must enter a password each time they use a key also conforms to the benchmark." - rationale: "If a user's account is compromised or their computer is inadvertently left unsecured the malicious user can use the keys stored for the user to access protected resources. You can configure this policy setting so that users must provide a password that is distinct from their domain password every time they use a key. This configuration makes it more difficult for an attacker to access locally stored user keys, even if the attacker takes control of the user's computer and determines their logon password." - remediation: "To establish the recommended configuration via GP, set the following UI path to User is prompted when the key is first used (configuring to User must enter a password each time they use a key also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System cryptography: Force strong key protection for user keys stored on the computer." - compliance: - - cis: ["2.3.14.1"] - - cis_csc: ["16.14"] - references: - - 'CCE-35007-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography -> ForceKeyProtection -> n:^(\d+) compare >= 1' - -# 5 System Services - - id: 13503 - title: "Ensure 'Bluetooth Support Service (bthserv)' is set to 'Disabled'" - description: "The Bluetooth service supports discovery and association of remote Bluetooth devices. The recommended state for this setting is: Disabled." - rationale: "Bluetooth technology has inherent security risks - especially prior to the v2.1 standard. Wireless Bluetooth traffic is not well encrypted (if at all), so in a high-security environment, it should not be permitted, in spite of the added inconvenience of not being able to use Bluetooth devices." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Bluetooth Support Service" - compliance: - - cis: ["5.2"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\bthserv -> Start -> 4' - - - id: 13504 - title: "Ensure 'Downloaded Maps Manager (MapsBroker)' is set to 'Disabled'" - description: "Windows service for application access to downloaded maps. This service is started on- demand by application accessing downloaded maps." - rationale: "Mapping technologies can unwillingly reveal your location to attackers and other software that picks up the information. In addition, automatic downloads of data from 3rd-party sources should be minimized when not needed. Therefore this service should not be needed in high security environments." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Downloaded Maps Manager" - compliance: - - cis: ["5.4"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MapsBroker -> Start -> 4' - - - id: 13505 - title: "Ensure 'Geolocation Service (lfsvc)' is set to 'Disabled'" - description: "This service monitors the current location of the system and manages geofences (a geographical location with associated events). The recommended state for this setting is: Disabled." - rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Geolocation Service" - compliance: - - cis: ["5.5"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lfsvc -> Start -> 4' - - - id: 13506 - title: "Ensure 'Link-Layer Topology Discovery Mapper (lltdsvc)' is set to 'Disabled'" - description: "Creates a Network Map, consisting of PC and device topology (connectivity) information, and metadata describing each PC and device. The recommended state for this setting is: Disabled." - rationale: "The feature that this service enables could potentially be used for unauthorized discovery and connection to network devices. Disabling the service helps to prevent responses to requests for network topology discovery in high security environments." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Link-Layer Topology Discovery Mapper" - compliance: - - cis: ["5.9"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lltdsvc -> Start -> 4' - - - id: 13507 - title: "Ensure 'Microsoft iSCSI Initiator Service (MSiSCSI)' is set to 'Disabled'" - description: "Manages Internet SCSI (iSCSI) sessions from this computer to remote target devices. The recommended state for this setting is: Disabled." - rationale: "This service is critically necessary in order to directly attach to an iSCSI device. However, iSCSI itself uses a very weak authentication protocol (CHAP), which means that the passwords for iSCSI communication are easily exposed, unless all of the traffic is isolated and/or encrypted using another technology like IPsec. This service is generally more appropriate for servers in a controlled environment then on workstations requiring high security." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Microsoft iSCSI Initiator Service" - compliance: - - cis: ["5.12"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSiSCSI -> Start -> 4' - - - id: 13508 - title: "Ensure 'Peer Name Resolution Protocol (PNRPsvc)' is set to 'Disabled'" - description: "Enables serverless peer name resolution over the Internet using the Peer Name Resolution Protocol (PNRP). The recommended state for this setting is: Disabled." - rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Name Resolution Protocol" - compliance: - - cis: ["5.15"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PNRPsvc -> Start -> 4' - - - id: 13509 - title: "Ensure 'Peer Networking Grouping (p2psvc)' is set to 'Disabled'" - description: "Enables multi-party communication using Peer-to-Peer Grouping. The recommended state for this setting is: Disabled." - rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Networking Grouping" - compliance: - - cis: ["5.16"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\p2psvc -> Start -> 4' - - - id: 13510 - title: "Ensure 'Peer Networking Identity Manager (p2pimsvc)' is set to 'Disabled'" - description: "Provides identity services for the Peer Name Resolution Protocol (PNRP) and Peer-to-Peer Grouping services. The recommended state for this setting is: Disabled." - rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Networking Identity Manager" - compliance: - - cis: ["5.17"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\p2pimsvc -> Start -> 4' - - - id: 13511 - title: "Ensure 'PNRP Machine Name Publication Service (PNRPAutoReg)' is set to 'Disabled'" - description: "This service publishes a machine name using the Peer Name Resolution Protocol. Configuration is managed via the netsh context ‘p2p pnrp peer'. The recommended state for this setting is: Disabled." - rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\PNRP Machine Name Publication Service" - compliance: - - cis: ["5.18"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PNRPAutoReg -> Start -> 4' - - - id: 13512 - title: "Ensure 'Problem Reports and Solutions Control Panel Support (wercplsupport)' is set to 'Disabled'" - description: "This service provides support for viewing, sending and deletion of system-level problem reports for the Problem Reports and Solutions control panel. The recommended state for this setting is: Disabled." - rationale: "This service is involved in the process of displaying/reporting issues & solutions to/from Microsoft. In a high security environment, preventing this information from being sent can help reduce privacy concerns for sensitive corporate information." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Problem Reports and Solutions Control Panel Support" - compliance: - - cis: ["5.19"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wercplsupport -> Start -> 4' - - - id: 13513 - title: "Ensure 'Remote Access Auto Connection Manager (RasAuto)' is set to 'Disabled'" - description: "Creates a connection to a remote network whenever a program references a remote DNS or NetBIOS name or address." - rationale: "The function of this service is to provide a \"demand dial\" type of functionality. In a high security environment, it is preferred that any remote \"dial\" connections (whether they be legacy dial-in POTS or VPN) are initiated by the user, not automatically by the system." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Access Auto Connection Manager" - compliance: - - cis: ["5.20"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasAuto -> Start -> 4' - - - id: 13514 - title: "Ensure 'Remote Desktop Configuration (SessionEnv)' is set to 'Disabled'" - description: "Remote Desktop Configuration service (RDCS) is responsible for all Remote Desktop related configuration and session maintenance activities that require SYSTEM context. These include per-session temporary folders, RD themes, and RD certificates. The recommended state for this setting is: Disabled." - rationale: "In a high security environment, Remote Desktop access is an increased security risk. For these environments, only local console access should be permitted." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Configuration" - compliance: - - cis: ["5.21"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SessionEnv -> Start -> 4' - - - id: 13515 - title: "Ensure 'Remote Desktop Services (TermService)' is set to 'Disabled'" - description: "Allows users to connect interactively to a remote computer. Remote Desktop and Remote Desktop Session Host Server depend on this service. The recommended state for this setting is: Disabled." - rationale: "In a high security environment, Remote Desktop access is an increased security risk. For these environments, only local console access should be permitted." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Services" - compliance: - - cis: ["5.22"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService -> Start -> 4' - - - id: 13516 - title: "Ensure 'Remote Desktop Services UserMode Port Redirector (UmRdpService)' is set to 'Disabled'" - description: "Allows the redirection of Printers/Drives/Ports for RDP connections. The recommended state for this setting is: Disabled." - rationale: "In a security-sensitive environment, it is desirable to reduce the possible attack surface - preventing the redirection of COM, LPT and PnP ports will reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer within an RDP session." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Services UserMode Port Redirector" - compliance: - - cis: ["5.23"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UmRdpService -> Start -> 4' - - - id: 13517 - title: "Ensure 'Remote Registry (RemoteRegistry)' is set to 'Disabled'" - description: "Enables remote users to modify registry settings on this computer. The recommended state for this setting is: Disabled." - rationale: "In a high security environment, exposing the registry to remote access is an increased security risk." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Registry" - compliance: - - cis: ["5.25"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteRegistry -> Start -> 4' - - - id: 13518 - title: "Ensure 'Server (LanmanServer)' is set to 'Disabled'" - description: "Supports file, print, and named-pipe sharing over the network for this computer. If this service is stopped, these functions will be unavailable. The recommended state for this setting is: Disabled." - rationale: "In a high security environment, a secure workstation should only be a client, not a server. Sharing workstation resources for remote access increases security risk as the attack surface is notably higher." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Server" - compliance: - - cis: ["5.27"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer -> Start -> 4' - - - id: 13519 - title: "Ensure 'SNMP Service (SNMP)' is set to 'Disabled' or 'Not Installed'" - description: "Enables Simple Network Management Protocol (SNMP) requests to be processed by this computer. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Simple Network Management Protocol (SNMP))." - rationale: "Features that enable inbound network connections increase the attack surface. In a high security environment, management of secure workstations should be handled locally." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\SNMP Service" - compliance: - - cis: ["5.29"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP -> Start -> 4' - - - id: 13520 - title: "Ensure 'Windows Error Reporting Service (WerSvc)' is set to 'Disabled'" - description: "Allows errors to be reported when programs stop working or responding and allows existing solutions to be delivered. Also allows logs to be generated for diagnostic and repair services. The recommended state for this setting is: Disabled." - rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Error Reporting Service" - compliance: - - cis: ["5.33"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WerSvc -> Start -> 4' - - - id: 13521 - title: "Ensure 'Windows Event Collector (Wecsvc)' is set to 'Disabled'" - description: "This service manages persistent subscriptions to events from remote sources that support WS-Management protocol. This includes Windows Vista event logs, hardware and IPMI- enabled event sources. The service stores forwarded events in a local Event Log. The recommended state for this setting is: Disabled." - rationale: "In a high security environment, remote connections to secure workstations should be minimized, and management functions should be done locally." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Event Collector" - compliance: - - cis: ["5.34"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Wecsvc -> Start -> 4' - - - id: 13522 - title: "Ensure 'Windows Push Notifications System Service (WpnService)' is set to 'Disabled'" - description: "This service runs in session 0 and hosts the notification platform and connection provider which handles the connection between the device and WNS server. The recommended state for this setting is: Disabled. Note: In the first two releases of Windows 10 (R1507 & R1511), the display name of this service was initially named Windows Push Notifications Service - but it was renamed to Windows Push Notifications System Service starting with Windows 10 R1607." - rationale: "Windows Push Notification Services (WNS) is a mechanism to receive 3rd-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Push Notifications System Service" - compliance: - - cis: ["5.37"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WpnService -> Start -> 4' - - - id: 13523 - title: "Ensure 'Windows PushToInstall Service (PushToInstall)' is set to 'Disabled'" - description: "This service manages Apps that are pushed to the device from the Windows Store App running on other devices or the web. The recommended state for this setting is: Disabled." - rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows PushToInstall Service (PushToInstall)" - compliance: - - cis: ["5.38"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PushToInstall -> Start -> 4' - - - id: 13524 - title: "Ensure 'Windows Remote Management (WS-Management) (WinRM)' is set to 'Disabled'" - description: "Windows Remote Management (WinRM) service implements the WS-Management protocol for remote management. WS-Management is a standard web services protocol used for remote software and hardware management. The WinRM service listens on the network for WS-Management requests and processes them. The recommended state for this setting is: Disabled." - rationale: "Features that enable inbound network connections increase the attack surface. In a high security environment, management of secure workstations should be handled locally." - remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Remote Management (WS-Management)" - compliance: - - cis: ["5.39"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinRM -> Start -> 4' - -# 18.1 Control Panel - - id: 13525 - title: "Ensure 'Allow Online Tips' is set to 'Disabled'" - description: "This policy setting configures the retrieval of online tips and help for the Settings app. The recommended state for this setting is: Disabled." - rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow Online Tips Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanel.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." - compliance: - - cis: ["18.1.3"] - - cis_csc: ["9.1"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips -> 0' - -# 18.4 MSS (Legacy) - - id: 13526 - title: "Ensure 'MSS: (DisableSavePassword) Prevent the dial-up password from being saved' is set to 'Enabled'" - description: "When you dial a phonebook or VPN entry in Dial-Up Networking, you can use the \"Save Password\" option so that your Dial-Up Networking password is cached and you will not need to enter it on successive dial attempts. For security, administrators may want to prevent users from caching passwords. The recommended state for this setting is: Enabled." - rationale: "An attacker who steals a mobile user's computer could automatically connect to the organization's network if the Save This Password check box is selected for the dial-up or VPN networking entry used to connect to your organization's network." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(DisableSavePassword) Prevent the dial-up password from being saved. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." - compliance: - - cis: ["18.4.4"] - - cis_csc: ["9"] - references: - - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters -> DisableSavePassword -> 1' - - - id: 13527 - title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'" - description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." - rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." - compliance: - - cis: ["18.4.6"] - - cis_csc: ["9"] - references: - - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - - 'CCE-35469-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 493e0' - - - id: 13528 - title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'" - description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." - rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." - compliance: - - cis: ["18.4.8"] - - cis_csc: ["9"] - references: - - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - - 'CCE-34614-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' - - - id: 13529 - title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" - description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." - rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." - compliance: - - cis: ["18.4.11"] - - cis_csc: ["9"] - references: - - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - - 'CCE-34622-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' - - - id: 13530 - title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" - description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." - rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." - compliance: - - cis: ["18.4.12"] - - cis_csc: ["9"] - references: - - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - - 'CCE-34623-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' - -# 18.5 Network - - id: 13531 - title: "Ensure 'Enable Font Providers' is set to 'Disabled'" - description: "This policy setting determines whether Windows is allowed to download fonts and font catalog data from an online font provider. The recommended state for this setting is: Disabled." - rationale: "In an enterprise managed environment the IT department should be managing the changes to the system configuration, to ensure all changes are tested and approved." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Fonts\\Enable Font Providers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." - compliance: - - cis: ["18.5.5.1"] - - cis_csc: ["3", "13"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders -> 0' - - - id: 13532 - title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'" - description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." - rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.5.9.1"] - - cis_csc: ["9"] - references: - - 'CCE-34262-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' - - - id: 13533 - title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'" - description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." - rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.5.9.2"] - - cis_csc: ["9"] - references: - - 'CCE-34073-7' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' - - - id: 13534 - title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'" - description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." - rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services. Note: This Group Policy path is provided by the Group Policy template P2P- pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.5.10.2"] - - cis_csc: ["9.1", "9.2"] - references: - - 'CCE-33208-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' - - - id: 13535 - title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')" - description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)" - rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components reduces a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." - remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:Disabl edComponents Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." - compliance: - - cis: ["18.5.19.2.1"] - - cis_csc: ["9"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> ff' - - - id: 13536 - title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'" - description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." - rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.5.20.1"] - - cis_csc: ["15.4", "15.5"] - references: - - 'CCE-34326-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' - - - id: 13537 - title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'" - description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." - rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." - compliance: - - cis: ["18.5.20.2"] - - cis_csc: ["15.4", "15.5"] - references: - - 'CCE-35606-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' - -# 18.8 System - - id: 13538 - title: "Ensure 'Turn off access to the Store' is set to 'Enabled'" - description: "This policy setting specifies whether to use the Store service for finding an application to open a file with an unhandled file type or protocol association. When a user opens a file type or protocol that is not associated with any applications on the computer, the user is given the choice to select a local application or use the Store service to find an application. The recommended state for this setting is: Enabled." - rationale: "The Store service is a retail outlet built into Windows, primarily for consumer use. In an enterprise managed environment the IT department should be managing the installation of all applications to reduce the risk of the installation of vulnerable software." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off access to the Store. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ICM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." - compliance: - - cis: ["18.8.22.1.1"] - - cis_csc: ["2"] - references: - - 'CCE-35626-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> 1' - - - id: 13539 - title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'" - description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." - rationale: "Users might download drivers that include malicious code." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off downloading of print drivers over HTTP." - compliance: - - cis: ["18.8.22.1.2"] - - cis_csc: ["7"] - references: - - 'CCE-35781-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' - - - id: 13540 - title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'" - description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." - rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.8.22.1.3"] - - cis_csc: ["13"] - references: - - 'CCE-32945-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' - - - id: 13541 - title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'" - description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." - rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.4"] - - cis_csc: ["13"] - references: - - 'CCE-35784-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' - - - id: 13542 - title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'" - description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." - rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.5"] - - cis_csc: ["13"] - references: - - 'CCE-33153-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' - - - id: 13543 - title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'" - description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." - rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.8"] - references: - - 'CCE-33216-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' - - - id: 13544 - title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" - description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." - rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.9"] - - cis_csc: ["13"] - references: - - 'CCE-33817-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' - - - id: 13545 - title: "Ensure 'Turn off the \"Order Prints\" picture task' is set to 'Enabled'" - description: "This policy setting specifies whether the \"Order Prints Online\" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled." - rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.10"] - - cis_csc: ["13"] - references: - - 'CCE-34061-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' - - - id: 13546 - title: "Ensure 'Turn off the \"Publish to Web\" task for files and folders' is set to 'Enabled'" - description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." - rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.11"] - - cis_csc: ["13"] - references: - - 'CCE-33246-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' - - - id: 13547 - title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" - description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." - rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.12"] - - cis_csc: ["13"] - references: - - 'CCE-33957-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' - - - id: 13548 - title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'" - description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." - rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.13"] - - cis_csc: ["13"] - references: - - 'CCE-33255-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' - - - id: 13549 - title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" - description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." - rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.14"] - - cis_csc: ["13"] - references: - - 'CCE-34260-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PCHealth\ErrorReporting -> DoReport -> 0' - - - id: 13550 - title: "Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'" - description: "This policy setting allows you to set support for Kerberos to attempt authentication using the certificate for the device to the domain. Support for device authentication using certificate will require connectivity to a DC in the device account domain which supports certificate authentication for computer accounts. The recommended state for this setting is: Enabled: Automatic." - rationale: "Having stronger device authentication with the use of certificates is strongly encouraged over standard username and password authentication. Having this set to Automatic will allow certificate based authentication to be used whenever possible." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Automatic: Computer Configuration\\Policies\\Administrative Templates\\System\\Kerberos\\Support device authentication using certificate. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Kerberos.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." - compliance: - - cis: ["18.8.25.1"] - - cis_csc: ["1.6", "1.8"] - references: - - 'CCE-41396-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled -> 1' - - - id: 13551 - title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'" - description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." - rationale: "This is a way to increase the security of the system account." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." - compliance: - - cis: ["18.8.26.1"] - - cis_csc: ["16.5", "16.11"] - references: - - 'CCE-35101-5' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' - - - id: 13552 - title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'" - description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." - rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." - compliance: - - cis: ["18.8.44.5.1"] - - cis_csc: ["13"] - references: - - 'CCE-34972-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' - - - id: 13553 - title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'" - description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." - rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.8.44.11.1"] - - cis_csc: ["13"] - references: - - 'CCE-33662-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' - - - id: 13554 - title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'" - description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." - rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.8.46.1"] - - cis_csc: ["13"] - references: - - 'CCE-33823-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' - - - id: 13555 - title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'" - description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." - rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.49.1.1"] - - cis_csc: ["6.1"] - references: - - 'CCE-33661-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' - - - id: 13556 - title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'" - description: "This policy setting allows you to specify whether the Windows NTP Server is enabled. The recommended state for this setting is: Disabled." - rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.49.1.2"] - - cis_csc: ["9.1", "9.2"] - references: - - 'CCE-35135-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' - -# 18.9 Windows Components - - id: 13557 - title: "Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'" - description: "Manages a Windows app's ability to share data between users who have installed the app. Data is shared through the SharedLocal folder. This folder is available through the Windows.Storage API. The recommended state for this setting is: Disabled." - rationale: "Users of a system could accidentally share sensitive data with other users on the same system." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Allow a Windows app to share application data between users. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." - compliance: - - cis: ["18.9.4.1"] - - cis_csc: ["14.4", "14.6"] - references: - - 'CCE-41397-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData -> 0' - - - id: 13558 - title: "Ensure 'Allow Use of Camera' is set to 'Disabled'" - description: "This policy setting controls whether the use of Camera devices on the machine are permitted. The recommended state for this setting is: Disabled." - rationale: "Cameras in a high security environment can pose serious privacy and data exfiltration risks - they should be disabled to help mitigate that risk." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Camera\\Allow Use of Camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Camera.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.12.1"] - - cis_csc: ["13"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera -> 0' - - - id: 13559 - title: "Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage'" - description: "This policy setting controls whether the Connected User Experience and Telemetry service can automatically use an authenticated proxy to send data back to Microsoft. The recommended state for this setting is: Enabled: Disable Authenticated Proxy usage." - rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Authenticated Proxy usage: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.16.2"] - - cis_csc: ["13"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy -> 1' - - - id: 13560 - title: "Ensure 'Turn off location' is set to 'Enabled'" - description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." - rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.39.2"] - - cis_csc: ["13"] - references: - - 'CCE-33743-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' - - - id: 13561 - title: "Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'" - description: "This policy setting allows backup and restore of cellular text messages to Microsoft's cloud services. The recommended state for this setting is: Disabled." - rationale: "In a high security environment, data should never be sent to any 3rd party since this data could contain sensitive information." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Messaging\\Allow Message Service Cloud Sync Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Messaging.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.43.1"] - - cis_csc: ["9.1", "9.2", "13"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync -> 0' - - - id: 13562 - title: "Ensure 'Allow Address bar drop-down list suggestions' is set to 'Disabled'" - description: "This setting determines whether the Address bar drop-down functionality is available in Microsoft Edge. The recommended state for this setting is: Disabled." - rationale: "Having Address bar drop-down list suggestions sent out to be processed is considered a privacy concern." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Allow Address bar drop-down list suggestions. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.45.1"] - - cis_csc: ["13"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\ServiceUI -> ShowOneBox -> 0' - - - id: 13563 - title: "Ensure 'Allow Adobe Flash' is set to 'Disabled'" - description: "This setting lets you decide whether employees can run Adobe Flash in Microsoft Edge. The recommended state for this setting is: Disabled." - rationale: "Adobe Flash is a very insecure product and has been a frequent attack vector on the web. In more highly security-sensitive environments, Adobe Flash should be disabled completely to eliminate this attack vector. Note: This setting will not prevent or remove Adobe Flash usage from other web browsers, so we recommend also uninstalling Adobe Flash completely from all systems in highly security-sensitive environments." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Allow Adobe Flash. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.45.2"] - - cis_csc: ["7.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Addons -> FlashPlayerEnabled -> 0' - - - id: 13564 - title: "Ensure 'Allow InPrivate Browsing' is set to 'Disabled'" - description: "This setting lets you decide whether employees can browse using InPrivate website browsing. The recommended state for this setting is: Disabled." - rationale: "Even though web filter logs can monitor traffic to and from websites, it is always a good practice to try and keep multiple source of logs. It can also be helpful to keep user from privately browsing in order to troubleshoot malicious site visits if a machine has become compromised." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Allow InPrivate Browsing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was named Turn off InPrivate browsing, but it was renamed starting with the Windows 10 Release 1607 & Server 2016 Administrative Templates." - compliance: - - cis: ["18.9.45.3"] - - cis_csc: ["7"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> AllowInPrivate -> 0' - - - id: 13565 - title: "Ensure 'Configure Pop-up Blocker' is set to 'Enabled'" - description: "This setting lets you decide whether to turn on Pop-up Blocker and whether to allow pop- ups to appear in secondary windows. The recommended state for this setting is: Enabled." - rationale: "The Pop-up Blocker serves an important purpose by blocking malicious popups and helping prevent the machine from being compromised." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Configure Pop-up Blocker. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was named Turn off Pop-up Blocker, but it was renamed starting with the Windows 10 Release 1607 & Server 2016 Administrative Templates." - compliance: - - cis: ["18.9.45.6"] - - cis_csc: ["7"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> AllowPopups -> r:yes' - - - id: 13566 - title: "Ensure 'Configure search suggestions in Address bar' is set to 'Disabled'" - description: "This setting lets you decide whether search suggestions should appear in the Address bar of Microsoft Edge. The recommended state for this setting is: Disabled." - rationale: "Having search suggestions sent out to be processed is considered a privacy concern." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Configure search suggestions in Address bar. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1507 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1507 Administrative Templates, this setting was named Stops address bar from showing search suggestions. In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was renamed to Turn off address bar search suggestions, but it was finally renamed to Configure search suggestions in Address bar starting with the Windows 10 Release 1607 & Server 2016 Administrative Templates." - compliance: - - cis: ["18.9.45.7"] - - cis_csc: ["13"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\SearchScopes -> ShowSearchSuggestionsGlobal -> 0' - - - id: 13567 - title: "Ensure 'Prevent access to the about:flags page in Microsoft Edge' is set to 'Enabled'" - description: "This policy setting lets you decide whether employees can access the about:flags page, which is used to change developer settings and to enable experimental features. The recommended state for this setting is: Enabled." - rationale: "Users should not have access to developer settings and experimental features. Vulnerabilities could be introduced if these settings are not properly managed." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Prevent access to the about:flags page in Microsoft Edge. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.45.9"] - - cis_csc: ["3"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> PreventAccessToAboutFlagsInMicrosoftEdge -> 1' - - - id: 13568 - title: "Ensure 'Prevent using Localhost IP address for WebRTC' is set to 'Enabled'" - description: "This setting lets you decide whether an employee's LocalHost IP address shows while making phone calls using the WebRTC protocol. The recommended state for this setting is: Enabled." - rationale: "WebRTC is a Real-Time Communications open source project supported by all major browsers. Allowing a system's local IP address to be shared may be considered a privacy concern." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Edge\\Prevent using Localhost IP address for WebRTC. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was named Don't allow WebRTC to share the LocalHost IP address, but it was renamed starting with the Windows 10 Release 1607 & Server 2016 Administrative Templates." - compliance: - - cis: ["18.9.45.10"] - - cis_csc: ["7.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -> HideLocalHostIP -> 1' - - - id: 13569 - title: "Ensure 'Turn off Push To Install service' is set to 'Enabled'" - description: "This policy setting controls whether users can push Apps to the device from the Windows Store App running on other devices or the web. The recommended state for this setting is: Enabled." - rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Push to Install\\Turn off Push To Install service. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PushToInstall.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.57.1"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall -> 1' - - - id: 13570 - title: "Ensure 'Allow users to connect remotely by using Remote Desktop Services' is set to 'Disabled'" - description: "This policy setting allows you to configure remote access to computers by using Remote Desktop Services. The recommended state for this setting is: Disabled." - rationale: "Any account with the Allow log on through Remote Desktop Services user right can log on to the remote console of the computer. If you do not restrict access to legitimate users who need to log on to the console of the computer, unauthorized users could download and execute malicious code to elevate their privileges." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Allow users to connect remotely by using Remote Desktop Services. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Allow users to connect remotely using Terminal Services, but it was renamed to Allow users to connect remotely using Remote Desktop Services in the Windows 7 & Server 2008 R2 Administrative Templates. It was renamed again to Allow users to connect remotely by using Remote Desktop Services in the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." - compliance: - - cis: ["18.9.58.3.2.1"] - references: - - 'CCE-35255-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDenyTSConnections -> 0' - - - id: 13571 - title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'" - description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." - rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.58.3.3.1"] - - cis_csc: ["9.1", "9.2"] - references: - - 'CCE-34496-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' - - - id: 13572 - title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'" - description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." - rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.58.3.3.3"] - - cis_csc: ["9.1", "9.2"] - references: - - 'CCE-34698-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' - - - id: 13573 - title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'" - description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." - rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.58.3.3.4"] - - cis_csc: ["9.1", "9.2"] - references: - - 'CCE-34790-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' - - - id: 13574 - title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'" - description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less." - rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." - compliance: - - cis: ["18.9.58.3.10.1"] - - cis_csc: ["16.5", "16.11"] - references: - - https://workbench.cisecurity.org/benchmarks/766 - - 'CCE-35595-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' - - - id: 13575 - title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'" - description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." - rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.58.3.10.2"] - - cis_csc: ["16.5", "16.11"] - references: - - 'CCE-35599-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' - - - id: 13576 - title: "Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'" - description: "This policy setting allows search and Cortana to search cloud sources like OneDrive and SharePoint. The recommended state for this setting is: Enabled: Disable Cloud Search." - rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Cloud Search: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cloud Search. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.60.2"] - - cis_csc: ["9.1", "9.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch -> 0' - - - id: 13577 - title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'" - description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." - rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." - compliance: - - cis: ["18.9.65.1"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' - - - id: 13578 - title: "Ensure 'Turn off the Store application' is set to 'Enabled'" - description: "This setting denies or allows access to the Store application. The recommended state for this setting is: Enabled. Note: Per Microsoft TechNet and MSKB 3135657, this policy setting does not apply to any Windows 10 editions other than Enterprise and Education." - rationale: "Only applications approved by an IT department should be installed. Allowing users to install 3rd party applications can lead to missed patches and potential zero day vulnerabilities." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off the Store application. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinStoreUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates, or by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.68.5"] - - cis_csc: ["2"] - references: - - https://docs.microsoft.com/en-us/windows/client-management/group-policies-for-enterprise-and-education-editions - - https://support.microsoft.com/en-us/help/3135657/can-t-disable-windows-store-in-windows-10-pro-through-group-policy - - 'CCE-35811-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RemoveWindowsStore -> 1' - - - id: 13579 - title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'" - description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to \"Windows Defender Antivirus Cloud Protection Service\". Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership. The recommended state for this setting is: Disabled." - rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Join Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.76.3.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting -> 0' - - - id: 13580 - title: "Ensure 'Configure Watson events' is set to 'Disabled'" - description: "This policy setting allows you to configure whether or not Watson events are sent. The recommended state for this setting is: Disabled." - rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission. Preventing this information from being sent can help reduce privacy concerns." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Reporting\\Configure Watson events. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.76.9.1"] - - cis_csc: ["13"] - references: - - 'CCE-33880-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' - - - id: 13581 - title: "Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'" - description: "This policy setting determines whether suggested apps in Windows Ink Workspace are allowed. The recommended state for this setting is: Disabled." - rationale: "This Microsoft feature is designed to collect data and suggest apps based on that data collected. Disabling this setting will help ensure your data is not shared with any third party." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow suggested apps in Windows Ink Workspace. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.84.1"] - - cis_csc: ["13"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace -> 0' - - - id: 13582 - title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'" - description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." - rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." - compliance: - - cis: ["18.9.85.3"] - - cis_csc: ["7"] - references: - - 'CCE-35086-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' - - - id: 13583 - title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'" - description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." - rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." - compliance: - - cis: ["18.9.97.2.2"] - - cis_csc: ["3.4", "4.5"] - references: - - 'CCE-33146-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' - - - id: 13584 - title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'" - description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." - rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.98.1"] - - cis_csc: ["3.4", "4.5"] - references: - - 'CCE-33740-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' diff --git a/sca/windows/cis_win2012r2_memberL1.yml b/sca/windows/cis_win2012r2.yml similarity index 63% rename from sca/windows/cis_win2012r2_memberL1.yml rename to sca/windows/cis_win2012r2.yml index 03d0e4d16..ac5c22985 100644 --- a/sca/windows/cis_win2012r2_memberL1.yml +++ b/sca/windows/cis_win2012r2.yml @@ -1,5 +1,5 @@ # Security Configuration Assessment -# CIS Checks for Windows 2012 R2 Member Server L1 +# CIS Checks for Windows 2012 R2 # Copyright (C) 2015-2020, Wazuh Inc. # # This program is free software; you can redistribute it @@ -13,24 +13,23 @@ # Center for Internet Security Benchmark for Microsoft Windows Server 2012 R2 v2.0.0 - 09-30-2015 policy: - id: "cis_win2012r2_memberL1" - file: "cis_win2012r2_memberL1.yml" - name: "CIS benchmark for Windows 2012 R2 Member Server L1" + id: "cis_win2012r2" + file: "cis_win2012r2.yml" + name: "CIS Benchmark for Windows 2012 R2" description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2012 R2." references: - https://www.cisecurity.org/cis-benchmarks/ requirements: title: "Check that the Windows platform is Windows Server 2012 R2" - description: "Requirements for running the CIS benchmark Member Server L1 under Windows Server 2012 R2" + description: "Requirements for running the CIS benchmark under Windows Server 2012 R2" condition: all rules: - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2012 R2' checks: - # Section 1.1 - Password Policies - - id: 12000 + - id: 15000 title: "Ensure 'Maximum password age' is set to '60 or fewer days, but not 0'" description: "This policy setting defines how long a user can use their password before it expires. Values for this policy setting range from 0 to 999 days. If you set the value to 0, the password will never expire. Because attackers can crack passwords, the more frequently you change the password the less opportunity an attacker has to use a cracked password. However, the lower this value is set, the higher the potential for an increase in calls to help desk support due to users having to change their password or forgetting which password is current. The recommended state for this setting is 60 or fewer days, but not 0." rationale: "The longer a password exists the higher the likelihood that it will be compromised by a brute force attack, by an attacker gaining general knowledge about the user, or by the user sharing the password. Configuring the Maximum password age setting to 0 so that users are never required to change their passwords is a major security risk because that allows a compromised password to be used by the malicious user for as long as the valid user is authorized access." @@ -38,6 +37,8 @@ checks: compliance: - cis: ["1.1.2"] - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] references: - 'CCE-37167-4' condition: all @@ -46,35 +47,39 @@ checks: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> n:^(\d+) compare <= 60' # Section 2.3 - Security Options - - id: 12001 - title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts" + - id: 15001 + title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'" description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." - remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts : Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts." compliance: - cis: ["2.3.1.2"] - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] references: - 'CCE-36147-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 3' - - id: 12002 + - id: 15002 title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'" description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." - rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domain-based password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." + rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domainbased password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Limit local account use of blank passwords to console logon only." compliance: - cis: ["2.3.1.4"] - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-37615-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' - - id: 12003 + - id: 15003 title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'" description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled. *Important*: Be very cautious about audit settings that can generate a large volume of traffic. For example, if you enable either success or failure auditing for all of the Privilege Use subcategories, the high volume of audit events generated can make it difficult to find other types of entries in the Security log. Such a configuration could also have a significant impact on system performance." rationale: "Prior to the introduction of auditing subcategories in Windows Vista, it was difficult to track events at a per-system or per-user level. The larger event categories created too many events and the key information that needed to be audited was difficult to find." @@ -82,42 +87,54 @@ checks: compliance: - cis: ["2.3.2.1"] - cis_csc: ["6.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-37850-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' - - id: 12004 + - id: 15004 title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'" description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. If the Audit: Shut down system immediately if unable to log security audits setting is enabled, unplanned system failures can occur. The administrative burden can be significant, especially if you also configure the Retention method for the Security log to Do not overwrite events (clear log manually). This configuration causes a repudiation threat (a backup operator could deny that they backed up or restored data) to become a denial of service (DoS) vulnerability, because a server could be forced to shut down if it is overwhelmed with logon events and other security events that are written to the Security log. Also, because the shutdown is not graceful, it is possible that irreparable damage to the operating system, applications, or data could result. Although the NTFS file system guarantees its integrity when an ungraceful computer shutdown occurs, it cannot guarantee that every data file for every application will still be in a usable form when the computer restarts. The recommended state for this setting is: Disabled." rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Shut down system immediately if unable to log security audits." - default_value: "Disabled." compliance: - cis: ["2.3.2.2"] - cis_csc: ["6"] + - pci_dss: ["2.2.4","10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-35907-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' - - id: 12005 + - id: 15005 title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'" description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators." rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." - remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Allowed to format and eject removable media." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators and Interactive Users: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Allowed to format and eject removable media." + default_value: "Disabled." compliance: - cis: ["2.3.4.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-37701-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 0' - - id: 12006 + + - id: 15006 title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'" description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, you should allow only Administrators, not users, to do so on servers, because printer driver installation on a server may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." @@ -125,13 +142,67 @@ checks: compliance: - cis: ["2.3.4.2"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.4","2,2,5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3","CC5.2"] references: - 'CCE-37942-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' - - id: 12007 + - id: 15007 + title: "Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only)" + description: "This policy setting determines whether members of the Server Operators group are allowed to submit jobs by means of the AT schedule facility. The impact of this policy setting configuration should be small for most organizations. Users, including those in the Server Operators group, will still be able to create jobs by means of the Task Scheduler Wizard, but those jobs will run in the context of the account with which the user authenticates when they set up the job. Note: An AT Service Account can be modified to select a different account rather than the LOCAL SYSTEM account. To change the account, open System Tools, click Scheduled Tasks, and then click Accessories folder. Then click AT Service Account on the Advanced menu. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, jobs that are created by server operators by means of the AT service will execute in the context of the account that runs that service. By default, that is the local SYSTEM account. If you enable this policy setting, server operators could perform tasks that SYSTEM is able to do but that they would typically not be able to do, such as add their account to the local Administrators group." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Allow server operators to schedule tasks." + compliance: + - cis: ["2.3.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-37848-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SubmitControl -> 0' + + - id: 15008 + title: "Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' (DC only)" + description: "This policy setting determines whether the Lightweight Directory Access Protocol (LDAP) server requires LDAP clients to negotiate data signing. The recommended state for this setting is: Require signing. Note: Domain member computers must have Network security: LDAP signing requirements (Rule 2.3.11.8) set to Negotiate signing or higher. If not, they will fail to authenticate once the above Require signing value is configured on the Domain Controllers. Fortunately, Negotiate signing is the default in the client configuration. Note #2: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are shipped with Windows XP Professional use LDAP simple bind or LDAP simple bind through SSL to talk to a Domain Controller. Note #3: Before enabling this setting, you should first ensure that there are no clients (including server-based applications) that are configured to authenticate with Active Directory via unsigned LDAP, because changing this setting will break those applications. Such applications should first be reconfigured to use signed LDAP, Secure LDAP (LDAPS), or IPsec-protected connections." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks. In such attacks, an intruder captures packets between the server and the client, modifies them, and then forwards them to the client. Where LDAP servers are concerned, an attacker could cause a client to make decisions that are based on false records from the LDAP directory. To lower the risk of such an intrusion in an organization's network, you can implement strong physical security measures to protect the network infrastructure. Also, you could implement Internet Protocol security (IPsec) authentication header mode (AH), which performs mutual authentication and packet integrity for IP traffic to make all types of man- in-the-middle attacks extremely difficult. Additionally, allowing the use of regular, unsigned LDAP permits credentials to be received over the network in clear text, which could very easily result in the interception of account passwords by other systems on the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require signing: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: LDAP server signing requirements." + compliance: + - cis: ["2.3.5.2"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - https://blogs.technet.microsoft.com/russellt/2016/01/13/identifying-clear-text-ldap-binds-to-your-dcs/ + - 'CCE-35904-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity -> 2' + + - id: 15009 + title: "Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' (DC only)" + description: "This security setting determines whether Domain Controllers will refuse requests from member computers to change computer account passwords. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting on all Domain Controllers in a domain, domain members will not be able to change their computer account passwords, and those passwords will be more susceptible to attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Refuse machine account password changes." + compliance: + - cis: ["2.3.5.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - 'CCE-36921-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange -> 0' + + - id: 15010 title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'" description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -139,13 +210,17 @@ checks: compliance: - cis: ["2.3.6.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36142-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' - - id: 12008 + - id: 15011 title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'" description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -153,13 +228,17 @@ checks: compliance: - cis: ["2.3.6.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37130-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' - - id: 12009 + - id: 15012 title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'" description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -167,13 +246,17 @@ checks: compliance: - cis: ["2.3.6.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37222-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' - - id: 12010 + - id: 15013 title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'" description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled." rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." @@ -181,27 +264,33 @@ checks: compliance: - cis: ["2.3.6.4"] - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] references: - 'CCE-37508-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' - - id: 12011 + - id: 15014 title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'" description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." - rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected)." + rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)" remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Require strong (Windows 2000 or later) session key." compliance: - cis: ["2.3.6.6"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37614-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' - - id: 12012 + - id: 15015 title: "Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'" description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." @@ -209,13 +298,19 @@ checks: compliance: - cis: ["2.3.7.1"] - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-36056-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' - - id: 12013 + - id: 15016 title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'" description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." @@ -223,13 +318,19 @@ checks: compliance: - cis: ["2.3.7.2"] - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-37637-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' - - id: 12014 + - id: 15017 title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'" description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit." rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." @@ -237,6 +338,8 @@ checks: compliance: - cis: ["2.3.7.3"] - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] references: - 'CCE-38235-8' condition: all @@ -244,7 +347,24 @@ checks: - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' - - id: 12015 + - id: 15018 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'" + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information. Logon information for domain accounts can be cached locally to allow users to log on even if a Domain Controller cannot be contacted. This policy setting determines the number of unique users for whom logon information is cached locally. If this value is set to 0, the logon cache feature is disabled. An attacker who is able to access the file system of the server could locate this cached information and use a brute force attack to determine user passwords. The recommended state for this setting is: 4 or fewer logon(s) ." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally. If the number is set to 4, then the computer caches logon information for 4 users. When a 5th user logs on to the computer, the server overwrites the oldest cached logon session. Users who access the computer console will have their logon credentials cached on that computer. An attacker who is able to access the file system of the computer could locate this cached information and use a brute force attack to attempt to determine user passwords. To mitigate this type of attack, Windows encrypts the information and obscures its physical location." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s) : Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)" + compliance: + - cis: ["2.3.7.6"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - 'CCE-37439-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> n:^(\d+) compare <= 4' + + + - id: 15019 title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'" description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." rationale: "It is recommended that user passwords be configured to expire periodically. Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." @@ -252,28 +372,33 @@ checks: compliance: - cis: ["2.3.7.7"] - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] references: - 'CCE-37622-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5' - - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare <= 14' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' + - - id: 12016 + - id: 15020 title: "Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled'" - description: "Logon information is required to unlock a locked computer. For domain accounts, this security setting determines whether it is necessary to contact a Domain Controller to unlock a computer. The recommended state for this setting is: Enabled." + description: "Logon information is required to unlock a locked computer. For domain accounts, this security setting determines whether it is necessary to contact a Domain Controller to unlock a computer. The recommended state for this setting is: Enabled ." rationale: "By default, the computer caches in memory the credentials of any users who are authenticated locally. The computer uses these cached credentials to authenticate anyone who attempts to unlock the console. When cached credentials are used, any changes that have recently been made to the account - such as user rights assignments, account lockout, or the account being disabled - are not considered or applied after the account is authenticated. User privileges are not updated, and (more importantly) disabled accounts are still able to unlock the console of the computer." - remediation: "To implement the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Require Domain Controller Authentication to unlock workstation." + remediation: "To implement the recommended configuration via GP, set the following UI path to Enabled:Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Require Domain Controller Authentication to unlock workstation" compliance: - cis: ["2.3.7.8"] - cis_csc: ["16.9"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] references: - 'CCE-38240-8' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon -> 1' - - id: 12017 + - id: 15021 title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher" description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." @@ -281,13 +406,15 @@ checks: compliance: - cis: ["2.3.7.9"] - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] references: - 'CCE-38333-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$|^3$' - - id: 12018 + - id: 15022 title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'" description: "This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the 'Microsoft network client and server: Digitally sign communications (four related settings)' section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -295,13 +422,17 @@ checks: compliance: - cis: ["2.3.8.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36325-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' - - id: 12019 + - id: 15023 title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'" description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -309,13 +440,17 @@ checks: compliance: - cis: ["2.3.8.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36269-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' - - id: 12020 + - id: 15024 title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'" description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." @@ -323,13 +458,17 @@ checks: compliance: - cis: ["2.3.8.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37863-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' - - id: 12021 + - id: 15025 title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0'" description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. A value of 0 appears to allow sessions to persist indefinitely. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s), but not 0." rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." @@ -337,6 +476,8 @@ checks: compliance: - cis: ["2.3.9.1"] - cis_csc: ["3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] references: - 'CCE-38046-9' condition: all @@ -344,7 +485,7 @@ checks: - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> 0' - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' - - id: 12022 + - id: 15026 title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'" description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -352,13 +493,17 @@ checks: compliance: - cis: ["2.3.9.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37864-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' - - id: 12023 + - id: 15027 title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'" description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -366,13 +511,17 @@ checks: compliance: - cis: ["2.3.9.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35988-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' - - id: 12024 + - id: 15028 title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'" description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." @@ -380,28 +529,35 @@ checks: compliance: - cis: ["2.3.9.4"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37972-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' - - id: 12025 + - id: 15029 title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher" - description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client. Configuring this setting to Required from client also conforms to the benchmark. Note: Since the release of the MS KB3161561 security patch, this setting can cause significant issues (such as replication problems, group policy editing issues and blue screen crashes) on Domain Controllers when used simultaneously with UNC path hardening (i.e. Rule 18.5.14.1). CIS therefore recommends against deploying this setting on Domain Controllers." + description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client . Configuring this setting to Required from client also conforms to the benchmark. Note: Since the release of the MS KB3161561 security patch, this setting can cause significant issues (such as replication problems, group policy editing issues and blue screen crashes) on Domain Controllers when used simultaneously with UNC path hardening (i.e. Rule 18.5.14.1). CIS therefore recommends against deploying this setting on Domain Controllers." rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." - remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level." + remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level" compliance: - cis: ["2.3.9.5"] - cis_csc: ["14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - https://support.microsoft.com/en-us/help/3161561/ms16-075-and-ms16-076-description-of-the-security-update-for-windows-n - 'CCE-36170-9' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' - - id: 12026 +# Section 2.3 - Security Options + + + - id: 15030 title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'" description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" @@ -409,13 +565,15 @@ checks: compliance: - cis: ["2.3.10.2"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36316-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' - - id: 12027 + - id: 15031 title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'" description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" @@ -423,13 +581,31 @@ checks: compliance: - cis: ["2.3.10.3"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36316-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' - - id: 12028 + - id: 15032 + title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'" + description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." + rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow storage of passwords and credentials for network authentication." + compliance: + - cis: ["2.3.10.4"] + - cis_csc: ["16.14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-38119-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' + + - id: 15033 title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'" description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." @@ -437,13 +613,15 @@ checks: compliance: - cis: ["2.3.10.5"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36148-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' - - id: 12029 + - id: 15034 title: "Configure 'Network access: Named Pipes that can be accessed anonymously'" description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: - Level 1 - Domain Controller. The recommended state for this setting is: LSARPC, NETLOGON, SAMR and (when the legacy Computer Browser service is enabled) BROWSER. - Level 1 - Member Server. The recommended state for this setting is: (i.e. None), or (when the legacy Computer Browser service is enabled) BROWSER. Note: A Member Server that holds the Remote Desktop Services Role with Remote Desktop Licensing Role Service will require a special exception to this recommendation, to allow the HydraLSPipe and TermServLicensing Named Pipes to be accessed anonymously." rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." @@ -451,13 +629,15 @@ checks: compliance: - cis: ["2.3.10.6"] - cis_csc: ["14.1", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-38258-0' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:\S*' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:lsarpc && r:netlogon && r:samr' - - id: 12030 + - id: 15035 title: "Configure 'Network access: Remotely accessible registry paths'" description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called 'Network access: Remotely accessible registry paths and sub- paths' in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2). Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." @@ -465,13 +645,17 @@ checks: compliance: - cis: ["2.3.10.7"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37194-8' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions|System\\CurrentControlSet\\Control\\Server Applications|Software\\Microsoft\\Windows NT\\CurrentVersion' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Server Applications' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion' - - id: 12031 + - id: 15036 title: "Configure 'Network access: Remotely accessible registry paths and sub-paths'" description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called 'Network access: Remotely accessible registry paths,' the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." @@ -479,13 +663,20 @@ checks: compliance: - cis: ["2.3.10.8"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36347-3' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print|Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows|System\\CurrentControlSet\\Control\\Print\\Printers|System\\CurrentControlSet\\Services\\Eventlog|Software\\Microsoft\\OLAP Server|System\\CurrentControlSet\\Control\\ContentIndex|System\\CurrentControlSet\\Control\\Terminal Server|System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig|System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration|Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib|System\\CurrentControlSet\\Services\\SysmonLog|System\\CurrentControlSet\\Services\\CertSvc|System\\CurrentControlSet\\Services\\WINS' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Print\\Printers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\SysmonLog' - - id: 12032 + - id: 15037 title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'" description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." @@ -493,41 +684,47 @@ checks: compliance: - cis: ["2.3.10.9"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36021-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' - - id: 12033 + - id: 15038 title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'" - description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)" + description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)." rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Shares that can be accessed anonymously." compliance: - cis: ["2.3.10.10"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-38095-6' - condition: all + condition: any rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares' - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\.' - - - id: 12034 + - id: 15039 title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'" - description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)" + description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)." rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." remediation: "To establish the recommended configuration via GP, set the following UI path to Classic - local users authenticate as themselves: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Sharing and security model for local accounts." compliance: - cis: ["2.3.10.11"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1.3"] + - tsc: ["CC6.4"] references: - 'CCE-37623-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' - - id: 12035 + - id: 15040 title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'" description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." @@ -535,13 +732,17 @@ checks: compliance: - cis: ["2.3.11.1"] - cis_csc: ["14", "16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-38341-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' - - id: 12036 + - id: 15041 title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'" description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." rationale: "NULL sessions are less secure because by definition they are unauthenticated." @@ -549,13 +750,17 @@ checks: compliance: - cis: ["2.3.11.2"] - cis_csc: ["14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37035-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' - - id: 12037 + - id: 15042 title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'" description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called Homegroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." @@ -563,13 +768,17 @@ checks: compliance: - cis: ["2.3.11.3"] - cis_csc: ["16.9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-38047-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' - - id: 12038 + - id: 15043 title: "Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'" description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it. For the purposes of scoring we have allowed the use of RC4_HMAC_MD5 as an optional setting." rationale: "he strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." @@ -577,13 +786,17 @@ checks: compliance: - cis: ["2.3.11.4"] - cis_csc: ["16.14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37755-6' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> 2147483644' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:r:2147483644|2147483640' - - id: 12039 + - id: 15044 title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'" description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." @@ -591,13 +804,15 @@ checks: compliance: - cis: ["2.3.11.5"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-36326-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' - - id: 12040 + - id: 15045 title: "Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'" description: "This policy setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Microsoft network server: Disconnect clients when logon hours expire (Rule 2.3.9.4). The recommended state for this setting is: Enabled. Note: This recommendation is unscored because there is not a documented registry value that corresponds to it. We still strongly encourage that it be configured as Enabled, to ensure that logon hours (when configured) are properly enforced." rationale: "If this setting is disabled, a user could remain connected to the computer outside of their allotted logon hours." @@ -605,13 +820,15 @@ checks: compliance: - cis: ["2.3.11.6"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36270-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' - - id: 12041 + - id: 15046 title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'" description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: -Join a domain -Authenticate between Active Directory forests -Authenticate to down-level domains -Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP -Authenticate to computers that are not in the domain. The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non- R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." @@ -619,12 +836,17 @@ checks: compliance: - cis: ["2.3.11.7"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36173-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' - - id: 12042 + + - id: 15047 title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher" description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." @@ -632,13 +854,17 @@ checks: compliance: - cis: ["2.3.11.8"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36858-9' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:(/d+) compare >= 1' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:^(\d+) compare >= 1' - - id: 12043 + - id: 15048 title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." @@ -646,13 +872,17 @@ checks: compliance: - cis: ["2.3.11.9"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37553-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' - - id: 12044 + - id: 15049 title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." @@ -660,6 +890,10 @@ checks: compliance: - cis: ["2.3.11.10"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - https://workbench.cisecurity.org/benchmarks/288 - 'CCE-37835-6' @@ -667,7 +901,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' - - id: 12045 + - id: 15050 title: "Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'" description: "This policy setting determines whether a computer can be shut down when a user is not logged on. If this policy setting is enabled, the shutdown command is available on the Windows logon screen. It is recommended to disable this policy setting to restrict the ability to shut down the computer to users with credentials on the system. The recommended state for this setting is: Disabled. Note: In Server 2008 R2 and older versions, this setting had no impact on Remote Desktop (RDP) / Terminal Services sessions - it only affected the local console. However, Microsoft changed the behavior in Windows Server 2012 (non-R2) and above, where if set to Enabled, RDP sessions are also allowed to shut down or restart the server." rationale: "Users who can access the console locally could shut down the computer. Attackers could also walk to the local console and restart the server, which would cause a temporary DoS condition. Attackers could also shut down the server and leave all of its applications and services unavailable. As noted in the Description above, the Denial of Service (DoS) risk of enabling this setting dramatically increases in Windows Server 2012 (non-R2) and above, as even remote users could then shut down or restart the server from the logon screen of an RDP session." @@ -675,54 +909,64 @@ checks: compliance: - cis: ["2.3.13.1"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36788-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon -> 0' - - id: 12046 + - id: 15051 title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'" description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Require case insensitivity for non- Windows subsystems." compliance: - cis: ["2.3.15.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37885-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' - - id: 12047 + - id: 15052 title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'" description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)." compliance: - cis: ["2.3.15.2"] - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37644-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' - - id: 12048 + - id: 15053 title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'" description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." - rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named 'Administrator' because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. - If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named 'Administrator' because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. -If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account." compliance: - cis: ["2.3.17.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36494-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' - - id: 12049 + - id: 15054 title: "Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled'" description: "This policy setting controls whether User Interface Accessibility (UIAccess or UIA) programs can automatically disable the secure desktop for elevation prompts used by a standard user. The recommended state for this setting is: Disabled." rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting allows the administrator to perform operations that require elevated privileges while connected via Remote Assistance. This increases security in that organizations can use UAC even when end user support is provided remotely. However, it also reduces security by adding the risk that an administrator might allow an unprivileged user to share elevated privileges for an application that the administrator needs to use during the Remote Desktop session." @@ -730,13 +974,15 @@ checks: compliance: - cis: ["2.3.17.2"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36863-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableUIADesktopToggle -> 0' - - id: 12050 + - id: 15055 title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'" description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop." rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." @@ -744,13 +990,15 @@ checks: compliance: - cis: ["2.3.17.3"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37029-6' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> r:^2$' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> 2' - - id: 12051 + - id: 15056 title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'" description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." @@ -758,13 +1006,15 @@ checks: compliance: - cis: ["2.3.17.4"] - cis_csc: ["5.1"] + - pci_dss: ["7.1.2"] + - tsc: ["CC6.4"] references: - 'CCE-36864-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' - - id: 12052 + - id: 15057 title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'" description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage." @@ -772,27 +1022,32 @@ checks: compliance: - cis: ["2.3.17.5"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36533-8' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' - - id: 12053 + - id: 15058 title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'" description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: ...\\Program Files\\, including subfolders; ...\\Windows\\system32\\; ...\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows). Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." - rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: - To set the foreground window. - To drive any application window using SendInput function. - To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. - To set journal hooks. - To uses AttachThreadInput to attach a thread to a higher integrity input queue." + rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: -To set the foreground window. -To drive any application window using SendInput function. -To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. -To set journal hooks. -To uses AttachThreadInput to attach a thread to a higher integrity input queue." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations." compliance: - cis: ["2.3.17.6"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37057-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' - - id: 12054 + - id: 15059 title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'" description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." @@ -800,13 +1055,15 @@ checks: compliance: - cis: ["2.3.17.7"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36869-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' - - id: 12055 + - id: 15060 title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'" description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." @@ -814,41 +1071,57 @@ checks: compliance: - cis: ["2.3.17.8"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36866-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' - - id: 12056 + - id: 15061 title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'" description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %Windir% - %Windir%\\system32 - HKEY_LOCAL_MACHINE\\Software. The recommended state for this setting is: Enabled." rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations." compliance: - cis: ["2.3.17.9"] + - pci_dss: ["6.5.8"] + - tsc: ["CC6.1"] references: - 'CCE-37064-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' -# Section 9.1 - Domain Profile - - id: 12057 - title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On'" + +############################################### +# 9 Windows Firewall with Advanced Security +############################################### +############################################### +# 9.1 Domain Profile +############################################### +# 9.1.1 Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On' + - id: 15062 + title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Firewall state." compliance: - cis: ["9.1.1"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-36062-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' - - id: 12058 + +# 9.1.2 Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)' + - id: 15063 title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'" description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -856,13 +1129,16 @@ checks: compliance: - cis: ["9.1.2"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-38117-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' - - id: 12059 +# 9.1.3 Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)' + - id: 15064 title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'" description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." @@ -870,40 +1146,55 @@ checks: compliance: - cis: ["9.1.3"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-36146-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' - - id: 12060 +# 9.1.4 Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No' + - id: 15065 title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'" description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification." compliance: - cis: ["9.1.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-38041-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' - - id: 12061 +# 9.1.5 Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log' + + - id: 15066 title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log'" description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." - remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name" compliance: - cis: ["9.1.5"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37482-7' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' + +# 9.1.6 Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater' - - id: 12062 + - id: 15067 title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater'" description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -911,13 +1202,20 @@ checks: compliance: - cis: ["9.1.6"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36088-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' - - id: 12063 +# 9.1.7 Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes' + - id: 15068 title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -925,13 +1223,20 @@ checks: compliance: - cis: ["9.1.7"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37523-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' - - id: 12064 +# 9.1.8 Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes' + - id: 15069 title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -939,28 +1244,41 @@ checks: compliance: - cis: ["9.1.8"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36393-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' -# Section 9.2 - Private Profile - - id: 12065 - title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On'" +############################################### +# 9.2 Private Profile +############################################### + +# 9.2.1 Ensure 'Windows Firewall: Private: Firewall state' is set to 'On' + - id: 15070 + title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Firewall state." compliance: - cis: ["9.2.1"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-38239-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' - - id: 12066 +# 9.2.2 Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)' + - id: 15071 title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'" description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -968,13 +1286,16 @@ checks: compliance: - cis: ["9.2.2"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-38042-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' - - id: 12067 +# 9.2.3 Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)' + - id: 15072 title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'" description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." @@ -982,40 +1303,53 @@ checks: compliance: - cis: ["9.2.3"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-38332-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' - - id: 12068 +# 9.2.4 Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)' + - id: 15073 title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'" description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification." compliance: - cis: ["9.2.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-37621-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' - - id: 12069 +# 9.2.5 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log' + - id: 15074 title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log'" description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." - remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Name." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Name" compliance: - cis: ["9.2.5"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37569-1' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' - - id: 12070 +# 9.2.6 Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 15075 title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater'" description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1023,13 +1357,20 @@ checks: compliance: - cis: ["9.2.6"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-38178-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' - - id: 12071 +# 9.2.7 Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes' + - id: 15076 title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1037,13 +1378,20 @@ checks: compliance: - cis: ["9.2.7"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35972-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' - - id: 12072 +# 9.2.8 Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes' + - id: 15077 title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1051,28 +1399,41 @@ checks: compliance: - cis: ["9.2.8"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37387-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' -# Sectin 9.3 - Public Profile - - id: 12073 - title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On'" +############################################### +# 9.3 Public Profile +############################################### + +# 9.3.1 Ensure 'Windows Firewall: Public: Firewall state' is set to 'On' + - id: 15078 + title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Firewall state." compliance: - cis: ["9.3.1"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-37862-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' - - id: 12074 +# 9.3.2 Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)' + - id: 15079 title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'" description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -1080,13 +1441,16 @@ checks: compliance: - cis: ["9.3.2"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-36057-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' - - id: 12075 +# 9.3.3 Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)' + - id: 15080 title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'" description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." @@ -1094,40 +1458,49 @@ checks: compliance: - cis: ["9.3.3"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-37434-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' - - id: 12076 +# 9.3.4 Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No' + - id: 15081 title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'" description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No." rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification." compliance: - cis: ["9.3.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-38043-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' - - id: 12077 +# 9.3.5 Ensure 'Windows Firewall: Public: Apply local firewall rules' is set to 'No' + - id: 15082 title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'" description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." - rationale: "When in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." + rationale: "iWhen in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local firewall rules." compliance: - cis: ["9.3.5"] - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-37861-2' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' - - id: 12078 + # 9.3.6 Ensure 'Windows Firewall: Public: Apply local connection security rules' is set to 'No' + - id: 15083 title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'" description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." @@ -1135,27 +1508,37 @@ checks: compliance: - cis: ["9.3.6"] - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-36268-1' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' - - id: 12079 - title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log'" +# 9.3.7 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log' + - id: 15084 + title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log'" description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." - remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Name." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Name" compliance: - cis: ["9.3.7"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37266-4' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' - - id: 12080 +# 9.3.8 Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater'' + - id: 15085 title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater'" description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1163,13 +1546,20 @@ checks: compliance: - cis: ["9.3.8"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36395-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' - - id: 12081 +# 9.3.9 Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'' + - id: 15086 title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1177,13 +1567,20 @@ checks: compliance: - cis: ["9.3.9"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37265-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' - - id: 12082 +# 9.3.10 Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'' + - id: 15087 title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1191,6 +1588,12 @@ checks: compliance: - cis: ["9.3.10"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36394-5' condition: all @@ -1198,26 +1601,30 @@ checks: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' # Section 18.1 - Control Panel - - id: 12083 + - id: 15088 title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'" description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." compliance: - cis: ["18.1.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-38347-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' - - id: 12084 + - id: 15089 title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'" description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." compliance: - cis: ["18.1.1.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-38348-9' condition: all @@ -1225,7 +1632,8 @@ checks: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' # Section 18.2 - LAPS - - id: 12085 + + - id: 15090 title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1233,12 +1641,14 @@ checks: compliance: - cis: ["18.2.1"] - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' - - id: 12086 + - id: 15091 title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1246,11 +1656,13 @@ checks: compliance: - cis: ["18.2.2"] - cis_csc: ["16.2"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' - - id: 12087 + - id: 15092 title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1258,11 +1670,13 @@ checks: compliance: - cis: ["18.2.3"] - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' - - id: 12088 + - id: 15093 title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1270,11 +1684,13 @@ checks: compliance: - cis: ["18.2.4"] - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' - - id: 12089 + - id: 15094 title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1282,11 +1698,13 @@ checks: compliance: - cis: ["18.2.5"] - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' - - id: 12090 + - id: 15095 title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer'" description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." @@ -1294,12 +1712,14 @@ checks: compliance: - cis: ["18.2.6"] - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' # Section 18.3 - MS Security Guide - - id: 12091 + - id: 15096 title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled'" description: "This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1. For more information about local accounts and credential theft, review the 'Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques' documents. For more information about LocalAccountTokenFilterPolicy, see Microsoft Knowledge Base article 951016: Description of User Account Control and remote restrictions in Windows Vista. The recommended state for this setting is: Enabled." rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." @@ -1307,6 +1727,8 @@ checks: compliance: - cis: ["18.3.1"] - cis_csc: ["5.8"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - https://www.microsoft.com/en-us/download/details.aspx?id=36036 - https://support.microsoft.com/en-us/help/951016/description-of-user-account-control-and-remote-restrictions-in-windows @@ -1316,7 +1738,63 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 0' - - id: 12092 + - id: 15097 + title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver'" + description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service ( MRxSmb10 ), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver. Note: Do not, under any circumstances, configure this overall setting as Disabled , as doing so will delete the underlying registry entry altogether, which will cause serious problems." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable driver : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 client driver. Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required - it is available from Microsoft" + compliance: + - cis: ["18.3.2"] + - cis_csc: ["9.1"] + references: + - https://www.microsoft.com/en-us/download/details.aspx?id=36036 + - https://blogs.technet.microsoft.com/filecab/2017/06/01/smb1-product-clearinghouse/ + - https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 4' + + - id: 15098 + title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'" + description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled ." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 server Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858' + - 'https://docs.microsoft.com/en-us/archive/blogs/staysafe/disable-smb-v1-in-managed-environments-with-ad-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/disabling-smbv1-through-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/security-baseline-for-windows-10-creators-update-v1703-final' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' + + - id: 15099 + title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'" + description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled ." + rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Enable Structured Exception Handling Overwrite Protection (SEHOP) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.4"] + - cis_csc: ["8.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/' + - 'https://support.microsoft.com/en-us/help/956607/how-to-enable-structured-exception-handling-overwrite-protection-sehop' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' + + - id: 15100 title: "Ensure 'WDigest Authentication' is set to 'Disabled'" description: "When WDigest authentication is enabled, Lsass.exe retains a copy of the user's plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server. The recommended state for this setting is: Disabled." rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." @@ -1324,6 +1802,8 @@ checks: compliance: - cis: ["18.3.5"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - https://www.microsoft.com/en-us/download/details.aspx?id=36036 - https://support.microsoft.com/en-us/help/2871997/microsoft-security-advisory-update-to-improve-credentials-protection-a @@ -1334,7 +1814,7 @@ checks: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' # Section 18.4 - MSS (Legacy) - - id: 12093 + - id: 15101 title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'" description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. The recommended state for this setting is: Disabled." rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." @@ -1342,6 +1822,8 @@ checks: compliance: - cis: ["18.4.1"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - https://support.microsoft.com/en-us/help/324737/how-to-turn-on-automatic-logon-in-windows - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ @@ -1350,7 +1832,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' - - id: 12094 + - id: 15102 title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." @@ -1358,6 +1840,10 @@ checks: compliance: - cis: ["18.4.2"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36871-2' @@ -1365,7 +1851,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' - - id: 12095 + - id: 15103 title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." @@ -1373,6 +1859,10 @@ checks: compliance: - cis: ["18.4.3"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36535-3' @@ -1380,7 +1870,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' - - id: 12096 + - id: 15104 title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'" description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." @@ -1388,6 +1878,9 @@ checks: compliance: - cis: ["18.4.4"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - nist_800_53: ["SC.5"] + - tsc: ["A1.1","CC6.1","CC7.2"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-37988-3' @@ -1395,7 +1888,28 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' - - id: 12097 + +# Section 18.4 - MSS (Legacy) + - id: 15105 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes'" + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.5"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-36868-8' + - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + + + - id: 15106 title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'" description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." @@ -1403,6 +1917,10 @@ checks: compliance: - cis: ["18.4.6"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36879-5' @@ -1410,7 +1928,29 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' - - id: 12098 + + + - id: 15107 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'" + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.7"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-38065-9' + - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + + + + - id: 15108 title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'" description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: -Search folders specified in the system path first, and then search the current working folder. -Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled." rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." @@ -1418,6 +1958,12 @@ checks: compliance: - cis: ["18.4.8"] - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36351-5' @@ -1425,7 +1971,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' - - id: 12099 + - id: 15109 title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'" description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." @@ -1433,6 +1979,8 @@ checks: compliance: - cis: ["18.4.9"] - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-37993-3' @@ -1440,7 +1988,47 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' - - id: 12100 + + + - id: 15110 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.10"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-37846-3' + - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + + + - id: 15111 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.11"] + - cis_csc: ["9"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + references: + - 'CCE-36051-1' + - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + + + - id: 15112 title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'" description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." @@ -1448,6 +2036,7 @@ checks: compliance: - cis: ["18.4.12"] - cis_csc: ["6.3"] + - pci_dss: ["10.7"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36880-3' @@ -1456,7 +2045,81 @@ checks: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' # Section 18.5 - Network - - id: 12101 + + - id: 15113 + title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'" + description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled ." + rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system. Note: To completely mitigate local name resolution poisoning, in addition to this setting, the properties of each installed NIC should also be set to Disable NetBIOS over TCP/IP (on the WINS tab in the NIC properties). Unfortunately, there is no global setting to achieve this that automatically applies to all NICs - it is a per-NIC setting that varies with different NIC hardware installations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.4.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37450-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 0' + + + - id: 15114 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38170-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' + + - id: 15115 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37959-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' + + - id: 15116 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'" + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services. Note: This Group Policy path is provided by the Group Policy template P2P- pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.10.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37699-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + + + + - id: 15117 title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'" description: "You can use this procedure to controls user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." @@ -1464,13 +2127,15 @@ checks: compliance: - cis: ["18.5.11.2"] - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] references: - 'CCE-38002-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' - - id: 12102 + - id: 15118 title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'" description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled." rationale: "Allowing regular users to set a network location increases the risk and attack surface." @@ -1478,13 +2143,86 @@ checks: compliance: - cis: ["18.5.11.3"] - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] references: - 'CCE-38188-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' - - id: 12103 + + + - id: 15119 + title: "Ensure 'Hardened UNC Paths' is set to 'Enabled, with \"Require Mutual Authentication\" and \"Require Integrity\" set for all NETLOGON and SYSVOL shares'" + description: "This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with \"Require Mutual Authentication\" and \"Require Integrity\" set for all NETLOGON and SYSVOL shares ." + rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template ( NetworkProvider.admx/adml ) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with the following paths configured, at a minimum: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Provider\\Hardened UNC Paths Note: This Group Policy path does not exist by default. An additional Group Policy template ( NetworkProvider.admx/adml ) is required" + compliance: + - cis: ["18.5.14.1"] + - cis_csc: ["3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + + +# Section 18.5 - Network + - id: 15120 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')" + description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)" + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components reduces a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents. Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." + compliance: + - cis: ["18.5.19.2.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + + + - id: 15121 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'" + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now. Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.20.1"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37481-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + + - id: 15122 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'" + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.20.2"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36109-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + + + + - id: 15123 title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled'" description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." rationale: "Blocking simultaneous connections can help prevent a user unknowingly allowing network traffic to flow between the Internet and the enterprise managed network." @@ -1492,14 +2230,37 @@ checks: compliance: - cis: ["18.5.21.1"] - cis_csc: ["12"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] references: - 'CCE-38338-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> 1' + +# Section 18.5.21 - Windows Connection Manager + - id: 15124 + title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled'" + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time." + rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\Network\\Windows Connection Manager\\Prohibit connection to non-domain networks when connected to domain authenticated network." + compliance: + - cis: ["18.5.21.2"] + - cis_csc: ["12"] + - pci_dss: ["2.2.4","1.3.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2","CC6.1"] + references: + - 'CCE-37627-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' + + + # Section 18.8 - System - - id: 12104 + - id: 15125 title: "Ensure 'Include command line in process creation events' is set to 'Disabled'" description: "This policy setting determines what information is logged in security audit events when a new process has been created. The recommended state for this setting is: Disabled." rationale: "When this policy setting is enabled, any user who has read access to the security events can read the command-line arguments for any successfully created process. Command-line arguments may contain sensitive or private information such as passwords or user data." @@ -1507,27 +2268,48 @@ checks: compliance: - cis: ["18.8.3.1"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-36925-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 0' - - id: 12105 + - id: 15126 + title: "Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled'" + description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled ." + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Remote host allows delegation of non-exportable credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/windows/access-protection/remote-credential-guard' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' + + - id: 15127 title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'" - description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: - Good: The driver has been signed and has not been tampered with. - Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. - Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. - Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware boot- start driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." + description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: -Good: The driver has been signed and has not been tampered with. -Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. -Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. -Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware boot- start driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." rationale: "This policy setting helps reduce the impact of malware that has already infected your system." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Good, unknown and bad but critical: Computer Configuration\\Policies\\Administrative Templates\\System\\Early Launch Antimalware\\Boot-Start Driver Initialization Policy Note: This Group Policy path may not exist by default. It is provided by the Group Policy template EarlyLaunchAM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." compliance: - cis: ["18.8.14.1"] - cis_csc: ["8"] + - pci_dss: ["5.1.1"] + - nist_800_53: ["SI.3"] + - tsc: ["CC6.8"] references: - 'CCE-37912-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' - - id: 12106 + - id: 15128 title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'" description: "The 'Do not apply during periodic background processing' option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked)." rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." @@ -1535,13 +2317,16 @@ checks: compliance: - cis: ["18.8.21.2"] - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36169-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' - - id: 12107 + - id: 15129 title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'" description: "The 'Process even if the Group Policy objects have not changed' option updates and reapplies policies even if the policies have not changed. The recommended state for this setting is: Enabled: TRUE (checked)." rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." @@ -1549,13 +2334,15 @@ checks: compliance: - cis: ["18.8.21.3"] - cis_csc: ["3.7"] + - pci_dss: ["11.5.1"] + - tsc: ["PI1.4","PI1.5","CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] references: - 'CCE-36169-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' - - id: 12108 + - id: 15130 title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'" description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." @@ -1563,13 +2350,247 @@ checks: compliance: - cis: ["18.8.21.4"] - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37712-7' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy -> 0' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' + +# Section 18.8 - System + - id: 15131 + title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'" + description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." + rationale: "Users might download drivers that include malicious code." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off downloading of print drivers over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.1"] + - cis_csc: ["2"] + - pci_dss: ["6"] + - nist_800_53: ["SI.3"] + references: + - 'CCE-36625-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' + + + - id: 15132 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'" + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37911-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + + - id: 15133 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'" + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36203-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + + - id: 15134 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37163-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + + - id: 15135 + title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'" + description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." + rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet download for Web publishing and online ordering wizards Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.5"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36096-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' + + - id: 15136 + title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'" + description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled." + rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off printing over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.6"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36920-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' + + + - id: 15137 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36352-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' - - id: 12109 + + - id: 15138 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36884-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + + - id: 15139 + title: "Ensure 'Turn off the \"Order Prints\" picture task' is set to 'Enabled'" + description: "This policy setting specifies whether the \"Order Prints Online\" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.9"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38275-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + + - id: 15140 + title: "Ensure 'Turn off the \"Publish to Web\" task for files and folders' is set to 'Enabled'" + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.10"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37090-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + + - id: 15141 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.11"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36628-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + + - id: 15142 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.12"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36174-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + + - id: 15143 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.13"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35964-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PCHealth\ErrorReporting -> DoReport -> 0' + + + + - id: 15144 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'" + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.26.1"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36343-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + + + - id: 15145 title: "Ensure 'Do not display network selection UI' is set to 'Enabled'" description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen. The recommended state for this setting is: Enabled." rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." @@ -1577,13 +2598,15 @@ checks: compliance: - cis: ["18.8.27.1"] - cis_csc: ["5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-38353-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' - - id: 12110 + - id: 15146 title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'" description: "This policy setting prevents connected users from being enumerated on domain-joined computers. The recommended state for this setting is: Enabled." rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." @@ -1591,13 +2614,15 @@ checks: compliance: - cis: ["18.8.27.2"] - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-37838-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' - - id: 12111 + - id: 15147 title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'" description: "This policy setting allows local users to be enumerated on domain-joined computers. The recommended state for this setting is: Disabled." rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." @@ -1605,13 +2630,15 @@ checks: compliance: - cis: ["18.8.27.3"] - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-35894-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' - - id: 12112 + - id: 15148 title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'" description: "This policy setting allows you to prevent app notifications from appearing on the lock screen. The recommended state for this setting is: Enabled." rationale: "App notifications might display sensitive business or personal data." @@ -1619,13 +2646,29 @@ checks: compliance: - cis: ["18.8.27.4"] - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-35893-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' - - id: 12113 + - id: 15149 + title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'" + description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled . Note: If the picture password feature is permitted, the user's domain password is cached in the system vault when using it." + rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.5"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' + + - id: 15150 title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'" description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work. Note: The user's domain password will be cached in the system vault when using this feature. The recommended state for this setting is: Disabled." rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." @@ -1633,13 +2676,47 @@ checks: compliance: - cis: ["18.8.27.6"] - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-37528-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' - - id: 12114 + - id: 15151 + title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'" + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'CCE-36881-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' + + - id: 15152 + title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'" + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'CCE-37066-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' + + - id: 15153 title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'" description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled." rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." @@ -1647,13 +2724,15 @@ checks: compliance: - cis: ["18.8.35.1"] - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-36388-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' - - id: 12115 + - id: 15154 title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'" description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." @@ -1661,13 +2740,16 @@ checks: compliance: - cis: ["18.8.35.2"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-37281-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' - - id: 12116 +# Section 18.8.36 - Remote Procedure Call + - id: 15155 title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'" description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers. Note: This policy will not be in effect until the system is rebooted. The recommended state for this setting is: Enabled." rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." @@ -1675,6 +2757,12 @@ checks: compliance: - cis: ["18.8.36.1"] - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - https://support.microsoft.com/en-us/help/3073942/rpc-endpoint-mapper-client-authentication-prevents-users-and-groups-fr - 'CCE-37346-4' @@ -1682,8 +2770,116 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' + - id: 15156 + title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'" + description: "This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers." + rationale: "Unauthenticated RPC communication can create a security vulnerability." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients." + compliance: + - cis: ["18.8.36.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36559-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' + + + - id: 15157 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'" + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.44.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38161-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + + - id: 15158 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'" + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.44.11.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36648-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + + + - id: 15159 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'" + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.46.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36931-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + + - id: 15160 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.49.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + references: + - 'CCE-37843-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + + + + - id: 15161 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'" + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server." + compliance: + - cis: ["18.8.49.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.3","CC7.2"] + references: + - 'CCE-37319-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + + + # Section 18.9 - Windows Components - - id: 12117 + - id: 15162 title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'" description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it. The recommended state for this setting is: Enabled." rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." @@ -1691,13 +2887,15 @@ checks: compliance: - cis: ["18.9.6.1"] - cis_csc: ["16.9"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] references: - 'CCE-38354-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' - - id: 12118 + - id: 15163 title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'" description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones. The recommended state for this setting is: Enabled." rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." @@ -1705,13 +2903,16 @@ checks: compliance: - cis: ["18.9.8.1"] - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37636-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' - - id: 12119 + - id: 15164 title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'" description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." @@ -1719,13 +2920,16 @@ checks: compliance: - cis: ["18.9.8.2"] - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-38217-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' - - id: 12120 + - id: 15165 title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'" description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." @@ -1733,13 +2937,16 @@ checks: compliance: - cis: ["18.9.8.3"] - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36875-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' - - id: 12121 + - id: 15166 title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'" description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences. The recommended state for this setting is: Enabled." rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." @@ -1747,13 +2954,15 @@ checks: compliance: - cis: ["18.9.15.1"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-37534-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' - - id: 12122 + - id: 15167 title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'" description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. The recommended state for this setting is: Disabled." rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." @@ -1761,13 +2970,190 @@ checks: compliance: - cis: ["18.9.15.2"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-36512-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' - - id: 12123 + + - id: 15168 + title: "Ensure 'Default Action and Mitigation Settings' is set to 'Enabled' (plus subsettings)" + description: "This setting configures the default action after detection and advanced ROP mitigation. The recommended state for this setting is: Default Action and Mitigation Settings - Enabled; Deep Hooks - Enabled; Anti Detours - Enabled; Banned Functions - Enabled; Exploit Action - User Configured" + rationale: "These advanced mitigations for ROP mitigations apply to all configured software in EMET: Deep Hooks protects critical APIs and the subsequent lower level APIs used by the top level critical API. Anti Detours renders ineffective exploits that evade hooks by executing a copy of the hooked function prologue and then jump to the function past the prologue. Banned Functions will block calls to ntdll!LdrHotPatchRoutine to mitigate potential exploits abusing the API." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\Default Action and Mitigation Settings .Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-38427-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> AntiDetours -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> BannedFunctions -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> DeepHooks -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> ExploitAction -> 2' + + - id: 15169 + title: "Ensure 'Default Protections for Internet Explorer' is set to 'Enabled'" + description: "This setting determines if recommended EMET mitigations are applied to Internet Explorer. The recommended state for this setting is: Enabled ." + rationale: "Applying EMET mitigations to Internet Explorer will help reduce the reliability of exploits that target it." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\Default Protections for Internet Explorer Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-38428-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Internet Explorer\iexplore.exe' + + - id: 15170 + title: "Ensure 'Default Protections for Popular Software' is set to 'Enabled'" + description: "This setting determines if recommended EMET mitigations are applied to the following popular software: 7-Zip; Adobe Photoshop; Foxit Reader; Google Chrome; Google Talk; iTunes; Microsoft Live Writer;Microsoft Lync Communicator ;Microsoft Photo Gallery ;Microsoft SkyDrive; mIRC; Mozilla Firefox; Mozilla Thunderbird; Opera;Pidgin ;QuickTime Player; RealPlayer; Safari; Skype; VideoLAN VLC; Winamp; Windows Live Mail; Windows Media Player; WinRAR; WinZip. The recommended state for this setting is: Enabled ." + rationale: "Applying EMET mitigations to popular software packages will help reduce the reliability of exploits that target them." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\Default Protections for Popular Software Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.4"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-36750-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\7-Zip\7z.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\7-Zip\7zFM.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\7-Zip\7zG.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Adobe\Adobe Photoshop CS*\Photoshop.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Foxit Reader\Foxit Reader.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Google\Chrome\Application\chrome.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Google\Google Talk\googletalk.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\iTunes\iTunes.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Microsoft Lync\communicator.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\mIRC\mirc.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Mozilla Firefox\firefox.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Mozilla Firefox\plugin-container.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Mozilla Thunderbird\plugin-container.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Mozilla Thunderbird\thunderbird.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Opera\*\opera.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Opera\opera.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Pidgin\pidgin.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\QuickTime\QuickTimePlayer.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Real\RealPlayer\realconverter.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Real\RealPlayer\realplay.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Safari\Safari.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\SkyDrive\SkyDrive.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Skype\Phone\Skype.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\VideoLAN\VLC\vlc.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Winamp\winamp.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows Live\Mail\wlmail.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows Live\Photo Gallery\WLXPhotoGallery.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows Live\Writer\WindowsLiveWriter.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows Media Player\wmplayer.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinRAR\rar.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinRAR\unrar.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinRAR\winrar.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinZip\winzip32.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinZip\winzip64.exe' + + - id: 15171 + title: "Ensure 'Default Protections for Recommended Software' is set to 'Enabled'" + description: "This setting determines if recommended EMET mitigations are applied to the following software: Adobe Acrobat; Adobe Acrobat Reader; Microsoft Office suite applications; Oracle Java; WordPad. The recommended state for this setting is: Enabled ." + rationale: "Applying EMET mitigations to recommended software will help reduce the reliability of exploits that target them." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\Default Protections for Recommended Software Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.5"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-36515-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Adobe\*\Reader\AcroRd32.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Adobe\Acrobat*\Acrobat\Acrobat.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Java\jre*\bin\java.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Java\jre*\bin\javaw.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Java\jre*\bin\javaws.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\EXCEL.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\INFOPATH.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\LYNC.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\MSACCESS.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\MSPUB.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\OIS.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\OUTLOOK.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\POWERPNT.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\PPTVIEW.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\VISIO.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\VPREVIEW.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\WINWORD.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows NT\Accessories\wordpad.exe' + + + - id: 15172 + title: "Ensure 'System ASLR' is set to 'Enabled: Application Opt-In'" + description: "This setting determines how applications become enrolled in Address Space Layout Randomization (ASLR). The recommended state for this setting is: Enabled: Application Opt-In ." + rationale: "ASLR reduces the predictability of process memory, which in-turn helps reduce the reliability of exploits targeting memory corruption vulnerabilities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Application Opt-In :Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\System ASLR Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.6"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-38437-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> ASLR -> 3' + + - id: 15173 + title: "Ensure 'System DEP' is set to 'Enabled: Application Opt-Out'" + description: "This setting determines how applications become enrolled in Data Execution Protection (DEP). The recommended state for this setting is: Enabled: Application Opt-Out ." + rationale: "DEP marks pages of application memory as non-executable, which reduces a given exploit's ability to run attacker-controlled code." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Application Opt-Out : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\System DEP Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.7"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-38438-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> DEP -> 2' + + - id: 15174 + title: "Ensure 'System SEHOP' is set to 'Enabled: Application Opt-Out'" + description: "This setting determines how applications become enrolled in Structured Exception Handler Overwrite Protection (SEHOP). The recommended state for this setting is: Enabled: Application Opt-Out ." + rationale: "When a software component suffers from a memory corruption vulnerability, an exploit may be able to overwrite memory that contains data structures that control how the software handles exceptions. By corrupting these structures in a controlled manner, an exploit may be able to execute arbitrary code. SEHOP verifies the integrity of those structures before they are used to handle exceptions, which reduces the reliability of exploits that leverage structured exception handler overwrites." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Application Opt-Out : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\System SEHOP Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.7"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-38438-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> SEHOP -> 2' + + + - id: 15175 title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1775,13 +3161,19 @@ checks: compliance: - cis: ["18.9.26.1.1"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37775-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' - - id: 12124 + - id: 15176 title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1789,13 +3181,19 @@ checks: compliance: - cis: ["18.9.26.1.2"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37948-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' - - id: 12125 + - id: 15177 title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1803,13 +3201,19 @@ checks: compliance: - cis: ["18.9.26.2.1"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37145-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' - - id: 12126 + - id: 15178 title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 196,608 or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1817,13 +3221,19 @@ checks: compliance: - cis: ["18.9.26.2.2"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37695-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' - - id: 12127 + - id: 15179 title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1831,13 +3241,19 @@ checks: compliance: - cis: ["18.9.26.3.1"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-38276-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' - - id: 12128 + - id: 15180 title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1845,13 +3261,19 @@ checks: compliance: - cis: ["18.9.26.3.2"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37526-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' - - id: 12129 + - id: 15181 title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1859,13 +3281,19 @@ checks: compliance: - cis: ["18.9.26.4.1"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36160-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' - - id: 12130 + - id: 15182 title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1873,13 +3301,19 @@ checks: compliance: - cis: ["18.9.26.4.2"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36092-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' - - id: 12131 + - id: 15183 title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'" description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer. The recommended state for this setting is: Disabled." rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." @@ -1887,13 +3321,16 @@ checks: compliance: - cis: ["18.9.30.2"] - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37809-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' - - id: 12132 + - id: 15184 title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'" description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." @@ -1901,13 +3338,16 @@ checks: compliance: - cis: ["18.9.30.3"] - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36660-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' - - id: 12133 + - id: 15185 title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'" description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." @@ -1915,13 +3355,52 @@ checks: compliance: - cis: ["18.9.30.4"] - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36809-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' - - id: 12134 + +# Section 18.9 - System + +# Section 18.9.39 - Location and Sensors + - id: 15186 + title: "Ensure 'Turn off Windows Location Provider' is set to 'Enabled'" + description: "This policy setting turns off the Windows Location Provider feature for the computer." + rationale: "This setting affects the Windows Location Provider feature (e.g. GPS or other location tracking)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Windows Location Provider\\Turn off Windows Location Provider." + compliance: + - cis: ["18.9.39.1.1"] + references: + - 'CCE-38225-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableWindowsLocationProvider -> 1' + + + - id: 15187 + title: "Ensure 'Turn off location' is set to 'Enabled'" + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.39.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36886-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + + + + - id: 15188 title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'" description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client. The recommended state for this setting is: Enabled." rationale: "Enabling this setting prevents users from accidentally uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client." @@ -1929,13 +3408,18 @@ checks: compliance: - cis: ["18.9.52.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36939-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' - - id: 12135 + + - id: 15189 title: "Ensure 'Prevent the usage of OneDrive for file storage on Windows 8.1' is set to 'Enabled'" description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the legacy OneDrive/SkyDrive client. The recommended state for this setting is: Enabled. Note: Despite the name of this setting, it is applicable to the legacy OneDrive client on any Windows OS." rationale: "Enabling this setting prevents users from accidentally uploading confidential or sensitive corporate information to the OneDrive cloud service using the legacy OneDrive/SkyDrive client." @@ -1943,13 +3427,14 @@ checks: compliance: - cis: ["18.9.52.2"] - cis_csc: ["13"] + - pci_dss: ["12.3.8"] references: - 'CCE-36939-7' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Skydrive -> DisableFileSync -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Onedrive -> DisableFileSync -> 1' - - id: 12136 + - id: 15190 title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'" description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." @@ -1957,13 +3442,47 @@ checks: compliance: - cis: ["18.9.58.2.2"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] references: - 'CCE-36223-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' - - id: 12137 + + - id: 15191 + title: "Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'" + description: "This policy setting allows you to restrict users to a single Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "This setting ensures that users & administrators who Remote Desktop to a server will continue to use the same session - if they disconnect and reconnect, they will go back to the same session they were using before, preventing the creation of a second simultaneous session. This both prevents unnecessary resource usage by having the server host unnecessary additional sessions (which would put extra load on the server) and also ensures a consistency of experience for the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Restrict Remote Desktop Services users to a single Remote Desktop Services session. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Restrict Terminal Services users to a single remote session, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.58.3.2.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-37708-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> 1' + + - id: 15192 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37696-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + + + - id: 15193 title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'" description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." @@ -1971,13 +3490,52 @@ checks: compliance: - cis: ["18.9.58.3.3.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36509-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' - - id: 12138 + + - id: 15194 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37778-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + + - id: 15195 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'" + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37477-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + + + + - id: 15196 title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'" description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." @@ -1985,13 +3543,15 @@ checks: compliance: - cis: ["18.9.58.3.9.1"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-37929-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' - - id: 12139 + - id: 15197 title: "Ensure 'Require secure RPC communication' is set to 'Enabled'" description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests. The recommended state for this setting is: Enabled." rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." @@ -1999,13 +3559,15 @@ checks: compliance: - cis: ["18.9.58.3.9.2"] - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-37567-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' - - id: 12140 + - id: 15198 title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'" description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." @@ -2013,13 +3575,51 @@ checks: compliance: - cis: ["18.9.58.3.9.3"] - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-36627-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' - - id: 12141 + + - id: 15199 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'" + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.58.3.10.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - 'CCE-37562-6' + - https://workbench.cisecurity.org/benchmarks/766 + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + + - id: 15200 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'" + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.10.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-37949-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + + + + - id: 15201 title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'" description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff. The recommended state for this setting is: Disabled." rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." @@ -2027,13 +3627,15 @@ checks: compliance: - cis: ["18.9.58.3.11.1"] - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37946-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' - - id: 12142 + - id: 15202 title: "Ensure 'Do not use temporary folders per session' is set to 'Disabled'" description: "By default, Remote Desktop Services creates a separate temporary folder on the RD Session Host server for each active session that a user maintains on the RD Session Host server. The temporary folder is created on the RD Session Host server in a Temp folder under the user's profile folder and is named with the sessionid. This temporary folder is used to store individual temporary files. To reclaim disk space, the temporary folder is deleted when the user logs off from a session. The recommended state for this setting is: Disabled." rationale: "Disabling this setting keeps the cached data independent for each session, both reducing the chance of problems from shared cached data between sessions, and keeping possibly sensitive data separate to each user session." @@ -2041,13 +3643,15 @@ checks: compliance: - cis: ["18.9.58.3.11.2"] - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-38180-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> 1' - - id: 12143 + - id: 15203 title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'" description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer. The recommended state for this setting is: Enabled." rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." @@ -2055,13 +3659,16 @@ checks: compliance: - cis: ["18.9.59.1"] - cis_csc: ["7.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37126-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' - - id: 12144 + - id: 15204 title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'" description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files. The recommended state for this setting is: Disabled." rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." @@ -2069,13 +3676,175 @@ checks: compliance: - cis: ["18.9.60.2"] - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-38277-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' - - id: 12145 + - id: 15205 + title: "Ensure 'Set what information is shared in Search' is set to 'Enabled: Anonymous info'" + description: "Various levels of information can be shared with Bing in Search, to include user information and location. Configuring this setting prevents users from selecting the level of information shared and enables the most restrictive selection. The recommended state for this setting is: Enabled: Anonymous info." + rationale: "Limiting the search information shared with Microsoft Bing enhances privacy and security." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Anonymous info: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Set what information is shared in Search. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.60.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36937-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> ConnectedSearchPrivacy -> 3' + + + - id: 15206 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'" + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.65.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + + + +# Section - 18.9.76.9 - Reporting + + + + - id: 15207 + title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'" + description: "This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to \"Windows Defender Antivirus Cloud Protection Service\". This setting can only be set by Group Policy. The recommended state for this setting is: Disabled ." + rationale: "The decision on whether or not to participate in Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.3.1"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36940-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' + + + - id: 15208 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'" + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to 'Windows Defender Antivirus Cloud Protection Service'. Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Join Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.3.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + + - id: 15209 + title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'" + description: "This policy setting allows you to configure behavior monitoring for Windows Defender Antivirus. The recommended state for this setting is: Enabled ." + rationale: "When running an antivirus solution such as Windows Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.7.1"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + references: + - 'CCE-38389-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection -> DisableBehaviorMonitoring -> 0' + + + - id: 15210 + title: "Ensure 'Configure Watson events' is set to 'Disabled'" + description: "This policy setting allows you to configure whether or not Watson events are sent." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Reporting\\Configure Watson events." + compliance: + - cis: ["18.9.76.9.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36950-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' + + - id: 15211 + title: "Ensure 'Scan removable drives' is set to 'Enabled'" + description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan. The recommended state for this setting is: Enabled ." + rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Scan removable drives Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.10.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-38409-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' + + - id: 15212 + title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'" + description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac). The recommended state for this setting is: Enabled ." + rationale: "Incoming e-mails should be scanned by an antivirus solution such as Windows Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Turn on e-mail scanning Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.10.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36958-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' + + - id: 15213 + title: "Ensure 'Turn off Windows Defender AntiVirus' is set to 'Disabled'" + description: "This policy setting turns off Windows Defender Antivirus. If the setting is configured to Disabled, Windows Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software. The recommended state for this setting is: Disabled ." + rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Windows Defender Antivirus. Organizations that choose to purchase a reputable 3rd-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Turn off Windows Defender AntiVirus Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn off Windows Defender, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.76.14"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + - tsc: ["CC6.8"] + references: + - 'CCE-36082-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware -> 0' + + + + - id: 15214 title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'" description: "This policy setting allows you to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled. The recommended state for this setting is: Enabled: Warn and prevent bypass." rationale: "Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." @@ -2083,13 +3852,16 @@ checks: compliance: - cis: ["18.9.80.1.1"] - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-35859-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 2' - - id: 12146 + - id: 15215 title: "Ensure 'Configure Default consent' is set to 'Enabled: Always ask before sending data'" description: "This setting allows you to set the default consent handling for error reports. The recommended state for this setting is: Enabled: Always ask before sending data." rationale: "Error reports may contain sensitive information and should not be sent to anyone automatically." @@ -2097,13 +3869,15 @@ checks: compliance: - cis: ["18.9.81.2.1"] - cis_csc: ["13"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37112-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting\Consent -> DefaultConsent -> 1' - - id: 12147 + - id: 15216 title: "Ensure 'Automatically send memory dumps for OS-generated error reports' is set to 'Disabled'" description: "This policy setting controls whether memory dumps in support of OS-generated error reports can be sent to Microsoft automatically. This policy does not apply to error reports generated by 3rd-party products, or additional data other than memory dumps. The recommended state for this setting is: Disabled." rationale: "Memory dumps may contain sensitive information and should not be automatically sent to anyone." @@ -2111,13 +3885,15 @@ checks: compliance: - cis: ["18.9.81.3"] - cis_csc: ["13"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36978-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> AutoApproveOSDumps -> 0' - - id: 12148 + - id: 15217 title: "Ensure 'Allow user control over installs' is set to 'Disabled'" description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user. The recommended state for this setting is: Disabled." rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." @@ -2125,13 +3901,15 @@ checks: compliance: - cis: ["18.9.85.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36400-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' - - id: 12149 + - id: 15218 title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'" description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." @@ -2139,13 +3917,32 @@ checks: compliance: - cis: ["18.9.85.2"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36919-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' - - id: 12150 + + - id: 15219 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'" + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.85.3"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37524-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + + - id: 15220 title: "Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled'" description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system. The recommended state for this setting is: Disabled." rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." @@ -2153,13 +3950,15 @@ checks: compliance: - cis: ["18.9.86.1"] - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] references: - 'CCE-36977-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' - - id: 12151 + - id: 15221 title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'" description: "This policy setting enables logging of all PowerShell script input to the Microsoft-Windows- PowerShell/Operational event log. The recommended state for this setting is: Disabled. Note: In Microsoft's own hardening guidance, they recommend the opposite value, Enabled, because having this data logged improves investigations of PowerShell attack incidents. However, the default ACL on the PowerShell Operational log allows Interactive User (i.e. any logged on user) to read it, and therefore possibly expose passwords or other sensitive information to unauthorized users. If Microsoft locks down the default ACL on that log in the future (e.g. to restrict it only to Administrators), then we will revisit this recommendation in a future release." rationale: "There are potential risks of capturing passwords in the PowerShell logs. This setting should only be needed for debugging purposes, and not in normal operation, it is important to ensure this is set to Disabled." @@ -2167,11 +3966,12 @@ checks: compliance: - cis: ["18.9.95.1"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 0' - - id: 12152 + - id: 15222 title: "Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'" description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts. The recommended state for this setting is: Disabled." rationale: "If this setting is enabled there is a risk that passwords could get stored in plain text in the PowerShell_transcript output file." @@ -2179,11 +3979,12 @@ checks: compliance: - cis: ["18.9.95.2"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 0' - - id: 12153 + - id: 15223 title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication. The recommended state for this setting is: Disabled." rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." @@ -2191,13 +3992,17 @@ checks: compliance: - cis: ["18.9.97.1.1"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36310-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' - - id: 12154 + - id: 15224 title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." @@ -2205,13 +4010,17 @@ checks: compliance: - cis: ["18.9.97.1.2"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37726-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' - - id: 12155 + - id: 15225 title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication. The recommended state for this setting is: Enabled." rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." @@ -2219,13 +4028,17 @@ checks: compliance: - cis: ["18.9.97.1.3"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-38318-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' - - id: 12156 + - id: 15226 title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client. The recommended state for this setting is: Disabled." rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." @@ -2233,13 +4046,37 @@ checks: compliance: - cis: ["18.9.97.2.1"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36254-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' - - id: 12157 + + - id: 15227 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.97.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37927-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + + + - id: 15228 title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." @@ -2247,13 +4084,17 @@ checks: compliance: - cis: ["18.9.97.2.3"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-38223-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' - - id: 12158 + - id: 15229 title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service will allow RunAs credentials to be stored for any plug-ins. The recommended state for this setting is: Enabled. Note: If you enable and then disable this policy setting, any values that were previously configured for RunAsPassword will need to be reset." rationale: "Although the ability to store RunAs credentials is a convenient feature it increases the risk of account compromise slightly. For example, if you forget to lock your desktop before leaving it unattended for a few minutes another person could access not only the desktop of your computer but also any hosts you manage via WinRM with cached RunAs credentials." @@ -2261,13 +4102,33 @@ checks: compliance: - cis: ["18.9.97.2.4"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] references: - 'CCE-36000-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' - - id: 12159 + - id: 15230 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'" + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.98.1"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36499-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + + + - id: 15231 title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'" description: "This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: - 2 - Notify for download and auto install (Notify before downloading any updates) - 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) - 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) - 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting 'Configure automatic updating:' has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a 3rd-party solution for patching may choose to exempt themselves from this setting, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the 3rd-party patching process." rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." @@ -2275,13 +4136,17 @@ checks: compliance: - cis: ["18.9.101.2"] - cis_csc: ["4.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36172-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' - - id: 12160 + - id: 15232 title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'" description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS. The recommended state for this setting is: 0 - Every day. Note: This setting is only applicable if 4 - Auto download and schedule the install is selected in Rule 18.9.101.2. It will have no impact if any other option is selected." rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." @@ -2289,13 +4154,14 @@ checks: compliance: - cis: ["18.9.101.3"] - cis_csc: ["4.5"] + - pci_dss: ["6.2"] references: - 'CCE-36172-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' - - id: 12161 + - id: 15233 title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'" description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." @@ -2303,6 +4169,7 @@ checks: compliance: - cis: ["18.9.101.4"] - cis_csc: ["4.5"] + - pci_dss: ["6.2"] references: - 'CCE-37027-0' condition: all diff --git a/sca/windows/cis_win2012r2_domainL2.yml b/sca/windows/cis_win2012r2_domainL2.yml deleted file mode 100644 index bd5e3e39e..000000000 --- a/sca/windows/cis_win2012r2_domainL2.yml +++ /dev/null @@ -1,583 +0,0 @@ -# Security Configuration Assessment -# CIS Checks for Windows Server 2012 R2 Domain Controller L2 -# Copyright (C) 2015-2020, Wazuh Inc. -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License (version 2) as published by the FSF - Free Software -# Foundation -# -# Based on: -# Center for Internet Security Benchmark for Microsoft Windows Server 2012 R2 v2.3.0 - 03-30-2018 -# Center for Internet Security Benchmark for Microsoft Windows Server 2012 R2 v2.1.0 - 11-02-2015 -# Center for Internet Security Benchmark for Microsoft Windows Server 2012 R2 v2.0.0 - 09-30-2015 - -policy: - id: "cis_win2012r2_domainL2" - file: "cis_win2012r2_domainL2.yml" - name: "CIS benchmark for Windows 2012 R2 Domain Controller L2" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2012 R2." - references: - - https://www.cisecurity.org/cis-benchmarks/ - -requirements: - title: "Check that the Windows platform is Windows Server 2012 R2" - description: "Requirements for running the CIS benchmark Domain Controller L2 under Windows Server 2012 R2" - condition: all - rules: - - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2012 R2' - -checks: - - id: 11500 - title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'" - description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." - rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, you should allow only Administrators, not users, to do so on servers, because printer driver installation on a server may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers." - compliance: - - cis: ["2.3.4.2"] - - cis_csc: ["5.1"] - references: - - 'CCE-37942-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' - -# Section 18.4 - MSS (Legacy) - - id: 11501 - title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes'" - description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." - rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." - compliance: - - cis: ["18.4.5"] - - cis_csc: ["9"] - references: - - 'CCE-36868-8' - - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' - - - id: 11502 - title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'" - description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." - rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." - compliance: - - cis: ["18.4.7"] - - cis_csc: ["9"] - references: - - 'CCE-38065-9' - - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' - - - id: 11503 - title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" - description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." - rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." - compliance: - - cis: ["18.4.10"] - - cis_csc: ["9"] - references: - - 'CCE-37846-3' - - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' - - - id: 11504 - title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" - description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." - rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." - compliance: - - cis: ["18.4.11"] - - cis_csc: ["9"] - references: - - 'CCE-36051-1' - - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' - -# Section 18.5 - Network - - id: 11505 - title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'" - description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." - rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.5.9.1"] - - cis_csc: ["9"] - references: - - 'CCE-38170-7' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' - - - id: 11506 - title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'" - description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." - rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.5.9.2"] - - cis_csc: ["9"] - references: - - 'CCE-37959-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' - - - id: 11507 - title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'" - description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." - rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services. Note: This Group Policy path is provided by the Group Policy template P2P- pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.5.10.2"] - - cis_csc: ["9.1"] - references: - - 'CCE-37699-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' - - - id: 11508 - title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')" - description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)" - rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components reduces a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." - remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents. Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." - compliance: - - cis: ["18.5.19.2.1"] - - cis_csc: ["9"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' - - - id: 11509 - title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'" - description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." - rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now. Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.5.20.1"] - - cis_csc: ["15.4"] - references: - - 'CCE-37481-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' - - - id: 11510 - title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'" - description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." - rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." - compliance: - - cis: ["18.5.20.2"] - - cis_csc: ["15.4"] - references: - - 'CCE-36109-7' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' - - - id: 11511 - title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'" - description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." - rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.8.22.1.2"] - - cis_csc: ["13"] - references: - - 'CCE-37911-5' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' - - - id: 11512 - title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'" - description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." - rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.3"] - - cis_csc: ["13"] - references: - - 'CCE-36203-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' - - - id: 11513 - title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'" - description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." - rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.4"] - - cis_csc: ["13"] - references: - - 'CCE-37163-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' - - - id: 11514 - title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'" - description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." - rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.7"] - references: - - 'CCE-36352-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' - - - id: 11515 - title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" - description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." - rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.8"] - - cis_csc: ["13"] - references: - - 'CCE-36884-5' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' - - - id: 11516 - title: "Ensure 'Turn off the \"Order Prints\" picture task' is set to 'Enabled'" - description: "This policy setting specifies whether the \"Order Prints Online\" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled." - rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.9"] - - cis_csc: ["13"] - references: - - 'CCE-38275-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' - - - id: 11517 - title: "Ensure 'Turn off the \"Publish to Web\" task for files and folders' is set to 'Enabled'" - description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." - rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.10"] - - cis_csc: ["13"] - references: - - 'CCE-37090-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' - - - id: 11518 - title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" - description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." - rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.11"] - - cis_csc: ["13"] - references: - - 'CCE-36628-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' - - - id: 11519 - title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'" - description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." - rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.12"] - - cis_csc: ["13"] - references: - - 'CCE-36174-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' - - - id: 11520 - title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" - description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." - rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.22.1.13"] - - cis_csc: ["13"] - references: - - 'CCE-35964-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' - - - id: 11521 - title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'" - description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." - rationale: "This is a way to increase the security of the system account." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." - compliance: - - cis: ["18.8.26.1"] - - cis_csc: ["16.5"] - references: - - 'CCE-36343-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' - - - id: 11522 - title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'" - description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." - rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." - compliance: - - cis: ["18.8.44.5.1"] - - cis_csc: ["13"] - references: - - 'CCE-38161-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' - - - id: 11523 - title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'" - description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." - rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.8.44.11.1"] - - cis_csc: ["13"] - references: - - 'CCE-36648-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' - - - id: 11524 - title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'" - description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." - rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.8.46.1"] - - cis_csc: ["13"] - references: - - 'CCE-36931-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' - - - id: 11525 - title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'" - description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." - rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.8.49.1.1"] - - cis_csc: ["6.1"] - references: - - 'CCE-37843-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' - -# Section 18.9 - System - - id: 11526 - title: "Ensure 'Turn off location' is set to 'Enabled'" - description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." - rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.39.2"] - - cis_csc: ["13"] - references: - - 'CCE-36886-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' - - - id: 11527 - title: "Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'" - description: "This policy setting allows you to restrict users to a single Remote Desktop Services session. The recommended state for this setting is: Enabled." - rationale: "This setting ensures that users & administrators who Remote Desktop to a server will continue to use the same session - if they disconnect and reconnect, they will go back to the same session they were using before, preventing the creation of a second simultaneous session. This both prevents unnecessary resource usage by having the server host unnecessary additional sessions (which would put extra load on the server) and also ensures a consistency of experience for the user." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Restrict Remote Desktop Services users to a single Remote Desktop Services session. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Restrict Terminal Services users to a single remote session, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." - compliance: - - cis: ["18.9.58.3.2.1"] - references: - - 'CCE-37708-5' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> 1' - - - id: 11528 - title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'" - description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." - rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.58.3.3.1"] - - cis_csc: ["9.1"] - references: - - 'CCE-37696-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' - - - id: 11529 - title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'" - description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." - rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.58.3.3.3"] - - cis_csc: ["9.1"] - references: - - 'CCE-37778-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' - - - id: 11530 - title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'" - description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." - rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.58.3.3.4"] - - cis_csc: ["9.1"] - references: - - 'CCE-37477-7' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' - - - id: 11531 - title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'" - description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less." - rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." - compliance: - - cis: ["18.9.58.3.10.1"] - - cis_csc: ["16.5"] - references: - - 'CCE-37562-6' - - https://workbench.cisecurity.org/benchmarks/766 - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' - - - id: 11532 - title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'" - description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." - rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.58.3.10.2"] - - cis_csc: ["16.5"] - references: - - 'CCE-37949-5' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' - - - id: 11533 - title: "Ensure 'Set what information is shared in Search' is set to 'Enabled: Anonymous info'" - description: "Various levels of information can be shared with Bing in Search, to include user information and location. Configuring this setting prevents users from selecting the level of information shared and enables the most restrictive selection. The recommended state for this setting is: Enabled: Anonymous info." - rationale: "Limiting the search information shared with Microsoft Bing enhances privacy and security." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Anonymous info: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Set what information is shared in Search. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.60.3"] - - cis_csc: ["13"] - references: - - 'CCE-36937-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> ConnectedSearchPrivacy -> 3' - - - id: 11534 - title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'" - description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." - rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." - compliance: - - cis: ["18.9.65.1"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' - - - id: 11535 - title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'" - description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to 'Windows Defender Antivirus Cloud Protection Service'. Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." - rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Join Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." - compliance: - - cis: ["18.9.76.3.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting -> 0' - - - id: 11536 - title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'" - description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." - rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." - compliance: - - cis: ["18.9.85.3"] - - cis_csc: ["7"] - references: - - 'CCE-37524-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' - - - id: 11537 - title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'" - description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." - rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." - compliance: - - cis: ["18.9.97.2.2"] - - cis_csc: ["3.4"] - references: - - 'CCE-37927-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' - - - id: 11538 - title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'" - description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." - rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." - compliance: - - cis: ["18.9.98.1"] - - cis_csc: ["3.4"] - references: - - 'CCE-36499-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' diff --git a/sca/windows/cis_win2012r2_memberL2.yml b/sca/windows/cis_win2012r2_memberL2.yml deleted file mode 100644 index 03583db35..000000000 --- a/sca/windows/cis_win2012r2_memberL2.yml +++ /dev/null @@ -1,679 +0,0 @@ -# Security Configuration Assessment -# CIS Checks for Windows 2012 R2 Member Server L2 -# Copyright (C) 2015-2020, Wazuh Inc. -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public -# License (version 2) as published by the FSF - Free Software -# Foundation -# -# Based on Center for Internet Security Benchmark for Microsoft Windows Server 2012 R2 v2.3.0 - -policy: - id: "cis_win2012r2_memberL2" - file: "cis_win2012r2_memberL2.yml" - name: "CIS benchmark for Windows 2012 R2 Member Server L2" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2012 R2." - references: - - https://www.cisecurity.org/cis-benchmarks/ - -requirements: - title: "Check that the Windows platform is Windows Server 2012 R2" - description: "Requirements for running the CIS benchmark Member Server L2 under Windows Server 2012 R2" - condition: all - rules: - - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2012 R2' - -checks: -# Section 2.3.7 - Interactive logon - - id: 12500 - title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'" - description: "This policy setting determines whether a user can log on to a Windows domain using cached account information." - rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally." - remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)." - compliance: - - cis: ["2.3.7.6"] - - cis_csc: ["16"] - references: - - 'CCE-38240-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> r:^0$|^1$|^2$|^3$|^4$' - -# Section 2.3.10 - Network access - - id: 12501 - title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'" - description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication." - rationale: "Passwords that are cached can be accessed by the user when logged on to the computer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow storage of passwords and credentials for network authentication." - compliance: - - cis: ["2.3.10.4"] - - cis_csc: ["16.14"] - references: - - 'CCE-38119-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' - -# Section 18.4 - MSS (Legacy) - - id: 12502 - title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'" - description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet." - rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds." - compliance: - - cis: ["18.4.5"] - - cis_csc: ["9"] - references: - - 'CCE-36868-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' - - - id: 12503 - title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'" - description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis." - rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)." - compliance: - - cis: ["18.4.7"] - - cis_csc: ["9"] - references: - - 'CCE-38065-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' - - - id: 12504 - title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" - description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted." - rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted." - compliance: - - cis: ["18.4.10"] - - cis_csc: ["9"] - references: - - 'CCE-37846-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' - - - id: 12505 - title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" - description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted." - rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted." - compliance: - - cis: ["18.4.11"] - - cis_csc: ["9"] - references: - - 'CCE-36051-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' - -# Section 18.5.9 - Link-Layer Topology Discovery - - id: 12506 - title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'" - description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver." - rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver." - compliance: - - cis: ["18.5.9.1"] - - cis_csc: ["9"] - references: - - 'CCE-38170-7' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' - - - id: 12507 - title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'" - description: "This policy setting changes the operational behavior of the Responder network protocol driver." - rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver." - compliance: - - cis: ["18.5.9.2"] - - cis_csc: ["9"] - references: - - 'CCE-37959-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' - -# Section 18.5.10 - Microsoft Peer-to-Peer Networking Services - - id: 12508 - title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'" - description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number." - rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services." - compliance: - - cis: ["18.5.10.2"] - - cis_csc: ["9.1"] - references: - - 'CCE-37699-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' - -# Section 18.5.19.2 - Parameters - - id: 12509 - title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')" - rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components reduces a possible attack surface that is also harder to monitor the traffic on." - remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents." - compliance: - - cis: ["18.5.19.2.1"] - - cis_csc: ["9"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' - -# Section 18.5.20 - Windows Connect Now - - id: 12510 - title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'" - description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN)." - rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now." - compliance: - - cis: ["18.5.20.1"] - - cis_csc: ["15.4"] - references: - - 'CCE-37481-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' - - - id: 12511 - title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'" - description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards." - rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\Network\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards." - compliance: - - cis: ["18.5.20.2"] - - cis_csc: ["15.4"] - references: - - 'CCE-36109-7' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' - -# Section 18.5.21 - Windows Connection Manager - - id: 12512 - title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled'" - description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time." - rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\Network\\Windows Connection Manager\\Prohibit connection to non-domain networks when connected to domain authenticated network." - compliance: - - cis: ["18.5.21.2"] - - cis_csc: ["12"] - references: - - 'CCE-37627-7' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' - -# Section 18.8.22.1 - Internet Communication settings - - id: 12513 - title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'" - description: "This setting turns off data sharing from the handwriting recognition personalization tool." - rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing." - compliance: - - cis: ["18.8.22.1.2"] - - cis_csc: ["13"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' - - - id: 12514 - title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'" - description: "Turns off the handwriting recognition error reporting tool." - rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting." - compliance: - - cis: ["18.8.22.1.3"] - - cis_csc: ["13"] - references: - - 'CCE-37911-5' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' - - - id: 12515 - title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'" - description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs)." - rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com" - compliance: - - cis: ["18.8.22.1.4"] - - cis_csc: ["13"] - references: - - 'CCE-37163-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' - - - id: 12516 - title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'" - description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration." - rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com" - compliance: - - cis: ["18.8.22.1.7"] - references: - - 'CCE-36352-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' - - - id: 12517 - title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" - description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches." - rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates." - compliance: - - cis: ["18.8.22.1.8"] - - cis_csc: ["13"] - references: - - 'CCE-36884-5' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' - - - id: 12518 - title: "Ensure 'Turn off the \"Order Prints\" picture task' is set to 'Enabled'" - description: "This policy setting specifies whether the \"Order Prints Online\" task is available from Picture Tasks in Windows folders." - rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task." - compliance: - - cis: ["18.8.22.1.9"] - - cis_csc: ["13"] - references: - - 'CCE-38275-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' - - - id: 12519 - title: "Ensure 'Turn off the \"Publish to Web\" task for files and folders' is set to 'Enabled'" - description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders." - rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders." - compliance: - - cis: ["18.8.22.1.10"] - - cis_csc: ["13"] - references: - - 'CCE-37090-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' - - - id: 12520 - title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" - description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used." - rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program." - compliance: - - cis: ["18.8.22.1.11"] - - cis_csc: ["13"] - references: - - 'CCE-36628-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' - - - id: 12521 - title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'" - description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used." - rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program." - compliance: - - cis: ["18.8.22.1.12"] - - cis_csc: ["13"] - references: - - 'CCE-36174-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' - - - id: 12522 - title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" - description: "This policy setting controls whether or not errors are reported to Microsoft." - rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting." - compliance: - - cis: ["18.8.22.1.13"] - - cis_csc: ["13"] - references: - - 'CCE-35964-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PCHealth\ErrorReporting -> DoReport -> 0' - -# Section 18.8.26 - Locale Services - - id: 12523 - title: Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'" - description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen." - rationale: "This is a way to increase the security of the system account." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in." - compliance: - - cis: ["18.8.26.1"] - - cis_csc: ["16.5"] - references: - - 'CCE-36343-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' - -# Section 18.8.36 - Remote Procedure Call - - id: 12524 - title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'" - description: "This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers." - rationale: "Unauthenticated RPC communication can create a security vulnerability." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients." - compliance: - - cis: ["18.8.36.2"] - - cis_csc: ["9.1"] - references: - - 'CCE-36559-3' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' - -# Section 18.8.44.5 - Microsoft Support Diagnostic Tool - - id: 12525 - title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'" - description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider." - rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider." - compliance: - - cis: ["18.8.44.5.1"] - - cis_csc: ["13"] - references: - - 'CCE-38161-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' - -# Section 18.8.44.11 - Windows Performance PerfTrack - - id: 12526 - title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'" - description: "This policy setting specifies whether to enable or disable tracking of responsiveness events." - rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack." - compliance: - - cis: ["18.8.44.11.1"] - - cis_csc: ["13"] - references: - - 'CCE-36648-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' - -# Section 18.8.46 User Profiles - - id: 12527 - title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'" - description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps." - rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID." - compliance: - - cis: ["18.8.46.1"] - - cis_csc: ["13"] - references: - - 'CCE-36931-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' - -# Section 18.8.49.1 - Time Providers - - id: 12528 - title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'" - description: "This policy setting specifies whether the Windows NTP Client is enabled." - rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client." - compliance: - - cis: ["18.8.49.1.1"] - - cis_csc: ["6.1"] - references: - - 'CCE-37843-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' - - - id: 12529 - title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'" - description: "This policy setting allows you to specify whether the Windows NTP Server is enabled." - rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server." - compliance: - - cis: ["18.8.49.1.2"] - - cis_csc: ["9.1"] - references: - - 'CCE-37319-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' - -# Section 18.9.39 - Location and Sensors - - id: 12530 - title: "Ensure 'Turn off Windows Location Provider' is set to 'Enabled'" - description: "This policy setting turns off the Windows Location Provider feature for the computer." - rationale: "This setting affects the Windows Location Provider feature (e.g. GPS or other location tracking)." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Windows Location Provider\\Turn off Windows Location Provider." - compliance: - - cis: ["18.9.39.1.1"] - references: - - 'CCE-38225-9' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableWindowsLocationProvider -> 1' - - - id: 12531 - title: "Ensure 'Turn off location' is set to 'Enabled'" - description: "This policy setting turns off the location feature for the computer." - rationale: "This setting affects the location feature (e.g. GPS or other location tracking)." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location." - compliance: - - cis: ["18.9.39.2"] - - cis_csc: ["13"] - references: - - 'CCE-36886-0' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' - -# Section 18.9.58.3.2 - Connections - - id: 12532 - title: "Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'" - description: "This policy setting allows you to restrict users to a single Remote Desktop Services session." - rationale: "This setting ensures that users & administrators who Remote Desktop to a server will continue to use the same session - if they disconnect and reconnect, they will go back to the same session they were using before, preventing the creation of a second simultaneous session." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Restrict Remote Desktop Services users to a single Remote Desktop Services session." - compliance: - - cis: ["18.9.58.3.2.1"] - references: - - 'CCE-37708-5' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> 1' - -# Section 18.9.58.3.3 Device and Resource Redirection - - id: 12533 - title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'" - description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session." - rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection." - compliance: - - cis: ["18.9.58.3.3.1"] - - cis_csc: ["9.1"] - references: - - 'CCE-37696-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' - - - id: 12534 - title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'" - description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session." - rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection." - compliance: - - cis: ["18.9.58.3.3.3"] - - cis_csc: ["9.1"] - references: - - 'CCE-37778-8' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' - - - id: 12535 - title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'" - description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session." - rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection." - compliance: - - cis: ["18.9.58.3.3.4"] - - cis_csc: ["9.1"] - references: - - 'CCE-37477-7' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' - -# Section 18.9.58.3.10 - Session Time Limits - - id: 12536 - title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'" - description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected." - rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions." - compliance: - - cis: ["18.9.58.3.10.1"] - - cis_csc: ["16.5"] - references: - - 'CCE-37562-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' - - - id: 12537 - title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'" - description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions." - rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions." - compliance: - - cis: ["18.9.58.3.10.2"] - - cis_csc: ["16.5"] - references: - - 'CCE-37949-5' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' - -# Section 18.9.60.1 - OCR - - id: 12538 - title: "Ensure 'Set what information is shared in Search' is set to 'Enabled: Anonymous info'" - description: "Various levels of information can be shared with Bing in Search, to include user information and location." - rationale: "Limiting the search information shared with Microsoft Bing enhances privacy and security." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Anonymous info: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Set what information is shared in Search." - compliance: - - cis: ["18.9.60.3"] - - cis_csc: ["13"] - references: - - 'CCE-36937-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> ConnectedSearchPrivacy -> 3' - -# Section 18.9.56 - Software Protection Platform - - id: 12539 - title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'" - description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses." - rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation." - compliance: - - cis: ["18.9.65.1"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' - -# Section 18.9.76.3 - MAPS - - id: 12540 - title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'" - description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to \"Windows Defender Antivirus Cloud Protection Service\"." - rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Join Microsoft MAPS." - compliance: - - cis: ["18.9.76.3.2"] - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting -> 0' - -# Section - 18.9.76.9 - Reporting - - id: 12541 - title: "Ensure 'Configure Watson events' is set to 'Disabled'" - description: "This policy setting allows you to configure whether or not Watson events are sent." - rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Reporting\\Configure Watson events." - compliance: - - cis: ["18.9.76.9.1"] - - cis_csc: ["13"] - references: - - 'CCE-36950-4' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' - -# Section 18.9.85 - Windows Installer - - id: 12542 - title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'" - description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user." - rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts." - compliance: - - cis: ["18.9.85.3"] - - cis_csc: ["7"] - references: - - 'CCE-37524-6' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' - -# Section 18.9.97.2 - WinRM Service - - id: 12543 - title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'" - description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port." - rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM." - compliance: - - cis: ["18.9.97.2.2"] - - cis_csc: ["3.4"] - references: - - 'CCE-37927-1' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' - -# Section 18.9.98 - Windows Remote Shell - - id: 12544 - title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'" - description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands." - rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access." - compliance: - - cis: ["18.9.98.1"] - - cis_csc: ["3.4"] - references: - - 'CCE-36499-2' - condition: all - rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' diff --git a/sca/windows/cis_win2012r2_domainL1.yml b/sca/windows/cis_win2016.yml similarity index 51% rename from sca/windows/cis_win2012r2_domainL1.yml rename to sca/windows/cis_win2016.yml index 991e04f55..4dfb1e782 100644 --- a/sca/windows/cis_win2012r2_domainL1.yml +++ b/sca/windows/cis_win2016.yml @@ -1,5 +1,5 @@ # Security Configuration Assessment -# CIS Checks for Windows 2012 R2 Domain Controller L1 +# CIS Checks for Windows 2016 # Copyright (C) 2015-2020, Wazuh Inc. # # This program is free software; you can redistribute it @@ -8,28 +8,38 @@ # Foundation # # Based on: -# Center for Internet Security Benchmark for Microsoft Windows Server 2012 R2 v2.3.0 - 03-30-2018 -# Center for Internet Security Benchmark for Microsoft Windows Server 2012 R2 v2.1.0 - 11-02-2015 -# Center for Internet Security Benchmark for Microsoft Windows Server 2012 R2 v2.0.0 - 09-30-2015 +# Center for Internet Security Benchmark for Microsoft Windows Server 2016 RTM (Release 1607) v1.1.0 - 10-31-2018 + policy: - id: "cis_win2012r2_domainL1" - file: "cis_win2012r2_domainL1.yml" - name: "CIS benchmark for Windows 2012 R2 Domain Controller L1" - description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2012 R2." + id: "cis_win2016" + file: "cis_win2016.yml" + name: "CIS Benchmark for Windows Server 2016" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2016." references: - https://www.cisecurity.org/cis-benchmarks/ requirements: - title: "Check that the Windows platform is Windows Server 2012 R2" - description: "Requirements for running the CIS benchmark Domain Controller L1 under Windows Server 2012 R2" + title: "Check that the Windows platform is Windows Server 2016 RTM" + description: "Requirements for running the CIS benchmark under Windows Server 2016 RTM" condition: all rules: - - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2012 R2' + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2016' + checks: -# Section 1.1 - Password Policies - - id: 11000 + + + +############################################### +# 1 Account Policies +############################################### +############################################### +# 1.1 Password Policy +############################################### + +# 1.1.2 Maximum password age (Scored) + - id: 16000 title: "Ensure 'Maximum password age' is set to '60 or fewer days, but not 0'" description: "This policy setting defines how long a user can use their password before it expires. Values for this policy setting range from 0 to 999 days. If you set the value to 0, the password will never expire. Because attackers can crack passwords, the more frequently you change the password the less opportunity an attacker has to use a cracked password. However, the lower this value is set, the higher the potential for an increase in calls to help desk support due to users having to change their password or forgetting which password is current. The recommended state for this setting is 60 or fewer days, but not 0." rationale: "The longer a password exists the higher the likelihood that it will be compromised by a brute force attack, by an attacker gaining general knowledge about the user, or by the user sharing the password. Configuring the Maximum password age setting to 0 so that users are never required to change their passwords is a major security risk because that allows a compromised password to be used by the malicious user for as long as the valid user is authorized access." @@ -37,6 +47,8 @@ checks: compliance: - cis: ["1.1.2"] - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] references: - 'CCE-37167-4' condition: all @@ -44,22 +56,34 @@ checks: - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 0' - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> n:^(\d+) compare <= 60' -# Section 2.3 - Security Options - - id: 11001 - title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'" + + +############################################### +# 2 Local Policies +############################################### +############################################### +# 2.3 Security Options +############################################### + +# 2.3.1.2 Accounts: Block Microsoft accounts (Scored) + - id: 16001 + title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts" description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." - rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably in order to meet the requirements of compliance standards that apply to their information systems." - remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts : Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts." compliance: - cis: ["2.3.1.2"] - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] references: - 'CCE-36147-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 3' - - id: 11002 +# 2.3.1.4 Accounts: Limit local account use of blank passwords to console logon only (Scored) + - id: 16002 title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'" description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domainbased password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." @@ -67,13 +91,16 @@ checks: compliance: - cis: ["2.3.1.4"] - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-37615-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' - - id: 11003 +# 2.3.2.1 Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings (Scored) + - id: 16003 title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'" description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled. *Important*: Be very cautious about audit settings that can generate a large volume of traffic. For example, if you enable either success or failure auditing for all of the Privilege Use subcategories, the high volume of audit events generated can make it difficult to find other types of entries in the Security log. Such a configuration could also have a significant impact on system performance." rationale: "Prior to the introduction of auditing subcategories in Windows Vista, it was difficult to track events at a per-system or per-user level. The larger event categories created too many events and the key information that needed to be audited was difficult to find." @@ -81,13 +108,20 @@ checks: compliance: - cis: ["2.3.2.1"] - cis_csc: ["6.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-37850-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' - - id: 11004 +# 2.3.2.2 Audit: Shut down system immediately if unable to log security audits (Scored) + - id: 16004 title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'" description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. The recommended state for this setting is: Disabled." rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." @@ -95,13 +129,15 @@ checks: compliance: - cis: ["2.3.2.2"] - cis_csc: ["6"] + - pci_dss: ["10.7"] references: - 'CCE-35907-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' - - id: 11005 +# 2.3.4.1 Devices: Allowed to format and eject removable media (Scored) + - id: 16005 title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'" description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators." rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." @@ -109,13 +145,34 @@ checks: compliance: - cis: ["2.3.4.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-37701-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 0' - - id: 11006 +# 2.3.4.2 Devices: Prevent users from installing printer drivers (Scored) + - id: 16006 + title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'" + description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." + rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, you should allow only Administrators, not users, to do so on servers, because printer driver installation on a server may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers." + compliance: + - cis: ["2.3.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4","2.2.5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3","CC5.2"] + references: + - 'CCE-37942-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' + +# 2.3.5.1 Domain controller: Allow server operators to schedule tasks (Scored) + - id: 16007 title: "Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only)" description: "This policy setting determines whether members of the Server Operators group are allowed to submit jobs by means of the AT schedule facility. The impact of this policy setting configuration should be small for most organizations. Users, including those in the Server Operators group, will still be able to create jobs by means of the Task Scheduler Wizard, but those jobs will run in the context of the account with which the user authenticates when they set up the job. Note: An AT Service Account can be modified to select a different account rather than the LOCAL SYSTEM account. To change the account, open System Tools, click Scheduled Tasks, and then click Accessories folder. Then click AT Service Account on the Advanced menu. The recommended state for this setting is: Disabled." rationale: "If you enable this policy setting, jobs that are created by server operators by means of the AT service will execute in the context of the account that runs that service. By default, that is the local SYSTEM account. If you enable this policy setting, server operators could perform tasks that SYSTEM is able to do but that they would typically not be able to do, such as add their account to the local Administrators group." @@ -123,13 +180,16 @@ checks: compliance: - cis: ["2.3.5.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37848-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SubmitControl -> 0' - - id: 11007 +# 2.3.5.2 Domain controller: LDAP server signing requirements (Scored) + - id: 16008 title: "Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' (DC only)" description: "This policy setting determines whether the Lightweight Directory Access Protocol (LDAP) server requires LDAP clients to negotiate data signing. The recommended state for this setting is: Require signing. Note: Domain member computers must have Network security: LDAP signing requirements (Rule 2.3.11.8) set to Negotiate signing or higher. If not, they will fail to authenticate once the above Require signing value is configured on the Domain Controllers. Fortunately, Negotiate signing is the default in the client configuration. Note #2: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are shipped with Windows XP Professional use LDAP simple bind or LDAP simple bind through SSL to talk to a Domain Controller. Note #3: Before enabling this setting, you should first ensure that there are no clients (including server-based applications) that are configured to authenticate with Active Directory via unsigned LDAP, because changing this setting will break those applications. Such applications should first be reconfigured to use signed LDAP, Secure LDAP (LDAPS), or IPsec-protected connections." rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks. In such attacks, an intruder captures packets between the server and the client, modifies them, and then forwards them to the client. Where LDAP servers are concerned, an attacker could cause a client to make decisions that are based on false records from the LDAP directory. To lower the risk of such an intrusion in an organization's network, you can implement strong physical security measures to protect the network infrastructure. Also, you could implement Internet Protocol security (IPsec) authentication header mode (AH), which performs mutual authentication and packet integrity for IP traffic to make all types of man- in-the-middle attacks extremely difficult. Additionally, allowing the use of regular, unsigned LDAP permits credentials to be received over the network in clear text, which could very easily result in the interception of account passwords by other systems on the network." @@ -137,6 +197,10 @@ checks: compliance: - cis: ["2.3.5.2"] - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - https://blogs.technet.microsoft.com/russellt/2016/01/13/identifying-clear-text-ldap-binds-to-your-dcs/ - 'CCE-35904-2' @@ -144,7 +208,8 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity -> 2' - - id: 11008 +# 2.3.5.3 Domain controller: Refuse machine account password changes (Scored) + - id: 16009 title: "Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' (DC only)" description: "This security setting determines whether Domain Controllers will refuse requests from member computers to change computer account passwords. The recommended state for this setting is: Disabled." rationale: "If you enable this policy setting on all Domain Controllers in a domain, domain members will not be able to change their computer account passwords, and those passwords will be more susceptible to attack." @@ -152,13 +217,16 @@ checks: compliance: - cis: ["2.3.5.3"] - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] references: - 'CCE-36921-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange -> 0' - - id: 11009 +# 2.3.6.1 Domain member: Digitally encrypt or sign secure channel data (always) (Scored) + - id: 16010 title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'" description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -166,13 +234,18 @@ checks: compliance: - cis: ["2.3.6.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36142-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' - - id: 11010 +# 2.3.6.2 Domain member: Digitally encrypt secure channel data (when possible) (Scored) + - id: 16011 title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'" description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -180,13 +253,18 @@ checks: compliance: - cis: ["2.3.6.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37130-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' - - id: 11011 +# 2.3.6.3 Domain member: Digitally sign secure channel data (when possible) (Scored) + - id: 16012 title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'" description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -194,13 +272,18 @@ checks: compliance: - cis: ["2.3.6.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37222-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' - - id: 11012 +# 2.3.6.4 Domain member: Disable machine account password changes (Scored) + - id: 16013 title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'" description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled." rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." @@ -208,13 +291,16 @@ checks: compliance: - cis: ["2.3.6.4"] - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] references: - 'CCE-37508-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' - - id: 11013 +# 2.3.6.6 Domain member: Require strong (Windows 2000 or later) session key (Scored) + - id: 16014 title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'" description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)" @@ -222,13 +308,18 @@ checks: compliance: - cis: ["2.3.6.6"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37614-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' - - id: 11014 +# 2.3.7.1 Interactive logon: Do not display last user name (Scored) + - id: 16015 title: "Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'" description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." @@ -236,13 +327,20 @@ checks: compliance: - cis: ["2.3.7.1"] - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-36056-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' - - id: 11015 +# 2.3.7.2 Interactive logon: Do not require CTRL+ALT+DEL (Scored) + - id: 16016 title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'" description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." @@ -250,13 +348,20 @@ checks: compliance: - cis: ["2.3.7.2"] - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - 'CCE-37637-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' - - id: 11016 +# 2.3.7.3 Interactive logon: Machine inactivity limit (Scored) + - id: 16017 title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'" description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit." rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." @@ -264,6 +369,8 @@ checks: compliance: - cis: ["2.3.7.3"] - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] references: - 'CCE-38235-8' condition: all @@ -271,7 +378,26 @@ checks: - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' - - id: 11017 +# 2.3.7.6 (L2) Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)' (MS only) (Scored) + - id: 16018 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'" + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information. Logon information for domain accounts can be cached locally to allow users to log on even if a Domain Controller cannot be contacted. This policy setting determines the number of unique users for whom logon information is cached locally. If this value is set to 0, the logon cache feature is disabled. An attacker who is able to access the file system of the server could locate this cached information and use a brute force attack to determine user passwords. The recommended state for this setting is: 4 or fewer logon(s) ." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally. If the number is set to 4, then the computer caches logon information for 4 users. When a 5th user logs on to the computer, the server overwrites the oldest cached logon session. Users who access the computer console will have their logon credentials cached on that computer. An attacker who is able to access the file system of the computer could locate this cached information and use a brute force attack to attempt to determine user passwords. To mitigate this type of attack, Windows encrypts the information and obscures its physical location." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s) : Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)" + compliance: + - cis: ["2.3.7.6"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - 'CCE-37439-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> n:^(\d+) compare <= 4' + + +# 2.3.7.7 Interactive logon: Prompt user to change password before expiration (Scored) + - id: 16019 title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'" description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." rationale: "It is recommended that user passwords be configured to expire periodically. Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." @@ -279,13 +405,33 @@ checks: compliance: - cis: ["2.3.7.7"] - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] references: - 'CCE-37622-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' - - id: 11018 +# 2.3.7.8 (L1) Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled' (MS only) (Scored) + - id: 16020 + title: "Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled'" + description: "Logon information is required to unlock a locked computer. For domain accounts, this security setting determines whether it is necessary to contact a Domain Controller to unlock a computer. The recommended state for this setting is: Enabled ." + rationale: "By default, the computer caches in memory the credentials of any users who are authenticated locally. The computer uses these cached credentials to authenticate anyone who attempts to unlock the console. When cached credentials are used, any changes that have recently been made to the account - such as user rights assignments, account lockout, or the account being disabled - are not considered or applied after the account is authenticated. User privileges are not updated, and (more importantly) disabled accounts are still able to unlock the console of the computer." + remediation: "To implement the recommended configuration via GP, set the following UI path to Enabled:Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Require Domain Controller Authentication to unlock workstation" + compliance: + - cis: ["2.3.7.8"] + - cis_csc: ["16.9"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - 'CCE-38240-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon -> 1' + +# 2.3.7.9 Interactive logon: Smart card removal behavior (Scored) + - id: 16021 title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher" description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." @@ -293,13 +439,18 @@ checks: compliance: - cis: ["2.3.7.9"] - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] references: - 'CCE-38333-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$|^3$' - - id: 11019 + + +# 2.3.8.1 Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled' + - id: 16022 title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'" description: "This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the 'Microsoft network client and server: Digitally sign communications (four related settings)' section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -307,13 +458,18 @@ checks: compliance: - cis: ["2.3.8.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36325-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' - - id: 11020 +# 2.3.8.2 Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled' + - id: 16023 title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'" description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -321,13 +477,18 @@ checks: compliance: - cis: ["2.3.8.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36269-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' - - id: 11021 +# 2.3.8.3 Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled' + - id: 16024 title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'" description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." @@ -335,13 +496,18 @@ checks: compliance: - cis: ["2.3.8.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37863-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' - - id: 11022 +# 2.3.9.1 Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0' + - id: 16025 title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0'" description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. A value of 0 appears to allow sessions to persist indefinitely. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s), but not 0." rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." @@ -349,6 +515,8 @@ checks: compliance: - cis: ["2.3.9.1"] - cis_csc: ["3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] references: - 'CCE-38046-9' condition: all @@ -356,7 +524,8 @@ checks: - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> 0' - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' - - id: 11023 +# 2.3.9.2 Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled' + - id: 16026 title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'" description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -364,13 +533,18 @@ checks: compliance: - cis: ["2.3.9.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37864-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' - - id: 11024 +# 2.3.9.3 Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled' + - id: 16027 title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'" description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -378,13 +552,18 @@ checks: compliance: - cis: ["2.3.9.3"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-35988-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' - - id: 11025 +# 2.3.9.4 Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled' + - id: 16028 title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'" description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." @@ -392,14 +571,68 @@ checks: compliance: - cis: ["2.3.9.4"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37972-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' -# Section 2.3 - Security Options - - id: 11026 +# 2.3.9.5 Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher + - id: 16029 + title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher" + description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client. Configuring this setting to Required from client also conforms to the benchmark. Note: Since the release of the MS KB3161561 security patch, this setting can cause significant issues (such as replication problems, group policy editing issues and blue screen crashes) on Domain Controllers when used simultaneously with UNC path hardening (i.e. Rule 18.5.14.1). CIS therefore recommends against deploying this setting on Domain Controllers." + rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level." + compliance: + - cis: ["2.3.9.5"] + - cis_csc: ["14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - https://support.microsoft.com/en-us/help/3161561/ms16-075-and-ms16-076-description-of-the-security-update-for-windows-n + - 'CCE-36170-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' + +# 2.3.10.2 Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled' + - id: 16030 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'" + description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts." + compliance: + - cis: ["2.3.10.2"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36316-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' + +# 2.3.10.3 Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled' + - id: 16031 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'" + description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" + remediation: "To establish the recommended configuration via GP, set the following U path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts and shares." + compliance: + - cis: ["2.3.10.3"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36316-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' + +# 2.3.10.4 (L2) Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled' (Scored) + - id: 16032 title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'" description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." @@ -407,13 +640,16 @@ checks: compliance: - cis: ["2.3.10.4"] - cis_csc: ["16.14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-38119-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' - - id: 11027 +# 2.3.10.5 Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled' + - id: 16033 title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'" description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." @@ -421,96 +657,134 @@ checks: compliance: - cis: ["2.3.10.5"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36148-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' - - id: 11028 +# 2.3.10.6 Configure 'Network access: Named Pipes that can be accessed anonymously' (Domain Controller) + - id: 16034 title: "Configure 'Network access: Named Pipes that can be accessed anonymously'" - description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: - Level 1 - Domain Controller. The recommended state for this setting is: LSARPC, NETLOGON, SAMR and (when the legacy Computer Browser service is enabled) BROWSER. - Level 1 - Member Server. The recommended state for this setting is: (i.e. None), or (when the legacy Computer Browser service is enabled) BROWSER. Note: A Member Server that holds the Remote Desktop Services Role with Remote Desktop Licensing Role Service will require a special exception to this recommendation, to allow the HydraLSPipe and TermServLicensing Named Pipes to be accessed anonymously." + description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: (i.e. None), or (when the legacy Computer Browser service is enabled) BROWSER. Note: A Member Server that holds the Remote Desktop Services Role with Remote Desktop Licensing Role Service will require a special exception to this recommendation, to allow the HydraLSPipe and TermServLicensing Named Pipes to be accessed anonymously." rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Named Pipes that can be accessed anonymously." compliance: - cis: ["2.3.10.6"] - cis_csc: ["14.1", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-38258-0' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:lsarpc|netlogon|samr' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:LSARPC && r:NETLOGON && r:SAMR' - - id: 11029 +# 2.3.10.8 Configure 'Network access: Remotely accessible registry paths' + - id: 16035 title: "Configure 'Network access: Remotely accessible registry paths'" description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called 'Network access: Remotely accessible registry paths and sub- paths' in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2). Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\ProductOptions | System\\CurrentControlSet\\Control\\Server Applications | Software\\Microsoft\\Windows NT\\CurrentVersion. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths." compliance: - - cis: ["2.3.10.7"] + - cis: ["2.3.10.8"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37194-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions|System\\CurrentControlSet\\Control\\Server Applications|Software\\Microsoft\\Windows NT\\CurrentVersion' - - id: 11030 +# 2.3.10.9 Configure 'Network access: Remotely accessible registry paths and sub-paths' + - id: 16036 title: "Configure 'Network access: Remotely accessible registry paths and sub-paths'" description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called 'Network access: Remotely accessible registry paths,' the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\Print\\Printers | System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server | Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows | NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex | System\\CurrentControlSet\\Control\\Terminal Server | System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig | System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration | Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib | System\\CurrentControlSet\\Services\\SysmonLog | Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local | Policies\\Security Options\\Network access: Remotely accessible registry paths | and sub-paths. When a server holds the Active Directory Certificate Services Role with Certification Authority Role Service, the above list should also include: System\\CurrentControlSet\\Services\\CertSvc. When a server has the WINS Server Feature installed, the above list should also include: System\\CurrentControlSet\\Services\\WINS" compliance: - - cis: ["2.3.10.8"] + - cis: ["2.3.10.9"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36347-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print|Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows|System\\CurrentControlSet\\Control\\Print\\Printers|System\\CurrentControlSet\\Services\\Eventlog|Software\\Microsoft\\OLAP Server|System\\CurrentControlSet\\Control\\ContentIndex|System\\CurrentControlSet\\Control\\Terminal Server|System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig|System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration|Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib|System\\CurrentControlSet\\Services\\SysmonLog|System\\CurrentControlSet\\Services\\CertSvc|System\\CurrentControlSet\\Services\\WINS' - - id: 11031 +# 2.3.10.10 Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled' + - id: 16037 title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'" description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict anonymous access to Named Pipes and Shares." compliance: - - cis: ["2.3.10.9"] + - cis: ["2.3.10.10"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36021-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' - - id: 11032 +# 2.3.10.11 Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow' (MS only) + - id: 16038 + title: "Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow'" + description: "This policy setting allows you to restrict remote RPC connections to SAM. The recommended state for this setting is: Administrators: Remote Access: Allow . Note: A Windows 10 R1607, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "To ensure that an unauthorized user cannot anonymously list local account names or groups and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Remote Access: Allow: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict clients allowed to make remote calls to SAM" + compliance: + - cis: ["2.3.10.11"] + - cis_csc: ["5.1", "9.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> restrictremotesam -> O:BAG:BAD:(A;;RC;;;BA)' + +# 2.3.10.12 Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None' + - id: 16039 title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'" - description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)." + description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)" rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Shares that can be accessed anonymously." compliance: - - cis: ["2.3.10.10"] + - cis: ["2.3.10.12"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-38095-6' - condition: all + condition: any rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares' - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\.' - - id: 11033 + +# 2.3.10.13 Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves' + - id: 16040 title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'" - description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)." + description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)" rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." remediation: "To establish the recommended configuration via GP, set the following UI path to Classic - local users authenticate as themselves: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Sharing and security model for local accounts." compliance: - - cis: ["2.3.10.11"] + - cis: ["2.3.10.13"] - cis_csc: ["14", "16"] + - pci_dss: ["7.1.3"] + - tsc: ["CC6.4"] references: - 'CCE-37623-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' - - id: 11034 +# 2.3.11.1 Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled' + - id: 16041 title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'" description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." @@ -518,13 +792,18 @@ checks: compliance: - cis: ["2.3.11.1"] - cis_csc: ["14", "16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-38341-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' - - id: 11035 +# 2.3.11.2 Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled' + - id: 16042 title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'" description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." rationale: "NULL sessions are less secure because by definition they are unauthenticated." @@ -532,13 +811,18 @@ checks: compliance: - cis: ["2.3.11.2"] - cis_csc: ["14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37035-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' - - id: 11036 +# 2.3.11.3 Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled' + - id: 16043 title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'" description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called Homegroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." @@ -546,27 +830,37 @@ checks: compliance: - cis: ["2.3.11.3"] - cis_csc: ["16.9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-38047-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' - - id: 11037 +# 2.3.11.4 Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types' + - id: 16044 title: "Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'" description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it. For the purposes of scoring we have allowed the use of RC4_HMAC_MD5 as an optional setting." - rationale: "he strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." + rationale: "The strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." remediation: "To establish the recommended configuration via GP, set the following UI path to AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Configure encryption types allowed for Kerberos." compliance: - cis: ["2.3.11.4"] - cis_csc: ["16.14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37755-6' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> 2147483644' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:2147483644|2147483640' - - id: 11038 +# 2.3.11.5 Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled' + - id: 16045 title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'" description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." @@ -574,13 +868,16 @@ checks: compliance: - cis: ["2.3.11.5"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-36326-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' - - id: 11039 +# 2.3.11.6 Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled' + - id: 16046 title: "Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'" description: "This policy setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Microsoft network server: Disconnect clients when logon hours expire (Rule 2.3.9.4). The recommended state for this setting is: Enabled. Note: This recommendation is unscored because there is not a documented registry value that corresponds to it. We still strongly encourage that it be configured as Enabled, to ensure that logon hours (when configured) are properly enforced." rationale: "If this setting is disabled, a user could remain connected to the computer outside of their allotted logon hours." @@ -588,13 +885,16 @@ checks: compliance: - cis: ["2.3.11.6"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36270-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' - - id: 11040 +# 2.3.11.7 Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM' + - id: 16047 title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'" description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: -Join a domain -Authenticate between Active Directory forests -Authenticate to down-level domains -Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP -Authenticate to computers that are not in the domain. The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non- R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." @@ -602,13 +902,18 @@ checks: compliance: - cis: ["2.3.11.7"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36173-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' - - - id: 11041 + +# 2.3.11.8 Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher + - id: 16048 title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher" description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." @@ -616,13 +921,18 @@ checks: compliance: - cis: ["2.3.11.8"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36858-9' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:^(\d+) compare >= 1' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:(\d+) compare >= 1' - - id: 11042 +# 2.3.11.9 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 16049 title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." @@ -630,13 +940,18 @@ checks: compliance: - cis: ["2.3.11.9"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37553-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' - - id: 11043 +# 2.3.11.10 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 16050 title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." @@ -644,6 +959,10 @@ checks: compliance: - cis: ["2.3.11.10"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - https://workbench.cisecurity.org/benchmarks/288 - 'CCE-37835-6' @@ -651,7 +970,9 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' - - id: 11044 + +# 2.3.13.1 Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled' + - id: 16051 title: "Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'" description: "This policy setting determines whether a computer can be shut down when a user is not logged on. If this policy setting is enabled, the shutdown command is available on the Windows logon screen. It is recommended to disable this policy setting to restrict the ability to shut down the computer to users with credentials on the system. The recommended state for this setting is: Disabled. Note: In Server 2008 R2 and older versions, this setting had no impact on Remote Desktop (RDP) / Terminal Services sessions - it only affected the local console. However, Microsoft changed the behavior in Windows Server 2012 (non-R2) and above, where if set to Enabled, RDP sessions are also allowed to shut down or restart the server." rationale: "Users who can access the console locally could shut down the computer. Attackers could also walk to the local console and restart the server, which would cause a temporary DoS condition. Attackers could also shut down the server and leave all of its applications and services unavailable. As noted in the Description above, the Denial of Service (DoS) risk of enabling this setting dramatically increases in Windows Server 2012 (non-R2) and above, as even remote users could then shut down or restart the server from the logon screen of an RDP session." @@ -659,54 +980,68 @@ checks: compliance: - cis: ["2.3.13.1"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36788-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon -> 0' - - id: 11045 +# 2.3.15.1 Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled' + - id: 16052 title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'" description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Require case insensitivity for non- Windows subsystems." compliance: - cis: ["2.3.15.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37885-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' - - id: 11046 +# 2.3.15.2 Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled' + - id: 16053 title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'" description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)" compliance: - cis: ["2.3.15.2"] - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37644-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' - - id: 11047 +# 2.3.17.1 Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled' + - id: 16054 title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'" description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." - rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named 'Administrator' because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. -If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named 'Administrator' because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. - If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account." compliance: - cis: ["2.3.17.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36494-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' - - id: 11048 +# 2.3.17.2 Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled' + - id: 16055 title: "Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled'" description: "This policy setting controls whether User Interface Accessibility (UIAccess or UIA) programs can automatically disable the secure desktop for elevation prompts used by a standard user. The recommended state for this setting is: Disabled." rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting allows the administrator to perform operations that require elevated privileges while connected via Remote Assistance. This increases security in that organizations can use UAC even when end user support is provided remotely. However, it also reduces security by adding the risk that an administrator might allow an unprivileged user to share elevated privileges for an application that the administrator needs to use during the Remote Desktop session." @@ -714,13 +1049,16 @@ checks: compliance: - cis: ["2.3.17.2"] - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36863-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableUIADesktopToggle -> 0' - - id: 11049 +# 2.3.17.3 Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop' + - id: 16056 title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'" description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop." rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." @@ -728,13 +1066,16 @@ checks: compliance: - cis: ["2.3.17.3"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37029-6' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> 2' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> r:^2$' - - id: 11050 +# 2.3.17.4 Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests' + - id: 16057 title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'" description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." @@ -742,13 +1083,16 @@ checks: compliance: - cis: ["2.3.17.4"] - cis_csc: ["5.1"] + - pci_dss: ["7.1.2"] + - tsc: ["CC6.4"] references: - 'CCE-36864-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' - - id: 11051 +# 2.3.17.5 Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled' + - id: 16058 title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'" description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage." @@ -756,27 +1100,34 @@ checks: compliance: - cis: ["2.3.17.5"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36533-8' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' - - id: 11052 +# 2.3.17.6 Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled' + - id: 16059 title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'" description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: ...\\Program Files\\, including subfolders; ...\\Windows\\system32\\; ...\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows). Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." - rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: -To set the foreground window. -To drive any application window using SendInput function. -To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. -To set journal hooks. -To uses AttachThreadInput to attach a thread to a higher integrity input queue." + rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: - To set the foreground window. - To drive any application window using SendInput function. - To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. - To set journal hooks. - To uses AttachThreadInput to attach a thread to a higher integrity input queue." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations." compliance: - cis: ["2.3.17.6"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37057-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' - - id: 11053 +# 2.3.17.7 Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled' + - id: 16060 title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'" description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." @@ -784,13 +1135,16 @@ checks: compliance: - cis: ["2.3.17.7"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36869-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' - - id: 11054 +# 2.3.17.8 Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled' + - id: 16061 title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'" description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." @@ -798,27 +1152,41 @@ checks: compliance: - cis: ["2.3.17.8"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36866-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' - - id: 11055 +# 2.3.17.9 Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled' + - id: 16062 title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'" description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %Windir% - %Windir%\\system32 - HKEY_LOCAL_MACHINE\\Software. The recommended state for this setting is: Enabled." rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations." compliance: - cis: ["2.3.17.9"] + - pci_dss: ["6.5.8"] + - tsc: ["CC6.1"] references: - 'CCE-37064-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' -# Section 9.1 - Domain Profile - - id: 11056 +############################################### +# 9 Windows Firewall with Advanced Security +############################################### + +############################################### +# 9.1 Domain Profile +############################################### + +# 9.1.1 Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)' + - id: 16063 title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -826,13 +1194,16 @@ checks: compliance: - cis: ["9.1.1"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-36062-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' - - id: 11057 +# 9.1.2 Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)' + - id: 16064 title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'" description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -840,13 +1211,16 @@ checks: compliance: - cis: ["9.1.2"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-38117-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' - - id: 11058 +# 9.1.3 Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)' + - id: 16065 title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'" description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." @@ -854,40 +1228,53 @@ checks: compliance: - cis: ["9.1.3"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-36146-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' - - id: 11059 +# 9.1.4 Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No' + - id: 16066 title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'" description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification." compliance: - cis: ["9.1.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-38041-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' - - id: 11060 +# 9.1.5 Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\domainfw.log' + - id: 16067 title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log'" description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name" compliance: - cis: ["9.1.5"] - - cis_csc: ["6.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37482-7' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' - - id: 11061 +# 9.1.6 Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 16068 title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater'" description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -895,13 +1282,20 @@ checks: compliance: - cis: ["9.1.6"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36088-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' - - id: 11062 +# 9.1.7 Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes' + - id: 16069 title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -909,13 +1303,20 @@ checks: compliance: - cis: ["9.1.7"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37523-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' - - id: 11063 +# 9.1.8 Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes' + - id: 16070 title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -923,14 +1324,24 @@ checks: compliance: - cis: ["9.1.8"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36393-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' -# Section 9.2 - Private Profile - - id: 11064 +############################################### +# 9.2 Private Profile +############################################### + +# 9.2.1 Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)' + - id: 16071 title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -938,13 +1349,16 @@ checks: compliance: - cis: ["9.2.1"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-38239-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' - - id: 11065 +# 9.2.2 Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)' + - id: 16072 title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'" description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -952,13 +1366,16 @@ checks: compliance: - cis: ["9.2.2"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-38042-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' - - id: 11066 +# 9.2.3 Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)' + - id: 16073 title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'" description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." @@ -966,26 +1383,32 @@ checks: compliance: - cis: ["9.2.3"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-38332-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' - - id: 11067 +# 9.2.4 Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No' + - id: 16074 title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'" description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification." compliance: - cis: ["9.2.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-37621-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' - - id: 11068 +# 9.2.5 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\privatefw.log' + - id: 16075 title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log'" description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -993,13 +1416,20 @@ checks: compliance: - cis: ["9.2.5"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37569-1' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' - - id: 11069 +# 9.2.6 Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 16076 title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater'" description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1007,13 +1437,20 @@ checks: compliance: - cis: ["9.2.6"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-38178-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' - - id: 11070 +# 9.2.7 Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes' + - id: 16077 title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1021,13 +1458,20 @@ checks: compliance: - cis: ["9.2.7"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-35972-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' - - id: 11071 +# 9.2.8 Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes' + - id: 16078 title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1035,14 +1479,24 @@ checks: compliance: - cis: ["9.2.8"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37387-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' -# Sectin 9.3 - Public Profile - - id: 11072 +############################################### +# 9.3 Public Profile +############################################### + +# 9.3.1 Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)' + - id: 16079 title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -1050,13 +1504,16 @@ checks: compliance: - cis: ["9.3.1"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-37862-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' - - id: 11073 +# 9.3.2 Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)' + - id: 16080 title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'" description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -1064,13 +1521,16 @@ checks: compliance: - cis: ["9.3.2"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-36057-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' - - id: 11074 +# 9.3.3 Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)' + - id: 16081 title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'" description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." @@ -1078,27 +1538,32 @@ checks: compliance: - cis: ["9.3.3"] - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] references: - 'CCE-37434-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' - - id: 11075 +# 9.3.4 Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No' + - id: 16082 title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'" description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No." rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification." compliance: - cis: ["9.3.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-38043-6' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 0' - + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' - - id: 11076 +# 9.3.5 Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No' + - id: 16083 title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'" description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." rationale: "iWhen in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." @@ -1106,13 +1571,16 @@ checks: compliance: - cis: ["9.3.5"] - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-37861-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' - - id: 11077 +# 9.3.6 Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No' + - id: 16084 title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'" description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." @@ -1120,13 +1588,16 @@ checks: compliance: - cis: ["9.3.6"] - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] references: - 'CCE-36268-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' - - id: 11078 +# 9.3.7 Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\publicfw.log' + - id: 16085 title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log'" description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1134,13 +1605,20 @@ checks: compliance: - cis: ["9.3.7"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37266-4' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' - - id: 11079 +# 9.3.8 Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 16086 title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater'" description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1148,13 +1626,20 @@ checks: compliance: - cis: ["9.3.8"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36395-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' - - id: 11080 +# 9.3.9 Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes' + - id: 16087 title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1162,13 +1647,20 @@ checks: compliance: - cis: ["9.3.9"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37265-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' - - id: 11081 +# 9.3.9 Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes' + - id: 16088 title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'" description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1176,59 +1668,316 @@ checks: compliance: - cis: ["9.3.10"] - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36394-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' -# Section 18.1 - Control Panel - - id: 11082 + +############################################### +# 17 Advanced Audit Policy Configuration +############################################### + + + + + + +############################################### +# 18 Administrative Templates (Computer) +############################################### +############################################### +# 18.1 Control Panel +############################################### +# 18.1.1.1 (L1) Ensure 'Prevent enabling lock screen camera' is set to 'Enabled' + - id: 16089 title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'" description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." compliance: - cis: ["18.1.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-38347-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' - - id: 11083 +# 18.1.1.2 Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled' + - id: 16090 title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'" description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." compliance: - cis: ["18.1.1.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-38348-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' +# 18.1.2.2 Ensure 'Allow input personalization' is set to 'Disabled' + - id: 16091 + title: "Ensure 'Allow input personalization' is set to 'Disabled'" + description: "This policy enables the automatic learning component of input personalization that includes speech, inking, and typing. Automatic learning enables the collection of speech and handwriting patterns, typing history, contacts, and recent calendar information. It is required for the use of Cortana. Some of this collected information may be stored on the user's OneDrive, in the case of inking and typing; some of the information will be uploaded to Microsoft to personalize speech. The recommended state for this setting is: Disabled." + rationale: "If this setting is Enabled sensitive information could be stored in the cloud or sent to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Regional and Language Options\\Allow input personalization Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.1.2.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38347-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization -> 0' + +# 18.1.3 Ensure 'Allow Online Tips' is set to 'Disabled' (Scored) + - id: 16092 + title: "Ensure 'Allow Online Tips' is set to 'Disabled'" + description: "This policy setting configures the retrieval of online tips and help for the Settings app. The recommended state for this setting is: Disabled ." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow Online Tips Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanel.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["1.3.4"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips -> 0' + +############################################### +# Section 18.2 - LAPS +############################################### + + - id: 16093 + title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "In order to utilize LAPS, a minor Active Directory Schema update is required, and a Group Policy Client Side Extension (CSE) must be installed on each managed computer. When LAPS is installed, the file AdmPwd.dll must be present in the following location and registered in Windows (the LAPS AdmPwd GPO Extension / CSE installation does this for you): C:\\Program Files\\LAPS\\CSE\\AdmPwd.dll" + compliance: + - cis: ["18.2.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + + - id: 16094 + title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Do not allow password expiration time longer than required by policy Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' + + - id: 16095 + title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Enable Local Admin Password Management Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' + + - id: 16096 + title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Complexity option to Large letters + small letters + numbers + special characters: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.4"] + - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' + + - id: 16097 + title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Length option to 15 or more: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.5"] + - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' + + - id: 16098 + title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Age (Days) option to 30 or fewer: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.6"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' +############################################### # Section 18.3 - MS Security Guide - - id: 11084 - title: "Ensure 'WDigest Authentication' is set to 'Disabled'" - description: "When WDigest authentication is enabled, Lsass.exe retains a copy of the user's plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server. The recommended state for this setting is: Disabled." +############################################### +# 18.3.1 (L1) Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled' (MS only) + - id: 16099 + title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled'" + description: "This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1. For more information about local accounts and credential theft, review the 'Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques' documents. For more information about LocalAccountTokenFilterPolicy, see Microsoft Knowledge Base article 951016: Description of User Account Control and remote restrictions in Windows Vista. The recommended state for this setting is: Enabled." + rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Apply UAC restrictions to local accounts on network logons Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft." + compliance: + - cis: ["18.3.1"] + - cis_csc: ["5.8"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - https://www.microsoft.com/en-us/download/details.aspx?id=36036 + - https://support.microsoft.com/en-us/help/951016/description-of-user-account-control-and-remote-restrictions-in-windows + - https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/ + - 'CCE-37069-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 0' + + +# 18.3.2 (L1) Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver' + - id: 16100 + title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver'" + description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service ( MRxSmb10 ), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver. Note: Do not, under any circumstances, configure this overall setting as Disabled , as doing so will delete the underlying registry entry altogether, which will cause serious problems." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable driver : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 client driver Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858' + - 'https://docs.microsoft.com/en-us/archive/blogs/staysafe/disable-smb-v1-in-managed-environments-with-ad-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/disabling-smbv1-through-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/security-baseline-for-windows-10-creators-update-v1703-final' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 4' + +# 18.3.3 Ensure 'Configure SMB v1 server' is set to 'Disabled' (Scored) + - id: 16101 + title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'" + description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled ." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 server Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858' + - 'https://docs.microsoft.com/en-us/archive/blogs/staysafe/disable-smb-v1-in-managed-environments-with-ad-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/disabling-smbv1-through-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/security-baseline-for-windows-10-creators-update-v1703-final' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' + +# 18.3.4 Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled' + - id: 16102 + title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'" + description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled ." + rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Enable Structured Exception Handling Overwrite Protection (SEHOP) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.4"] + - cis_csc: ["8.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/' + - 'https://support.microsoft.com/en-us/help/956607/how-to-enable-structured-exception-handling-overwrite-protection-sehop' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' + +# 18.3.5 Ensure 'Turn on Windows Defender protection against Potentially Unwanted Applications' is set to 'Enabled' + - id: 16103 + title: "Ensure 'Turn on Windows Defender protection against Potentially Unwanted Applications' is set to 'Enabled'" + description: "Enabling this Windows Defender feature will protect against Potentially Unwanted Applications (PUA), which are sneaky unwanted application bundlers or their bundled applications to deliver adware or malware. The recommended state for this setting is: Enabled ." rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\WDigest Authentication (disabling may require KB2871997) Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Turn on Windows Defender protection against Potentially Unwanted Applications Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" compliance: - cis: ["18.3.5"] - - cis_csc: ["16.14"] + - cis_csc: ["8.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - https://www.microsoft.com/en-us/download/details.aspx?id=36036 - https://support.microsoft.com/en-us/help/2871997/microsoft-security-advisory-update-to-improve-credentials-protection-a - https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> MpEnablePus -> 1' + +# 18.3.6 Ensure 'WDigest Authentication' is set to 'Disabled' + - id: 16104 + title: "Ensure 'WDigest Authentication' is set to 'Disabled'" + description: "When WDigest authentication is enabled, Lsass.exe retains a copy of the user's plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server. For more information about local accounts and credential theft, review the \"Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques\" documents. For more information about UseLogonCredential , see Microsoft Knowledge Base article 2871997: Microsoft Security Advisory Update to improve credentials protection and management May 13, 2014. The recommended state for this setting is: Disabled ." + rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\WDigest Authentication (disabling may require KB2871997) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required - it is available from Microsoft at this link." + compliance: + - cis: ["18.3.6"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'http://www.microsoft.com/en-us/download/details.aspx?id=36036' + - 'https://support.microsoft.com/en-us/kb/2871997' + - 'https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/' - 'CCE-38444-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' -# Section 18.4 - MSS (Legacy) - - id: 11085 +############################################### +# 18.4 MSS (Legacy) +############################################### +# 18.4.1 (L1) Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled' + - id: 16105 title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'" description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. The recommended state for this setting is: Disabled." rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." @@ -1236,6 +1985,8 @@ checks: compliance: - cis: ["18.4.1"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - https://support.microsoft.com/en-us/help/324737/how-to-turn-on-automatic-logon-in-windows - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ @@ -1244,7 +1995,8 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' - - id: 11086 +# 18.4.2 Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' + - id: 16106 title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." @@ -1252,6 +2004,10 @@ checks: compliance: - cis: ["18.4.2"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36871-2' @@ -1259,7 +2015,8 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' - - id: 11087 +# 18.4.3 Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' + - id: 16107 title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." @@ -1267,6 +2024,10 @@ checks: compliance: - cis: ["18.4.3"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36535-3' @@ -1274,7 +2035,8 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' - - id: 11088 +# 18.4.4 Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled' + - id: 16108 title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'" description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." @@ -1282,6 +2044,9 @@ checks: compliance: - cis: ["18.4.4"] - cis_csc: ["9"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-37988-3' @@ -1289,7 +2054,29 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' - - id: 11089 + +# 18.4.5 Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes' + - id: 16109 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes'" + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.5"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-36868-8' + - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + + +# 18.4.6 Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled' + - id: 16110 title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'" description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." @@ -1297,6 +2084,10 @@ checks: compliance: - cis: ["18.4.6"] - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36879-5' @@ -1304,7 +2095,27 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' - - id: 11090 +# 18.4.7 Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled' + - id: 16111 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'" + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.7"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-38065-9' + - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + +# 18.4.8 Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled' + - id: 16112 title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'" description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: -Search folders specified in the system path first, and then search the current working folder. -Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled." rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." @@ -1312,6 +2123,16 @@ checks: compliance: - cis: ["18.4.8"] - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36351-5' @@ -1319,7 +2140,8 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' - - id: 11091 +# 18.4.9 Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds' + - id: 16113 title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'" description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." @@ -1327,6 +2149,8 @@ checks: compliance: - cis: ["18.4.9"] - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-37993-3' @@ -1334,7 +2158,47 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' - - id: 11092 +# 18.4.10 Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' + - id: 16114 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.10"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-37846-3' + - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + +# 18.4.11 Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' + - id: 16115 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.11"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-36051-1' + - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + + +# 18.4.12 Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less' + - id: 16116 title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'" description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." @@ -1342,6 +2206,7 @@ checks: compliance: - cis: ["18.4.12"] - cis_csc: ["6.3"] + - pci_dss: ["10.7"] references: - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ - 'CCE-36880-3' @@ -1349,8 +2214,141 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' -# Section 18.5 - Network - - id: 11093 + +############################################ +# 18.5 Network +############################################ +# 18.5.4.1 Set 'NetBIOS node type' to 'P-node' (Ensure NetBT Parameter 'NodeType' is set to '0x2 (2)') (MS Only) + - id: 16117 + title: "Set 'NetBIOS node type' to 'P-node' (Ensure NetBT Parameter 'NodeType' is set to '0x2 (2)')" + description: "This parameter determines which method NetBIOS over TCP/IP (NetBT) will use to register and resolve names. A B-node (broadcast) system only uses broadcasts. A P-node (point-to-point) system uses only name queries to a name server (WINS). An M-node (mixed) system broadcasts first, then queries the name server (WINS). An H-node (hybrid) system queries the name server (WINS) first, then broadcasts. The recommended state for this setting is: NodeType - 0x2 (2) (P-node / point-to-point)." + rationale: "In order to help mitigate the risk of NetBIOS Name Service (NBT-NS) poisoning attacks, setting the node type to P-node will prevent the system from sending out NetBIOS broadcasts." + remediation: "To establish the recommended configuration, set the following Registry value to 0x2 (2) (DWORD) : HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NetBT\\Parameters:NodeType" + compliance: + - cis: ["18.5.4.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NetBT\Parameters -> NodeType -> 2' + + +# 18.5.4.2 Ensure 'Turn off multicast name resolution' is set to 'Enabled' (MS Only) + - id: 16118 + title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'" + description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled ." + rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system. Note: To completely mitigate local name resolution poisoning, in addition to this setting, the properties of each installed NIC should also be set to Disable NetBIOS over TCP/IP (on the WINS tab in the NIC properties). Unfortunately, there is no global setting to achieve this that automatically applies to all NICs - it is a per-NIC setting that varies with different NIC hardware installations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution ote: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.4.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37450-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 0' + +############################################### +# 18.5.5 Fonts +############################################### +# 18.5.5.1 Ensure 'Enable Font Providers' is set to 'Disabled' (Scored) + - id: 16119 + title: "Ensure 'Enable Font Providers' is set to 'Disabled'" + description: "This policy setting determines whether Windows is allowed to download fonts and font catalog data from an online font provider.The recommended state for this setting is: Disabled ." + rationale: "In an enterprise managed environment the IT department should be managing the changes to the system configuration, to ensure all changes are tested and approved." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\Fonts\\Enable Font Providers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.5.1"] + - cis_csc: ["3", "13"] + - pci_dss: ["6.4.5"] + - tsc: ["CC6.6","CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders -> 0' + +# 18.5.8.1 Ensure 'Enable insecure guest logons' is set to 'Disabled' + - id: 16120 + title: "Ensure 'Enable insecure guest logons' is set to 'Disabled'" + description: "This policy setting determines if the SMB client will allow insecure guest logons to an SMB server. The recommended state for this setting is: Disabled ." + rationale: "Insecure guest logons are used by file servers to allow unauthenticated access to shared folders." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\LanmanWorkstation\\Enable insecure guest logons Note: This Group Policy path may not exist by default. It is provided by the Group Policy template LanmanWorkstation.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.8.1"] + - cis_csc: ["9.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth -> 0' + +# 18.5.9.1 Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled' + - id: 16121 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38170-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' + +# 18.5.9.2 (L2) Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled' + - id: 16122 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37959-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' + +# 18.5.10.2 (L2) Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled' (Scored) + - id: 16123 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'" + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services. Note: This Group Policy path is provided by the Group Policy template P2P- pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.10.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37699-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + +# 18.5.11.2 (L1) Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled' (Scored) + - id: 16124 title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'" description: "You can use this procedure to controls user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." @@ -1358,13 +2356,16 @@ checks: compliance: - cis: ["18.5.11.2"] - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] references: - 'CCE-38002-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' - - id: 11094 +# 18.5.11.3 (L1) Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled' (Scored) + - id: 16125 title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'" description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled." rationale: "Allowing regular users to set a network location increases the risk and attack surface." @@ -1372,13 +2373,102 @@ checks: compliance: - cis: ["18.5.11.3"] - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + references: + - 'CCE-38188-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' + +# 18.5.11.4 (L1) Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled' (Scored) + - id: 16126 + title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'" + description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled ." + rationale: "Allowing regular users to set a network location increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Require domain users to elevate when setting a network's location Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NetworkConnections.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.11.4"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-38188-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' - - id: 11095 +# 18.5.14.1 Ensure 'Hardened UNC Paths' is set to 'Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares' + - id: 16127 + title: "Ensure 'Hardened UNC Paths' is set to 'Enabled, with \"Require Mutual Authentication\" and \"Require Integrity\" set for all NETLOGON and SYSVOL shares'" + description: "This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with \"Require Mutual Authentication\" and \"Require Integrity\" set for all NETLOGON and SYSVOL shares ." + rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template ( NetworkProvider.admx/adml ) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with the following paths configured, at a minimum: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Provider\\Hardened UNC Paths Note: This Group Policy path does not exist by default. An additional Group Policy template ( NetworkProvider.admx/adml ) is required" + compliance: + - cis: ["18.5.14.1"] + - cis_csc: ["3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + + +# 18.5.19.2.1 (L2) Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)') (Scored) + - id: 16128 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')" + description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)" + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components reduces a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents. Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." + compliance: + - cis: ["18.5.19.2.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + +# 18.5.20.1 (L2) Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled' (Scored) + - id: 16129 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'" + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now. Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.20.1"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37481-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + +# 18.5.20.2 (L2) Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled' (Scored) + - id: 16130 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'" + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.20.2"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36109-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + +# 18.5.21.1 (L1) Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled' (Scored) + - id: 16131 title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled'" description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." rationale: "Blocking simultaneous connections can help prevent a user unknowingly allowing network traffic to flow between the Internet and the enterprise managed network." @@ -1386,14 +2476,23 @@ checks: compliance: - cis: ["18.5.21.1"] - cis_csc: ["12"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-38338-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> 1' -# Section 18.8 - System - - id: 11096 +###################################### +# 18.8 System +###################################### +###################################### +# 18.8.3 Audit Process Creation +###################################### +# 18.8.3.1 (L1) Ensure 'Include command line in process creation events' is set to 'Disabled' (Scored) + - id: 16132 title: "Ensure 'Include command line in process creation events' is set to 'Disabled'" description: "This policy setting determines what information is logged in security audit events when a new process has been created. The recommended state for this setting is: Disabled." rationale: "When this policy setting is enabled, any user who has read access to the security events can read the command-line arguments for any successfully created process. Command-line arguments may contain sensitive or private information such as passwords or user data." @@ -1401,13 +2500,39 @@ checks: compliance: - cis: ["18.8.3.1"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-36925-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 0' - - id: 11097 +###################################### +# 18.8.4 Credentials Delegation +###################################### +# 18.8.4.1 (L1) Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled' (Scored) + - id: 16133 + title: "Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled'" + description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled ." + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Remote host allows delegation of non-exportable credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/windows/access-protection/remote-credential-guard' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' + +########################################## +# 18.8.14 Early Launch Antimalware +########################################## +# 18.8.14.1 (L1) Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical' (Scored) + - id: 16134 title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'" description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: -Good: The driver has been signed and has not been tampered with. -Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. -Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. -Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware boot- start driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." rationale: "This policy setting helps reduce the impact of malware that has already infected your system." @@ -1415,13 +2540,17 @@ checks: compliance: - cis: ["18.8.14.1"] - cis_csc: ["8"] + - pci_dss: ["5.1.1"] + - nist_800_53: ["SI.3"] + - tsc: ["CC6.8"] references: - 'CCE-37912-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' - - id: 11098 +# 18.8.21.2 (L1) Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE' (Scored) + - id: 16135 title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'" description: "The 'Do not apply during periodic background processing' option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked)." rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." @@ -1429,13 +2558,17 @@ checks: compliance: - cis: ["18.8.21.2"] - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36169-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' - - id: 11099 +# 18.8.21.3 (L1) Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE' (Scored) + - id: 16136 title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'" description: "The 'Process even if the Group Policy objects have not changed' option updates and reapplies policies even if the policies have not changed. The recommended state for this setting is: Enabled: TRUE (checked)." rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." @@ -1443,28 +2576,53 @@ checks: compliance: - cis: ["18.8.21.3"] - cis_csc: ["3.7"] + - pci_dss: ["11.5.1"] + - tsc: ["PI1.4","PI1.5","CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] references: - 'CCE-36169-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' - - id: 11100 - title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'" - description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." +# 18.8.21.4 (L1) Ensure 'Continue experiences on this device' is set to 'Disabled' (Scored) + - id: 16137 + title: "Ensure 'Continue experiences on this device' is set to 'Disabled'" + description: "This policy setting determines whether the Windows device is allowed to participate in cross-device experiences (continue experiences). The recommended state for this setting is: Disabled ." + rationale: "A cross-device experience is when a system can access app and send messages to other devices. In an enterprise managed environment only trusted systems should be communicating within the network. Access to any other system should be prohibited." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Continue experiences on this device Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.4"] + - cis_csc: ["9.1"] + - pci_dss: ["6.5.8"] + - nist_800_53: ["SA.11","AU.14","AC.7"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp -> 0' + + +# 18.8.21.5 (L1) Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled' (Scored) + - id: 16138 + title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'" + description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Turn off background refresh of Group Policy Note: This Group Policy path is provided by the Group Policy template GroupPolicy.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." compliance: - - cis: ["18.8.21.4"] + - cis: ["18.8.21.5"] - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37712-7' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy -> 0' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' # Section 18.8 - System - - id: 11101 + - id: 16139 title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'" description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." rationale: "Users might download drivers that include malicious code." @@ -1472,13 +2630,68 @@ checks: compliance: - cis: ["18.8.22.1.1"] - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36625-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' - - id: 11102 +# 18.8.22.1.2 (L2) Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' (Scored) + - id: 16140 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'" + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37911-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + +# 18.8.22.1.3 (L2) Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' (Scored) + - id: 16141 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'" + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36203-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + +# 18.8.22.1.4 (L2) Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' (Scored) + - id: 16142 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37163-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + +# 18.8.22.1.5 (L1) Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' (Scored) + - id: 16143 title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'" description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." @@ -1486,13 +2699,16 @@ checks: compliance: - cis: ["18.8.22.1.5"] - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-36096-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' - - id: 11103 +# 18.8.22.1.6 (L1) Ensure 'Turn off printing over HTTP' is set to 'Enabled' (Scored) + - id: 16144 title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'" description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled." rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." @@ -1500,111 +2716,380 @@ checks: compliance: - cis: ["18.8.22.1.6"] - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-36920-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' - - id: 11104 +# 18.8.22.1.7 (L2) Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' (Scored) + - id: 16145 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36352-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' + +# 18.8.22.1.8 (L2) Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' (Scored) + - id: 16146 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36884-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + +# 18.8.22.1.9 (L2) Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' (Scored) + - id: 16147 + title: "Ensure 'Turn off the \"Order Prints\" picture task' is set to 'Enabled'" + description: "This policy setting specifies whether the \"Order Prints Online\" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.9"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38275-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + +# 18.8.22.1.10 (L2) Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' (Scored) + - id: 16148 + title: "Ensure 'Turn off the \"Publish to Web\" task for files and folders' is set to 'Enabled'" + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.10"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37090-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + +# 18.8.22.1.11 (L2) Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' (Scored) + - id: 16149 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.11"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36628-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + +# 18.8.22.1.12 (L2) Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' (Scored) + - id: 16150 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.12"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36174-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + +# 18.8.22.1.13 (L2) Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' (Scored) + - id: 16151 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.13"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35964-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + +###################################### +# 18.8.25 Kerberos +###################################### +# 18.8.25.1 (L2) Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic' (Scored) + - id: 16152 + title: "Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'" + description: "This policy setting allows you to set support for Kerberos to attempt authentication using the certificate for the device to the domain. Support for device authentication using certificate will require connectivity to a DC in the device account domain which supports certificate authentication for computer accounts. The recommended state for this setting is: Enabled: Automatic ." + rationale: "Having stronger device authentication with the use of certificates is strongly encouraged over standard username and password authentication. Having this set to Automatic will allow certificate based authentication to be used whenever possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Automatic : Computer Configuration\\Policies\\Administrative Templates\\System\\Kerberos\\Support device authentication using certificate Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Kerberos.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.25.1"] + - cis_csc: ["1.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled -> 1' + +####################################### +# 18.8.26 Locale Services +####################################### +# 18.8.26.1 (L2) Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled' (Scored) + - id: 16153 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'" + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.26.1"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36343-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + +################################################ +# 18.8.27 Logon +################################################ +# 18.8.27.1 (L1) Ensure 'Block user from showing account details on sign-in' is set to 'Enabled' (Scored) + - id: 16154 + title: "Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'" + description: "This policy prevents the user from showing account details (email address or user name) on the sign-in screen. The recommended state for this setting is: Enabled ." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Block user from showing account details on sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.1"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin -> 1' + +# 18.8.27.2 (L1) Ensure 'Do not display network selection UI' is set to 'Enabled' (Scored) + - id: 16155 title: "Ensure 'Do not display network selection UI' is set to 'Enabled'" description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen. The recommended state for this setting is: Enabled." rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not display network selection UI Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." compliance: - - cis: ["18.8.27.1"] + - cis: ["18.8.27.2"] - cis_csc: ["5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-38353-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' - - id: 11105 +# 18.8.27.3 (L1) Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled' (Scored) + - id: 16156 title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'" description: "This policy setting prevents connected users from being enumerated on domain-joined computers. The recommended state for this setting is: Enabled." rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not enumerate connected users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." compliance: - - cis: ["18.8.27.2"] + - cis: ["18.8.27.3"] - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-37838-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' - - id: 11106 +# 18.8.27.4 (L1) Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled' (MS only) (Scored) + - id: 16157 title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'" description: "This policy setting allows local users to be enumerated on domain-joined computers. The recommended state for this setting is: Disabled." rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Enumerate local users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." compliance: - - cis: ["18.8.27.3"] + - cis: ["18.8.27.4"] - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-35894-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' - - id: 11107 +# 18.8.27.5 (L1) Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled' (Scored) + - id: 16158 title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'" description: "This policy setting allows you to prevent app notifications from appearing on the lock screen. The recommended state for this setting is: Enabled." rationale: "App notifications might display sensitive business or personal data." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off app notifications on the lock screen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." compliance: - - cis: ["18.8.27.4"] + - cis: ["18.8.27.5"] - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-35893-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' - - id: 11108 +# 18.8.27.6 (L1) Ensure 'Turn off picture password sign-in' is set to 'Enabled' (Scored) + - id: 16159 + title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'" + description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled . Note: If the picture password feature is permitted, the user's domain password is cached in the system vault when using it." + rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.6"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' + +# 18.8.27.7 (L1) Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled' (Scored) + - id: 16160 title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'" description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work. Note: The user's domain password will be cached in the system vault when using this feature. The recommended state for this setting is: Disabled." rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn on convenience PIN sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn on PIN sign-in, but it was renamed starting with the Windows 10 Release 1511 Administrative Templates." compliance: - - cis: ["18.8.27.6"] + - cis: ["18.8.27.7"] - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-37528-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' - - id: 11109 +# 18.8.28.1 (L1) Ensure 'Untrusted Font Blocking' is set to 'Enabled: Block untrusted fonts and log events' (Scored) + - id: 16161 + title: "Ensure 'Untrusted Font Blocking' is set to 'Enabled: Block untrusted fonts and log events'" + description: "This security feature provides a global setting to prevent programs from loading untrusted fonts. Untrusted fonts are any font installed outside of the %windir%\\Fonts directory. This feature can be configured to be in 3 modes: On, Off, and Audit. The recommended state for this setting is: Enabled : Block untrusted fonts and log events" + rationale: "Blocking untrusted fonts helps prevent both remote (web-based or email-based) and local EOP attacks that can happen during the font file-parsing process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block untrusted fonts and log events : Computer Configuration\\Policies\\Administrative Templates\\System\\MitigationOptions\\Untrusted Font Blocking Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.1"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\MitigationOptions -> MitigationOptions_FontBocking -> 1000000000000' + +####################################### +# 18.8.33 Power Management +####################################### +####################################### +# 18.8.33.6 Sleep Settings +####################################### +# 18.8.33.6.1 (L2) Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled' (Scored) + - id: 16162 + title: "Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'" + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled ." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, on battery and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex -> 0' + +# 18.8.33.6.2 (L2) Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled' (Scored) + - id: 16163 + title: "Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'" + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled ." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, plugged in and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex -> 0' + +# 18.8.33.6.3 (L1) Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled' (Scored) + - id: 16164 title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'" description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." compliance: - - cis: ["18.8.33.6.1"] + - cis: ["18.8.33.6.3"] - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-36881-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' - - id: 11110 +# 18.8.33.6.4 (L1) Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled' (Scored) + - id: 16165 title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'" description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." compliance: - - cis: ["18.8.33.6.2"] + - cis: ["18.8.33.6.4"] - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] references: - 'CCE-37066-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' - - id: 11111 +# 18.8.35.1 (L1) Ensure 'Configure Offer Remote Assistance' is set to 'Disabled' (Scored) + - id: 16166 title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'" description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled." rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." @@ -1612,13 +3097,16 @@ checks: compliance: - cis: ["18.8.35.1"] - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-36388-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' - - id: 11112 +# 18.8.35.2 (L1) Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled' (Scored) + - id: 16167 title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'" description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." @@ -1626,14 +3114,171 @@ checks: compliance: - cis: ["18.8.35.2"] - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-37281-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' -# Section 18.9 - Windows Components - - id: 11113 +####################################### +# 18.8.36 Remote Procedure Call +####################################### +# 18.8.36.1 (L1) Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled' (MS only) (Scored) + - id: 16168 + title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'" + description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers. Note: This policy will not be in effect until the system is rebooted. The recommended state for this setting is: Enabled." + rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Enable RPC Endpoint Mapper Client Authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.36.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - https://support.microsoft.com/en-us/help/3073942/rpc-endpoint-mapper-client-authentication-prevents-users-and-groups-fr + - 'CCE-37346-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' + +# 18.8.36.2 (L2) Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated' (MS only) (Scored) + - id: 16169 + title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'" + description: "This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers." + rationale: "Unauthenticated RPC communication can create a security vulnerability." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients." + compliance: + - cis: ["18.8.36.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36559-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' + + +# 18.8.44.5.1 (L2) Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled' (Scored) + - id: 16170 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'" + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.44.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38161-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + +# 18.8.44.11.1 (L2) Ensure 'Enable/Disable PerfTrack' is set to 'Disabled' (Scored) + - id: 16171 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'" + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.44.11.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36648-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + +# 18.8.46.1 (L2) Ensure 'Turn off the advertising ID' is set to 'Enabled' (Scored) + - id: 16172 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'" + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.46.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36931-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + +# 18.8.49.1.1 (L2) Ensure 'Enable Windows NTP Client' is set to 'Enabled' (Scored) + - id: 16173 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.49.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + references: + - 'CCE-37843-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + +# 18.8.49.1.2 (L2) Ensure 'Enable Windows NTP Server' is set to 'Disabled' (MS only) (Scored) + - id: 16174 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'" + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server." + compliance: + - cis: ["18.8.49.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + references: + - 'CCE-37319-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + +################################################ +# 18.9 Windows Components +################################################ + +# 18.9.4.1 (L2) Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled' (Scored) + - id: 16175 + title: "Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'" + description: "Manages a Windows app's ability to share data between users who have installed the app. Data is shared through the SharedLocal folder. This folder is available through the Windows.Storage API. The recommended state for this setting is: Disabled ." + rationale: "Users of a system could accidentally share sensitive data with other users on the same system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Allow a Windows app to share application data between users Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.1"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData -> 0' + +# 18.9.6.1 (L1) Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled' (Scored) + - id: 16176 title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'" description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it. The recommended state for this setting is: Enabled." rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." @@ -1641,13 +3286,16 @@ checks: compliance: - cis: ["18.9.6.1"] - cis_csc: ["16.9"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] references: - 'CCE-38354-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' - - id: 11114 +# 18.9.8.1 (L1) Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled' (Scored) + - id: 16177 title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'" description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones. The recommended state for this setting is: Enabled." rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." @@ -1655,13 +3303,17 @@ checks: compliance: - cis: ["18.9.8.1"] - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37636-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' - - id: 11115 +# 18.9.8.2 (L1) Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands' (Scored) + - id: 16178 title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'" description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." @@ -1669,13 +3321,17 @@ checks: compliance: - cis: ["18.9.8.2"] - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-38217-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' - - id: 11116 +# 18.9.8.3 (L1) Ensure 'Turn off Autoplay' is set to 'Enabled: All drives' (Scored) + - id: 16179 title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'" description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." @@ -1683,13 +3339,84 @@ checks: compliance: - cis: ["18.9.8.3"] - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36875-3' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' - - id: 11117 +# 18.9.10.1.1 (L1) Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled' (Scored) + - id: 16180 + title: "Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'" + description: "This policy setting determines whether enhanced anti-spoofing is configured for devices which support it. The recommended state for this setting is: Enabled ." + rationale: "Enterprise managed environments are now supporting a wider range of mobile devices, increasing the security on these devices will help protect against unauthorized access on your network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Biometrics\\Facial Features\\Configure enhanced anti-spoofing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Biometrics.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Windows 10 Release 1511 and Windows 10 Release 1607 & Server 2016 Administrative Templates, this setting was named Use enhanced anti-spoofing when available. It was renamed to Configure enhanced anti-spoofing starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.10.1.1"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing -> 1' + +# 18.9.12.1 (L2) Ensure 'Allow Use of Camera' is set to 'Disabled' (Scored) + - id: 16181 + title: "Ensure 'Allow Use of Camera' is set to 'Disabled'" + description: "This policy setting controls whether the use of Camera devices on the machine are permitted. The recommended state for this setting is: Disabled ." + rationale: "Cameras in a high security environment can pose serious privacy and data exfiltration risks - they should be disabled to help mitigate that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Camera\\Allow Use of Camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Camera.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.12.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera -> 0' + +# 18.9.13.1 (L1) Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled' (Scored) + - id: 16182 + title: "Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'" + description: "This policy setting turns off experiences that help consumers make the most of their devices and Microsoft account. The recommended state for this setting is: Enabled . Note: Per Microsoft TechNet, this policy setting only applies to Windows 10 Enterprise and Windows 10 Education editions." + rationale: "Having apps silently install in an enterprise managed environment is not good security practice - especially if the apps send data back to a 3rd party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off Microsoft consumer experiences Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.13.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'https://technet.microsoft.com/en-us/itpro/windows/manage/group-policies-for-enterprise-and-education-editions' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures -> 1' + +# 18.9.14.1 (L1) Ensure 'Require pin for pairing' is set to 'Enabled' (Scored) + - id: 16183 + title: "Ensure 'Require pin for pairing' is set to 'Enabled'" + description: "This policy setting controls whether or not a PIN is required for pairing to a wireless display device. The recommended state for this setting is: Enabled ." + rationale: "If this setting is not configured or disabled then a PIN would not be required when pairing wireless display devices to the system, increasing the risk of unauthorized use." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Connect\\Require pin for pairing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WirelessDisplay.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.14.1"] + - cis_csc: ["15.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> 2' + +# 18.9.15.1 (L1) Ensure 'Do not display the password reveal button' is set to 'Enabled' (Scored) + - id: 16184 title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'" description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences. The recommended state for this setting is: Enabled." rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." @@ -1697,13 +3424,16 @@ checks: compliance: - cis: ["18.9.15.1"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-37534-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' - - id: 11118 +# 18.9.15.2 (L1) Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled' (Scored) + - id: 16185 title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'" description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. The recommended state for this setting is: Disabled." rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." @@ -1711,13 +3441,102 @@ checks: compliance: - cis: ["18.9.15.2"] - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-36512-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' - - id: 11119 +# 18.9.16.1 (L1) Ensure 'Allow Telemetry' is set to 'Enabled: 0 - Security [Enterprise Only]' or 'Enabled: 1 - Basic' (Scored) + - id: 16186 + title: "Ensure 'Allow Telemetry' is set to 'Enabled: 0 - Security [Enterprise Only]' or 'Enabled: 1 - Basic'" + description: "This policy setting determines the amount of diagnostic and usage data reported to Microsoft:A value of 0 - Security [Enterprise Only] will send minimal data to Microsoft. This data includes Malicious Software Removal Tool (MSRT) & Windows Defender data, if enabled, and telemetry client settings. Setting a value of 0 applies to enterprise, EDU, IoT and server devices only. Setting a value of 0 for other devices is equivalent to choosing a value of 1. A value of 1 - Basic sends only a basic amount of diagnostic and usage data. Note that setting values of 0 or 1 will degrade certain experiences on the device. A value of 2 - Enhanced sends enhanced diagnostic and usage data. A value of 3 - Full sends the same data as a value of 2, plus additional diagnostics data, including the files and content that may have caused the problem. Windows 10 telemetry settings apply to the Windows operating system and some first party apps. This setting does not apply to third party apps running on Windows 10. The recommended state for this setting is: Enabled: 0 - Security [Enterprise Only] or Enabled: 1 - Basic . Note: If the Allow Telemetry setting is configured to 0 - Security [Enterprise Only] , then the options in Windows Update to defer upgrades and updates will have no effect. Note #2: In the Microsoft Windows 10 RTM (Release 1507) Administrative Templates, the zero value was named 0 - Off [Enterprise Only] , but it was renamed to 0 - Security [Enterprise Only] starting with the Windows 10 Release 1511 Administrative Templates." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 0 - Security [Enterprise Only] or Enabled: 1 - Basic : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Allow Telemetry Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> 1' + +# 18.9.16.2 (L2) Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage' (Scored) + - id: 16187 + title: "Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage'" + description: "This policy setting controls whether the Connected User Experience and Telemetry service can automatically use an authenticated proxy to send data back to Microsoft. The recommended state for this setting is: Enabled: Disable Authenticated Proxy usage ." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Authenticated Proxy usage : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy -> 1' + +# 18.9.16.3 (L1) Ensure 'Disable pre-release features or settings' is set to 'Disabled' (Scored) + - id: 16188 + title: "Ensure 'Disable pre-release features or settings' is set to 'Disabled'" + description: "This policy setting determines the level that Microsoft can experiment with the product to study user preferences or device behavior. A value of 1 permits Microsoft to configure device settings only. A value of 2 allows Microsoft to conduct full experimentations. The recommended state for this setting is: Disabled . Note: Although the setting of Disabled seems counter-intuitive (disabling a Disable setting is a double negative, which should mean Enable), this setting is incorrectly worded in the Microsoft templates. Configuring Disabled does indeed achieve the desired result of disabling the pre-release features and settings." + rationale: "It can be dangerous in an enterprise managed environment if experimental features are allowed because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Disable pre-release features or settings Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.3"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> EnableConfigFlighting -> 0' + +# 18.9.16.4 (L1) Ensure 'Do not show feedback notifications' is set to 'Enabled' (Scored) + - id: 16189 + title: "Ensure 'Do not show feedback notifications' is set to 'Enabled'" + description: "This policy setting allows an organization to prevent its devices from showing feedback questions from Microsoft. The recommended state for this setting is: Enabled ." + rationale: "Users should not be sending any feedback to 3rd party vendors in an enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Do not show feedback notifications Note: This Group Policy path may not exist by default. It is provided by the Group Policy template FeedbackNotifications.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.4"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications -> 1' + +# 18.9.16.5 (L1) Ensure 'Toggle user control over Insider builds' is set to 'Disabled' (Scored) + - id: 16190 + title: "Ensure 'Toggle user control over Insider builds' is set to 'Disabled'" + description: "This policy setting determines whether users can access the Insider build controls in the Advanced Options for Windows Update. These controls are located under \"Get Insider builds,\" and enable users to make their devices available for downloading and installing Windows preview software. The recommended state for this setting is: Disabled . Note: This policy setting applies only to devices running Windows Server 2016, up until Release 1703. For Release 1709 or newer, Microsoft encourages using the Manage preview builds setting (Rule 18.9.101.1.1). We have kept this setting in the benchmark to ensure that any older builds of Windows Server 2016 in the environment are still enforced." + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Toggle user control over Insider builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AllowBuildPreview.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.5"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview -> 0' + +# 18.9.26.1.1 (L1) Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16191 title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1725,13 +3544,20 @@ checks: compliance: - cis: ["18.9.26.1.1"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37775-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' - - id: 11120 +# 18.9.26.1.2 (L1) Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' (Scored) + - id: 16192 title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1739,13 +3565,20 @@ checks: compliance: - cis: ["18.9.26.1.2"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37948-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' - - id: 11121 +# 18.9.26.2.1 (L1) Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16193 title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1753,13 +3586,20 @@ checks: compliance: - cis: ["18.9.26.2.1"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37145-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' - - id: 11122 +# 18.9.26.2.2 (L1) Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater' (Scored) + - id: 16194 title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 196,608 or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1767,13 +3607,20 @@ checks: compliance: - cis: ["18.9.26.2.2"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37695-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' - - id: 11123 +# 18.9.26.3.1 (L1) Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16195 title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1781,13 +3628,20 @@ checks: compliance: - cis: ["18.9.26.3.1"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-38276-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' - - id: 11124 +# 18.9.26.3.2 (L1) Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' (Scored) + - id: 16196 title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1795,13 +3649,20 @@ checks: compliance: - cis: ["18.9.26.3.2"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-37526-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' - - id: 11125 +# 18.9.26.4.1 (L1) Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16197 title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1809,13 +3670,20 @@ checks: compliance: - cis: ["18.9.26.4.1"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36160-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' - - id: 11126 +# 18.9.26.4.2 (L1) Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' (Scored) + - id: 16198 title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." @@ -1823,13 +3691,20 @@ checks: compliance: - cis: ["18.9.26.4.2"] - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] references: - 'CCE-36092-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' - - id: 11127 +# 18.9.30.2 (L1) Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled' (Scored) + - id: 16199 title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'" description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer. The recommended state for this setting is: Disabled." rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." @@ -1837,13 +3712,17 @@ checks: compliance: - cis: ["18.9.30.2"] - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37809-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' - - id: 11128 +# 18.9.30.3 (L1) Ensure 'Turn off heap termination on corruption' is set to 'Disabled' (Scored) + - id: 16200 title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'" description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." @@ -1851,13 +3730,17 @@ checks: compliance: - cis: ["18.9.30.3"] - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36660-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' - - id: 11129 +# 18.9.30.4 (L1) Ensure 'Turn off shell protocol protected mode' is set to 'Disabled' (Scored) + - id: 16201 title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'" description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." @@ -1865,13 +3748,66 @@ checks: compliance: - cis: ["18.9.30.4"] - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-36809-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' - - id: 11130 +# 18.9.39.2 Ensure 'Turn off location' is set to 'Enabled' + - id: 16202 + title: "Ensure 'Turn off location' is set to 'Enabled'" + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.39.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36886-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + +# 18.9.43.1 (L2) Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled' (Scored) + - id: 16203 + title: "Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'" + description: "This policy setting allows backup and restore of cellular text messages to Microsoft's cloud services. The recommended state for this setting is: Disabled ." + rationale: "In a high security environment, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Messaging\\Allow Message Service Cloud Sync Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Messaging.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.43.1"] + - cis_csc: ["9.1", "13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync -> 0' + +# 18.9.44.1 (L1) Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled' (Scored) + - id: 16204 + title: "Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'" + description: "This setting determines whether applications and services on the device can utilize new consumer Microsoft account authentication via the Windows OnlineID and WebAccountManager APIs. The recommended state for this setting is: Enabled ." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used on their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft accounts\\Block all consumer Microsoft account user authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSAPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.44.1"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth -> 1' + +# 18.9.52.1 (L1) Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled' (Scored) + - id: 16205 title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'" description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client. The recommended state for this setting is: Enabled." rationale: "Enabling this setting prevents users from accidentally uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client." @@ -1879,13 +3815,18 @@ checks: compliance: - cis: ["18.9.52.1"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36939-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' - - id: 11131 +# 18.9.58.2.2 (L1) Ensure 'Do not allow passwords to be saved' is set to 'Enabled' (Scored) + - id: 16206 title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'" description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." @@ -1893,13 +3834,48 @@ checks: compliance: - cis: ["18.9.58.2.2"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] references: - 'CCE-36223-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' - - id: 11132 +# 18.9.58.3.2.1 Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled' + - id: 16207 + title: "Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'" + description: "This policy setting allows you to restrict users to a single Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "This setting ensures that users & administrators who Remote Desktop to a server will continue to use the same session - if they disconnect and reconnect, they will go back to the same session they were using before, preventing the creation of a second simultaneous session. This both prevents unnecessary resource usage by having the server host unnecessary additional sessions (which would put extra load on the server) and also ensures a consistency of experience for the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Restrict Remote Desktop Services users to a single Remote Desktop Services session. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Restrict Terminal Services users to a single remote session, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.58.3.2.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-37708-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> 1' + +# 18.9.58.3.3.1 Ensure 'Do not allow COM port redirection' is set to 'Enabled' + - id: 16208 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37696-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + +# 18.9.58.3.3.2 (L1) Ensure 'Do not allow drive redirection' is set to 'Enabled' (Scored) + - id: 16209 title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'" description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." @@ -1907,13 +3883,52 @@ checks: compliance: - cis: ["18.9.58.3.3.2"] - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36509-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' - - id: 11133 +# 18.9.58.3.3.3 Ensure 'Do not allow LPT port redirection' is set to 'Enabled' + - id: 16210 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37778-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + +# 18.9.58.3.3.4 Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled' + - id: 16211 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'" + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37477-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + +# 18.9.58.3.9.1 (L1) Ensure 'Always prompt for password upon connection' is set to 'Enabled' (Scored) + - id: 16212 title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'" description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." @@ -1921,13 +3936,16 @@ checks: compliance: - cis: ["18.9.58.3.9.1"] - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-37929-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' - - id: 11134 +# 18.9.58.3.9.2 (L1) Ensure 'Require secure RPC communication' is set to 'Enabled' (Scored) + - id: 16213 title: "Ensure 'Require secure RPC communication' is set to 'Enabled'" description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests. The recommended state for this setting is: Enabled." rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." @@ -1935,13 +3953,16 @@ checks: compliance: - cis: ["18.9.58.3.9.2"] - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-37567-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' - - id: 11135 +# 18.9.58.3.9.3 (L1) Ensure 'Set client connection encryption level' is set to 'Enabled: High Level' (Scored) + - id: 16214 title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'" description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." @@ -1949,13 +3970,52 @@ checks: compliance: - cis: ["18.9.58.3.9.3"] - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] references: - 'CCE-36627-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' - - id: 11136 +# 18.9.58.3.10.1 Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less' + - id: 16215 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'" + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.58.3.10.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - 'CCE-37562-6' + - https://workbench.cisecurity.org/benchmarks/766 + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare != 0' + +# 18.9.58.3.10.2 Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute' + - id: 16216 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'" + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.10.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-37949-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + +# 18.9.58.3.11.1 (L1) Ensure 'Do not delete temp folders upon exit' is set to 'Disabled' (Scored) + - id: 16217 title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'" description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff. The recommended state for this setting is: Disabled." rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." @@ -1963,13 +4023,16 @@ checks: compliance: - cis: ["18.9.58.3.11.1"] - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-37946-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' - - id: 11137 +# 18.9.58.3.11.2 (L1) Ensure 'Do not use temporary folders per session' is set to 'Disabled' (Scored) + - id: 16218 title: "Ensure 'Do not use temporary folders per session' is set to 'Disabled'" description: "By default, Remote Desktop Services creates a separate temporary folder on the RD Session Host server for each active session that a user maintains on the RD Session Host server. The temporary folder is created on the RD Session Host server in a Temp folder under the user's profile folder and is named with the sessionid. This temporary folder is used to store individual temporary files. To reclaim disk space, the temporary folder is deleted when the user logs off from a session. The recommended state for this setting is: Disabled." rationale: "Disabling this setting keeps the cached data independent for each session, both reducing the chance of problems from shared cached data between sessions, and keeping possibly sensitive data separate to each user session." @@ -1977,13 +4040,16 @@ checks: compliance: - cis: ["18.9.58.3.11.2"] - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-38180-6' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> 1' - - id: 11138 +# 18.9.59.1 Ensure 'Prevent downloading of enclosures' is set to 'Enabled' + - id: 16219 title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'" description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer. The recommended state for this setting is: Enabled." rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." @@ -1991,27 +4057,239 @@ checks: compliance: - cis: ["18.9.59.1"] - cis_csc: ["7.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-37126-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' - - id: 11139 +# 18.9.60.2 (L2) Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search' (Scored) + - id: 16220 + title: "Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'" + description: "This policy setting allows search and Cortana to search cloud sources like OneDrive and SharePoint. The recommended state for this setting is: Enabled: Disable Cloud Search ." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Cloud Search : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cloud Search Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.60.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch -> 0' + +# 18.9.60.3 Ensure 'Allow indexing of encrypted files' is set to 'Disabled' + - id: 16221 title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'" description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files. The recommended state for this setting is: Disabled." rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow indexing of encrypted files Note: This Group Policy path is provided by the Group Policy template Search.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." compliance: - - cis: ["18.9.60.2"] + - cis: ["18.9.60.3"] - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] references: - 'CCE-38277-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' - - id: 11140 +# 18.9.65.1 Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled' + - id: 16222 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'" + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.65.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + +# 18.9.76.3.1 (L1) Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled' (Scored) + - id: 16223 + title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'" + description: "This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to \"Windows Defender Antivirus Cloud Protection Service\". This setting can only be set by Group Policy. The recommended state for this setting is: Disabled ." + rationale: "The decision on whether or not to participate in Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.3.1"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36940-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' + +# 18.9.76.3.2 Ensure 'Join Microsoft MAPS' is set to 'Disabled' + - id: 16224 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'" + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to 'Windows Defender Antivirus Cloud Protection Service'. Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Join Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.3.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + +# 18.9.76.7.1 (L1) Ensure 'Turn on behavior monitoring' is set to 'Enabled' (Scored) + - id: 16225 + title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'" + description: "This policy setting allows you to configure behavior monitoring for Windows Defender Antivirus. The recommended state for this setting is: Enabled ." + rationale: "When running an antivirus solution such as Windows Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.7.1"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + - tsc: ["CC6.8"] + references: + - 'CCE-38389-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection -> DisableBehaviorMonitoring -> 0' + +# 18.9.76.9.1 (L2) Ensure 'Configure Watson events' is set to 'Disabled' (Scored) + - id: 16226 + title: "Ensure 'Configure Watson events' is set to 'Disabled'" + description: "This policy setting allows you to configure whether or not Watson events are sent." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Reporting\\Configure Watson events." + compliance: + - cis: ["18.9.76.9.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36950-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 0' + +# 18.9.76.10.1 (L1) Ensure 'Scan removable drives' is set to 'Enabled' (Scored) + - id: 16227 + title: "Ensure 'Scan removable drives' is set to 'Enabled'" + description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan. The recommended state for this setting is: Enabled ." + rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Scan removable drives Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.10.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-38409-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' + +# 18.9.76.10.2 (L1) Ensure 'Turn on e-mail scanning' is set to 'Enabled' (Scored) + - id: 16228 + title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'" + description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac). The recommended state for this setting is: Enabled ." + rationale: "Incoming e-mails should be scanned by an antivirus solution such as Windows Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Turn on e-mail scanning Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.10.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36958-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' + +# 18.9.76.13.1.1 (L1) Ensure 'Configure Attack Surface Reduction rules' is set to 'Enabled' (Scored) + - id: 16229 + title: "Ensure 'Configure Attack Surface Reduction rules' is set to 'Enabled'" + description: "This policy setting controls the state for the Attack Surface Reduction (ASR) rules. The recommended state for this setting is: Enabled." + rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Windows Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.13.1.1"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules' + +# 18.9.76.13.3.1 (L1) Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block' (Scored) + - id: 16230 + title: "Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'" + description: "This policy setting controls Windows Defender Exploit Guard network protection. The recommended state for this setting is: Enabled: Block ." + rationale: "This setting can help prevent employees from using any application to access dangerous domains that may host phishing scams, exploit-hosting sites, and other malicious content on the Internet." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Windows Defender Exploit Guard\\Network Protection\\Prevent users and apps from accessing dangerous websites Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.13.3.1"] + - cis_csc: ["7"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection -> 1' + +# 18.9.76.14 (L1) Ensure 'Turn off Windows Defender AntiVirus' is set to 'Disabled' (Scored) + - id: 16231 + title: "Ensure 'Turn off Windows Defender AntiVirus' is set to 'Disabled'" + description: "This policy setting turns off Windows Defender Antivirus. If the setting is configured to Disabled, Windows Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software. The recommended state for this setting is: Disabled ." + rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Windows Defender Antivirus. Organizations that choose to purchase a reputable 3rd-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Turn off Windows Defender AntiVirus Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn off Windows Defender, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.76.14"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + - tsc: ["CC6.8"] + references: + - 'CCE-36082-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware -> 0' + +# 18.9.79.1.1 (L1) Ensure 'Prevent users from modifying settings' is set to 'Enabled' (Scored) + - id: 16232 + title: "Ensure 'Prevent users from modifying settings' is set to 'Enabled'" + description: "This policy setting prevent users from making changes to the Exploit protection settings area in the Windows Defender Security Center. The recommended state for this setting is: Enabled ." + rationale: "Only authorized IT staff should be able to make changes to the exploit protection settings in order to ensure the organizations specific configuration is not modified." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Security Center\\App and browser protection\\Prevent users from modifying settings. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefenderSecurityCenter.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.79.1.1"] + - cis_csc: ["8.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride -> 1' + +# 18.9.80.1.1 Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass' + - id: 16233 title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'" description: "This policy setting allows you to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled. The recommended state for this setting is: Enabled: Warn and prevent bypass." rationale: "Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." @@ -2019,41 +4297,49 @@ checks: compliance: - cis: ["18.9.80.1.1"] - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] references: - 'CCE-35859-8' condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 2' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel -> Block' - - id: 11141 - title: "Ensure 'Configure Default consent' is set to 'Enabled: Always ask before sending data'" - description: "This setting allows you to set the default consent handling for error reports. The recommended state for this setting is: Enabled: Always ask before sending data" - rationale: "Error reports may contain sensitive information and should not be sent to anyone automatically." - remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Always ask before sending data: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Error Reporting\\Consent\\Configure Default consent Note: This Group Policy path is provided by the Group Policy template ErrorReporting.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." +# 18.9.84.1 (L2) Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled' (Scored) + - id: 16234 + title: "Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'" + description: "This policy setting determines whether suggested apps in Windows Ink Workspace are allowed. The recommended state for this setting is: Disabled ." + rationale: "This Microsoft feature is designed to collect data and suggest apps based on that data collected. Disabling this setting will help ensure your data is not shared with any third party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow suggested apps in Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." compliance: - - cis: ["18.9.81.2.1"] + - cis: ["18.9.84.1"] - cis_csc: ["13"] - references: - - 'CCE-37112-0' + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] condition: all rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting\Consent -> DefaultConsent -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace -> 0' - - id: 11142 - title: "Ensure 'Automatically send memory dumps for OS-generated error reports' is set to 'Disabled'" - description: "This policy setting controls whether memory dumps in support of OS-generated error reports can be sent to Microsoft automatically. This policy does not apply to error reports generated by 3rd-party products, or additional data other than memory dumps. The recommended state for this setting is: Disabled." - rationale: "Memory dumps may contain sensitive information and should not be automatically sent to anyone." - remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Error Reporting\\Automatically send memory dumps for OS- generated error reports Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ErrorReporting.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." +# 18.9.84.2 (L1) Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Disabled' but not 'Enabled: On' (Scored) + - id: 16235 + title: "Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Disabled' but not 'Enabled: On'" + description: "This policy setting determines whether Windows Ink items are allowed above the lock screen. The recommended state for this setting is: Enabled: On, but disallow access above lock OR Disabled ." + rationale: "Allowing any apps to be accessed while system is locked is not recommended. If this feature is permitted, it should only be accessible once a user authenticates with the proper credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: On, but disallow access above lock OR Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." compliance: - - cis: ["18.9.81.3"] - - cis_csc: ["13"] - references: - - 'CCE-36978-5' - condition: all + - cis: ["18.9.84.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + condition: any rules: - - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> AutoApproveOSDumps -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> 1' - - id: 11143 +# 18.9.85.1 Ensure 'Allow user control over installs' is set to 'Disabled' + - id: 16236 title: "Ensure 'Allow user control over installs' is set to 'Disabled'" description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user. The recommended state for this setting is: Disabled." rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." @@ -2061,13 +4347,16 @@ checks: compliance: - cis: ["18.9.85.1"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36400-0' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' - - id: 11144 +# 18.9.85.2 Ensure 'Always install with elevated privileges' is set to 'Disabled' + - id: 16237 title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'" description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." @@ -2075,13 +4364,33 @@ checks: compliance: - cis: ["18.9.85.2"] - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] references: - 'CCE-36919-9' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' - - id: 11145 +# 18.9.85.3 Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled' + - id: 16238 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'" + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.85.3"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37524-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + +# 18.9.86.1 Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled' + - id: 16239 title: "Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled'" description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system. The recommended state for this setting is: Disabled." rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." @@ -2089,13 +4398,16 @@ checks: compliance: - cis: ["18.9.86.1"] - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] references: - 'CCE-36977-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' - - id: 11146 +# 18.9.95.1 Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled' + - id: 16240 title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'" description: "This policy setting enables logging of all PowerShell script input to the Microsoft-Windows- PowerShell/Operational event log. The recommended state for this setting is: Disabled. Note: In Microsoft's own hardening guidance, they recommend the opposite value, Enabled, because having this data logged improves investigations of PowerShell attack incidents. However, the default ACL on the PowerShell Operational log allows Interactive User (i.e. any logged on user) to read it, and therefore possibly expose passwords or other sensitive information to unauthorized users. If Microsoft locks down the default ACL on that log in the future (e.g. to restrict it only to Administrators), then we will revisit this recommendation in a future release." rationale: "There are potential risks of capturing passwords in the PowerShell logs. This setting should only be needed for debugging purposes, and not in normal operation, it is important to ensure this is set to Disabled." @@ -2103,11 +4415,13 @@ checks: compliance: - cis: ["18.9.95.1"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 0' - - id: 11147 +# 18.9.95.2 Ensure 'Turn on PowerShell Transcription' is set to 'Disabled' + - id: 16241 title: "Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'" description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts. The recommended state for this setting is: Disabled." rationale: "If this setting is enabled there is a risk that passwords could get stored in plain text in the PowerShell_transcript output file." @@ -2115,11 +4429,13 @@ checks: compliance: - cis: ["18.9.95.2"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 0' - - id: 11148 +# 18.9.97.1.1 Ensure 'Allow Basic authentication' is set to 'Disabled' + - id: 16242 title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication. The recommended state for this setting is: Disabled." rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." @@ -2127,13 +4443,18 @@ checks: compliance: - cis: ["18.9.97.1.1"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36310-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' - - id: 11149 +# 18.9.97.1.2 Ensure 'Allow unencrypted traffic' is set to 'Disabled' + - id: 16243 title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." @@ -2141,13 +4462,18 @@ checks: compliance: - cis: ["18.9.97.1.2"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-37726-7' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' - - id: 11150 +# 18.9.97.1.3 Ensure 'Disallow Digest authentication' is set to 'Enabled' + - id: 16244 title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication. The recommended state for this setting is: Enabled." rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." @@ -2155,13 +4481,18 @@ checks: compliance: - cis: ["18.9.97.1.3"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-38318-2' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' - - id: 11151 +# 18.9.97.2.1 Ensure 'Allow Basic authentication' is set to 'Disabled' + - id: 16245 title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client. The recommended state for this setting is: Disabled." rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." @@ -2169,13 +4500,37 @@ checks: compliance: - cis: ["18.9.97.2.1"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-36254-1' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' - - id: 11152 +# 18.9.97.2.2 Ensure 'Allow remote server management through WinRM' is set to 'Disabled' + - id: 16246 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.97.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37927-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + +# 18.9.97.2.3 Ensure 'Allow unencrypted traffic' is set to 'Disabled' + - id: 16247 title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." @@ -2183,13 +4538,18 @@ checks: compliance: - cis: ["18.9.97.2.3"] - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] references: - 'CCE-38223-4' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' - - id: 11153 +# 18.9.97.2.4 Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled' + - id: 16248 title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'" description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service will allow RunAs credentials to be stored for any plug-ins. The recommended state for this setting is: Enabled. Note: If you enable and then disable this policy setting, any values that were previously configured for RunAsPassword will need to be reset." rationale: "Although the ability to store RunAs credentials is a convenient feature it increases the risk of account compromise slightly. For example, if you forget to lock your desktop before leaving it unattended for a few minutes another person could access not only the desktop of your computer but also any hosts you manage via WinRM with cached RunAs credentials." @@ -2197,13 +4557,95 @@ checks: compliance: - cis: ["18.9.97.2.4"] - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] references: - 'CCE-36000-8' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' - - id: 11154 +# 18.9.98.1 Ensure 'Allow Remote Shell Access' is set to 'Disabled' + - id: 16249 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'" + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.98.1"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36499-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + +# 18.9.101.1.1 (L1) Ensure 'Manage preview builds' is set to 'Enabled: Disable preview builds' (Scored) + - id: 16250 + title: "Ensure 'Manage preview builds' is set to 'Enabled: Disable preview builds'" + description: "This policy setting determines whether users can access the Windows Insider Program controls in Settings -> Update and Security. These controls enable users to make their devices available for downloading and installing preview (beta) builds of Windows software. The recommended state for this setting is: Enabled: Disable preview builds ." + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable preview builds : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Manage preview builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.101.1.1"] + - cis_csc: ["3"] + - pci_dss: ["6.4.2"] + - tsc: ["CC6.6","CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuilds -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue -> 0' + +# 18.9.101.1.2 (L1) Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: Semi-Annual Channel, 180 or more days' (Scored) + - id: 16251 + title: "Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: Semi-Annual Channel, 180 or more days'" + description: "This policy setting determines the level of Preview Build or Feature Updates to receive, and when. The Windows readiness level for each new Windows 10 Feature Update is classified in one of 5 categories, depending on your organizations level of comfort with receiving them: Preview Build - Fast: Devices set to this level will be the first to receive new builds of Windows with features not yet available to the general public. Select Fast to participate in identifying and reporting issues to Microsoft, and provide suggestions on new functionality. Preview Build - Slow: Devices set to this level receive new builds of Windows before they are available to the general public, but at a slower cadence than those set to Fast, and with changes and fixes identified in earlier builds. Release Preview: Receive builds of Windows just before Microsoft releases them to the general public. Semi-Annual Channel (Targeted): Receive feature updates when they are released to the general public. Semi-Annual Channel: Feature updates will arrive when they are declared Semi-Annual Channel. This usually occurs about 4 months after Semi-Annual Channel (Targeted), indicating that Microsoft, Independent Software Vendors (ISVs), partners and customer believe that the release is ready for broad deployment. The recommended state for this setting is: Enabled: Semi-Annual Channel, 180 or more days . Note: If the \"Allow Telemetry\" policy is set to 0, this policy will have no effect. Note #2: Starting with Windows Server 2016 RTM (Release 1607), Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. Note #3: Prior to Windows Server 2016 R1709, values above 180 days are not recognized by the OS. Starting with Windows Server 2016 R1709, the maximum number of days you can defer is 365 days." + rationale: "Forcing new features without prior testing in your environment could cause software incompatibilities as well as introducing new bugs into the operating system. In an enterprise managed environment, it is generally preferred to delay Feature Updates until thorough testing and a deployment plan is in place. This recommendation delays the automatic installation of new features as long as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Semi-Annual Channel, 180 or more days : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Select when Preview Builds and Feature Updates are received Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Select when Feature Updates are received, but it was renamed to Select when Preview Builds and Feature Updates are received starting with the Windows 10 Release 1709 Administrative Templates." + compliance: + - cis: ["18.9.101.1.2"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'https://blogs.technet.microsoft.com/wsus/2017/05/05/demystifying-dual-scan/' + - 'https://blogs.technet.microsoft.com/wsus/2017/08/04/improving-dual-scan-on-1607/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays -> n:^(\d+) compare >= 180' + +# 18.9.101.1.3 (L1) Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days' (Scored) + - id: 16252 + title: "Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'" + description: "This settings controls when Quality Updates are received. The recommended state for this setting is: Enabled: 0 days . Note: If the \"Allow Telemetry\" policy is set to 0, this policy will have no effect. Note #2: Starting with Windows Server 2016 RTM (Release 1607), Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering" + rationale: "Quality Updates can contain important bug fixes and/or security patches, and should be installed as soon as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled:0 days : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Select when Quality Updates are received Note: This Group Policy path does not exist by default. An updated Group Policy template ( WindowsUpdate.admx/adml ) is required - it is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.101.1.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'https://blogs.technet.microsoft.com/wsus/2017/05/05/demystifying-dual-scan/' + - 'https://blogs.technet.microsoft.com/wsus/2017/08/04/improving-dual-scan-on-1607/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdatesPeriodInDays -> 0' + + +# 18.9.101.2 Ensure 'Configure Automatic Updates' is set to 'Enabled' + - id: 16253 title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'" description: "This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: 2 - Notify for download and auto install (Notify before downloading any updates) 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting 'Configure automatic updating:' has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a 3rd-party solution for patching may choose to exempt themselves from this setting, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the 3rd-party patching process." rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." @@ -2211,13 +4653,20 @@ checks: compliance: - cis: ["18.9.101.2"] - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] references: - 'CCE-36172-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' - - id: 11155 +# 18.9.101.3 Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day' + - id: 16254 title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'" description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS. The recommended state for this setting is: 0 - Every day. Note: This setting is only applicable if 4 - Auto download and schedule the install is selected in Rule 18.9.101.2. It will have no impact if any other option is selected." rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." @@ -2225,13 +4674,20 @@ checks: compliance: - cis: ["18.9.101.3"] - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] references: - 'CCE-36172-5' condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' - - id: 11156 +# 18.9.101.4 Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled' + - id: 16255 title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'" description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." @@ -2239,6 +4695,12 @@ checks: compliance: - cis: ["18.9.101.4"] - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] references: - 'CCE-37027-0' condition: all diff --git a/sca/windows/cis_win2019.yml b/sca/windows/cis_win2019.yml new file mode 100644 index 000000000..e3256cfb5 --- /dev/null +++ b/sca/windows/cis_win2019.yml @@ -0,0 +1,4808 @@ +# Security Configuration Assessment +# CIS Checks for Windows 2016 RTM +# Copyright (C) 2015-2020, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Microsoft Windows Server 2019 RTM (Release 1809) v1.0.1 - 11-22-2019 + + +policy: + id: "cis_win2019" + file: "cis_win2019.yml" + name: "CIS Benchmark for Windows Server 2019 RTM " + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2019." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform is Windows Server 2019 RTM" + description: "Requirements for running the CIS benchmark under Windows Server 2019 RTM" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2019' + +checks: + + + +############################################### +# 1 Account Policies +############################################### +############################################### +# 1.1 Password Policy +############################################### + +# 1.1.2 Maximum password age (Scored) + - id: 16500 + title: "Ensure 'Maximum password age' is set to '60 or fewer days, but not 0'" + description: "This policy setting defines how long a user can use their password before it expires. Values for this policy setting range from 0 to 999 days. If you set the value to 0, the password will never expire. Because attackers can crack passwords, the more frequently you change the password the less opportunity an attacker has to use a cracked password. However, the lower this value is set, the higher the potential for an increase in calls to help desk support due to users having to change their password or forgetting which password is current. The recommended state for this setting is 60 or fewer days, but not 0." + rationale: "The longer a password exists the higher the likelihood that it will be compromised by a brute force attack, by an attacker gaining general knowledge about the user, or by the user sharing the password. Configuring the Maximum password age setting to 0 so that users are never required to change their passwords is a major security risk because that allows a compromised password to be used by the malicious user for as long as the valid user is authorized access." + remediation: "To establish the recommended configuration via GP, set the following UI path to 60 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Maximum password age." + compliance: + - cis: ["1.1.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - 'CCE-37167-4' + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> n:^(\d+) compare <= 60' + + + +############################################### +# 2 Local Policies +############################################### +############################################### +# 2.3 Security Options +############################################### + +# 2.3.1.2 Accounts: Block Microsoft accounts (Scored) + - id: 16501 + title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts" + description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts : Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts." + compliance: + - cis: ["2.3.1.2"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-36147-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 3' + +# 2.3.1.4 Accounts: Limit local account use of blank passwords to console logon only (Scored) + - id: 16502 + title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'" + description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." + rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domainbased password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Limit local account use of blank passwords to console logon only." + compliance: + - cis: ["2.3.1.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'CCE-37615-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' + +# 2.3.2.1 Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings (Scored) + - id: 16503 + title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'" + description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled. *Important*: Be very cautious about audit settings that can generate a large volume of traffic. For example, if you enable either success or failure auditing for all of the Privilege Use subcategories, the high volume of audit events generated can make it difficult to find other types of entries in the Security log. Such a configuration could also have a significant impact on system performance." + rationale: "Prior to the introduction of auditing subcategories in Windows Vista, it was difficult to track events at a per-system or per-user level. The larger event categories created too many events and the key information that needed to be audited was difficult to find." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings." + compliance: + - cis: ["2.3.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-37850-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' + +# 2.3.2.2 Audit: Shut down system immediately if unable to log security audits (Scored) + - id: 16504 + title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'" + description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. The recommended state for this setting is: Disabled." + rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Shut down system immediately if unable to log security audits." + compliance: + - cis: ["2.3.2.2"] + - cis_csc: ["6"] + - pci_dss: ["10.7"] + references: + - 'CCE-35907-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' + +# 2.3.4.1 Devices: Allowed to format and eject removable media (Scored) + - id: 16505 + title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'" + description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators." + rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators and Interactive Users: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Allowed to format and eject removable media." + compliance: + - cis: ["2.3.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-37701-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 0' + +# 2.3.4.2 Devices: Prevent users from installing printer drivers (Scored) + - id: 16506 + title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'" + description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." + rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, you should allow only Administrators, not users, to do so on servers, because printer driver installation on a server may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers." + compliance: + - cis: ["2.3.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4","2.2.5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3","CC5.2"] + references: + - 'CCE-37942-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' + +# 2.3.5.1 Domain controller: Allow server operators to schedule tasks (Scored) + - id: 16507 + title: "Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only)" + description: "This policy setting determines whether members of the Server Operators group are allowed to submit jobs by means of the AT schedule facility. The impact of this policy setting configuration should be small for most organizations. Users, including those in the Server Operators group, will still be able to create jobs by means of the Task Scheduler Wizard, but those jobs will run in the context of the account with which the user authenticates when they set up the job. Note: An AT Service Account can be modified to select a different account rather than the LOCAL SYSTEM account. To change the account, open System Tools, click Scheduled Tasks, and then click Accessories folder. Then click AT Service Account on the Advanced menu. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, jobs that are created by server operators by means of the AT service will execute in the context of the account that runs that service. By default, that is the local SYSTEM account. If you enable this policy setting, server operators could perform tasks that SYSTEM is able to do but that they would typically not be able to do, such as add their account to the local Administrators group." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Allow server operators to schedule tasks." + compliance: + - cis: ["2.3.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-37848-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SubmitControl -> 0' + +# 2.3.5.2 Domain controller: LDAP server signing requirements (Scored) + - id: 16508 + title: "Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' (DC only)" + description: "This policy setting determines whether the Lightweight Directory Access Protocol (LDAP) server requires LDAP clients to negotiate data signing. The recommended state for this setting is: Require signing. Note: Domain member computers must have Network security: LDAP signing requirements (Rule 2.3.11.8) set to Negotiate signing or higher. If not, they will fail to authenticate once the above Require signing value is configured on the Domain Controllers. Fortunately, Negotiate signing is the default in the client configuration. Note #2: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are shipped with Windows XP Professional use LDAP simple bind or LDAP simple bind through SSL to talk to a Domain Controller. Note #3: Before enabling this setting, you should first ensure that there are no clients (including server-based applications) that are configured to authenticate with Active Directory via unsigned LDAP, because changing this setting will break those applications. Such applications should first be reconfigured to use signed LDAP, Secure LDAP (LDAPS), or IPsec-protected connections." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks. In such attacks, an intruder captures packets between the server and the client, modifies them, and then forwards them to the client. Where LDAP servers are concerned, an attacker could cause a client to make decisions that are based on false records from the LDAP directory. To lower the risk of such an intrusion in an organization's network, you can implement strong physical security measures to protect the network infrastructure. Also, you could implement Internet Protocol security (IPsec) authentication header mode (AH), which performs mutual authentication and packet integrity for IP traffic to make all types of man- in-the-middle attacks extremely difficult. Additionally, allowing the use of regular, unsigned LDAP permits credentials to be received over the network in clear text, which could very easily result in the interception of account passwords by other systems on the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require signing: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: LDAP server signing requirements." + compliance: + - cis: ["2.3.5.2"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - https://blogs.technet.microsoft.com/russellt/2016/01/13/identifying-clear-text-ldap-binds-to-your-dcs/ + - 'CCE-35904-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity -> 2' + +# 2.3.5.3 Domain controller: Refuse machine account password changes (Scored) + - id: 16509 + title: "Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' (DC only)" + description: "This security setting determines whether Domain Controllers will refuse requests from member computers to change computer account passwords. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting on all Domain Controllers in a domain, domain members will not be able to change their computer account passwords, and those passwords will be more susceptible to attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Refuse machine account password changes." + compliance: + - cis: ["2.3.5.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - 'CCE-36921-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange -> 0' + +# 2.3.6.1 Domain member: Digitally encrypt or sign secure channel data (always) (Scored) + - id: 16510 + title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'" + description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt or sign secure channel data (always)." + compliance: + - cis: ["2.3.6.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36142-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' + +# 2.3.6.2 Domain member: Digitally encrypt secure channel data (when possible) (Scored) + - id: 16511 + title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'" + description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt secure channel data (when possible)." + compliance: + - cis: ["2.3.6.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37130-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' + +# 2.3.6.3 Domain member: Digitally sign secure channel data (when possible) (Scored) + - id: 16512 + title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'" + description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally sign secure channel data (when possible)." + compliance: + - cis: ["2.3.6.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37222-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' + +# 2.3.6.4 Domain member: Disable machine account password changes (Scored) + - id: 16513 + title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'" + description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled." + rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Disable machine account password changes." + compliance: + - cis: ["2.3.6.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - 'CCE-37508-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' + +# 2.3.6.6 Domain member: Require strong (Windows 2000 or later) session key (Scored) + - id: 16514 + title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'" + description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." + rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Require strong (Windows 2000 or later) session key." + compliance: + - cis: ["2.3.6.6"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37614-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' + +# 2.3.7.1 Interactive logon: Do not require CTRL+ALT+DEL (Scored) + - id: 16515 + title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'" + description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." + rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Do not require CTRL+ALT+DEL" + compliance: + - cis: ["2.3.7.1"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-37637-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' + +# 2.3.7.2 Interactive logon: Do not display last user name (Scored) + - id: 16516 + title: "Ensure 'Interactive logon: Don't display last signed-in' is set to 'Enabled'" + description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Don't display last signed-in." + compliance: + - cis: ["2.3.7.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36056-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' + +# 2.3.7.3 Interactive logon: Machine inactivity limit (Scored) + - id: 16517 + title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'" + description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit." + rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." + remediation: "To establish the recommended configuration via GP, set the following UI path to 900 or fewer seconds, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Machine inactivity limit." + compliance: + - cis: ["2.3.7.3"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - 'CCE-38235-8' + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' + +# 2.3.7.6 - Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s) + - id: 16518 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'" + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)." + compliance: + - cis: ["2.3.7.6"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'CCE-38240-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> r:^0$|^1$|^2$|^3$|^4$' + +# 2.3.7.7 Interactive logon: Prompt user to change password before expiration (Scored) + - id: 16519 + title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'" + description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." + rationale: "It is recommended that user passwords be configured to expire periodically. Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to a value between 5 and 14 days: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Prompt user to change password before expiration." + compliance: + - cis: ["2.3.7.7"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - 'CCE-37622-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' + +# 2.3.7.8 (L1) Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled' (MS only) (Scored) + - id: 16520 + title: "Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled'" + description: "Logon information is required to unlock a locked computer. For domain accounts, this security setting determines whether it is necessary to contact a Domain Controller to unlock a computer. The recommended state for this setting is: Enabled ." + rationale: "By default, the computer caches in memory the credentials of any users who are authenticated locally. The computer uses these cached credentials to authenticate anyone who attempts to unlock the console. When cached credentials are used, any changes that have recently been made to the account - such as user rights assignments, account lockout, or the account being disabled - are not considered or applied after the account is authenticated. User privileges are not updated, and (more importantly) disabled accounts are still able to unlock the console of the computer." + remediation: "To implement the recommended configuration via GP, set the following UI path to Enabled:Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Require Domain Controller Authentication to unlock workstation" + compliance: + - cis: ["2.3.7.8"] + - cis_csc: ["16.9"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - 'CCE-38240-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon -> 1' + +# 2.3.7.9 Interactive logon: Smart card removal behavior (Scored) + - id: 16521 + title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher" + description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." + rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Lock Workstation (or, if applicable for your environment, Force Logoff or Disconnect if a Remote Desktop Services session): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Smart card removal behavior." + compliance: + - cis: ["2.3.7.9"] + - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - 'CCE-38333-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$|^3$' + + + +# 2.3.8.1 Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled' + - id: 16522 + title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'" + description: "This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the 'Microsoft network client and server: Digitally sign communications (four related settings)' section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (always)." + compliance: + - cis: ["2.3.8.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36325-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' + +# 2.3.8.2 Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled' + - id: 16523 + title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'" + description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (if server agrees)." + compliance: + - cis: ["2.3.8.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36269-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' + +# 2.3.8.3 Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled' + - id: 16524 + title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'" + description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Send unencrypted password to third-party SMB servers." + compliance: + - cis: ["2.3.8.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37863-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' + +# 2.3.9.1 Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0' + - id: 16525 + title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0'" + description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. A value of 0 appears to allow sessions to persist indefinitely. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s), but not 0." + rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or fewer minute(s), but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Amount of idle time required before suspending session." + compliance: + - cis: ["2.3.9.1"] + - cis_csc: ["3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - 'CCE-38046-9' + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> 0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' + +# 2.3.9.2 Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled' + - id: 16526 + title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'" + description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (always)." + compliance: + - cis: ["2.3.9.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37864-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' + +# 2.3.9.3 Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled' + - id: 16527 + title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'" + description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (if client agrees)." + compliance: + - cis: ["2.3.9.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-35988-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' + +# 2.3.9.4 Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled' + - id: 16528 + title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'" + description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." + rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Disconnect clients when logon hours expire." + compliance: + - cis: ["2.3.9.4"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-37972-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + +# 2.3.9.5 Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher + - id: 16529 + title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher" + description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client. Configuring this setting to Required from client also conforms to the benchmark. Note: Since the release of the MS KB3161561 security patch, this setting can cause significant issues (such as replication problems, group policy editing issues and blue screen crashes) on Domain Controllers when used simultaneously with UNC path hardening (i.e. Rule 18.5.14.1). CIS therefore recommends against deploying this setting on Domain Controllers." + rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level." + compliance: + - cis: ["2.3.9.5"] + - cis_csc: ["14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - https://support.microsoft.com/en-us/help/3161561/ms16-075-and-ms16-076-description-of-the-security-update-for-windows-n + - 'CCE-36170-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' + +# 2.3.10.2 Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled' + - id: 16530 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'" + description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts." + compliance: + - cis: ["2.3.10.2"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36316-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' + +# 2.3.10.3 Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled' + - id: 16531 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'" + description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" + remediation: "To establish the recommended configuration via GP, set the following U path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts and shares." + compliance: + - cis: ["2.3.10.3"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36316-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' + +# 2.3.10.4 (L2) Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled' (Scored) + - id: 16532 + title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'" + description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." + rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow storage of passwords and credentials for network authentication." + compliance: + - cis: ["2.3.10.4"] + - cis_csc: ["16.14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-38119-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' + +# 2.3.10.5 Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled' + - id: 16533 + title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'" + description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Let Everyone permissions apply to anonymous users." + compliance: + - cis: ["2.3.10.5"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36148-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' + +# 2.3.10.6 Configure 'Network access: Named Pipes that can be accessed anonymously' + - id: 16534 + title: "Configure 'Network access: Named Pipes that can be accessed anonymously'" + description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: (Domain Controller) LSARPC, NETLOGON, SAMR (Member Server) (i.e. None), or (when the legacy Computer Browser service is enabled) BROWSER. Note: A Member Server that holds the Remote Desktop Services Role with Remote Desktop Licensing Role Service will require a special exception to this recommendation, to allow the HydraLSPipe and TermServLicensing Named Pipes to be accessed anonymously." + rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Named Pipes that can be accessed anonymously." + compliance: + - cis: ["2.3.10.6"] + - cis_csc: ["14.1", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-38258-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:LSARPC && r:NETLOGON && r:SAMR' + +# 2.3.10.8 Configure 'Network access: Remotely accessible registry paths' + - id: 16535 + title: "Configure 'Network access: Remotely accessible registry paths'" + description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called 'Network access: Remotely accessible registry paths and sub- paths' in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2). Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." + rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\ProductOptions | System\\CurrentControlSet\\Control\\Server Applications | Software\\Microsoft\\Windows NT\\CurrentVersion. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths." + compliance: + - cis: ["2.3.10.8"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-37194-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions|System\\CurrentControlSet\\Control\\Server Applications|Software\\Microsoft\\Windows NT\\CurrentVersion' + +# 2.3.10.9 Configure 'Network access: Remotely accessible registry paths and sub-paths' + - id: 16536 + title: "Configure 'Network access: Remotely accessible registry paths and sub-paths'" + description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called 'Network access: Remotely accessible registry paths,' the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." + rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\Print\\Printers | System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server | Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows | NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex | System\\CurrentControlSet\\Control\\Terminal Server | System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig | System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration | Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib | System\\CurrentControlSet\\Services\\SysmonLog | Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local | Policies\\Security Options\\Network access: Remotely accessible registry paths | and sub-paths. When a server holds the Active Directory Certificate Services Role with Certification Authority Role Service, the above list should also include: System\\CurrentControlSet\\Services\\CertSvc. When a server has the WINS Server Feature installed, the above list should also include: System\\CurrentControlSet\\Services\\WINS" + compliance: + - cis: ["2.3.10.9"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36347-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print|Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows|System\\CurrentControlSet\\Control\\Print\\Printers|System\\CurrentControlSet\\Services\\Eventlog|Software\\Microsoft\\OLAP Server|System\\CurrentControlSet\\Control\\ContentIndex|System\\CurrentControlSet\\Control\\Terminal Server|System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig|System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration|Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib|System\\CurrentControlSet\\Services\\SysmonLog|System\\CurrentControlSet\\Services\\CertSvc|System\\CurrentControlSet\\Services\\WINS' + +# 2.3.10.10 Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled' + - id: 16537 + title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'" + description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." + rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict anonymous access to Named Pipes and Shares." + compliance: + - cis: ["2.3.10.10"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36021-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' + +# 2.3.10.11 Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow' (MS only) + - id: 16538 + title: "Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow'" + description: "This policy setting allows you to restrict remote RPC connections to SAM. The recommended state for this setting is: Administrators: Remote Access: Allow . Note: A Windows 10 R1607, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "To ensure that an unauthorized user cannot anonymously list local account names or groups and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Remote Access: Allow: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict clients allowed to make remote calls to SAM" + compliance: + - cis: ["2.3.10.11"] + - cis_csc: ["5.1", "9.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> restrictremotesam -> O:BAG:BAD:(A;;RC;;;BA)' + +# 2.3.10.12 Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None' + - id: 16539 + title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'" + description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)" + rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Shares that can be accessed anonymously." + compliance: + - cis: ["2.3.10.12"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-38095-6' + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\.' + +# 2.3.10.13 Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves' + - id: 16540 + title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'" + description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)" + rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Classic - local users authenticate as themselves: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Sharing and security model for local accounts." + compliance: + - cis: ["2.3.10.13"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1.3"] + - tsc: ["CC6.4"] + references: + - 'CCE-37623-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' + +# 2.3.11.1 Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled' + - id: 16541 + title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'" + description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." + rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow Local System to use computer identity for NTLM." + compliance: + - cis: ["2.3.11.1"] + - cis_csc: ["14", "16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-38341-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' + +# 2.3.11.2 Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled' + - id: 16542 + title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'" + description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." + rationale: "NULL sessions are less secure because by definition they are unauthenticated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow LocalSystem NULL session fallback." + compliance: + - cis: ["2.3.11.2"] + - cis_csc: ["14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37035-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' + +# 2.3.11.3 Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled' + - id: 16543 + title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'" + description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called Homegroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." + rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network Security: Allow PKU2U authentication requests to this computer to use online identities." + compliance: + - cis: ["2.3.11.3"] + - cis_csc: ["16.9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-38047-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' + +# 2.3.11.4 Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types' + - id: 16544 + title: "Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'" + description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it. For the purposes of scoring we have allowed the use of RC4_HMAC_MD5 as an optional setting." + rationale: "The strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." + remediation: "To establish the recommended configuration via GP, set the following UI path to AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Configure encryption types allowed for Kerberos." + compliance: + - cis: ["2.3.11.4"] + - cis_csc: ["16.14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + references: + - 'CCE-37755-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:2147483644|2147483640' + +# 2.3.11.5 Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled' + - id: 16545 + title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'" + description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." + rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Do not store LAN Manager hash value on next password change." + compliance: + - cis: ["2.3.11.5"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-36326-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' + +# 2.3.11.6 Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled' + - id: 16546 + title: "Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'" + description: "This policy setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Microsoft network server: Disconnect clients when logon hours expire (Rule 2.3.9.4). The recommended state for this setting is: Enabled. Note: This recommendation is unscored because there is not a documented registry value that corresponds to it. We still strongly encourage that it be configured as Enabled, to ensure that logon hours (when configured) are properly enforced." + rationale: "If this setting is disabled, a user could remain connected to the computer outside of their allotted logon hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Force logoff when logon hours expire." + compliance: + - cis: ["2.3.11.6"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36270-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + +# 2.3.11.7 Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM' + - id: 16547 + title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'" + description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: -Join a domain -Authenticate between Active Directory forests -Authenticate to down-level domains -Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP -Authenticate to computers that are not in the domain. The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." + rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non- R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Send NTLMv2 response only. Refuse LM & NTLM: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LAN Manager authentication level." + compliance: + - cis: ["2.3.11.7"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36173-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' + +# 2.3.11.8 Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher + - id: 16548 + title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher" + description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Negotiate signing (configuring to Require signing also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LDAP client signing requirements." + compliance: + - cis: ["2.3.11.8"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36858-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:(\d+) compare >= 1' + +# 2.3.11.9 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 16549 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" + description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) clients." + compliance: + - cis: ["2.3.11.9"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37553-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' + +# 2.3.11.10 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 16550 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" + description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) servers." + compliance: + - cis: ["2.3.11.10"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - https://workbench.cisecurity.org/benchmarks/288 + - 'CCE-37835-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' + + +# 2.3.13.1 Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled' + - id: 16551 + title: "Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'" + description: "This policy setting determines whether a computer can be shut down when a user is not logged on. If this policy setting is enabled, the shutdown command is available on the Windows logon screen. It is recommended to disable this policy setting to restrict the ability to shut down the computer to users with credentials on the system. The recommended state for this setting is: Disabled. Note: In Server 2008 R2 and older versions, this setting had no impact on Remote Desktop (RDP) / Terminal Services sessions - it only affected the local console. However, Microsoft changed the behavior in Windows Server 2012 (non-R2) and above, where if set to Enabled, RDP sessions are also allowed to shut down or restart the server." + rationale: "Users who can access the console locally could shut down the computer. Attackers could also walk to the local console and restart the server, which would cause a temporary DoS condition. Attackers could also shut down the server and leave all of its applications and services unavailable. As noted in the Description above, the Denial of Service (DoS) risk of enabling this setting dramatically increases in Windows Server 2012 (non-R2) and above, as even remote users could then shut down or restart the server from the logon screen of an RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Shutdown: Allow system to be shut down without having to log on." + compliance: + - cis: ["2.3.13.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-36788-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon -> 0' + +# 2.3.15.1 Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled' + - id: 16552 + title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'" + description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." + rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Require case insensitivity for non- Windows subsystems." + compliance: + - cis: ["2.3.15.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-37885-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' + +# 2.3.15.2 Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled' + - id: 16553 + title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'" + description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." + rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)" + compliance: + - cis: ["2.3.15.2"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-37644-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' + +# 2.3.17.1 Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled' + - id: 16554 + title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'" + description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named 'Administrator' because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. - If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account." + compliance: + - cis: ["2.3.17.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36494-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' + +# 2.3.17.2 Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop' + - id: 16555 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'" + description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop." + rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." + remediation: "To establish the recommended configuration via GP, set the following UI path to Prompt for consent on the secure desktop: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-37029-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> r:^2$' + +# 2.3.17.3 Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests' + - id: 16556 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'" + description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." + remediation: "To establish the recommended configuration via GP, set the following UI path to Automatically deny elevation requests: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for standard users." + compliance: + - cis: ["2.3.17.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-36864-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' + +# 2.3.17.4 Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled' + - id: 16557 + title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'" + description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." + rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Detect application installations and prompt for elevation." + compliance: + - cis: ["2.3.17.4"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36533-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + +# 2.3.17.5 Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled' + - id: 16558 + title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'" + description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: ...\\Program Files\\, including subfolders; ...\\Windows\\system32\\; ...\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows). Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." + rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: - To set the foreground window. - To drive any application window using SendInput function. - To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. - To set journal hooks. - To uses AttachThreadInput to attach a thread to a higher integrity input queue." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations." + compliance: + - cis: ["2.3.17.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-37057-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' + +# 2.3.17.6 Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled' + - id: 16559 + title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'" + description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." + rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Run all administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.6"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36869-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' + +# 2.3.17.7 Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled' + - id: 16560 + title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'" + description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." + rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Switch to the secure desktop when prompting for elevation." + compliance: + - cis: ["2.3.17.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-36866-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' + +# 2.3.17.8 Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled' + - id: 16561 + title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'" + description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %Windir% - %Windir%\\system32 - HKEY_LOCAL_MACHINE\\Software. The recommended state for this setting is: Enabled." + rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations." + compliance: + - cis: ["2.3.17.8"] + - pci_dss: ["6.5.8"] + - tsc: ["CC6.1"] + references: + - 'CCE-37064-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' + + +############################################### +# 9 Windows Firewall with Advanced Security +############################################### + + +############################################### +# 9.1 Domain Profile +############################################### + +# 9.1.1 Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)' + - id: 16562 + title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'" + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Firewall state." + compliance: + - cis: ["9.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - 'CCE-36062-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' + +# 9.1.2 Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)' + - id: 16563 + title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'" + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Inbound connections." + compliance: + - cis: ["9.1.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - 'CCE-38117-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' + +# 9.1.3 Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)' + - id: 16564 + title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'" + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Outbound connections." + compliance: + - cis: ["9.1.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - 'CCE-36146-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' + +# 9.1.4 Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No' + - id: 16565 + title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'" + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.1.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-38041-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' + +# 9.1.5 Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\domainfw.log' + - id: 16566 + title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log'" + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.1.5"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37482-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' + +# 9.1.6 Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 16567 + title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater'" + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.1.6"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-36088-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + +# 9.1.7 Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes' + - id: 16568 + title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.1.7"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37523-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' + +# 9.1.8 Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes' + - id: 16569 + title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.1.8"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-36393-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' + +############################################### +# 9.2 Private Profile +############################################### + +# 9.2.1 Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)' + - id: 16570 + title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'" + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Firewall state." + compliance: + - cis: ["9.2.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - 'CCE-38239-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' + +# 9.2.2 Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)' + - id: 16571 + title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'" + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Inbound connections." + compliance: + - cis: ["9.2.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - 'CCE-38042-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' + +# 9.2.3 Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)' + - id: 16572 + title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'" + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Outbound connections." + compliance: + - cis: ["9.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - 'CCE-38332-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' + +# 9.2.4 Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No' + - id: 16573 + title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'" + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.2.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-37621-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' + +# 9.2.5 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\privatefw.log' + - id: 16574 + title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log'" + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.2.5"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37569-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' + +# 9.2.6 Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 16575 + title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater'" + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.2.6"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-38178-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + +# 9.2.7 Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes' + - id: 16576 + title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.2.7"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-35972-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' + +# 9.2.8 Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes' + - id: 16577 + title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.2.8"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37387-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' + +############################################### +# 9.3 Public Profile +############################################### + +# 9.3.1 Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)' + - id: 16578 + title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'" + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Firewall state." + compliance: + - cis: ["9.3.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - 'CCE-37862-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' + +# 9.3.2 Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)' + - id: 16579 + title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'" + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Inbound connections." + compliance: + - cis: ["9.3.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - 'CCE-36057-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' + +# 9.3.3 Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)' + - id: 16580 + title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'" + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Outbound connections." + compliance: + - cis: ["9.3.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - 'CCE-37434-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' + +# 9.3.4 Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No' + - id: 16581 + title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'" + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No." + rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." + remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.3.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-38043-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' + +# 9.3.5 Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No' + - id: 16582 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'" + description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "iWhen in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local firewall rules." + compliance: + - cis: ["9.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-37861-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' + +# 9.3.6 Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No' + - id: 16583 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'" + description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." + rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local connection security rules." + compliance: + - cis: ["9.3.6"] + - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-36268-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' + +# 9.3.7 Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\publicfw.log' + - id: 16584 + title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log'" + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.3.7"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37266-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' + +# 9.3.8 Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 16585 + title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater'" + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.3.8"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-36395-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + +# 9.3.9 Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes' + - id: 16586 + title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.3.9"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37265-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' + +# 9.3.9 Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes' + - id: 16587 + title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.3.10"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-36394-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' + + + + +############################################### +# 17 Advanced Audit Policy Configuration +############################################### + + + + + + +############################################### +# 18 Administrative Templates (Computer) +############################################### +############################################### +# 18.1 Control Panel +############################################### +# 18.1.1.1 (L1) Ensure 'Prevent enabling lock screen camera' is set to 'Enabled' + - id: 16588 + title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'" + description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38347-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' + +# 18.1.1.2 Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled' + - id: 16589 + title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'" + description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38348-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' +# 18.1.2.2 Ensure 'Allow input personalization' is set to 'Disabled' + - id: 16590 + title: "Ensure 'Allow input personalization' is set to 'Disabled'" + description: "This policy enables the automatic learning component of input personalization that includes speech, inking, and typing. Automatic learning enables the collection of speech and handwriting patterns, typing history, contacts, and recent calendar information. It is required for the use of Cortana. Some of this collected information may be stored on the user's OneDrive, in the case of inking and typing; some of the information will be uploaded to Microsoft to personalize speech. The recommended state for this setting is: Disabled." + rationale: "If this setting is Enabled sensitive information could be stored in the cloud or sent to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Regional and Language Options\\Allow input personalization Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.1.2.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38347-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization -> 0' + +# 18.1.3 Ensure 'Allow Online Tips' is set to 'Disabled' (Scored) + - id: 16591 + title: "Ensure 'Allow Online Tips' is set to 'Disabled'" + description: "This policy setting configures the retrieval of online tips and help for the Settings app. The recommended state for this setting is: Disabled ." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow Online Tips Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanel.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["1.3.4"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips -> 0' + +############################################### +# Section 18.2 - LAPS +############################################### +# 18.2.1 Ensure LAPS AdmPwd GPO Extension / CSE is installed + - id: 16592 + title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "In order to utilize LAPS, a minor Active Directory Schema update is required, and a Group Policy Client Side Extension (CSE) must be installed on each managed computer. When LAPS is installed, the file AdmPwd.dll must be present in the following location and registered in Windows (the LAPS AdmPwd GPO Extension / CSE installation does this for you): C:\\Program Files\\LAPS\\CSE\\AdmPwd.dll" + compliance: + - cis: ["18.2.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + +# 18.2.2 Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled' + - id: 16593 + title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Do not allow password expiration time longer than required by policy Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' + +# 18.2.3 Ensure 'Enable Local Admin Password Management' is set to 'Enabled' + - id: 16594 + title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Enable Local Admin Password Management Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' + +# 18.2.4 Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters' + - id: 16595 + title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Complexity option to Large letters + small letters + numbers + special characters: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.4"] + - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' + +# 18.2.5 Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more' + - id: 16596 + title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Length option to 15 or more: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.5"] + - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' + +# 18.2.6 Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer' + - id: 16597 + title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Age (Days) option to 30 or fewer: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.6"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' + +############################################### +# Section 18.3 - MS Security Guide +############################################### +# 18.3.1 Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled' + - id: 16598 + title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled'" + description: "This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1. For more information about local accounts and credential theft, review the 'Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques' documents. For more information about LocalAccountTokenFilterPolicy, see Microsoft Knowledge Base article 951016: Description of User Account Control and remote restrictions in Windows Vista. The recommended state for this setting is: Enabled." + rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Apply UAC restrictions to local accounts on network logons Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft." + compliance: + - cis: ["18.3.1"] + - cis_csc: ["5.8"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - https://www.microsoft.com/en-us/download/details.aspx?id=36036 + - https://support.microsoft.com/en-us/help/951016/description-of-user-account-control-and-remote-restrictions-in-windows + - https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/ + - 'CCE-37069-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 1' + +# 18.3.2 (L1) Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver' + - id: 16599 + title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver'" + description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service ( MRxSmb10 ), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver. Note: Do not, under any circumstances, configure this overall setting as Disabled , as doing so will delete the underlying registry entry altogether, which will cause serious problems." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable driver : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 client driver Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858' + - 'https://docs.microsoft.com/en-us/archive/blogs/staysafe/disable-smb-v1-in-managed-environments-with-ad-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/disabling-smbv1-through-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/security-baseline-for-windows-10-creators-update-v1703-final' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 1' + +# 18.3.3 Ensure 'Configure SMB v1 server' is set to 'Disabled' (Scored) + - id: 16600 + title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'" + description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled ." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 server Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858' + - 'https://docs.microsoft.com/en-us/archive/blogs/staysafe/disable-smb-v1-in-managed-environments-with-ad-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/disabling-smbv1-through-group-policy' + - 'https://docs.microsoft.com/en-us/archive/blogs/secguide/security-baseline-for-windows-10-creators-update-v1703-final' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' + +# 18.3.4 Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled' + - id: 16601 + title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'" + description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled ." + rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Enable Structured Exception Handling Overwrite Protection (SEHOP) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.4"] + - cis_csc: ["8.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/' + - 'https://support.microsoft.com/en-us/help/956607/how-to-enable-structured-exception-handling-overwrite-protection-sehop' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' + + +# 18.3.5 (L1) Ensure 'Extended Protection for LDAP Authentication (Domain Controllers only)' is set to 'Enabled: Enabled, always (recommended)' (DC Only) (Scored) + - id: 16602 + title: "Ensure 'Extended Protection for LDAP Authentication (Domain Controllers only)' is set to 'Enabled: Enabled, always (recommended)'" + description: "This setting controls LDAP authentication over SSL/TLS to help make it more secure. The recommended state for this setting is: Enabled: Enabled, always (recommended) . Note: All LDAP clients must have the CVC-2017-8563 security update to be compatible with Domain Controllers that have this setting enabled." + rationale: "Configuring the LdapEnforceChannelBinding registry value can help to increase protection against 'man-in-the-middle attacks'. " + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Enabled, always (recommended) : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Extended Protection for LDAP Authentication (Domain Controllers only) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.5"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CVC-2017-8563' + - 'https://support.microsoft.com/en-us/help/4034879/how-to-add-the-ldapenforcechannelbinding-registry-entry' + - 'https://blogs.technet.microsoft.com/secguide/2018/11/20/security-baseline-final-for-windows-10-v1809-and-windows-server-2019/' + - 'https://technet.microsoft.com/library/security/973811' + - 'https://support.microsoft.com/en-us/help/4034879/how-to-add-the-ldapenforcechannelbinding-registry-entry' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters -> LdapEnforceChannelBinding -> 2' + +# 18.3.6 Ensure 'WDigest Authentication' is set to 'Disabled' + - id: 16603 + title: "Ensure 'WDigest Authentication' is set to 'Disabled'" + description: "When WDigest authentication is enabled, Lsass.exe retains a copy of the user's plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server." + rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\WDigest Authentication (disabling may require KB2871997) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.6"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'http://www.microsoft.com/en-us/download/details.aspx?id=36036' + - 'https://support.microsoft.com/en-us/kb/2871997' + - 'https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' + +############################################### +# 18.4 MSS (Legacy) +############################################### +# 18.4.1 Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled' + - id: 16604 + title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'" + description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. The recommended state for this setting is: Disabled." + rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - https://support.microsoft.com/en-us/help/324737/how-to-turn-on-automatic-logon-in-windows + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-37067-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' + +# 18.4.2 Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' + - id: 16605 + title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.2"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-36871-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' + +# 18.4.3 Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' + - id: 16606 + title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.3"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-36535-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' + +# 18.4.4 Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled' + - id: 16607 + title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'" + description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." + rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.4"] + - cis_csc: ["9"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-37988-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' + +# 18.4.5 Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes' + - id: 16608 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'" + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds." + compliance: + - cis: ["18.4.5"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-36868-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + +# 18.4.6 Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled' + - id: 16609 + title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'" + description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." + rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.6"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-36879-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' + +# 18.4.7 Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled' + - id: 16610 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'" + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)." + compliance: + - cis: ["18.4.7"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-38065-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + +# 18.4.8 Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled' + - id: 16611 + title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'" + description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: -Search folders specified in the system path first, and then search the current working folder. -Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled." + rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.8"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-36351-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' + +# 18.4.9 Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds' + - id: 16612 + title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'" + description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." + rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 5 or fewer seconds: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.9"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-37993-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' + + +# 18.4.10 Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' + - id: 16613 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted." + compliance: + - cis: ["18.4.10"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-37846-3' + - 'https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + +# 18.4.11 Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' + - id: 16614 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted." + compliance: + - cis: ["18.4.11"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1","CC6.1","CC7.2"] + - nist_800_53: ["SC.5"] + references: + - 'CCE-36051-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + +# 18.4.12 Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less' + - id: 16615 + title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'" + description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." + rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 90% or less: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.12"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - 'CCE-36880-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' + + + +############################################### +# 18.5 Network +############################################### +# 18.5.4.1 Set 'NetBIOS node type' to 'P-node' (Ensure NetBT Parameter 'NodeType' is set to '0x2 (2)') + - id: 16616 + title: "Set 'NetBIOS node type' to 'P-node' (Ensure NetBT Parameter 'NodeType' is set to '0x2 (2)')" + description: "This parameter determines which method NetBIOS over TCP/IP (NetBT) will use to register and resolve names. A B-node (broadcast) system only uses broadcasts. A P-node (point-to-point) system uses only name queries to a name server (WINS). An M-node (mixed) system broadcasts first, then queries the name server (WINS). An H-node (hybrid) system queries the name server (WINS) first, then broadcasts. The recommended state for this setting is: NodeType - 0x2 (2) (P-node / point-to-point)." + rationale: "In order to help mitigate the risk of NetBIOS Name Service (NBT-NS) poisoning attacks, setting the node type to P-node will prevent the system from sending out NetBIOS broadcasts." + remediation: "To establish the recommended configuration, set the following Registry value to 0x2 (2) (DWORD) : HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NetBT\\Parameters:NodeType" + compliance: + - cis: ["18.5.4.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NetBT\Parameters -> NodeType -> 2' + +# 18.5.4.2 Ensure 'Turn off multicast name resolution' is set to 'Enabled' + - id: 16617 + title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'" + description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled ." + rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system. Note: To completely mitigate local name resolution poisoning, in addition to this setting, the properties of each installed NIC should also be set to Disable NetBIOS over TCP/IP (on the WINS tab in the NIC properties). Unfortunately, there is no global setting to achieve this that automatically applies to all NICs - it is a per-NIC setting that varies with different NIC hardware installations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution ote: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.4.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37450-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 0' + +############################################### +# 18.5.5 Fonts +############################################### +# 18.5.5.1 Ensure 'Enable Font Providers' is set to 'Disabled' (Scored) + - id: 16618 + title: "Ensure 'Enable Font Providers' is set to 'Disabled'" + description: "This policy setting determines whether Windows is allowed to download fonts and font catalog data from an online font provider.The recommended state for this setting is: Disabled ." + rationale: "In an enterprise managed environment the IT department should be managing the changes to the system configuration, to ensure all changes are tested and approved." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\Fonts\\Enable Font Providers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.5.1"] + - cis_csc: ["3", "13"] + - pci_dss: ["6.4.5"] + - tsc: ["CC6.6","CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders -> 0' + +# 18.5.8.1 Ensure 'Enable insecure guest logons' is set to 'Disabled' + - id: 16619 + title: "Ensure 'Enable insecure guest logons' is set to 'Disabled'" + description: "This policy setting determines if the SMB client will allow insecure guest logons to an SMB server. The recommended state for this setting is: Disabled ." + rationale: "Insecure guest logons are used by file servers to allow unauthenticated access to shared folders." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\LanmanWorkstation\\Enable insecure guest logons Note: This Group Policy path may not exist by default. It is provided by the Group Policy template LanmanWorkstation.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.8.1"] + - cis_csc: ["9.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth -> 0' + +# Section 18.5.9 - Link-Layer Topology Discovery +# 18.5.9.1 Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled' + - id: 16620 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver." + compliance: + - cis: ["18.5.9.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38170-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' + +# 18.5.9.2 (L2) Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled' + - id: 16621 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Responder network protocol driver." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver." + compliance: + - cis: ["18.5.9.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37959-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' + +# Section 18.5.10 - Microsoft Peer-to-Peer Networking Services + - id: 16622 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'" + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services." + compliance: + - cis: ["18.5.10.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37699-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + +# 18.5.11.2 (L1) Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled' (Scored) + - id: 16623 + title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'" + description: "You can use this procedure to controls user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." + rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit installation and configuration of Network Bridge on your DNS domain network Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.11.2"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + references: + - 'CCE-38002-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' + +# 18.5.11.3 (L1) Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled' (Scored) + - id: 16624 + title: "Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled'" + description: "Although this \"legacy\" setting traditionally applied to the use of Internet Connection Sharing (ICS) in Windows 2000, Windows XP & Server 2003, this setting now freshly applies to the Mobile Hotspot feature in Windows 10 & Server 2016. The recommended state for this setting is: Enabled ." + rationale: "Non-administrators should not be able to turn on the Mobile Hotspot feature and open their Internet connectivity up to nearby mobile devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit use of Internet Connection Sharing on your DNS domain network Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.11.3"] + - cis_csc: ["9.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI -> 0' + +# 18.5.11.4 (L1) Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled' (Scored) + - id: 16625 + title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'" + description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled ." + rationale: "Allowing regular users to set a network location increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Require domain users to elevate when setting a network's location Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NetworkConnections.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.11.4"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-38188-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' + +# 18.5.14.1 Ensure 'Hardened UNC Paths' is set to 'Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares' + - id: 16626 + title: "Ensure 'Hardened UNC Paths' is set to 'Enabled, with \"Require Mutual Authentication\" and \"Require Integrity\" set for all NETLOGON and SYSVOL shares'" + description: "This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with \"Require Mutual Authentication\" and \"Require Integrity\" set for all NETLOGON and SYSVOL shares ." + rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template ( NetworkProvider.admx/adml ) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with the following paths configured, at a minimum: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Provider\\Hardened UNC Paths Note: This Group Policy path does not exist by default. An additional Group Policy template ( NetworkProvider.admx/adml ) is required" + compliance: + - cis: ["18.5.14.1"] + - cis_csc: ["3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + +# Section 18.5.19.2 - Parameters +# 18.5.19.2.1 (L2) Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)') (Scored) + - id: 16627 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')" + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components reduces a possible attack surface that is also harder to monitor the traffic on." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents." + compliance: + - cis: ["18.5.19.2.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + +# Section 18.5.20 - Windows Connect Now +# 18.5.20.1 (L2) Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled' (Scored) + - id: 16628 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'" + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN)." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now." + compliance: + - cis: ["18.5.20.1"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37481-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + +# 18.5.20.2 (L2) Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled' (Scored) + - id: 16629 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'" + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\Network\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards." + compliance: + - cis: ["18.5.20.2"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36109-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + +# Section 18.5.21 - Windows Connection Manager +# 18.5.21.1 (L1) Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled' (Scored) + - id: 16630 + title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled'" + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." + rationale: "Blocking simultaneous connections can help prevent a user unknowingly allowing network traffic to flow between the Internet and the enterprise managed network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Minimize the number of simultaneous connections to the Internet or a Windows Domain Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.21.1"] + - cis_csc: ["12"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-38338-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> n:(\d+) compare != 0' + +# 18.5.21.2 (L2) Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled' (MS only) (Scored) + - id: 16631 + title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled'" + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time." + rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Prohibit connection to non-domain networks when connected to domain authenticated network." + compliance: + - cis: ["18.5.21.2"] + - cis_csc: ["12"] + - pci_dss: ["1.3.4"] + - tsc: ["CC6.6"] + references: + - 'CCE-37627-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' + +############################################### +# 18.7 Start Menu and Taskbar +############################################### + +# 18.7.1.1 (L2) Ensure 'Turn off notifications network usage' is set to 'Enabled' (Scored) + - id: 16632 + title: "Ensure 'Turn off notifications network usage' is set to 'Enabled'" + description: "This policy setting blocks applications from using the network to send notifications to update tiles, tile badges, toast, or raw notifications. This policy setting turns off the connection between Windows and the Windows Push Notification Service (WNS). This policy setting also stops applications from being able to poll application services to update tiles. The recommended state for this setting is: Enabled ." + rationale: "Windows Push Notification Services (WNS) is a mechanism to receive 3rd-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Start Menu and Taskbar\\Turn off notifications network usage Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WPN.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.7.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification -> 1' + +############################################### +# 18.8 System +############################################### +###################################### +# 18.8.3 Audit Process Creation +###################################### + - id: 16633 + title: "Ensure 'Include command line in process creation events' is set to 'Disabled'" + description: "This policy setting determines what information is logged in security audit events when a new process has been created. The recommended state for this setting is: Disabled." + rationale: "When this policy setting is enabled, any user who has read access to the security events can read the command-line arguments for any successfully created process. Command-line arguments may contain sensitive or private information such as passwords or user data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Audit Process Creation\\Include command line in process creation events Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AuditSettings.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.3.1"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-36925-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 0' + +###################################### +# 18.8.4 Credentials Delegation +###################################### +# 18.8.4.1 (L1) Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients' (Scored) + - id: 16634 + title: "Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients'" + description: "Some versions of the CredSSP protocol that is used by some applications (such as Remote Desktop Connection) are vulnerable to an encryption oracle attack against the client. This policy controls compatibility with vulnerable clients and servers and allows you to set the level of protection desired for the encryption oracle vulnerability. The recommended state for this setting is: Enabled: Force Updated Clients ." + rationale: "This setting is important to mitigate the CredSSP encryption oracle vulnerability, for which information was published by Microsoft on 03/13/2018 in CVE-2018-0886 | CredSSP Remote Code Execution Vulnerability. All versions of Windows Server from Server 2008 (non-R2) onwards are affected by this vulnerability, and will be compatible with this recommendation provided that they have been patched up through May 2018 (or later)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Force Updated Clients : Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Encryption Oracle Remediation Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1803 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle -> 0' + +# 18.8.4.2 (L1) Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled' (Scored) + - id: 16635 + title: "Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled'" + description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled ." + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Remote host allows delegation of non-exportable credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.2"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'https://docs.microsoft.com/en-us/windows/access-protection/remote-credential-guard' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' + +########################################## +# 18.8.14 Early Launch Antimalware +########################################## +# 18.8.14.1 (L1) Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical' (Scored) + - id: 16636 + title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'" + description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: - Good: The driver has been signed and has not been tampered with. - Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. - Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. - Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware boot- start driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." + rationale: "This policy setting helps reduce the impact of malware that has already infected your system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Good, unknown and bad but critical: Computer Configuration\\Policies\\Administrative Templates\\System\\Early Launch Antimalware\\Boot-Start Driver Initialization Policy Note: This Group Policy path may not exist by default. It is provided by the Group Policy template EarlyLaunchAM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.14.1"] + - cis_csc: ["8"] + - pci_dss: ["5.1.1"] + - nist_800_53: ["SI.3"] + - tsc: ["CC6.8"] + references: + - 'CCE-37912-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' + +# 18.8.21.2 (L1) Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE' (Scored) + - id: 16637 + title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'" + description: "The 'Do not apply during periodic background processing' option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked)." + rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Do not apply during periodic background processing option to FALSE (unchecked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.2"] + - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-36169-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' + +# 18.8.21.3 (L1) Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE' (Scored) + - id: 16638 + title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'" + description: "The 'Process even if the Group Policy objects have not changed' option updates and reapplies policies even if the policies have not changed. The recommended state for this setting is: Enabled: TRUE (checked)." + rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Process even if the Group Policy objects have not changed option to TRUE (checked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.3"] + - cis_csc: ["3.7"] + - pci_dss: ["11.5.1"] + - tsc: ["PI1.4","PI1.5","CC6.1","CC6.8","CC7.2","CC7.3","CC7.4"] + references: + - 'CCE-36169-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' + +# 18.8.21.4 (L1) Ensure 'Continue experiences on this device' is set to 'Disabled' (Scored) + - id: 16639 + title: "Ensure 'Continue experiences on this device' is set to 'Disabled'" + description: "This policy setting determines whether the Windows device is allowed to participate in cross-device experiences (continue experiences). The recommended state for this setting is: Disabled ." + rationale: "A cross-device experience is when a system can access app and send messages to other devices. In an enterprise managed environment only trusted systems should be communicating within the network. Access to any other system should be prohibited." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Continue experiences on this device Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.4"] + - cis_csc: ["9.1"] + - pci_dss: ["6.5.8"] + - nist_800_53: ["SA.11","AU.14","AC.7"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp -> 0' + +# 18.8.21.5 (L1) Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled' (Scored) + - id: 16640 + title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'" + description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." + rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Turn off background refresh of Group Policy Note: This Group Policy path is provided by the Group Policy template GroupPolicy.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.21.5"] + - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-37712-7' + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' + + +# 18.8.22.1.1 (L1) Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' (Scored) + - id: 16641 + title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'" + description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." + rationale: "Users might download drivers that include malicious code." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off downloading of print drivers over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-36625-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' + + # 18.8.22.1.2 (L2) Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' (Scored) + - id: 16642 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'" + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37911-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + +# 18.8.22.1.3 (L2) Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' (Scored) + - id: 16643 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'" + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36203-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + +# 18.8.22.1.4 (L2) Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' (Scored) + - id: 16644 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37163-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + + +# 18.8.22.1.5 (L1) Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' (Scored) + - id: 16645 + title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'" + description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." + rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet download for Web publishing and online ordering wizards Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.5"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36096-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' + +# 18.8.22.1.6 (L1) Ensure 'Turn off printing over HTTP' is set to 'Enabled' (Scored) + - id: 16646 + title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'" + description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled." + rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off printing over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.6"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36920-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' + + +# 18.8.22.1.7 (L2) Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' (Scored) + - id: 16647 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36352-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' + +# 18.8.22.1.8 (L2) Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' (Scored) + - id: 16648 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36884-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + +# 18.8.22.1.9 (L2) Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' (Scored) + - id: 16649 + title: "Ensure 'Turn off the \"Order Prints\" picture task' is set to 'Enabled'" + description: "This policy setting specifies whether the \"Order Prints Online\" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.9"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38275-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + +# 18.8.22.1.10 (L2) Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' (Scored) + - id: 16650 + title: "Ensure 'Turn off the \"Publish to Web\" task for files and folders' is set to 'Enabled'" + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.10"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37090-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + +# 18.8.22.1.11 (L2) Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' (Scored) + - id: 16651 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.11"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36628-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + +# 18.8.22.1.12 (L2) Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' (Scored) + - id: 16652 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.12"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36174-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + +# 18.8.22.1.13 (L2) Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' (Scored) + - id: 16653 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.13"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35964-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + + +###################################### +# 18.8.25 Kerberos +###################################### +# 18.8.25.1 (L2) Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic' (Scored) + - id: 16654 + title: "Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'" + description: "This policy setting allows you to set support for Kerberos to attempt authentication using the certificate for the device to the domain. Support for device authentication using certificate will require connectivity to a DC in the device account domain which supports certificate authentication for computer accounts. The recommended state for this setting is: Enabled: Automatic ." + rationale: "Having stronger device authentication with the use of certificates is strongly encouraged over standard username and password authentication. Having this set to Automatic will allow certificate based authentication to be used whenever possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Automatic : Computer Configuration\\Policies\\Administrative Templates\\System\\Kerberos\\Support device authentication using certificate Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Kerberos.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.25.1"] + - cis_csc: ["1.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled -> 1' + + +# 18.8.26.1 (L1) Ensure 'Enumeration policy for external devices incompatible with Kernel DMA Protection' is set to 'Enabled: Block All' (Scored) + - id: 16655 + title: "Ensure 'Enumeration policy for external devices incompatible with Kernel DMA Protection' is set to 'Enabled: Block All'" + description: "This policy is intended to provide additional security against external DMA-capable devices. It allows for more control over the enumeration of external DMA-capable devices that are not compatible with DMA Remapping/device memory isolation and sandboxing. The recommended state for this setting is: Enabled: Block All . Note: This policy does not apply to 1394, PCMCIA or ExpressCard devices. The protection also only applies to Windows 10 R1803 or higher, and also requires a UEFI BIOS to function." + rationale: "Device memory sandboxing allows the OS to leverage the I/O Memory Management Unit (IOMMU) of a device to block unpermitted I/O, or memory access, by the peripheral." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block All : Computer Configuration\\Policies\\Administrative Templates\\System\\Kernel DMA Protection\\Enumeration policy for external devices incompatible with Kernel DMA Protection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DmaGuard.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.26.1"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36920-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection -> DeviceEnumerationPolicy -> 0' + +####################################### +# 18.8.27 Locale Services +####################################### +# 18.8.27.1 (L2) Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled' (Scored) + - id: 16656 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'" + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.26.1"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36343-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + + +################################################ +# 18.8.28 Logon +################################################ +# 18.8.28.1 (L1) Ensure 'Block user from showing account details on sign-in' is set to 'Enabled' (Scored) + - id: 16657 + title: "Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'" + description: "This policy prevents the user from showing account details (email address or user name) on the sign-in screen. The recommended state for this setting is: Enabled ." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Block user from showing account details on sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.1"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin -> 1' + +# 18.8.28.2 (L1) Ensure 'Do not display network selection UI' is set to 'Enabled' (Scored) + - id: 16658 + title: "Ensure 'Do not display network selection UI' is set to 'Enabled'" + description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen. The recommended state for this setting is: Enabled." + rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not display network selection UI Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.2"] + - cis_csc: ["5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38353-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' + +# 18.8.28.3 (L1) Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled' (Scored) + - id: 16659 + title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'" + description: "This policy setting prevents connected users from being enumerated on domain-joined computers. The recommended state for this setting is: Enabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not enumerate connected users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + references: + - 'CCE-37838-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' + +# 18.8.28.4 (L1) Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled' (MS only) (Scored) + - id: 16660 + title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'" + description: "This policy setting allows local users to be enumerated on domain-joined computers. The recommended state for this setting is: Disabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Enumerate local users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35894-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' + +# 18.8.28.5 (L1) Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled' (Scored) + - id: 16661 + title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'" + description: "This policy setting allows you to prevent app notifications from appearing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "App notifications might display sensitive business or personal data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off app notifications on the lock screen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.5"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-35893-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' + +# 18.8.28.6 (L1) Ensure 'Turn off picture password sign-in' is set to 'Enabled' (Scored) + - id: 16662 + title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'" + description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled . Note: If the picture password feature is permitted, the user's domain password is cached in the system vault when using it." + rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.6"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' + +# 18.8.28.7 (L1) Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled' (Scored) + - id: 16663 + title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'" + description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work. Note: The user's domain password will be cached in the system vault when using this feature. The recommended state for this setting is: Disabled." + rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn on convenience PIN sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn on PIN sign-in, but it was renamed starting with the Windows 10 Release 1511 Administrative Templates." + compliance: + - cis: ["18.8.28.7"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'CCE-37528-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' + +####################################### +# 18.8.31 OS Policies +####################################### +# 18.8.31.1 (L2) Ensure 'Allow Clipboard synchronization across devices' is set to 'Disabled' (Scored) + - id: 16664 + title: "Ensure 'Allow Clipboard synchronization across devices' is set to 'Disabled'" + description: "This policy setting determines whether Clipboard contents can be synchronized across devices. The recommended state for this setting is: Disabled ." + rationale: "Due to privacy concerns, clipboard data should stay local to the system and not synced across devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow Clipboard synchronization across devices" + compliance: + - cis: ["18.8.31.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCrossDeviceClipboard -> 0' + +# 18.8.31.2 (L2) Ensure 'Allow upload of User Activities' is set to 'Disabled' (Scored) + - id: 16665 + title: "Ensure 'Allow upload of User Activities' is set to 'Disabled'" + description: "This policy setting determines whether published User Activities can be uploaded to the cloud. The recommended state for this setting is: Disabled ." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "TTo establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow upload of User Activities" + compliance: + - cis: ["18.8.31.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> UploadUserActivities -> 0' + +####################################### +# 18.8.34 Power Management +####################################### +####################################### +# 18.8.34.6 Sleep Settings +####################################### +# 18.8.34.6.1 (L2) Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled' (Scored) + - id: 16666 + title: "Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'" + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled ." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, on battery and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex -> 0' + +# 18.8.34.6.2 (L2) Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled' (Scored) + - id: 16667 + title: "Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'" + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled ." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, plugged in and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex -> 0' + +# 18.8.34.6.3 (L1) Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled' (Scored) + - id: 16668 + title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'" + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.3"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'CCE-36881-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' + +# 18.8.34.6.4 (L1) Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled' (Scored) + - id: 16669 + title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'" + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.4"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - 'CCE-37066-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' + + +# 18.8.36.1 (L1) Ensure 'Configure Offer Remote Assistance' is set to 'Disabled' (Scored) + - id: 16670 + title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'" + description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled." + rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Offer Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.35.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36388-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' + +# # 18.8.36.2 (L1) Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled' (Scored) + - id: 16671 + title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'" + description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." + rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Solicited Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.36.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37281-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' + +# 18.8.37.1 (L1) Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled' (MS only) (Scored) + - id: 16672 + title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'" + description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers. Note: This policy will not be in effect until the system is rebooted. The recommended state for this setting is: Enabled." + rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Enable RPC Endpoint Mapper Client Authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.37.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - https://support.microsoft.com/en-us/help/3073942/rpc-endpoint-mapper-client-authentication-prevents-users-and-groups-fr + - 'CCE-37346-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' + +# 18.8.37.2 (L2) Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated' (MS only) (Scored) + - id: 16673 + title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'" + description: "This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers." + rationale: "Unauthenticated RPC communication can create a security vulnerability." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients." + compliance: + - cis: ["18.8.37.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36559-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' + + +# Section 18.8.45.5 - Microsoft Support Diagnostic Tool +# 18.8.45.5.1 (L2) Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled' (Scored) + - id: 16674 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'" + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider." + compliance: + - cis: ["18.8.45.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38161-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + +# Section 18.8.45.11 - Windows Performance PerfTrack +# 18.8.45.11.1 (L2) Ensure 'Enable/Disable PerfTrack' is set to 'Disabled' (Scored) + - id: 16675 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'" + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack." + compliance: + - cis: ["18.8.45.11.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36648-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + +# Section 18.8.47 User Profiles +# 18.8.47.1 (L2) Ensure 'Turn off the advertising ID' is set to 'Enabled' (Scored) + - id: 16676 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'" + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID." + compliance: + - cis: ["18.8.47.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36931-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + +# Section 18.8.50.1 - Time Providers +# 18.8.50.1.1 (L2) Ensure 'Enable Windows NTP Client' is set to 'Enabled' (Scored) + - id: 16677 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows NTP Client is enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client." + compliance: + - cis: ["18.8.50.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + references: + - 'CCE-37843-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + +# 18.8.50.1.2 (L2) Ensure 'Enable Windows NTP Server' is set to 'Disabled' (MS only) (Scored) + - id: 16678 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'" + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server." + compliance: + - cis: ["18.8.50.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.3"] + references: + - 'CCE-37319-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + +################################################ +# 18.9 Windows Components +################################################ + +# 18.9.4.1 (L2) Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled' (Scored) + - id: 16679 + title: "Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'" + description: "Manages a Windows app's ability to share data between users who have installed the app. Data is shared through the SharedLocal folder. This folder is available through the Windows.Storage API. The recommended state for this setting is: Disabled ." + rationale: "Users of a system could accidentally share sensitive data with other users on the same system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Allow a Windows app to share application data between users Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.1"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData -> 0' + + +# 18.9.6.1 (L1) Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled' (Scored) + - id: 16680 + title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'" + description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App runtime\\Allow Microsoft accounts to be optional Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppXRuntime.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.6.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-38354-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' + +# 18.9.8.1 (L1) Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled' (Scored) + - id: 16681 + title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'" + description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones. The recommended state for this setting is: Enabled." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Disallow Autoplay for non-volume devices Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.1"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2"] + references: + - 'CCE-37636-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' + +# 18.9.8.2 (L1) Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands' (Scored) + - id: 16682 + title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'" + description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." + rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Do not execute any autorun commands: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Set the default behavior for AutoRun Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-38217-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' + +# 18.9.8.3 (L1) Ensure 'Turn off Autoplay' is set to 'Enabled: All drives' (Scored) + - id: 16683 + title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'" + description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: All drives: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Turn off Autoplay Note: This Group Policy path is provided by the Group Policy template AutoPlay.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.8.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-36875-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' + +# 18.9.10.1.1 (L1) Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled' (Scored) + - id: 16684 + title: "Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'" + description: "This policy setting determines whether enhanced anti-spoofing is configured for devices which support it. The recommended state for this setting is: Enabled ." + rationale: "Enterprise managed environments are now supporting a wider range of mobile devices, increasing the security on these devices will help protect against unauthorized access on your network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Biometrics\\Facial Features\\Configure enhanced anti-spoofing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Biometrics.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Windows 10 Release 1511 and Windows 10 Release 1607 & Server 2016 Administrative Templates, this setting was named Use enhanced anti-spoofing when available. It was renamed to Configure enhanced anti-spoofing starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.10.1.1"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing -> 1' + +# 18.9.12.1 (L2) Ensure 'Allow Use of Camera' is set to 'Disabled' (Scored) + - id: 16685 + title: "Ensure 'Allow Use of Camera' is set to 'Disabled'" + description: "This policy setting controls whether the use of Camera devices on the machine are permitted. The recommended state for this setting is: Disabled ." + rationale: "Cameras in a high security environment can pose serious privacy and data exfiltration risks - they should be disabled to help mitigate that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Camera\\Allow Use of Camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Camera.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.12.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera -> 0' + +# 18.9.13.1 (L1) Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled' (Scored) + - id: 16686 + title: "Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'" + description: "This policy setting turns off experiences that help consumers make the most of their devices and Microsoft account. The recommended state for this setting is: Enabled . Note: Per Microsoft TechNet, this policy setting only applies to Windows 10 Enterprise and Windows 10 Education editions." + rationale: "Having apps silently install in an enterprise managed environment is not good security practice - especially if the apps send data back to a 3rd party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off Microsoft consumer experiences Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.13.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'https://technet.microsoft.com/en-us/itpro/windows/manage/group-policies-for-enterprise-and-education-editions' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures -> 1' + +# 18.9.14.1 (L1) Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always' (Scored) + - id: 16687 + title: "Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always'" + description: "This policy setting controls whether or not a PIN is required for pairing to a wireless display device. The recommended state for this setting is: 'Enabled: First Time' OR 'Enabled: Always'." + rationale: "If this setting is not configured or disabled then a PIN would not be required when pairing wireless display devices to the system, increasing the risk of unauthorized use." + remediation: "To establish the recommended configuration via GP, set the following UI path to 'Enabled: First Time' OR 'Enabled: Always' : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Connect\\Require pin for pairing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WirelessDisplay.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.14.1"] + - cis_csc: ["15.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> 2' + +# 18.9.15.1 (L1) Ensure 'Do not display the password reveal button' is set to 'Enabled' (Scored) + - id: 16688 + title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'" + description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences. The recommended state for this setting is: Enabled." + rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Do not display the password reveal button Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.15.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-37534-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' + +# 18.9.15.2 (L1) Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled' (Scored) + - id: 16689 + title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'" + description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. The recommended state for this setting is: Disabled." + rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Enumerate administrator accounts on elevation Note: This Group Policy path is provided by the Group Policy template CredUI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.15.2"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-36512-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' + +# 18.9.16.1 (L1) Ensure 'Allow Telemetry' is set to 'Enabled: 0 - Security [Enterprise Only]' or 'Enabled: 1 - Basic' (Scored) + - id: 16690 + title: "Ensure 'Allow Telemetry' is set to 'Enabled: 0 - Security [Enterprise Only]' or 'Enabled: 1 - Basic'" + description: "This policy setting determines the amount of diagnostic and usage data reported to Microsoft:A value of 0 - Security [Enterprise Only] will send minimal data to Microsoft. This data includes Malicious Software Removal Tool (MSRT) & Windows Defender data, if enabled, and telemetry client settings. Setting a value of 0 applies to enterprise, EDU, IoT and server devices only. Setting a value of 0 for other devices is equivalent to choosing a value of 1. A value of 1 - Basic sends only a basic amount of diagnostic and usage data. Note that setting values of 0 or 1 will degrade certain experiences on the device. A value of 2 - Enhanced sends enhanced diagnostic and usage data. A value of 3 - Full sends the same data as a value of 2, plus additional diagnostics data, including the files and content that may have caused the problem. Windows 10 telemetry settings apply to the Windows operating system and some first party apps. This setting does not apply to third party apps running on Windows 10. The recommended state for this setting is: Enabled: 0 - Security [Enterprise Only] or Enabled: 1 - Basic . Note: If the Allow Telemetry setting is configured to 0 - Security [Enterprise Only] , then the options in Windows Update to defer upgrades and updates will have no effect. Note #2: In the Microsoft Windows 10 RTM (Release 1507) Administrative Templates, the zero value was named 0 - Off [Enterprise Only] , but it was renamed to 0 - Security [Enterprise Only] starting with the Windows 10 Release 1511 Administrative Templates." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 0 - Security [Enterprise Only] or Enabled: 1 - Basic : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Allow Telemetry Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> 1' + +# 18.9.16.2 (L2) Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage' (Scored) + - id: 16691 + title: "Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage'" + description: "This policy setting controls whether the Connected User Experience and Telemetry service can automatically use an authenticated proxy to send data back to Microsoft. The recommended state for this setting is: Enabled: Disable Authenticated Proxy usage ." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Authenticated Proxy usage : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy -> 1' + +# 18.9.16.3 (L1) Ensure 'Do not show feedback notifications' is set to 'Enabled' (Scored) + - id: 16692 + title: "Ensure 'Do not show feedback notifications' is set to 'Enabled'" + description: "This policy setting allows an organization to prevent its devices from showing feedback questions from Microsoft. The recommended state for this setting is: Enabled ." + rationale: "Users should not be sending any feedback to 3rd party vendors in an enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Do not show feedback notifications Note: This Group Policy path may not exist by default. It is provided by the Group Policy template FeedbackNotifications.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications -> 1' + +# 18.9.16.4 (L1) Ensure 'Toggle user control over Insider builds' is set to 'Disabled' (Scored) + - id: 16693 + title: "Ensure 'Toggle user control over Insider builds' is set to 'Disabled'" + description: "This policy setting determines whether users can access the Insider build controls in the Advanced Options for Windows Update. These controls are located under \"Get Insider builds,\" and enable users to make their devices available for downloading and installing Windows preview software. The recommended state for this setting is: Disabled . Note: This policy setting applies only to devices running Windows Server 2016, up until Release 1703. For Release 1709 or newer, Microsoft encourages using the Manage preview builds setting (Rule 18.9.102.1.1). We have kept this setting in the benchmark to ensure that any older builds of Windows Server 2016 in the environment are still enforced." + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Toggle user control over Insider builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AllowBuildPreview.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.4"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview -> 0' + +# 18.9.26.1.1 (L1) Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16694 + title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37775-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' + +# 18.9.26.1.2 (L1) Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' (Scored) + - id: 16695 + title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37948-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' + +# 18.9.26.2.1 (L1) Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16696 + title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.2.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37145-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' + +# 18.9.26.2.2 (L1) Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater' (Scored) + - id: 16697 + title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 196,608 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 196,608 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.2.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37695-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' + +# 18.9.26.3.1 (L1) Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16698 + title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.3.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-38276-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' + +# 18.9.26.3.2 (L1) Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' (Scored) + - id: 16699 + title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.3.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-37526-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' + +# 18.9.26.4.1 (L1) Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16700 + title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.4.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-36160-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' + +# 18.9.26.4.2 (L1) Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' (Scored) + - id: 16701 + title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.4.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1","CC6.8","CC7.2","CC7.3"] + references: + - 'CCE-36092-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' + +# 18.9.30.2 (L1) Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled' (Scored) + - id: 16702 + title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'" + description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer. The recommended state for this setting is: Disabled." + rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off Data Execution Prevention for Explorer Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Explorer.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.30.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-37809-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' + +# 18.9.30.3 (L1) Ensure 'Turn off heap termination on corruption' is set to 'Disabled' (Scored) + - id: 16703 + title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'" + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.30.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-36660-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' + +# 18.9.30.4 (L1) Ensure 'Turn off shell protocol protected mode' is set to 'Disabled' (Scored) + - id: 16704 + title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'" + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.30.4"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-36809-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' + +# 18.9.39.2 Ensure 'Turn off location' is set to 'Enabled' + - id: 16705 + title: "Ensure 'Turn off location' is set to 'Enabled'" + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.39.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36886-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + +# 18.9.43.1 (L2) Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled' (Scored) + - id: 16706 + title: "Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'" + description: "This policy setting allows backup and restore of cellular text messages to Microsoft's cloud services. The recommended state for this setting is: Disabled ." + rationale: "In a high security environment, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Messaging\\Allow Message Service Cloud Sync Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Messaging.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.43.1"] + - cis_csc: ["9.1", "13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync -> 0' + +# 18.9.44.1 (L1) Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled' (Scored) + - id: 16707 + title: "Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'" + description: "This setting determines whether applications and services on the device can utilize new consumer Microsoft account authentication via the Windows OnlineID and WebAccountManager APIs. The recommended state for this setting is: Enabled ." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used on their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft accounts\\Block all consumer Microsoft account user authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSAPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.44.1"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth -> 1' + +# 18.9.52.1 (L1) Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled' (Scored) + - id: 16708 + title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'" + description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting prevents users from accidentally uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\OneDrive\\Prevent the usage of OneDrive for file storage Note: This Group Policy path may not exist by default. It is provided by the Group Policy template SkyDrive.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). However, we strongly recommend you only use the version included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Older versions of the templates had conflicting settings in different template files for both OneDrive & SkyDrive, until it was cleaned up properly in the above version. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Prevent the usage of SkyDrive for file storage, but it was renamed starting with the Windows 10 RTM (Release 1507) Administrative Templates." + compliance: + - cis: ["18.9.52.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36939-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' + +# 18.9.59.2.2 (L1) Ensure 'Do not allow passwords to be saved' is set to 'Enabled' (Scored) + - id: 16709 + title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'" + description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." + rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Connection Client\\Do not allow passwords to be saved Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.2.2"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + references: + - 'CCE-36223-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' + +# 18.9.59.3.2.1 Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled' + - id: 16710 + title: "Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'" + description: "This policy setting allows you to restrict users to a single Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "This setting ensures that users & administrators who Remote Desktop to a server will continue to use the same session - if they disconnect and reconnect, they will go back to the same session they were using before, preventing the creation of a second simultaneous session. This both prevents unnecessary resource usage by having the server host unnecessary additional sessions (which would put extra load on the server) and also ensures a consistency of experience for the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Restrict Remote Desktop Services users to a single Remote Desktop Services session. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Restrict Terminal Services users to a single remote session, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.59.3.2.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - 'CCE-37708-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> 1' + +# 18.9.59.3.3.1 Ensure 'Do not allow COM port redirection' is set to 'Enabled' + - id: 16711 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.3.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37696-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + + +# 18.9.59.3.3.2 (L1) Ensure 'Do not allow drive redirection' is set to 'Enabled' (Scored) + - id: 16712 + title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'" + description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." + rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow drive redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.3.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36509-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' + +# 18.9.59.3.3.3 Ensure 'Do not allow LPT port redirection' is set to 'Enabled' + - id: 16713 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37778-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + +# 18.9.59.3.3.4 Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled' + - id: 16714 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'" + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.3.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37477-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + +# 18.9.59.3.9.1 (L1) Ensure 'Always prompt for password upon connection' is set to 'Enabled' (Scored) + - id: 16715 + title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'" + description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." + rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Always prompt for password upon connection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was named Always prompt client for password upon connection, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.1"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-37929-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' + +# 18.9.59.3.9.2 (L1) Ensure 'Require secure RPC communication' is set to 'Enabled' (Scored) + - id: 16716 + title: "Ensure 'Require secure RPC communication' is set to 'Enabled'" + description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests. The recommended state for this setting is: Enabled." + rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require secure RPC communication Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.2"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-37567-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' + +# 18.9.59.3.9.3 (L1) Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL' (Scored) + - id: 16717 + title: "Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL'" + description: "This policy setting specifies whether to require the use of a specific security layer to secure communications between clients and RD Session Host servers during Remote Desktop Protocol (RDP) connections. The recommended state for this setting is: Enabled: SSL. Note: In spite of this setting being labeled SSL, it is actually enforcing Transport Layer Security (TLS) version 1.0, not the older (and less secure) SSL protocol." + rationale: "The native Remote Desktop Protocol (RDP) encryption is now considered a weak protocol, so enforcing the use of stronger Transport Layer Security (TLS) encryption for all RDP communications between clients and RD Session Host servers is preferred." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require use of specific security layer for remote (RDP) connections. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.5.3"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-CCE-36598-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer -> 2' + +# 18.9.59.3.9.4 (L1) Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled' (Scored) + - id: 16718 + title: "Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled'" + description: "This policy setting allows you to specify whether to require user authentication for remote connections to the RD Session Host server by using Network Level Authentication. The recommended state for this setting is: Enabled." + rationale: "Requiring that user authentication occur earlier in the remote connection process enhances security." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.4"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-36598-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication -> 1' + +# 18.9.59.3.9.5 (L1) Ensure 'Set client connection encryption level' is set to 'Enabled: High Level' (Scored) + - id: 16719 + title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'" + description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." + rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.5"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-36627-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' + +# 18.9.59.3.10.1 Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less' + - id: 16720 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'" + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.59.3.10.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - 'CCE-37562-6' + - https://workbench.cisecurity.org/benchmarks/766 + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare != 0' + +# 18.9.59.3.10.2 Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute' + - id: 16721 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'" + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.10.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - 'CCE-37949-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + +# 18.9.59.3.11.1 (L1) Ensure 'Do not delete temp folders upon exit' is set to 'Disabled' (Scored) + - id: 16722 + title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'" + description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff. The recommended state for this setting is: Disabled." + rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not delete temp folders upon exit Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Do not delete temp folder upon exit, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.59.3.11.1"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-37946-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' + +# 18.9.59.3.11.2 (L1) Ensure 'Do not use temporary folders per session' is set to 'Disabled' (Scored) + - id: 16723 + title: "Ensure 'Do not use temporary folders per session' is set to 'Disabled'" + description: "By default, Remote Desktop Services creates a separate temporary folder on the RD Session Host server for each active session that a user maintains on the RD Session Host server. The temporary folder is created on the RD Session Host server in a Temp folder under the user's profile folder and is named with the sessionid. This temporary folder is used to store individual temporary files. To reclaim disk space, the temporary folder is deleted when the user logs off from a session. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting keeps the cached data independent for each session, both reducing the chance of problems from shared cached data between sessions, and keeping possibly sensitive data separate to each user session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not use temporary folders per session Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.11.2"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-38180-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> 1' + +# 18.9.60.1 Ensure 'Prevent downloading of enclosures' is set to 'Enabled' + - id: 16724 + title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'" + description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer. The recommended state for this setting is: Enabled." + rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\RSS Feeds\\Prevent downloading of enclosures Note: This Group Policy path is provided by the Group Policy template InetRes.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Turn off downloading of enclosures, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.60.1"] + - cis_csc: ["7.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-37126-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' + +# 18.9.61.2 (L2) Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search' (Scored) + - id: 16725 + title: "Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'" + description: "This policy setting allows search and Cortana to search cloud sources like OneDrive and SharePoint. The recommended state for this setting is: Enabled: Disable Cloud Search ." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Cloud Search : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cloud Search Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.61.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch -> 0' + +# 18.9.61.3 Ensure 'Allow indexing of encrypted files' is set to 'Disabled' + - id: 16726 + title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'" + description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files. The recommended state for this setting is: Disabled." + rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow indexing of encrypted files Note: This Group Policy path is provided by the Group Policy template Search.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.61.3"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-38277-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' + +# 18.9.66.1 Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled' + - id: 16727 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'" + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.66.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + + +# 18.9.77.3.1 (L1) Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled' (Scored) + - id: 16728 + title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'" + description: "This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to \"Windows Defender Antivirus Cloud Protection Service\". This setting can only be set by Group Policy. The recommended state for this setting is: Disabled ." + rationale: "The decision on whether or not to participate in Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.3.1"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36940-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' + +# 18.9.77.3.2 Ensure 'Join Microsoft MAPS' is set to 'Disabled' + - id: 16729 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'" + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to 'Windows Defender Antivirus Cloud Protection Service'. Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Join Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.3.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + +# 18.9.77.7.1 (L1) Ensure 'Turn on behavior monitoring' is set to 'Enabled' (Scored) + - id: 16730 + title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'" + description: "This policy setting allows you to configure behavior monitoring for Windows Defender Antivirus. The recommended state for this setting is: Enabled ." + rationale: "When running an antivirus solution such as Windows Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.7.1"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + references: + - 'CCE-38389-3' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection -> DisableBehaviorMonitoring -> 0' + +# Section - 18.9.77.9 - Reporting + - id: 16731 + title: "Ensure 'Configure Watson events' is set to 'Disabled'" + description: "This policy setting allows you to configure whether or not Watson events are sent." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Reporting\\Configure Watson events." + compliance: + - cis: ["18.9.77.9.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-36950-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' + + +# 18.9.77.10.1 (L1) Ensure 'Scan removable drives' is set to 'Enabled' (Scored) + - id: 16732 + title: "Ensure 'Scan removable drives' is set to 'Enabled'" + description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan. The recommended state for this setting is: Enabled ." + rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Scan removable drives Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.10.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-38409-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' + +# 18.9.77.10.2 (L1) Ensure 'Turn on e-mail scanning' is set to 'Enabled' (Scored) + - id: 16733 + title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'" + description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac). The recommended state for this setting is: Enabled ." + rationale: "Incoming e-mails should be scanned by an antivirus solution such as Windows Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Turn on e-mail scanning Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.10.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - 'CCE-36958-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' + + +# 18.9.77.13.3.1 (L1) Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block' (Scored) + - id: 16734 + title: "Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'" + description: "This policy setting controls Windows Defender Exploit Guard network protection. The recommended state for this setting is: Enabled: Block ." + rationale: "This setting can help prevent employees from using any application to access dangerous domains that may host phishing scams, exploit-hosting sites, and other malicious content on the Internet." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Windows Defender Exploit Guard\\Network Protection\\Prevent users and apps from accessing dangerous websites Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.13.3.1"] + - cis_csc: ["7"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection -> 1' + +# 18.9.77.14 (L1) Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block' (Scored) + - id: 16735 + title: "Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block'" + description: "This policy setting controls detection and action for Potentially Unwanted Applications (PUA), which are sneaky unwanted application bundlers or their bundled applications, that can deliver adware or malware. The recommended state for this setting is: Enabled: Block . For more information, see this link: Block potentially unwanted applications with Windows Defender Antivirus | Microsoft Docs" + rationale: "Potentially unwanted applications can increase the risk of your network being infected with malware, cause malware infections to be harder to identify, and can waste IT resources in cleaning up the applications. They should be blocked from installation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Configure detection for potentially unwanted applications Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.14"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection -> 1' + +# 18.9.77.15 (L1) Ensure 'Turn off Windows Defender AntiVirus' is set to 'Disabled' (Scored) + - id: 16736 + title: "Ensure 'Turn off Windows Defender AntiVirus' is set to 'Disabled'" + description: "This policy setting turns off Windows Defender Antivirus. If the setting is configured to Disabled, Windows Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software. The recommended state for this setting is: Disabled ." + rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Windows Defender Antivirus. Organizations that choose to purchase a reputable 3rd-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Turn off Windows Defender AntiVirus Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn off Windows Defender, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.77.15"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + - tsc: ["CC6.8"] + references: + - 'CCE-36082-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware -> 0' + +# 18.9.80.1.1 Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass' + - id: 16737 + title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'" + description: "This policy setting allows you to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled. The recommended state for this setting is: Enabled: Warn and prevent bypass." + rationale: "Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Warn and prevent bypass: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Explorer\\Configure Windows Defender SmartScreen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsExplorer.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Configure Windows SmartScreen, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.80.1.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - 'CCE-35859-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel -> Block' + +# 18.9.84.1 (L2) Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled' (Scored) + - id: 16738 + title: "Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'" + description: "This policy setting determines whether suggested apps in Windows Ink Workspace are allowed. The recommended state for this setting is: Disabled ." + rationale: "This Microsoft feature is designed to collect data and suggest apps based on that data collected. Disabling this setting will help ensure your data is not shared with any third party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow suggested apps in Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.84.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace -> 0' + +# 18.9.84.2 (L1) Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Disabled' but not 'Enabled: On' (Scored) + - id: 16739 + title: "Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Disabled' but not 'Enabled: On'" + description: "This policy setting determines whether Windows Ink items are allowed above the lock screen. The recommended state for this setting is: Enabled: On, but disallow access above lock OR Disabled ." + rationale: "Allowing any apps to be accessed while system is locked is not recommended. If this feature is permitted, it should only be accessible once a user authenticates with the proper credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: On, but disallow access above lock OR Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.84.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> 1' + +# 18.9.85.1 Ensure 'Allow user control over installs' is set to 'Disabled' + - id: 16740 + title: "Ensure 'Allow user control over installs' is set to 'Disabled'" + description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Allow user control over installs Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Enable user control over installs, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.85.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36400-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' + +# 18.9.85.2 Ensure 'Always install with elevated privileges' is set to 'Disabled' + - id: 16741 + title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'" + description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." + rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Always install with elevated privileges Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.85.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - 'CCE-36919-9' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' + +# 18.9.85.3 Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled' + - id: 16742 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'" + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.85.3"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - 'CCE-37524-6' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + +# 18.9.86.1 Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled' + - id: 16743 + title: "Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled'" + description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system. The recommended state for this setting is: Disabled." + rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Logon Options\\Sign-in last interactive user automatically after a system-initiated restart Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinLogon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.86.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - 'CCE-36977-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' + +# 18.9.95.1 Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled' + - id: 16744 + title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'" + description: "This policy setting enables logging of all PowerShell script input to the Microsoft-Windows- PowerShell/Operational event log. The recommended state for this setting is: Disabled. Note: In Microsoft's own hardening guidance, they recommend the opposite value, Enabled, because having this data logged improves investigations of PowerShell attack incidents. However, the default ACL on the PowerShell Operational log allows Interactive User (i.e. any logged on user) to read it, and therefore possibly expose passwords or other sensitive information to unauthorized users. If Microsoft locks down the default ACL on that log in the future (e.g. to restrict it only to Administrators), then we will revisit this recommendation in a future release." + rationale: "There are potential risks of capturing passwords in the PowerShell logs. This setting should only be needed for debugging purposes, and not in normal operation, it is important to ensure this is set to Disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Script Block Logging Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.95.1"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 0' + +# 18.9.95.2 Ensure 'Turn on PowerShell Transcription' is set to 'Disabled' + - id: 16745 + title: "Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'" + description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts. The recommended state for this setting is: Disabled." + rationale: "If this setting is enabled there is a risk that passwords could get stored in plain text in the PowerShell_transcript output file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Transcription Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.95.2"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 0' + +# 18.9.97.1.1 Ensure 'Allow Basic authentication' is set to 'Disabled' + - id: 16746 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.1.1"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36310-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' + +# 18.9.97.1.2 Ensure 'Allow unencrypted traffic' is set to 'Disabled' + - id: 16747 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.1.2"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37726-7' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' + +# 18.9.97.1.3 Ensure 'Disallow Digest authentication' is set to 'Enabled' + - id: 16748 + title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication. The recommended state for this setting is: Enabled." + rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Disallow Digest authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.1.3"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-38318-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' + +# 18.9.97.2.1 Ensure 'Allow Basic authentication' is set to 'Disabled' + - id: 16749 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.2.1"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36254-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' + +# 18.9.97.2.2 Ensure 'Allow remote server management through WinRM' is set to 'Disabled' + - id: 16750 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.97.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-37927-1' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + +# 18.9.97.2.3 Ensure 'Allow unencrypted traffic' is set to 'Disabled' + - id: 16751 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.2.3"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-38223-4' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' + +# 18.9.97.2.4 Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled' + - id: 16752 + title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service will allow RunAs credentials to be stored for any plug-ins. The recommended state for this setting is: Enabled. Note: If you enable and then disable this policy setting, any values that were previously configured for RunAsPassword will need to be reset." + rationale: "Although the ability to store RunAs credentials is a convenient feature it increases the risk of account compromise slightly. For example, if you forget to lock your desktop before leaving it unattended for a few minutes another person could access not only the desktop of your computer but also any hosts you manage via WinRM with cached RunAs credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Disallow WinRM from storing RunAs credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.97.2.4"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + references: + - 'CCE-36000-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' + +# 18.9.98.1 Ensure 'Allow Remote Shell Access' is set to 'Disabled' + - id: 16753 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'" + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.98.1"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'CCE-36499-2' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + +# 18.9.99.2.1 (L1) Ensure 'Prevent users from modifying settings' is set to 'Enabled' (Scored) + - id: 16754 + title: "Ensure 'Prevent users from modifying settings' is set to 'Enabled'" + description: "This policy setting prevent users from making changes to the Exploit protection settings area in the Windows Security settings. The recommended state for this setting is: Enabled ." + rationale: "Only authorized IT staff should be able to make changes to the exploit protection settings in order to ensure the organizations specific configuration is not modified." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Security\\App and browser protection\\Prevent users from modifying settings Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefenderSecurityCenter.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.99.2.1"] + - cis_csc: ["8.4"] + - pci_dss: ["12.3.8"] + references: + - 'CCE-36000-8' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride -> 1' + +# 18.9.102.1.1 (L1) Ensure 'Manage preview builds' is set to 'Enabled: Disable preview builds' (Scored) + - id: 16755 + title: "Ensure 'Manage preview builds' is set to 'Enabled: Disable preview builds'" + description: "This policy setting determines whether users can access the Windows Insider Program controls in Settings -> Update and Security. These controls enable users to make their devices available for downloading and installing preview (beta) builds of Windows software. The recommended state for this setting is: Enabled: Disable preview builds ." + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable preview builds : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Manage preview builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.102.1.1"] + - cis_csc: ["3"] + - pci_dss: ["6.4.2"] + - tsc: ["CC6.6","CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuilds -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue -> 0' + +# 18.9.102.1.2 (L1) Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: Semi-Annual Channel, 180 or more days' (Scored) + - id: 16756 + title: "Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: Semi-Annual Channel, 180 or more days'" + description: "This policy setting determines the level of Preview Build or Feature Updates to receive, and when. The Windows readiness level for each new Windows 10 Feature Update is classified in one of 5 categories, depending on your organizations level of comfort with receiving them: Preview Build - Fast: Devices set to this level will be the first to receive new builds of Windows with features not yet available to the general public. Select Fast to participate in identifying and reporting issues to Microsoft, and provide suggestions on new functionality. Preview Build - Slow: Devices set to this level receive new builds of Windows before they are available to the general public, but at a slower cadence than those set to Fast, and with changes and fixes identified in earlier builds. Release Preview: Receive builds of Windows just before Microsoft releases them to the general public. Semi-Annual Channel (Targeted): Receive feature updates when they are released to the general public. Semi-Annual Channel: Feature updates will arrive when they are declared Semi-Annual Channel. This usually occurs about 4 months after Semi-Annual Channel (Targeted), indicating that Microsoft, Independent Software Vendors (ISVs), partners and customer believe that the release is ready for broad deployment. The recommended state for this setting is: Enabled: Semi-Annual Channel, 180 or more days . Note: If the \"Allow Telemetry\" policy is set to 0, this policy will have no effect. Note #2: Starting with Windows Server 2016 RTM (Release 1607), Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. Note #3: Prior to Windows Server 2016 R1709, values above 180 days are not recognized by the OS. Starting with Windows Server 2016 R1709, the maximum number of days you can defer is 365 days." + rationale: "Forcing new features without prior testing in your environment could cause software incompatibilities as well as introducing new bugs into the operating system. In an enterprise managed environment, it is generally preferred to delay Feature Updates until thorough testing and a deployment plan is in place. This recommendation delays the automatic installation of new features as long as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Semi-Annual Channel, 180 or more days : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Select when Preview Builds and Feature Updates are received Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Select when Feature Updates are received, but it was renamed to Select when Preview Builds and Feature Updates are received starting with the Windows 10 Release 1709 Administrative Templates." + compliance: + - cis: ["18.9.102.1.2"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1","CC6.7","CC7.2"] + references: + - 'https://blogs.technet.microsoft.com/wsus/2017/05/05/demystifying-dual-scan/' + - 'https://blogs.technet.microsoft.com/wsus/2017/08/04/improving-dual-scan-on-1607/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays -> n:^(\d+) compare >= 180' + +# 18.9.102.1.3 (L1) Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days' (Scored) + - id: 16757 + title: "Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'" + description: "This settings controls when Quality Updates are received. The recommended state for this setting is: Enabled: 0 days . Note: If the \"Allow Telemetry\" policy is set to 0, this policy will have no effect. Note #2: Starting with Windows Server 2016 RTM (Release 1607), Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering" + rationale: "Quality Updates can contain important bug fixes and/or security patches, and should be installed as soon as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled:0 days : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Select when Quality Updates are received Note: This Group Policy path does not exist by default. An updated Group Policy template ( WindowsUpdate.admx/adml ) is required - it is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.102.1.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'https://blogs.technet.microsoft.com/wsus/2017/05/05/demystifying-dual-scan/' + - 'https://blogs.technet.microsoft.com/wsus/2017/08/04/improving-dual-scan-on-1607/' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdatesPeriodInDays -> 0' + + +# 18.9.102.2 Ensure 'Configure Automatic Updates' is set to 'Enabled' + - id: 16758 + title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'" + description: "This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: 2 - Notify for download and auto install (Notify before downloading any updates) 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting 'Configure automatic updating:' has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a 3rd-party solution for patching may choose to exempt themselves from this setting, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the 3rd-party patching process." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Configure Automatic Updates Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.2"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'CCE-36172-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' + +# 18.9.102.3 Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day' + - id: 16759 + title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'" + description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS. The recommended state for this setting is: 0 - Every day. Note: This setting is only applicable if 4 - Auto download and schedule the install is selected in Rule 18.9.102.2. It will have no impact if any other option is selected." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to 0 - Every day: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Configure Automatic Updates: Scheduled install day Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'CCE-36172-5' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' + + +# 18.9.102.4 Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled' + - id: 16760 + title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'" + description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." + rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\No auto-restart with logged on users for scheduled automatic updates installations Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named No auto-restart for scheduled Automatic Updates installations, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.102.4"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2","SA.11","SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2","CC6.8"] + references: + - 'CCE-37027-0' + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> 0' diff --git a/sca/windows/sca_win_audit.yml b/sca/windows/sca_win_audit.yml index 133af4a55..507e47de7 100644 --- a/sca/windows/sca_win_audit.yml +++ b/sca/windows/sca_win_audit.yml @@ -22,7 +22,7 @@ requirements: - 'r:HKEY_LOCAL_MACHINE\SAM\SAM' checks: - - id: 14000 + - id: 14500 title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'" description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domainbased password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." @@ -33,7 +33,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' - - id: 14001 + - id: 14501 title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'" description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. The recommended state for this setting is: Disabled." rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." @@ -44,7 +44,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' - - id: 14002 + - id: 14502 title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'" description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators." rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." @@ -55,7 +55,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 0' - - id: 14003 + - id: 14503 title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'" description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, in a high security environment, you should allow only Administrators, not users, to do this, because printer driver installation may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." @@ -66,7 +66,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' - - id: 14004 + - id: 14504 title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'" description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -77,7 +77,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' - - id: 14005 + - id: 14505 title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'" description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -87,7 +87,7 @@ checks: condition: all rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' - - id: 14006 + - id: 14506 title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'" description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." @@ -98,7 +98,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' - - id: 14007 + - id: 14507 title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'" description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled." rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." @@ -109,7 +109,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' - - id: 14008 + - id: 14508 title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'" description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)" @@ -120,7 +120,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' - - id: 14009 + - id: 14509 title: "Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'" description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." @@ -131,7 +131,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' - - id: 14010 + - id: 14510 title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'" description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." @@ -142,7 +142,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' - - id: 14011 + - id: 14511 title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'" description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." rationale: "It is recommended that user passwords be configured to expire periodically. Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." @@ -153,7 +153,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' - - id: 14012 + - id: 14512 title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher" description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." @@ -164,7 +164,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$|^3$' - - id: 14013 + - id: 14513 title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'" description: "This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the 'Microsoft network client and server: Digitally sign communications (four related settings)' section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -175,7 +175,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' - - id: 14014 + - id: 14514 title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'" description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -186,7 +186,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' - - id: 14015 + - id: 14515 title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'" description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." @@ -197,7 +197,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' - - id: 14016 + - id: 14516 title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0'" description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. A value of 0 appears to allow sessions to persist indefinitely. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s), but not 0." rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." @@ -208,7 +208,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' - - id: 14017 + - id: 14517 title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'" description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -219,7 +219,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' - - id: 14018 + - id: 14518 title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'" description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." @@ -230,7 +230,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' - - id: 14019 + - id: 14519 title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'" description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" @@ -241,7 +241,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' - - id: 14020 + - id: 14520 title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'" description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." @@ -252,7 +252,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' - - id: 14021 + - id: 14521 title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'" description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." @@ -263,7 +263,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' - - id: 14022 + - id: 14522 title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'" description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." @@ -274,7 +274,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' - - id: 14023 + - id: 14523 title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'" description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)." rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." @@ -285,7 +285,7 @@ checks: rules: - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\.' - - id: 14024 + - id: 14524 title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'" description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)." rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." @@ -296,7 +296,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' - - id: 14025 + - id: 14525 title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'" description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." @@ -307,7 +307,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' - - id: 14026 + - id: 14526 title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'" description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: -Join a domain -Authenticate between Active Directory forests -Authenticate to down-level domains -Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP -Authenticate to computers that are not in the domain. The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non- R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." @@ -318,7 +318,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' - - id: 14027 + - id: 14527 title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher" description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." @@ -329,7 +329,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:^(\d+) compare >= 1' - - id: 14028 + - id: 14528 title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security." rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." @@ -340,7 +340,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' - - id: 14029 + - id: 14529 title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security." rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." @@ -353,7 +353,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' - - id: 14030 + - id: 14530 title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'" description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." @@ -362,7 +362,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' - - id: 14031 + - id: 14531 title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'" description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." @@ -373,7 +373,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' - - id: 14032 + - id: 14532 title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -384,7 +384,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' - - id: 14033 + - id: 14533 title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On'" description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." @@ -395,7 +395,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' - - id: 14034 + - id: 14534 title: "Ensure Registry tools set is enabled" compliance: - pci_dss: ["10.6.1"] @@ -406,7 +406,7 @@ checks: rules: - 'r:HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableRegistryTools -> 0' - - id: 14035 + - id: 14535 title: "Ensure DCOM is enabled" description: "The Distributed Component Object Model (DCOM) is a protocol that enables software components to communicate directly over a network." compliance: @@ -420,7 +420,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\OLE -> EnableDCOM -> Y' - - id: 14036 + - id: 14536 title: "Ensure LM authentication is not allowed (disable weak passwords)" compliance: - pci_dss: ["10.6.1", "11.4"] @@ -433,7 +433,7 @@ checks: # Disabled by some Malwares (sometimes by McAfee and Symantec # security center too). - - id: 14037 + - id: 14537 title: "Ensure Firewall/Anti Virus notifications are enabled" compliance: - pci_dss: ["10.6.1"] @@ -448,7 +448,7 @@ checks: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center -> firewalldisableoverride -> 0' # Checking for the microsoft firewall. - - id: 14038 + - id: 14538 title: "Ensure Microsoft Firewall is enabled" compliance: - pci_dss: ["10.6.1", "1.4"] @@ -459,7 +459,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\software\policies\microsoft\windowsfirewall\domainprofile -> enablefirewall -> 1' - - id: 14039 + - id: 14539 title: "Ensure Null sessions are not allowed" compliance: - pci_dss: ["11.4"] @@ -469,7 +469,7 @@ checks: rules: - 'r:HKLM\System\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' - - id: 14040 + - id: 14540 title: "Ensure Turn off Windows Error reporting is enabled" compliance: - pci_dss: ["10.6.1"] @@ -483,7 +483,7 @@ checks: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PCHealth\ErrorReporting -> DoReport -> 0' - - id: 14041 + - id: 14541 title: "Ensure Automatic Logon is disabled" compliance: - pci_dss: ["10.6.1"] @@ -495,7 +495,7 @@ checks: - 'not r:HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> DefaultPassword' - 'r:HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' - - id: 14042 + - id: 14542 title: "Ensure Winpcap packet filter driver is not present" compliance: - pci_dss: ["10.6.1"] @@ -507,7 +507,7 @@ checks: - 'f:%WINDIR%\System32\drivers\npf.sys' - 'f:%WINDIR%\Sysnative\drivers\npf.sys' - - id: 14043 + - id: 14543 title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'" description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. The recommended state for this setting is: Disabled." rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." @@ -521,7 +521,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' - - id: 14044 + - id: 14544 title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." @@ -534,7 +534,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' - - id: 14045 + - id: 14545 title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." @@ -547,7 +547,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' - - id: 14046 + - id: 14546 title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'" description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: -Search folders specified in the system path first, and then search the current working folder. -Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled." rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." @@ -560,7 +560,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' - - id: 14047 + - id: 14547 title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'" description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." @@ -573,7 +573,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' - - id: 14048 + - id: 14548 title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'" description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." @@ -586,7 +586,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' - - id: 14049 + - id: 14549 title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'" description: "The 'Do not apply during periodic background processing' option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked)." rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." @@ -597,7 +597,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' - - id: 14050 + - id: 14550 title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'" description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." rationale: "Users might download drivers that include malicious code." @@ -608,7 +608,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' - - id: 14051 + - id: 14551 title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'" description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." @@ -619,7 +619,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' - - id: 14052 + - id: 14552 title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'" description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled." rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." @@ -630,7 +630,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' - - id: 14053 + - id: 14553 title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'" description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled" rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." @@ -641,7 +641,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' - - id: 14054 + - id: 14554 title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'" description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." @@ -652,7 +652,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' - - id: 14055 + - id: 14555 title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'" description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." @@ -663,7 +663,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' - - id: 14056 + - id: 14556 title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'" description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." @@ -674,7 +674,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' - - id: 14057 + - id: 14557 title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'" description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." @@ -685,7 +685,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' - - id: 14058 + - id: 14558 title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'" description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." @@ -696,7 +696,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' - - id: 14059 + - id: 14559 title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'" description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." @@ -707,7 +707,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' - - id: 14060 + - id: 14560 title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'" description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." @@ -717,7 +717,7 @@ checks: condition: all rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' - - id: 14061 + - id: 14561 title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'" description: "This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: 2) - Notify for download and auto install (Notify before downloading any updates) 3) - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) 4) - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) 5) - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting 'Configure automatic updating:' has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a 3rd-party solution for patching may choose to exempt themselves from this setting, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the 3rd-party patching process." rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." @@ -728,7 +728,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' - - id: 14062 + - id: 14562 title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'" description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." @@ -739,7 +739,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> 0' - - id: 14063 + - id: 14563 title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." @@ -752,7 +752,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' - - id: 14064 + - id: 14564 title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." @@ -765,7 +765,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' - - id: 14065 + - id: 14565 title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." @@ -776,7 +776,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' - - id: 14066 + - id: 14566 title: "Ensure 'Turn off the \"Publish to Web\" task for files and folders' is set to 'Enabled'" description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." @@ -787,7 +787,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' - - id: 14067 + - id: 14567 title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." @@ -798,7 +798,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' - - id: 14068 + - id: 14568 title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." @@ -809,7 +809,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' - - id: 14069 + - id: 14569 title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'" description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers." rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." @@ -820,7 +820,7 @@ checks: rules: - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' - - id: 14070 + - id: 14570 title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'" description: "This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers. This policy setting impacts all RPC applications. In a domain environment this policy setting should be used with caution as it can impact a wide range of functionality including group policy processing itself. Reverting a change to this policy setting can require manual intervention on each affected machine. This policy setting should never be applied to a Domain Controller. A client will be considered an authenticated client if it uses a named pipe to communicate with the server or if it uses RPC Security. RPC Interfaces that have specifically requested to be accessible by unauthenticated clients may be exempt from this restriction, depending on the selected value for this policy setting. -- None allows all RPC clients to connect to RPC Servers running on the machine on which the policy setting is applied. -- Authenticated allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. Exemptions are granted to interfaces that have requested them. -- Authenticated without exceptions allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. No exceptions are allowed. This value has the potential to cause serious problems and is not recommended.'" rationale: "Unauthenticated RPC communication can create a security vulnerability."