Dopra Linux OS Security (SingleRAN - 04) PDF
Dopra Linux OS Security (SingleRAN - 04) PDF
Dopra Linux OS Security (SingleRAN - 04) PDF
Issue 04
Date 2012-12-30
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and the
customer. All or part of the products, services and features described in this document may not be within the
purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information,
and recommendations in this document are provided "AS IS" without warranties, guarantees or representations
of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Website: http://www.huawei.com
Email: support@huawei.com
Contents
1 Introduction....................................................................................................................................1
1.1 Scope..............................................................................................................................................................................1
1.2 Intended Audience..........................................................................................................................................................1
1.3 Change History...............................................................................................................................................................1
6 Parameters.....................................................................................................................................28
7 Counters........................................................................................................................................29
8 Glossary.........................................................................................................................................30
9 Reference Documents.................................................................................................................31
1 Introduction
1.1 Scope
This document describes the security features and capabilities of the Dopra Linux operating
system.
NOTE
l Feature change
Changes in features of a specific product version
l Editorial change
Changes in wording or addition of information that was not described in the earlier version
04 (2012-12-30)
This issue includes the following changes.
03 (2012-11-30)
This issue includes the following changes.
02 (2012-09-30)
This issue includes the following changes.
01 (2012-08-16)
This issue includes the following changes.
Draft A (2012-06-20)
This is a draft.
2.1.1 Overview
The Dopra Linux is a Linux-based operating system tailored to provide full security protection
for telecommunications products. As part of an end-to-end security solution, the Dopra Linux
is enhanced in hardware support, software commissioning, and performance to minimize
security risks.
A customized Dopra Linux consists of the kernel and root file system:
l Kernel: The Dopra Linux kernel is customized and has the latest patch installed, which
helps improve system security.
l Root file system: The Dopra Linux is a compact operating system where only useful
database and service components are installed in the file system. This helps minimize
security risks.
Security The kernel, SSH, and Minor The Dopra Linux provides a new
vulnerability Secure File Transfer service protocol version and is
Protocol (SFTP) able to fix security
have known security vulnerabilities by version
vulnerabilities. upgrade or patch installation.
The Dopra Linux is upgraded
every 12 months by default.
Illegal operation The maximum Minor The Dopra Linux locks the login
number of account or IP address when the
unsuccessful login maximum number of
attempts is not unsuccessful login attempts is
specified. exceeded.
NOTE
The Dopra Linux does not require antivirus software because few viruses target at Linux and only few
Dopra Linux ports are open. For details about Dopra Linux antivirus, see "3.4 Enhanced Antivirus
Policy."
System and Security Log Log file management, such as auditing and
Management monitoring
l The root user has the highest operation permission, including read, write, and execute
permission. The read permission allows the root user to view the names and contents of
files under a directory. The write permission allows the root user to create or delete files
as well as modify file contents. The execute permission allows the root user to run shell
scripts or binary executable files. The root user can be granted read, write, and execute
permission to all files and directories.
V200R003C02SPC090, RTOS-V100R001C00SPC070, and later versions no longer allow
the root user to perform remote login. This measure helps enhance system security.
l Common users are created by the root user. They can log in to the Dopra Linux and create,
modify, or delete files under their specific home directories. For example, user jack can
perform relevant operations under the home directory /home/jack. In addition, common
users can run scripts or binary executable files under the /usr/bin and /bin directories.
l Service users are used by system service processes. Service users have the lowest operation
permission and cannot log in to the operating system. They are not created by the root user.
This prevents unauthorized users from attacking the operating system and reduces security
risks. Service user accounts in the Dopra Linux include sshd, nobody, haldaemon,
messagebox, and mysql.
NOTE
Table 3-1 Security policies for user management in the Dopra Linux
User Policy
Management
Password A user password must contain at least eight characters, including at least
complexity one uppercase letter, one lowercase letter, one special character, and
one digit.
Simple passwords (passwords defined in the weak password dictionary)
are not allowed.
NOTE
l You can run the zcat /usr/share/cracklib/cracklib-words.gz command to
view the weak password dictionary.
l For the Dopra Linux,you can run the create-cracklib-dict command to
update the weak password dictionary. For example, run the create-cracklib-
dict dict1.dat command to add words in dict1.dat to the weak password
dictionary.
l For the RTOS, the weak password dictionary cannot be viewed or modified
to prevent it from being disclosed.
The Dopra Linux records the history passwords of only common users.
By default, the Dopra Linux records a maximum of three history
passwords. The new password must be different with the history
passwords or the reverse of history passwords.
Common users can change only their own passwords. The root user can
change all users' passwords.
User Policy
Management
Login message l For the Dopra Linux, the Dopra Linux prints the information about
the previous login after a login, including the login date, time, and
IP address. The information helps users determine whether
unauthorized users have used the account.
l For the RTOS, the information print function is disabled by default
after a successful login. You can enable the information print
function as follows: Run the vi /etc/ssh/sshd_config command to
open the sshd_config file, set PrintLastLog to yes, and run the
killall sshd command to restart the SSHD service.
Login permission By default, a user account is locked for 300 seconds at three consecutive
unsuccessful login attempts. The administrator can unlock the account.
Non-root users will be asked for old passwords when changing their
own passwords (old password is not required for the root user). This
policy strengthens the authentication procedure.
Root user The root user is the only superuser in the system and is authorized to
execute all scripts and executable files.
The password for the root user is customized before Dopra Linux
deployment.
Default user Default users are service users. They cannot log in to the Dopra Linux
and are only for service purposes.
Advance warning The default password validity period is 30 days. To enhance password
before password security, the Dopra Linux prompts users to change their passwords
expiration seven days before the passwords expire.
In versions earlier than V200R003C02SPC090, the default password
validity period is 30 days. In V200R003C02SPC090 and later versions,
the default password validity period is 90 days.
Passwords The Dopra Linux uses MD5 encryption algorithm to encrypt passwords
encryption in V200R003C02SPC080 and later.
userdel r user1 //After user1 is deleted, its home directory /home/user1 is also deleted.
l To change the password for user1, run the following command:
passwd user1 //Only user1 and the root user can change the password for user1.
The password must comply with the password complexity policy in Table 3-1. For example,
Huawei@751.
l To switch to user1, run the following command:
su user1 //The current user is switched to user1.
su - user1 //The current user is switched to user1. The hyphen (-) indicates that the
environment variables are also switched.
It is recommended that you not modify password complexity settings to enhance password security.
You can set the following parameters in the /etc/pam.d/common-password file to modify
password complexity settings:
l retry = N: You have N attempts to change the password each time you run the passwd
command. N is an integer from 1 to 256. The default value is 6.
l lcredit = N: A password contains at least N lower-case letters. N is an integer from 0 to
127. The default value is 1 for the Dopra Linux OS and 0 for the RTOS.
l ucredit = N: A password contains at least N upper-case letters. N is an integer from 0 to
127. The default value is 1 for the Dopra Linux OS and 0 for the RTOS.
l dcredit = N: A password contains at least N digits. N is an integer from 0 to 127. The
default value is 1 for the Dopra Linux OS and 0 for the RTOS.
l ocredit = N: A password contains at least N special characters(~!@#$%^&*()_+`-={}|[]
\:";'<>?,./). N is an integer from 0 to 127. The default value is 1 for the Dopra Linux OS
and 0 for the RTOS.
l minlen = N: A password contains at least N characters. N is an integer from 6 to 127. The
default value is 8.
l enforce_root: A password policy takes effect to the root user. After this parameter is
deleted, the password policy does not take effect to the root user.
l remember = N: N previous passwords are recorded for common users. N is an integer from
0 to 400. The default value is 3 for the Dopra Linux OS and 5 for the RTOS. This rule does
not take effect for the root user to change the passwords for itself and other accounts.
l uname_check: A password cannot be the same as any user name or be any user name in
reverse order. This function is enabled by default.
In versions earlier than V100R001C03SPC030, the password lock and validity period cannot be changed
because the etc/pam.conf file and chage command are not supported in these versions.
You can set the following options in the /etc/pam.d/common-auth file to modify password
locking settings:
l deny=N, which indicates that the login account is locked when the number of unsuccessful
login attempts exceeds N. N is an integer between 1 to 32. The default value is 3.
l unlock_time=N, which indicates that the user account is locked for N seconds when the
maximum number of unsuccessful login attempts is exceeded. N is an integer between 1
to 3600. The default value is 300.
You can run the following commands to view or modify password time settings:
l chage -l user1 //You can view the parameters such as the minimum interval at which a
password must be changed (Minimum), the maximum interval at which a password must
be changed (Maximum), and advance warning before password expires (Warning).
l chage -m N common user //N indicates the minimum interval at which a common user's
password must be changed, which means you can change the password N days later. N is
an integer between 0 to 99999. If N is set to 0, you can change the password anytime. This
option does not apply to the root user.
l chage -M N root/common user //N indicates the maximum interval at which common user's
password must be changed. N is an integer between 1 to 99999.
l chage -W N root/common user //N indicates the advance warning days before a common
user's password expires. N is an integer between 1 to 99999.
The following uses the last line as an example to explain the command output:
l In drwxr-xr-x:
d means directory. Files are not started with d.
rwx indicates that the file or directory creator has read, write, and execute permission.
r-x indicates that users who belong to the same user group as the file or directory creator
have read and execute permission.
The second r-x indicates that users who do not belong to the same user group as the file
or directory creator have read and execute permission.
NOTE
The root user has the highest permission and can operate all files created by other users.
l 10 indicates the number of hard connections to the directory.
l root indicates that the file or directory is created by the root user.
l The second root indicates that the file or directory creator is in the root user group.
l 4096 indicates the directory or file size (excluding files or sub-directories under the
directory).
l Jul 6 22:10 is the time when the file or directory was last modified.
l var is the file or directory name.
l Common users can access the home directory (for example, /home/jack) of other users.
However, they are not authorized to run the ls l command to query other users' information.
l Common users cannot modify or delete commands, library files, and directories storing
device files (/dev) or configuration files (/etc).
l Only the root user is authorized to access system command management directories (/
sbin and /usr/sbin) and log files in /var/log.
NOTE
The read permission to a directory indicates that a user can view the files and sub-directories under the
directory. The write permission indicates that a user can create files and sub-directories under the directory.
The execute permission does not apply to directories.
The read permission to a file indicates that a user can view the contents in the file. The write permission
to a file indicates that a user can edit the contents in the file. The execute permission to a file indicates that
a user can execute the commands in the file.
Users can run the setfacl command to set access permission to a file. For example, in the setfacl
-m u:user1:rw a.dat command, user1 has read and write permission to a.dat.
Table 3-2 describes the default services provided in the Dopra Linux.
You can run the netstat -nlp command to view all listening ports.
Being integrated into the Dopra Linux, iptables does not need to be configured by default.
However, users can define rules in the iptables if required. When defining rules for a live
network, note the following points:
NOTE
The configuration items of TCP/IP stacks are named in the format of "net + protocol + conf + all/default/
device + attribute". Where, device means a logical interface, such as eth1, bond2, and vlan3, default is used
to initialize an interface as it is initialized and loaded, and all means to apply to all interfaces.
net.ipv4.conf.all.arp_ig- 0 for the This parameter defines the modes for sending replies
nore RTOS in response to received ARP requests that resolve
1 for the local target IP addresses.
net.ipv4.conf.default.arp_i
Dopra l 0: Reply to any local target IP address,
gnore
Linux irrespective of its interface.
l 1: Reply only if the target IP address is the local
address configured on the incoming interface.
l 2: Reply only if the target IP address is the local
address configured on the incoming interface,
and both the sender's and receiver's IP addresses
are in the same subnet.
l 3: Reply only resolutions for global and link
addresses, and do not reply to local addresses
configured with scope host.
l 4-7: Reserved.
l 8: Do not reply to local addresses.
StrictModes Yes Forcibly checks file permission and the login user's
permission to the home directory and files.
NOTE
Secure Logins
To log in to a target computer (for example, with an IP address of 192.168.0.241) that provides
SSH services:
Run the ssh root@192.168.0.241 command to log in as the root user, or run the ssh
user1@192.168.0.241 command to log in as user user1.
Secure Copy
To copy data (for example, /home/filename) from a Linux server that provides SSH services
to /home of a target computer (for example, with an IP address of 192.168.0.241):
SFTP Operations
A computer running Dopra Linux can function as a server to provide SFTP services. To connect
to a target computer (for example, with an IP address of 192.168.0.241):
Step 1 Add a common user that can log in to the Dopra Linux remotely. For example:
l Run the useradd m user1 command to add user user1 and create directory /home/user1.
l Run the passwd user1 command to set or change the password (for example,
Tom@520123) for user user1. For details about the password policy, see "3.1.2 Security
Policies for User Management".
Step 2 Modify the configuration file. Log in as the root user, and set PermitRootLogin to no in the /
etc/ssh/sshd_config file.
Step 3 Run the killall sshd command to restart the SSH service. The modification takes effect after the
SSH service restarts.
----End
NOTE
After the sshd process is killed, the SSH service becomes unavailable. Several seconds later, the SSH
service restarts automatically.
To permit remote login of user root, set PermitRootLogin to yes in the /etc/ssh/sshd_config
file, and restart the SSH service.
l acpid
A log file for the daemon of the Advanced Configuration and Power Interface (ACPI),
which notifies the user-space program of advanced configuration and power management
events.
l audit
A log file for the audit daemon, which writes kernel information generated by applications
and system activities into hard disk.
l dlinstall.log/dlrecover.log/dlupgrade.log
Log files recording information about system installation, rollback, and upgrade.
l faillog
A log file recording the number of failed logins due to incorrect user name or password.
This file is encrypted. Running the vi/cat command cannot open this file. You can run
faillog to view this file.
l messages
A log file recording kernel and system information.
You can run vi/cat to view this file.
l warn
A log file recording all warnings and error information.
l wtmp
A log file recording all remote and local logins, changes in system running level, and time
of the changes.
This file is encrypted. You can run last to view this file.
pose security threats such as hacking or viruses. You can install patches to eliminate these system
vulnerabilities.
3.7.2 Upgrade
Currently, the Dopra Linux version and product version are independent. The Dopra Linux
upgrade does not affect applications that have been installed on the source Dopra Linux, when
the hard disk partition settings on the source and destination Dopra Linux versions are the same.
You can upgrade the Dopra Linux using either of the following methods:
l USB upgrade
l Web upgrade
For details about upgrade methods, see Guide to Dopra Linux Operating System Remote Patch
Upgrade delivered with Dopra Linux patches.
NOTE
You must restart the system after an upgrade is complete. If you upgrade the Dopra Linux using the web
mode, you can roll back the Dopra Linux to the source version if the upgrade fails. If you upgrade the
Dopra Linux using the USB mode, you have to reinstall the Dopra Linux if the upgrade fails.
If you upgrade the RTOS or certain Dopra Linux versions using the web mode, the version cannot be rolled
back. In this case, the USB upgrade is recommended. The following versions can be rolled back when they
are upgraded to V200R003C02SPC090 using the web mode.
l V100R001C03 initial versions
l V200R003C02SPC030
l V200R003C02SPC070
l V200R003C02SPC080
The base station operating system patches are packed in the base station product version, and
therefore an separated operating system upgrade is not supported on the base station. However
if any security risks are exposed in RTOS versions, you can run the operating system patches
by way of the product version upgrade because these patches are packed in the latest product
version.
NOTE
If the product version includes RTOS patches, the patch information will be addressed in the Release
Notes of base stations.
The base station operating system is not visible for users because the patches are packed in the
base station software.
l Of all operating system security policies of the base station, only the anti-virus policy is
provided by the operating system. For details, see "3.4 Enhanced Antivirus Policy."
l Other than the antivirus policy, operating system security policies are packed in the base
station software. For details, see the Equipment Security Feature Parameter Description.
V100R001C03SPC010 OMUa/SAUa/OMUb/SAUb
V100R001C03SPC020 OMUa/SAUa/OMUb/SAUb
V100R001C03SPC030 OMUa/SAUa/OMUb/SAUb
V200R003C02SPC030 OMUc/SAUc
V200R003C02SPC060 OMUc/SAUc
V200R003C02SPC070 OMUc/SAUc
RTOS-V100R001C00SPC030 EOMUa/ESAUa
RTOS-V100R001C00SPC05 EOMUa/ESAUa
NOTE
l The Dopra Linux can be upgraded to a destination version that supports the same type of boards as the
source version. For example, any version can be upgraded to V200R003C02SPC080, but
V100R001C03SPC010 cannot be upgraded to V200R003C02SPC070.
l Unless otherwise stated, basic functions of previous versions are inherited in the latest version, although
supported boards vary with versions.
6 Parameters
7 Counters
8 Glossary
9 Reference Documents