177629 matches found
Ensure That the PATH User Variable Is Strictly Defined
In Linux, the PATH variable defines the path for searching for executable files in the user context of the current user. For example, if a user runs the ls command in any directory, the system searches for the ls command in the directories specified by PATH and executes the command. The PATH...
Do Not Allow Empty Links
Empty links are redundant files and waste system resources. In addition, if a file is installed or created at the target location of an empty link, the file can be accessed through the link, leading to possible information leakage or tampering. If the file to which the link points has been delete...
Ensure That the su Command Is Restricted
The su command enables a common user to have the permissions of the superuser or other users. It is often used for switching the user from a common user to the root user. The su command provides a convenient way for users to change their identities. However, if the su command is run without...
Configure the Remote Log Server
rsyslog can send local logs to a remote log server for unified storage. This facilitates centralized log management, prevents local logs from occupying too much drive space and being tampered with. If remote log storage is not configured, rsyslog logs are stored in local files. As far as the...
Do Not Install Insecure SNMP Versions
Simple Network Management Protocol SNMP is a standard protocol designed to manage network nodes in IP networks. This protocol allows the exchange of network management and control data between network elements NEs. If SNMP is installed in scenarios where SNMP is not required, additional system...
Configure Proper Policies for INPUT of iptables
The INPUT chain is used to filter packets received from external systems. For any service provided for external systems, configure the corresponding INPUT policy and enable the related port so that external clients can access the service through the port. If the policy is not set, all packets tha...
Enable Reverse Path Filtering
Setting net.ipv4.conf.all.rpfilter and net.ipv4.conf.default.rpfilter to 1 forces the Linux kernel to perform reverse path filtering on a received packet and check the validity of its source address. If the Linux kernel queries the routing table in which the source address is included and finds...
Do Not Enable Login Capabilities for Users Who Are Not Meant for Direct Login
Typically, a Linux system has multiple users, not all of which are used for login. For instance, some users are automatically created during the installation of software packages like systemd and dhcp. These users serve specific purposes, such as running related software services. It is essential...
Ensure That Partitions That Do Not Require SUID/SGID Bits Are Mounted Using nosuid
After the SUID bit is set for an executable file, the user who executes the file not the file owner is temporarily granted the permission of the file owner. For example, common user test executes a program whose permission is 755 and owner is root. In this case, if the SUID bit is not set,only th...
Bind Network Interfaces to the Correct Zones
Different filtering policies can be configured for different firewall zones. If the server network is complex and has multiple interfaces that provide different service functions, it is recommended that interfaces be configured in different zones and different firewall policies be configured. For...
Disable the Function of Forwarding ICMP Redirect Messages
ICMP redirects can be used to send routing information to other hosts. As a host itself does not act as a router, it is unnecessary for the host to forward ICMP redirect messages. Attackers can exploit the compromised host to send invalid ICMP redirect messages to other routers, attempting to...
Configure the Default Policies of nftables to DROP Properly
For security purposes, the nftables base chains INPUT, OUTPUT, and FORWARD are similar to those of iptables. You need to configure the DROP policy for all packets, and then add the ACCEPT policy to the base chains to open related services and ports. If the base chains are not configured or the ho...
Configure Audit Rules for Kernel Module Changes
Generally, for deployed services, the loaded kernel modules do not change. Therefore, changes in loaded kernel modules may indicate attacks. You are advised to audit and monitor kernel module changes for future tracing. By default, audit rules for kernel module changes are not configured in...
Configure the SSH Service Log Level Properly
SSH provides multiple log output levels, such as QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. A higher log level such as QUIET or FATAL prints less log information. This saves drive space but hinders administrators from auditing and tracing SSH events. Conversely, a lowe...
Ensure That GPG Verification Is Configured for the Yum Repositories
Software packages may be tampered with by attackers during network transmission or local storage. If the integrity verification is not performed on the software packages, software tampered with by attackers may be installed. As a result, the server or even the entire network cluster is attacked. ...
Disable PermitUserEnvironment
PermitUserEnvironment allows users to set SSH environment variables, which may be exploited by attackers to launch attacks. If PermitUserEnvironment is set to yes, attackers can modify SSH environment variables to evade the security mechanism or execute attack code. This configuration must be...
Do Not Enable the Avahi Service
Avahi is a zero-configuration networking implementation, including a system for multicast DNS/DNS-SD service discovery and automatic broadcast. For example, you can connect a server to the network and use Avahi to automatically broadcast network services running on the server for other user to...
Configure the Core Dump Properly
A core dump records the memory status when a program stops abnormally or breaks down. It helps locate faults but may contain sensitive information in the process memory. In some cases, the core dump function needs to be enabled to record problem causes. When enabling the core dump function,...
Configure a Proper SSH Service Authentication Mode
A proper authentication mode helps ensure user and system data security. Typically, the user/password authentication mode is suitable for human-machine users. In non-interactive login scenarios, the public and private keys are suitable for authentication. In high-risk scenarios, only the public a...
Do Not Enable the rsync Service
The rsync service can synchronize data between servers or between local drive partitions. However, information leakage risks exist because rsync uses non-encrypted transmission protocols. If the rsync service is enabled and data is transmitted between servers over the network, attackers can...
Do Not Enable the Samba Service
The daemon of Samba allows the system administrator to configure the Linux system to share file systems and directories with Windows systems. Samba publishes file systems and directories through the Server Message Block SMB protocol. Windows users will be able to mount these directories and file...
Restrict the Number of Historical Command Records
HISTSIZE is an environment variable used to control the size of the command history. Specifically, HISTSIZE defines the number of command entries that can be stored in the command history. By setting the value of HISTSIZE, you can limit or increase the size of the command history, thus controllin...
Ensure That a User Is Locked After a Specified Number of Login Failures
If a user fails to log in to the system for a specified number of consecutive times, the system locks the user. That is, the user is not allowed to log in to the system for a specified period of time to prevent malicious system password cracking. During the lockout period, any input is considered...
Ensure That All Groups Exist in /etc/passwd
All user groups in /etc/passwd must exist in the /etc/group file. If the administrator manually modifies the two files, the user groups may be incorrectly set due to human errors. If a user group in /etc/passwd does not exist in /etc/group, risks of user group permission management may occur...
Do Not Enable the RPC Service
The rpcbind service maps remote procedure call RPC services to the ports on which they listen. RPC processes notify rpcbind when they start and register the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server using a...
Discard Forged ICMP Packets and Do Not Record Logs
Setting icmpignoreboguserrorresponses to 1 prevents the kernel from recording responses to duplicate broadcast packets, which prevents useless log information from filling in the file system. Some attackers send ICMP packets that violate RFC-1122 and attempt to fill the log file system with a lar...
Configure the Kernel Parameter ptrace_scope Properly
ptrace is a system call used for process tracing. It provides the capability for a parent process to observe and control child processes. Linux Kernel 3.4 and later versions support completely restricting or disabling the ptrace function. According to the Linux Kernel Yama Documentation, the...
Disable the Source Packet Routing
In a network, source routing allows the sender to specify some or all routes for data packets to pass through the network. In regular routing, routers in the network determine the path based on the destination of the data packets. If a large number of packets are tampered with and pass through th...
Do Not Enable the DNS Service
The Domain Name System DNS is a hierarchical naming system that maps names to IP addresses of computers, services, and other network resources. Unless a system is the designated DNS server, you are advised to disable its DNS service to reduce the attack surface. SPDX-FileCopyrightText: 2025...
Enable Kernel ASLR
Address-space layout randomization ASLR randomly arranges the positions of the stack, function libraries, and programs to slightly different positions each time. As a result, the correct positions cannot be guessed, and buffer overflow attacks fail. In the Linux kernel, ASLR is classified into...
Configure the chronyd Service Properly
If the time server is incorrectly configured, the time of the local server may be inconsistent with that of other servers or the standard time. If time is incorrect, services that strongly depend on time synchronization, such as market transactions, may be interrupted, and attackers may exploit t...
Ensure That the Password Protection Is Configured for GRUB
GRUB is the default bootloader of Linux. The bootloader can set the startup mode of the system. By setting the GRUB password, you can prevent attackers from modifying the GRUB setting to enter the single-user mode. If the GRUB password is not set, attackers can easily access the GRUB editing menu...
Disable tcp_timestamps
tcptimestamps is used to record the time when TCP data packets are sent. It can be used for RTT measurement RTTM and protection against wrapped sequence number PAWS. It is a bidirectional option and takes effect only when it is enabled on both the client and server. If this option is enabled, the...
Do Not Install the NIS Client
Network Information Service NIS works in client-server mode. NIS clients running the ypbind daemon obtain information from a server. NIS is inherently insecure and is vulnerable to DoS and buffer overflow attacks. Therefore, do not install the NIS client in the service scenario where NIS is not...
Do Not Configure Deprecated Options for the SSH Service
Currently, the SSH service communication protocols are classified into the first generation and the second generation. The configuration options of the SSH service of different versions are incompatible. In addition, the configuration options of some earlier versions are deprecated in the new...
Configure Proper SSH Key Exchange Algorithms
Key exchange is a process in which two parties exchange keys to allow the use of an encryption algorithm. A secure key exchange algorithm enables them to securely exchange keys, thereby using encryption algorithms to encrypt messages to be sent and decrypt received messages. Set the SSH key...
Ensure That the Password Validity Is Set Correctly
If a password is not changed for a long time, the password is vulnerable to brute force cracking, which compromises system security. If the password validity period is set too short, the password needs to be changed frequently, increasing management costs. In addition, users may fail to log in...
Enable TCP-SYN Cookie Protection
TCP-SYN cookie protection mitigates the impact of SYN flood attacks on the system. When an attacker launches a SYN flood attack, the half-open connection queue in the kernel is quickly exhausted to block valid connections. If SYN cookie is enabled, the system can still accept valid connections ev...
Avoid the .netrc File in the Home Directory
The .netrc file stores the passwords for logging in to the remote FTP server. If there are no FTP-related scenarios, you are advised to delete the .netrc file. Passwords stored in the .netrc file are in plaintext and can be easily stolen by attackers. As a result, sensitive data on the FTP server...
Ensure That the Group Names Are Unique
The user group names in /etc/group must be unique. If user group names in /etc/group are duplicate, only the GID of the first user group in /etc/group is valid. If the administrator runs commands such as useradd or groupadd to add users or user groups, duplicate user group names typically do not...
Do Not Use Historical Passwords
Using the same historical password frequently may cause password leakage and attacks. To ensure user security, the function of disabling historical passwords must be configured. The number of historical passwords that cannot be used must be properly set based on the actual service scenario. The...
Do Not Allow Hidden Executable Files
In Linux, the name of a hidden file starts with a dot .. Hidden executable files are not allowed in the system. Note that . and . are not hidden files. They refer to the current directory and upper-level directory, respectively. The .bashrc, .bashprofile, and .bashlogout files are script files us...
Ensure That the Number of Files That Can Be Opened by Users Is Correctly Configured
The number of files that can be opened in Linux is limited. Once the limit is reached by a user, other users can no longer open files. By default, openEuler limits the maximum number of file handles that can be opened by each user to 1024. If the value exceeds 1024, new file handles cannot be...
Configure a Proper Value for LoginGraceTime
LoginGraceTime is used to limit the login time of a user. If a user does not complete the login within the time specified by LoginGraceTime, the connection is automatically disconnected. You are advised to set this field to a value less than or equal to 60, in seconds. If this field is set to a...
Ensure That auditd Is Enabled
The auditd component is a user-space component of the Linux audit framework, providing the auditctl, ausearch, and aureport programs to audit and view logs. Audit rules are configured using the auditctl program. When getting started, auditctl reads these rules from /etc/audit/audit.rules. The aud...
Ensure That Removable Device Partitions Are Mounted Using noexec and nodev
The security of removable devices cannot be ensured completely due to a lot of factors, such as the source, usage, and transportation process. In this sense, removable devices are the main host for viruses. Therefore, removable devices must be mounted using noexec and nodev to improve security an...
Disable SysRq
SysRq enables users with physical access to access dangerous system-level commands in a computer. Therefore, it is advised to restrict the usage of the SysRq function. If SysRq is not disabled, you can use the keyboard to trigger SysRq. As a result, commands may be directly sent to the kernel,...
Correctly Configure the Default File Permission For rsyslog
Log files record system behaviors. The rsyslog log tool records logs in specified files. When the specified log file does not exist in the system, rsyslog creates a log file. The permission of the created log file can be configured in the rsyslog configuration file. The configuration of the defau...
Enable the haveged Service
The haveged service can generate an unpredictable stream of random numbers in a simple way. These random numbers can fill the system entropy pool, which can solve the problem of low system entropy in some cases. You are advised to enable this service to meet the needs of encryption, decryption, o...
Avoid Using the root User to Access the System Locally
Users with the root permission can access all Linux resources. If the root user is used to log in to the Linux OS to perform operations, there are many potential security risks. To avoid the risks, do not use the root user to log in to the Linux OS. If necessary, indirectly use the root user...