1. Account Management
Deletion of Default Accounts (Priority: High)
Delete system default accounts and unused accounts.
Criteria
A. Delete default accounts (lp, uucp, nuucp).
B. Delete accounts for resigned, transferred, on-leave, or contract-terminated employees.
※ Both items A and B must be applied.
Configuration Method
# userdel lp # userdel uucp # userdel nuucp
Detailed Description
Identify and delete default accounts not used by the system and suspicious or unusual accounts. Accounts that are certainly not used by most systems, as listed below, and any suspicious accounts must be deleted. (In principle, if account creation is unavoidable for server testing or specific tasks, the account should be deleted immediately after the work is completed.)
Generally, system accounts that do not require login should be prohibited from logging in by referring to the “Shell Restriction for Accounts Not Requiring Login (Priority: Medium)” item. Accounts generated by default during OS or package installation often use default passwords, which can be exploited for password guessing attacks.
- Delete accounts of resigned, transferred, on-leave, or contract-terminated employees.
- Delete
lp,uucp,nuucp, suspicious unusual accounts (e.g.,guest,test), and unused accounts. - Modifying the login shell to
/bin/falsemay still cause security issues, so deletion is recommended.
Root Privilege Management for General Accounts (Priority: High)
Check for general accounts that possess root privileges.
Criteria
A. Set the UID of general accounts (excluding the root account and group) to 100 or higher.
Configuration Method
Execute # vi /etc/passwd and modify the UID of any general account with a UID of 0 to 100 or higher.
Example: To change the UID of the wiki account to 2002: # usermod –u 2002 wiki
Detailed Description
System administrators should regularly inspect and delete directories and files of all suspicious accounts, including the root account. It is necessary for security to periodically investigate and remove unnecessary user accounts.
- Check if there are other general accounts with
rootprivileges. - If a UID overlaps with
root(0), another user can use administrator privileges. Overlapping UIDs between users make audit tracking difficult and cause overlapping user permissions. - If the UID of a general account (excluding
root) is0, delete it or assign an appropriate UID (change to a number above100). Register general accounts belonging to therootgroup into a group with appropriate permissions. - System accounts (
daemon,bin,adm,uucp,nuucp,lp,hpdb, etc.) are excluded.
<Distinguishing General Accounts and Directories – From /etc/passwd file content> The following is a sample of the /etc/passwd file. The field separator is :, and if the third field is 0, it has superuser privileges. Accounts with a UID other than 0 are considered general accounts, and the sixth field is the home directory of that account.
root:!:0:0::/:/bin/ksh
daemon:!:1:1::/etc:
bin:!:2:2::/bin:
sys:!:3:3::/usr/sys:
adm:!:4:4::/var/adm:
lpd:!:9:4294967294::/:
<passwd file fields>
loginID:x:UID:GID:comment:home_directory:login_shell
/etc/passwd File Permission Settings (Priority: High)
Check the permissions of the /etc/passwd file, which contains system user account information.
Criteria
A. Set the permissions of the /etc/passwd file to 644 or lower, owned by root.
Configuration Method
# chmod 644 /etc/passwd # chown root /etc/passwd
# chmod 400 /tcb/files/auth/계정이니셜/계정명 # chown root /tcb/files/auth/계정이니셜/계정명
# chmod 400 /etc/shadow # chown root /etc/shadow
Detailed Description
The /etc/passwd file contains account information necessary for system user authentication. This diagnosis assesses the risk of security incidents (such as obtaining general user or root privileges) that may arise due to issues like incorrect file permission settings or management errors.
<Standard Mode>
- Set the permissions of the
/etc/passwdfile to644, owned byroot.
<Trusted Mode>
- Set the permissions of the
/etc/passwdfile to644, owned byroot. - For files under
/tcb/files/auth/[initial]/[username], set the permissions of loggable accounts (excluding system accounts) to400, owned byroot.
<Shadow Password>
- For HP-UX 11.11, the
shadowfile is created by runningpwconvafter installing the Shadow Password Bundle. - For HP-UX 11.23, the Shadow Password product is installed by default.
- Set the permissions of the
/etc/shadowfile to400, owned byroot.
※ Reference site: https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=ShadowPassword&lc=EN_US
/etc/group File Permission Settings (Priority: High)
Check the permissions of the /etc/group file, which contains information about user groups.
Criteria A.
Set the permissions of the /etc/group file to 644 or lower, owned by root (or bin).
Configuration Method
# chmod 644 /etc/group # chown root /etc/group
Detailed Description
If a general user accesses and modifies the group file, an unauthorized user can be registered to the root group, enabling them to obtain root privileges. You must check whether modification of the group file is restricted for general users and ensure that write permissions for other users are limited.
Applying Password Usage Rules (Importance: High)
Prohibit the use of weak passwords when setting passwords for user accounts (both root and general accounts).
Criteria
A. Password Usage Rule Configuration
- When Identity Management solutions (Control-SA, RedOwl) are running:
Password rules are managed automatically by the solution. - When solutions are NOT running:
Configure minimum length, maximum/minimum usage period, and account lockout thresholds.
# Edit /etc/login.defs to apply the following (Unit: Days):
PASS_MIN_LEN 8 PASS_MAX_DAYS 70 PASS_MIN_DAYS 7
B. Password Settings
- Combination rules: At least 8 characters with a mix of 2 types (letters/numbers/special chars) OR at least 10 characters with a mix of 3 types.
※ Note: Both items A and B must be applied.
Configuration Method
[Security Application 1] When Identity Management Solutions are running
- Control-SA: Rules are applied (currently requiring at least one letter, number, and special character).수문자 1자 이상 사용하도록 되어 있음)
→ Check process
$ ps -ef|grep p_ctsc /bmc/ctsa/control-sa/exe/HP-UX-11/p_ctsce /bmc/ctsa/ control-sa/exe/HP-UX-11/./p_ctscs /bmc/ctsa/control-sa/exe/ HP-UX-11/./p_ctscd
- RedOwl: Rules are applied.
→ Check process
$ ps -ef|grep cmmd ngmseos 417792 1 0 Jan 28 - 0:07 /usr/src/cmm/system/cmmd ngmseos 847942 417792 0 Jan 28 - 0:02 /usr/src/cmm/system/cmmd
[Security Application 2] When Identity Management Solutions are NOT running
1. Minimum Password Length
Check if a minimum password length is set to avoid password-guessing attacks. If it is not set or is set too short, malicious users can easily guess passwords due to the use of weak credentials.
2. Maximum Password Usage Period
Check password date limits to prevent an environment where an unauthorized user who obtained a password through an arbitrary path can reconnect at any time.
3. Minimum Password Usage Period
Check password date limits to prevent an environment where an unauthorized user who obtained a password through an arbitrary path can reconnect at any time.
4. Remember Previous Passwords
Prohibit the reuse of previously used passwords by remembering them when a password change occurs.
- Recommended minimum password length: 8 characters or more.
- Recommended maximum password usage period: 70 days (10 weeks) or less.
- Recommended minimum password usage period: 7 days (1 week) or more.
- Recommended password history depth: at least 12 previous passwords.
5. Account Lockout Threshold
If an account lockout threshold is not set, there is a possibility that an attacker can obtain a user’s password without much effort through Brute-Force attacks using automated tools.
- Allow only up to 10 login failures; the account is locked upon the 10th failure.
<Account Lockout Threshold Setting, applicable to HP-UX 11.v3 or higher>
Run # vi /etc/default/security and apply the following settings (Unit: Attempts): AUTH_MAXTRIES=10
<Standard Mode>
1) Run # vi /etc/default/security and apply the following settings:
MIN_PASSWORD_LENGTH=8 PASSWORD_MAXDAYS=70 PASSWORD_MINDAYS=7 PASSWORD_HISTORY_DEPTH=12
2) To unlock a locked account, log in as root and execute the following command:
# userdbset –d –u username auth_failures
<Trusted Mode>
1) Run # /usr/sbin/sam and check the following (Navigate using the Tab key):
(1) Check the following in Auditing and Security → System Security Policies → Password Format Policies:
- Ensure Allow Null Passwords is unchecked.
- Ensure Use Restriction Rules is checked.
(2) Check the following in Auditing and Security → System Security Policies → Password Aging Policies:
- Password Aging : Enable
- Time Between Password Changes (days) : 7
- Password Life Time (days) :70
(3) Run # vi /etc/default/security and apply the following settings:
MIN_PASSWORD_LENGTH=8 PASSWORD_HISTORY_DEPTH=12
2) To unlock a locked account, log in as root and execute the following command:
# audusr –d –u username auth_failures
Detailed Description
When setting passwords for user accounts (both root and general accounts), if easily guessable passwords are used, unauthorized users may gain access to the system by obtaining general account or root privileges. If passwords are set differently from the criteria below, they must be changed according to the password policy.
<Password Configuration Criteria>
1. Passwords must be composed of a combination of at least 2 types of the 4 character types listed below with a minimum length of 10 characters, or a combination of at least 3 types with a minimum length of 8 characters.
Character Types:
- Uppercase letters (26)
- Lowercase letters (26)
- Numbers (10)
- Special characters (32)
<Design Requirements to Prevent Guessing by Unauthorized Persons>
- Prohibit the use of Null passwords.
- Prohibit compositions consisting of only letters or only numbers.
- Prohibit passwords identical to the User ID.
- Prohibit the use of sequential characters or numbers (e.g., 1111, 1234, abcd).
- Prohibit the reuse of cyclic passwords.
- Prohibit the use of easily guessable information such as phone numbers, birthdays, account names, or hostnames.
- Use the “John The Ripper” tool to check for weak passwords.
Restricting Shell for Non-Login Accounts (Importance: Medium)
Restricting shell access for system accounts that do not require login privileges.
Criteria
A. Restricting Shell Access for Non-Login Accounts
Configuration Method
Example: Setting the daemon account to prevent login
# vi /etc/passwd
(Before) daemon:x:1:1::/:/sbin/ksh
(After) daemon:x:1:1::/:/bin/false
Detailed Description
Unauthorized system utilization should be prevented by restricting shell access for users who do not require system entry. System accounts that do not need to log in should have their execution shell (e.g., /bin/sh) restricted and be assigned a “nologin” (/bin/false) shell to prohibit login.
<Target Accounts Not Requiring an Execution Shell>
This includes all accounts with general system account names such as: daemon, bin, sys, adm, listen, nobody, nobody4, noaccess, diag, operator, games, gopher, etc.
The following is a sample of the /etc/passwd file. Fields are delimited by “:”. If the final field is nologin or /bin/false, it indicates that a non-functional shell has been applied to the account.
bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin games:x:12:100:games:/usr/games:/sbin/nologin gopher:x:13:30:gopher:/var/gopher:/sbin/nologin nobody:x:99:99:Nobody:/:/sbin/nologin
<Account Configuration When Shell Login is Not Required>
# useradd account -c "account finger_info" -d /home/{account} -m -s /bin/false
Restricting SU (Select User) Command Usage (Importance: High)
Restricting the su command to prevent unauthorized users from switching to privileged accounts.
Criteria
A. Creation of the Wheel Group and User Configuration
Configuration Method
<Method 1>
1) Specify the group that will use the su command in the /etc/default/security file.
# vi /etc/default/security
SU_ROOT_GROUP=wheel (Specify the group that will use the su command)
<Method 2>
1) Create a group (Request the group to be created; typically wheel is used).
# groupadd wheel
2) Change the group of the /usr/bin/su file to the wheel group.
# chgrp wheel /usr/bin/su
3) Change the permissions of the /usr/bin/su file (4750).
# chmod 4750 /usr/bin/su
4) Add accounts that require the use of the su command to the wheel group.
# usermod –G wheel [계정명]
Detailed Description
General users without administrative privileges can obtain root authority through Password Guessing after using the su command. Therefore, the use of the su command by general users must be restricted. (Configure the system so that only the wheel group can use the su command.)
2. File System
User UMASK (User MASK) Configuration (Importance: Low)
Configuring UMASK to apply proper file and directory permissions for files created by users within the system.
Criteria
A. Set user UMASK to 022 in /etc/profile or /etc/bashrc
Gemini said
2. File System
User UMASK (User MASK) Configuration (Importance: Low)
Configuring UMASK to apply proper file and directory permissions for files created by users within the system.
Criteria
A. Set user UMASK to 022 in /etc/profile or /etc/bashrc
Configuration Method
1) Edit /etc/profile
umask 022
2) Edit /etc/default/security
UMASK=022
Detailed Description
The permissions applied when a user creates a file or directory within the system depend on the umask value. A low umask value may allow unauthorized persons to access files and directories that should only be accessible by administrators.
To view the umask value set for the current user, execute “umask” at the command prompt. It is recommended that the umask value be “022.” A umask value of “022” creates files with “rw-r–r–” access permissions.
By adding the command to the account’s Start Profile (/etc/profile, .cshrc, .kshrc, .bashrc, .login, .profile, etc.), the changed umask value will be applied after the user logs in.
SUID (Set User-ID) and SGID (Set Group-ID) Configuration (Priority: Low)
Restriction of SUID and SGID bits on root-owned files vulnerable to security threats.
Criteria
A. Removal of SUID (Set User-ID) and SGID (Set Group-ID)
※ Exception Handling: Files created by applications or files created for operational necessity are exempt.
Configuration Method
Verify the filenames in the table below and remove the SUID/SGID bits.
# chmod –s [Filename]
HP-UX
/opt/perf/bin/glance /usr/dt/bin/dtprintinfo /usr/sbin/swreg
/opt/perf/bin/gpm /usr/sbin/arp /usr/sbin/swremove
/opt/video/lbin/camServer /usr/sbin/lanadmin
/usr/bin/at /usr/sbin/landiag
/usr/bin/lpalt /usr/sbin/lpsched
/usr/bin/mediainit /usr/sbin/swacl
/usr/bin/newgrp /usr/sbin/swconfig
/usr/bin/rdist /usr/sbin/swinstall
/usr/contrib/bin/traceroute /usr/sbin/swmodify
/usr/dt/bin/dtappgather /usr/sbin/swpackage
Detailed Description
Files with SUID (Set User-ID) and SGID (Set Group-ID) enabled—especially those owned by root—are frequently utilized in Buffer Overflow and local attacks. These files require periodic management as they are critical from a security perspective.
For root-owned setuid files that are vulnerable, attributes should be removed from all such files except for those that are absolutely necessary. Periodic diagnosis and management are required to ensure that misconfigurations do not become security threats.
The list of Setuid and Setgid files to be removed is provided in the configuration method table. Setuid should also be removed if unusual files, such as those created by applications or arbitrarily by users, are discovered outside of this list. When removing Setuid, proceed carefully while verifying the normal operation of services, including the OS and applications.
Example of removal method: # chmod -s file-name
Example of periodic audit method:
# find / -user root -type f \( -perm -4000 -o -perm -2000 \) -exec ls -lg {} \;
If a Setuid file must be used, restrict its use to a specific group only.
Example of restricting use to a specific group: Restrict Setuid use by general users (allow only a designated group).
# /usr/bin/chgrp <Group_Name> <Setuid_File_Name> # /usr/bin/chmod 4750 <Setuid_File_Name>
If you wish to add an account, such as ‘wiki’, to a designated group to allow Setuid use, configure it as follows:
# usermod –G100 wiki
G : Change the configuration of the supplementary group list.
100 : the numerical value of the <Group>’s ID
/etc/inetd.conf File Permission Settings (Priority: High)
Configuration to remove write permissions for other users on the daemon configuration file (/etc/inetd.conf) owned by root.
Criteria
A. Restrictions on write access for other users to the /etc/inetd.conf file owned by root.
Configuration Method
# chown root /etc/inetd.conf # chmod o-w /etc/inetd.conf
※ If the file is a symbolic link, change the ownership of the original source file.
Detailed Description
This check determines whether access permissions are restricted for inetd.conf, the configuration file for the Internet Super-Daemon service.
The Internet Super-Daemon executes internal program daemons registered in /etc/inetd.conf upon receiving requests from the external network. If the permissions for inetd.conf are misconfigured, an unauthorized attacker could register a malicious program in this file and execute it with root privileges.
History File Permission Settings (Priority: Medium)
Permission management for script files that store the commands executed by all users logged into the system.
Criteria
A. Set permissions for history-related files to 600 or less.
Configuration Method
# chmod 600 [User Home Directory Path]/.history
# chmod 600 [User Home Directory Path]/.sh_history
Detailed Description
History files (.history, .sh_history, etc.) are scripts that record the commands of every user who logs in; therefore, they require strict security management.
If these files are world-readable, sensitive information such as plain-text passwords included in commands, internal directory structures, or administrative activities could be exposed. You must set the permissions for all users’ history files to “600” (read/write for owner only) and ensure the owner is set to the user themselves.
Crontab File Permission Setting and Management (Priority: High)
Inspection of permissions for Crontab-related files and the files scheduled to run with root privileges within Crontab.
Criteria
A. Removal of write permissions for other users on Crontab-related files.
B. Configuration of Crontab file permissions:
- Set file permissions to 744 and owner to root.
- Use absolute paths for scheduled files.
- Ensure all files scheduled in Crontab actually exist
※ Both items A and B must be applied.
Configuration Method
1) Remove write permissions for other users on Crontab-related files:
# chmod o-w /var/spool/cron/crontabs/*
2) Check and change the permissions of each file:
# ls –al [file] # chmod 744 [file] # ls -al /backup/OS_backup.sh -rwxr--r-- 1 root sys 84 Aug 10 05:01 /backup/OS_backup.sh # ls -al /opt/sfm/vacuum -rwxr--r-- 1 root sys 67 Dec 18 14:47 /opt/sfm/vacuum
3) Change the owner of files displayed as UIDs:
# ls -al [file] -rw-r--r-- 1 102 other 0 Jun 5 11:00 /tmp/user3 # chown root [file] # ls -al [file] -rw-r--r-- 1 root other 0 Jun 5 11:00 /tmp/user3
※ If a file scheduled in Crontab does not exist in the actual path, delete it from the Crontab list.
Detailed Description
This check determines whether access permissions are restricted to prevent general users from maliciously accessing cron-related files.
Cron is a program that provides job scheduling, automatically performing specific tasks at specific times. If the access permissions for Cron-related files are misconfigured, unauthorized individuals can change the user environment through various methods, leading to security incidents.
A review of execution file permissions for files set to run in Crontab with root privileges is required (administrator review required).
If a file is set with general user privileges instead of root, an attacker can perform scheduled tasks. If relative paths are used, the file may fail to execute. If a file registered in Crontab does not exist in the actual path, an attacker can create a file with the same name as the registered file and execute it.
Additionally, when checking the permissions of files registered in Crontab, a problem may occur where the owner of files created by a deleted user remains as that user’s UID; appropriate ownership must be assigned to such files.
- Set permissions to 744 and owner to root for execution files set to run in Crontab with root privileges.
- Modify relative paths to absolute paths for files scheduled in Crontab.
- If the owner of a file scheduled in Crontab remains as a UID, assign a proper owner (root).
- Verify the existence of scheduled files in their actual paths.
# crontab –ㅣ 1 15 * * /backup/OS_backup.sh 30 * * * * /opt/sfm/vacuum
/etc/profile File Permission Settings (Priority: Medium)
Restricting access permissions for the user configuration file /etc/profile.
Criteria
A. Removal of write permissions for other users on the /etc/profile file owned by root (or bin).
Configuration Method
# chown root /etc/profile # chmod o-w /etc/profile
Gemini said
/etc/profile File Permission Settings (Importance: Medium)
Description: Restricting access permissions for the user configuration file /etc/profile.
Criteria
A. Removal of write permissions for other users on the /etc/profile file owned by root (or bin).
Configuration Method
Bash
# chown root /etc/profile
# chmod o-w /etc/profile
Detailed Description
The /etc/profile file is a login script used to configure the default environment for all users who log in to the system. If the access permissions for the /etc/profile file are incorrectly set, an unauthorized person can change user environments through various methods, potentially leading to a security breach.
For example, an attacker with write access could insert a malicious script into this file, which would then be executed with the privileges of any user (including root) who logs into the system.
/etc/hosts File Permission Settings (Priority: Medium)
Restricting access permissions for /etc/hosts, the hostname registration file.
Criteria
A. Removal of write permissions for other users on the /etc/hosts file owned by root (or bin).
Configuration Method
# chown root /etc/hosts # chmod o-w /etc/hosts
※ If the file is a symbolic link, change the ownership and permissions of the original source file.
Detailed Description
The /etc/hosts file is used to map IP addresses to hostnames. If the access permissions for this file are incorrectly configured, an attacker could modify the mappings to redirect traffic to a malicious system.
/etc/issue 파일 권한 설정(중요도 : 중)
터미널 설정과 관련된 /etc/issue 파일에 대한 접근 권한 제한
기준
가. /etc/issue 파일의 권한을 root (또는 bin) 소유의 타사용자의 쓰기권한 제거
설정방법
# chown root /etc/issue # chmod o-w /etc/issue
상세설명
/etc/issue 파일은 터미널이나 Telnet Session 또는 Console을 통해 접속하는 사용자에게 메시지를 보여주기 때문에 보안상의 관리가 필요합니다.
사용자 홈 디렉터리 및 파일관리(중요도 : 중)
사용자 홈 디렉터리 및 홈 디렉터리 내 환경변수 파일 권한 제한
기준
가. 사용자 홈 디렉터리 및 환경변수 파일 타사용자 쓰기권한 제거
설정방법
# chmod o-w [홈 디렉터리] # chmod o-w [파일명] # chmod o-w [홈 디렉터리 경로] [파일명] (홈 디렉터리의 설정파일에서 권한을 제거할 경우)
상세설명
사용자 홈 디렉터리 내 파일들을 인가되지 않은 사용자가 접근하여 설정파일 및 파일을 변조하게 되면 정상적인 사용자의 서비스가 제한되므로, 해당 홈 디렉터리 계정 외 일반 사용자들이 해당 홈 디렉터리 및 환경변수 파일을 수정할 수 없도록 제한하고 있는지 점검합니다.
환경변수 파일의 접근권한 설정이 잘못되어 있을 경우 비 인가자가 다양한 방법으로 사용자 환경을 변경하여 침해사고를 일으킬 수 있습니다.
“.profile”, “.kshrc”, “.cshrc”, “.bashrc”, “.bash_profile”, “.login”, “.exrc”, “.netrc”, “.dtprofile”, “.Xdefaults” 등 환경변수 파일의 타사용자 쓰기 권한을 제거합니다.
중요 디렉터리 파일 권한 설정(중요도 : 중)
중요 디렉터리 및 디렉터리 내 파일 권한 설정
기준
가. 중요 디렉터리의 권한을 root(또는 bin) 소유의 타사용자 쓰기 권한 제거
설정방법
# chown root [디렉터리명] # chmod o-w [디렉터리명]
상세설명
중요 디렉터리 접근권한 설정이 잘못되어 있을 경우 비 인가자가 다양한 방법으로 사용자 환경을 변경하여 침해사고를 일으킬 수 있습니다.
/sbin, /etc/, /bin, /usr/bin, /usr/sbin, /usr/lbin 디렉터리의 권한을 root(또는 bin) 소유의 타사용자 쓰기권한제거를 설정합니다.
# ls -ldb /sbin /etc/ /bin /usr/bin /usr/sbin /usr/lbin drwxrwxr-x 13 root bin 2048 Aug 25 14:53 /sbin drwxrwxr-x 16 root bin 2048 Aug 26 09:27 /etc/ drwxrwxr-x 18 root bin 1024 Jun 10 1996 /bin drwxrwxr-x 3 root bin 6144 Aug 25 14:53 /usr/bin drwxrwxr-x 7 root bin 1024 Aug 25 14:53 /usr/sbin drwxrwxr-x 5 root bin 4096 Aug 25 14:53 /usr/lbin
PATH 환경변수 설정(중요도 : 중)
root 계정 환경변수 파일의 PATH 경로 설정
기준
가. root 계정 환경변수 설정 파일 내 PATH 경로 중 “.” 없거나 맨뒤로 설정
설정방법
현재 디렉터리를 의미하는 “.”이 PATH 맨 앞이나 중간에 위치하면 안되며, 애플리케이션 구성상 “.” 을 사용해야 하는 경우에는 “.”을 PATH 환경변수의 마지막으로 이동
상세설명
root 계정의 PATH 환경변수에 “.”(현재 디렉터리 지칭)이 포함되어 있으면, root 계정의 인가자로 인해 비의도적으로 현재 디렉터리에 위치하고 있는 명령어가 실행될 수 있습니다.
즉, “.”이 /usr/bin이나 /bin, /sbin 등의 명령어들이 위치하고 있는 디렉터리보다 우선하여 위치하고 있을 경우, root 계정의 인가자가 어떠한 명령을 실행했을 때 비 인가자가 불법적으로 위치시킨 파일을 비의도적으로 실행하여, 예기치 않은 결과를 가져올 수 있습니다. 또한, “.” 뿐만 아니라 비 인가자가 불법적으로 생성한 디렉터리를 우선적으로 가리키게 하여 예기치 않은 결과를 가져올 수 있습니다.
root 계정의 환경변수 설정파일(.profile, .cshrc 등)과 “/etc/profile” 등에서 PATH 환경변수에 포함되어 있는 현재 디렉터리를 나타내는 “.”을 제거합니다.
※ echo $PATH 로 확인 (root 계정만 해당됨)
FTP(File Transfer Protocol)접근제한 파일 권한설정(중요도 : 상)
FTP 접근제어 설정파일의 권한을 root 소유의 타사용자 쓰기권한 제거
기준
가. /etc/ftpusers, /etc/ftpd/ftpusers 파일의 권한을 root 소유의 타사용자 쓰기 권한 제거
설정방법
# chown root /etc/ftpusers # chown root /etc/ftpd/ftpusers # chmod o-w /etc/ftpusers # chmod o-w /etc/ftpd/ftpusers
※ vsftp를 사용할 경우 vsftpd.conf 파일에서 userlist_enable = YES인 경우 : /etc/vsftpd/user_list 또는 /etc/vsftpd.user_list 확인
# chown root /etc/vsftpd/user_list 또는 # chown root /etc/vsftpd.user_list # chmod o-w /etc/vsftpd/user_list 또는 # chmod o-w /etc/vsftpd.user_list
vsftpd.conf 파일에서 userlist_enable=NO 혹은 옵션이 존재하지 않을 경우 : /etc/vsftpd/ftpusers 확인
# chown root /etc/vsftpd/ftpusers # chmod o-w /etc/vsftpd/ftpusers
상세설명
FTP 접근제어 설정파일을 관리자가 아닌 일반사용자들이 접근 및 변경 가능하면 이를 통해 비 인가된 사용자를 등록하고 서버에 접속하여 불법적인 행동을 하는 등의 침해사고가 발생 가능하므로, FTP접근제어 설정 파일을 일반 사용자들이 수정할 수 없도록 제한하고 있는지 점검해야 합니다.
root원격 접근제어 파일 권한 설정(중요도 : 중)
root 원격 접근 제어 설정 파일인 /etc/security 권한 root 소유의 타사용자 쓰기 권한 제거
기준
가. /etc/security 권한을 root(또는 bin) 소유의 타사용자 쓰기 권한 제거
설정방법
# chown root /etc/security # chmod o-w /etc/security
상세설명
root 접근제어 설정파일을 관리자가 아닌 일반사용자들이 접근 및 변경 가능하면 root로의 접근이 제한되는 등 서비스 장애 발생이 가능하므로, root 접근제어 설정파일을 일반사용자들이 수정할 수 없도록 제한하고 있는지 점검해야 합니다.
NFS(Network File System) 접근제어 파일 권한 설정(중요도 : 상)
NFS 접근제어 파일의 root 소유의 타사용자 쓰기 권한 제거
기준
가. /etc/exports 파일의 권한이 root(또는 bin) 소유의 타사용자 쓰기 권한 제거
설정방법
# chown root /etc/exports # chmod o-w /etc/exports
상세설명
NFS(Network File System) 접근제어 설정파일을 관리자가 아닌 일반 사용자들이 접근 및 변경 가능하면 이를 통해 비 인가된 사용자를 등록하고, 파일시스템을 마운트하여 불법적인 변조를 시도할 수 있으므로, NFS접근제어 설정파일을 일반 사용자들이 수정할 수 없도록 제한하고 있는지 점검합니다.
/etc/services파일 권한 설정(중요도 : 중)
service 파일의 root 소유의 타사용자 쓰기 권한 제거
기준
가. /etc/services 파일의 권한을 root(또는 bin) 소유의 타사용자 쓰기 권한 제거
설정방법
# chown root w /etc/services # chmod o-w /etc/services
상세설명
Service 파일을 관리자가 아닌 일반사용자들이 접근 및 변경 가능하면 이를 통해 정상적인 서비스를 제한하거나 허용되지 않은 서비스를 실행시켜 침해사고의 위험이 있습니다.
부팅 스크립트 파일 권한 설정(중요도 : 상)
OS상에서 사용하는 부팅 스크립트 파일에 대하여 접근 권한 제한 설정
기준
가. 부팅 스크립트 파일 권한 중 타사용자 쓰기 권한 제거
설정방법
부팅 스크립트 관여 파일 중에서 취약하게 나온 파일명을 아래의 명령어를 사용하여 조치
# chmod o-w [파일명 또는 디렉터리명]
상세설명
시스템 운영상 중요한 부팅스크립트 파일들의 접근권한은 반드시 필요한 사용자만 접근 할 수 있도록 해야 하며, 권한 중 타사용자 쓰기 권한이 부여되어 있는 경우에 제거합니다.
/etc/rc*.d/* /etc/inittab 등
3. 네트워크 서비스
RPC(Remote Procedure Call)서비스 제한(중요도 : 중)
보안상 취약한 RPC(Remote Procedure Call) 서비스 제거
기준
가. 사용하지 않는 RPC 서비스의 제거
※ 운영상 필요에 의하여 사용하는 RPC 서비스는 예외처리
설정방법
<inetd 일 경우 서비스 제거 방법의 예>
- “/etc/inetd.conf” 파일에서 해당 라인 # 처리(주석처리) 후 inetd 재구동
- 부팅스크립트에서 rpc 서비스 완전 삭제
# vi /etc/inetd.conf (수정 전) rpc dgram udp wait root /usr/lib/netsvc/rstat/rpc.rstatd 100001 2-4 rpc.rstatd (수정 후) # rpc dgram udp wait root /usr/lib/netsvc/rstat/rpc.rstatd 100001 2-4 rpc.rstatd
# ps -ef | grep inetd root 141 1 0 15:03:22 ? 0:01 /usr/sbin/inetd -s # inetd -c (재구동) # kill -HUP 141
※ 시스템 재시작이 어려운 경우 rpc.statd 프로세스 중지
# ps –ef |grep rpc rpc 3136 1 0 Oct11 ? 00:00:01 rpc.statd # kill –HUP 3136
상세설명
RPC (Remote Procedure Call) 서비스는 분산 환경에서 서버 응용프로그램에 접근하여 특정 작업을 요구하는 Call을 말하며, 이를 사용하면 분산처리 환경의 개발이 용이하여 많이 사용되기 때문에 Unix 시스템에서 기본적으로 서비스를 제공하고 있습니다. 그러나, RPC 서비스들은 원격 Buffer Overflow 취약성들이 많이 존재하여 침해사고의 위험성이 매우 높습니다.
Buffer Overflow 란 지정된 Buffer 의 크기보다 더 많은 데이터를 입력해서 프로그램이 비정상적으로 동작하도록 하는 것을 말하며, 버퍼가 오버 플로우가 되는 순간에 사용자가 원하는 임의의 명령어를 수행하여 루트 권한을 획득 하는 등 다양한 공격을 할 수 있습니다.
사용하지 않는 아래의 RPC 서비스들은 제거해야 하며, 사용되고 있는 서비스가 있다면 해당 서비스에 맞는 보안 패치를 수행해야 합니다.
rpc.cmsd 데이터베이스 관리 프로그램으로 Open Windows의 Calendar Manager와 CDE의 Calendar 프로그램에서 사용
users rusers 명령의 조회에 응답 rs
td 커널에서 얻은 성능 통계 리턴 rpc.statd 시스 템 장애시 NFS에서 파일 복구를 위해 제공하는 lockd 프로그램을 지원하는 도구 kcms_server kodak color management 관련된 api 와 라이브러리들은 데스크탑의 디지털 이미지들의 컬러 퍼포먼스를 컨트롤할 수 있는 Profile를 만들거나 관리하기 위해 사용 rpc.ttdb erverd RPC기반의 ToolTalk 데이터베이스 서버 프로그램 Walld 다른 사용자들에게 메시지를 보내기 위해 사용 rpc.nids NIS server Daemon rpc.ypupdated Network Information Services(NIS) 맵의 정보를 갱신 cachefsd Cache 파일 시스템 daemon sadmind remote로부터 시스템 관리를 하는데 사용되는 프로그램 s rayd 지정된 수의 패킷을 호스트에 전송하고 성능 통계를 보고하는 spra 명령에 의해 전송된 패 을 수신 rpc.pcnfsd PC-NFS (개인용 컴퓨터 네트워크 파일 시스템) 클라이언트에서의 서비스 요청을 처리 rexd 원격 시스템용 프로그램을 실행 rpc.rquotad 리스트 머신에 NFS mount 되고 있는 파일 시스템에 대해 유저에 한 로컬 머신에서의 할당 제한치를 돌려줌
- /etc/inetd.conf에서 RPC관련 서비스 제거
ttdb, cmsd, rstatd, sadmind, rusersd, rexd, rwalld, sprayd, kcms_server, cachefsd 등 서비스 제거
NFS(Network File System) 제한(중요도 : 상)
특별한 목적으로 사용하지 않는 NFS(Network File System) 서비스 제거
기준
가. 서비스 필요 시
- 인가되지 않는 시스템 mount 해제
- everyone 으로 시스템 mount 제한
나. 서비스 불필요 시
- NFS데몬(nfsd, statd, lockd) 중지
설정방법
<서비스 사용> NFS를 원격에서 mount하고 있는 시스템을 확인 후, 인가되지 않은 시스템은 Umount mount확인 (NFS서비스가 중지되어 있는 경우 명령어 실행되지 않음) # showmount -e hostname 명령어를 실행하여 everyone으로 시스템이 마운트 되어 있는지 확인
# showmount Umount # umount "파일시스템 이름"
NFS 서비스를 사용하면 “/etc/exports 파일에 꼭 필요한 공유 디렉터리만 나열하고, everyone으로 시스템이 마운트 되어서는 안되며, NFS 관련 보안패치를 수행해야 함
<서비스 미사용> 1) 실행중인 서비스 중지 NFS 데몬(nfsd)을 중지
# ps -ef | grep mountd
root 163 1 0 Sep 27 ? 0:04 /usr/lib/autofs/automountd
# kill –9 163
# ps -ef | grep nfs
root 146 1 0 Sep 27 ? 0:16 /usr/lib/nfs/nfs
# kill –9 146
2) NFS 리스트 제거하고 재시작시 NFS Server 가 시작되지 않도록 함
# vi /etc/rc.config.d/nfsconf 파일 실행하여 NFS_SERVER=0 으로 수정 # mv /sbin/rc2.d/S900nfs.Server /sbin/rc2.d/_S900nfs.Server
상세설명
NFS는 Network를 통해 File system을 공유하는 목적으로 설계되어 많은 용량의 서비스를 하는 사이트나 한 서버의 파일을 많은 서비스 서버들이 공유하여 사용할 때 많이 이용되는 서비스이지만 이를 이용한 침해사고 위험성이 높습니다.
특별한 목적으로 사용하지 않는다면 NFS 서비스 제거 및 NFS 서비스의 일부인 statd, lockd 서비스를 중지 해야 합니다.
NFS 서비스가 불가피하게 사용할 시에는 인가되지 않은 시스템이 NFS 시스템 마운트 하여 비 인가된 시스템 접근 및 파일변조가 발생하지 않도록 확인해야 합니다.
Automountd 서비스 제거(중요도 : 하)
특별한 목적으로 사용하지 않는 Automount 서비스 제거
기준
가. Automount 서비스 제거
설정방법
1) 실행중인 서비스 중지
# ps -ef | grep automount root 650 1 0 3월 30 ? 0:30 /usr/lib/netsvc/fs/automount/automount -f /etc/auto_master # kill –9 650
2) 시스템 재시작시 automount 가 시작되지 않도록 함 (정확한 파일 위치는 O/S 마다 다름)
# vi /etc/rc.config.d/nfsconf (수정 전) AUTOFS=1 (수정 후) AUTOFS=0
상세설명
Autofs는 client system의 사용자가 필요할 때에 remote system의 디렉터리 또는 file system을 mount하고 해당되는 mount point를 사용하지 않을 때는 자동으로 unmount 시키는 기능을 합니다.
Autofs 데몬인 automountd는 RPC를 통해 autofs으로부터 파일 시스템의 mount와 unmount 요청을 처리하며, automountd 데몬에는 로컬 공격자가 데몬에 RPC를 보낼 수 있는 취약점이 존재합니다.
NIS(Network Information Service)제한(중요도 : 상)
특별한 목적으로 사용하지 않는 NIS 서비스 제거
기준
가. NIS 서비스 중지
※ 운영상 필요에 의하여 사용하는 NIS 서비스 예외처리
설정방법
1) NIS 서비스 중지
# /usr/lib/netsvc/yp/ypstop
2) 부팅 스크립트 제거
# cd /etc/rc*/ # mv S88ypserv _S88ypserv
상세설명
NIS(Network Information Service)는 중요한 시스템 데이터베이스 파일들을 네트워크를 통하여 공유함으로써 관리자와 사용자들에게 일관성 있는 시스템 환경을 제공하며, NIS+는 보안 및 편의 기능들을 추가한 그 후의 버전입니다.
<서비스 확인방법> 아래의 프로세스를 확인하여 프로세스가 없으면 정상입니다.
프로세스 및 데몬 설 명 Ypserv master와 slave 서버에서 실행되며, client로부터의 ypbind 요청에 응답 Ypbind 모든 NIS 시스템에서 실행되며 클라이언트와 서버를 바인딩하고 초기화 rpc.yppasswdd 사용자들이 패스워드를 변경하기 위해 사용 ypxfrd NIS 마스터 서버에서만 실행되며 고속으로 NIS 맵을 전송 rpc.ypupdated NIS 마스터 서버에서만 실행되며 고속으로 암호화하여 NIS 맵을 전송
‘r’commands 서비스 제거(중요도 : 상)
특별한 목적으로 사용하지 않는 ‘r’ commands 서비스 제거
기준
가. 서비스 필요 시
- /etc/hosts.equiv, ./$HOME/rhosts 파일의 권한을 400 root 소유로 설정
- /etc/hosts.equiv, /$HOME/.rhosts 설정에 접근가능 고정 IP 설정 사용
나. 서비스 불필요 시
- rsh, rlogin, rexec 등 ‘r’ commands 서비스 제거
- /etc/hosts.equiv, /$HOME/.rhosts 파일의 권한을 root 소유의 000 또는 /dev/null 로 링크
※.rhosts 파일은 root 홈 디렉터리에 반드시 생성
b. 조치방법 <‘r’ command를 사용하는 경우> /etc/hosts.equiv 파일과 $HOME/.rhosts 파일 내 호스트 및 계정부분에서 ”+“를 반드시 제거하고, 아래 예시처럼 필요한 호스트 및 계정만 등록 예) # vi /etc/hosts.equiv ( or $HOME/.rhosts)
Wiki security
”/etc/hosts.equiv“, “$HOME/.rhosts” 파일의 권한과 소유 지정
# chown root /etc/hosts.equiv # chmod 400 /etc/hosts.equiv # chown root /root/.rhosts # chmod 400 /root/.rhosts
※ Symbolic Link를 사용을 권장하며, 퍼미션 변경은 필요 없음
cron에 넣어서 주기적으로 관리하는 것과 ”/etc/hosts.equiv“ 파일은 아래와 같이 설정하는 것을 권장
# /bin/touch /.netrc /etc/hosts.equiv # /bin/chmod 400 /.netrc /etc/hosts.equiv
<‘r’ command를 사용하지 않을 경우> 서비스 제거하고 /etc/hosts.equiv, /$HOME/.rhosts 파일 권한 변경
<서비스 제거 방법의 예> ”/etc/inetd.conf“ 파일에서 해당 라인 # 처리(주석처리) 후 inetd 재구동
# vi /etc/inetd.conf (수정 전) shell stream tcp nowait root /usr/sbin/in.rshd in.rshd shell stream tcp6 nowait root /usr/sbin/in.rshd in.rshd login stream tcp6 nowait root /usr/sbin/in.rlogind in.rlogind exec stream tcp nowait root /usr/sbin/in.rexecd in.rexecd exec stream tcp6 nowait root /usr/sbin/in.rexecd in.rexecd (수정 후) # shell stream tcp nowait root /usr/sbin/in.rshd in.rshd # shell stream tcp nowait root /usr/sbin/in.rshd in.rshd # shell stream tcp6 nowait root /usr/sbin/in.rshd in.rshd # login stream tcp6 nowait root /usr/sbin/in.rlogind in.rlogind # exec stream tcp nowait root /usr/sbin/in.rexecd in.rexecd # exec stream tcp6 nowait root /usr/sbin/in.rexecd in.rexecd # ps -ef | grep inetd root 141 1 0 15:03:22 ? 0:01 /usr/sbin/inetd -s # kill -HUP 141
</etc/hosts.equiv, /$HOME/.rhosts 파일 권한 변경 방법 1>
# chown root /etc/hosts.equiv # chmod 000 /etc/hosts.equiv # chown root /root/.rhosts # chmod 000 /root/.rhosts
</etc/hosts.equiv, /$HOME/.rhosts 파일 권한 변경 방법 2>
# ln –s /dev/null /etc/hosts.equiv (/etc/hosts.equiv 파일 삭제 후) # ln –s /dev/null /root/.rhosts (/root/.rhosts 파일 삭제 후)
※.rhosts 파일은 root 홈 디렉터리에 root 권한의 000 또는 /dev/null 링크로 반드시 생성
cron에 넣어서 주기적으로 관리하는 것과 ”/etc/hosts.equiv“, ”/etc/.rhosts“ 파일은 아래와 같이 설정하는 것을 권장
# /bin/touch /root/.netrc /etc/hosts.equiv # /bin/chmod 0 /root/.netrc /etc/hosts.equiv # /bin/touch /.netrc /root/.rhosts # /bin/chmod 0 /.netrc /root/.rhosts
상세설명
rsh, rlogin, rexec 등의 ‘r’ commands는 인증 없이 관리자의 원격접속이 가능하게 하는 명령어들로, NET Backup이나 다른 용도로 사용되는 경우가 있으나 ‘r’ command의 사용은 보안상 매우 취약하여 서비스 포트가 열려있으면 침해사고의 위험성이 있습니다.
NET Backup 등 특별한 용도로 사용하지 않는다면 아래의 서비스들을 제거합니다
shell(514) login(513) exec(512)
서비스를 사용해야 하는 경우 반드시 필요한 서버에 대해서만 접근을 허용하고, 관련 설정파일의 퍼미션을 적절히 설정해야 합니다. (“3.6. 신뢰관계 설정” 참조)
- /etc/inetd.conf에서 Berkeley R-Command 서비스 제거
: rsh, rlogin, rexec 서비스 제거
”/etc/hosts.equiv“ 파일은 TRUSTED 시스템들을 등록하고 ‘r’ command를 이용하여 인증 없이 접근하는 것을 가능하게 하는 설정 파일이며, ”.rhosts“ 파일은 ”/etc/hosts.equiv“ 파일과 거의 동일한 기능을 수행하지만 ”.rhosts“ 파일은 사용자 별로 ‘r’ command 를 통해 접속 가능하도록 설정할 수 있습니다.
‘r’ command를 사용할 경우에는 특정 서버만 신중히 적어두고, ”+“와 같이 모든 서버가 접근 가능하도록 하는 것은 보안 상 매우 위험하므로 주의하여 설정해야 합니다.
사용할 경우에는 특정 서버만 신중히 적어두고, ”+“와 같이 모든 서버가 접근 가능하도록 하는 것은 매우 위험하므로 주의하여 설정해야 합니다.
사용할 경우에는 root 소유의 “400”으로 설정합니다.
- /etc/hosts.equiv 파일 내에 ‘+’ 설정금지
: 파일 미 사용시 퍼미션 000 또는 null로 링크 : 파일 사용시 소유자 : root, 권한 : 400
+ + : 모든 호스트의 모든 계정을 신뢰 + wiki : 모든 호스트의 wiki 계정을 신뢰 Wiki + : Wiki 호스트의 모든 계정을 신뢰
불필요한 서비스 제거(중요도 : 상)
보안상 불필요한 서비스 제거
기준
가. 불필요한 서비스 제거
설정방법
< 서비스 제거 방법의 예 >
- ”/etc/inetd.conf“ 파일에서 해당 라인 # 처리(주석처리) 후 inetd 재구동
- 부팅스크립트에서 불필요 서비스 완전 삭제
# vi /etc/inetd.conf (수정 전) # 100068/2-5 dgram rpc/udp wait root /usr/dt/bin/rpc.cmsd rpc.cmsd (수정 후) # 100068/2-5 dgram rpc/udp wait root /usr/dt/bin/rpc.cmsd rpc.cmsd # inetd -c
사용해야 하는 서비스가 있을 경우 단기적으로는 네트워크 장비, 방화벽에서 1차적으로 접근제어를 강화하고 장기적으로는 서비스 제공의 타당성을 재검토하여 Application을 변경합니다. (해당 서비스를 사용하는 procedure call 변경)
상세설명
서버에 불필요한 서비스 Port들이 열려 있는 경우 주요 시스템 정보 노출 및 서비스 거부(DOS)를 야기시킬 수 있습니다.
사용하지 않는 아래의 서비스는 제거합니다.
echo(7) 클라이언트에서 보내는 메시지를 단순히 재전송 chargen(19) 임의 길이의 문자열을 반환하는 서비스 finger(79) 사용자 정보를 표시 nntp(119) NNTP(Network News Transfer Protocol) 인터넷 상에 토론 그룹을 생성할 수 있는 표준 서비스 netbios_dgm(138) NetBIOS Datagram 서비스, 호스트, 그룹, 또는 전체로 브로드캐스팅 하는데 사용 ldap(389) 디렉터리 서비스 엑세스를 위한 서비스 ntalk(518) 서로 다른 시스템간에 채팅을 가능하게 하는 서비스 ldaps(636) LDAP over SSL nfsd(2049) -NFS미사용시 NFS 서버 데몬 서비스 discard(9) 수신되는 임의 사용자의 데이터를 폐기하는 서비스 time(37) rdate 데몬에 의해 사용되는 RFC 868 시간 서버의 TCP 버전 sftp(115) ftp over SSH ntp(123) ntp(Network Time Protocol) 는 클라이언트와 서버의 시간을 동기화 함 netbios_ssn(139) NetBIOS session 서비스, 네트워크 공유 등을 이용한 실제 데이터를 송수신 하는데 사용 printer(515) 원격 프린터에서 스풀링 하는데 사용 uucp(540) 다른 유닉스 시스템들 간에 파일을 복사하고, 다른 시스템 상에서 실행될 명령어들을 전송 ingreslock(1524) Ingre 데이터 베이스 Lock 서비스 dtspcd(6112) 데스크탑 하위 프로세스 제어 데몬 서비스 daytime(13) daytime은 클라이언트의 질의에 응답하여 아스키 형태로 현재 시간과 날짜를 출력하는 데몬 tftp(69) 파일 전송을 위한 프로토콜이며, tftp프로토콜은 OS에서는 부팅 디스켓이 없는 워크스테이션이나 네트워크 인식 프린터를 위한 설정 파일의 다운로드, 설치 프로세스의 시작을 위해 사용 uucp-path(117) Uucp path 서비스 netbios_ns(137) NetBIOS name 서비스, 네트워크 상에 자원을 식별하기 위해 사용 bftp(152) binary File Transfer Protocol talk(517) 사용자가 시스템에 원격으로 연결하여 다른 시스템에 로그인하고 있는 사용자와 대화 세션을 시작 pcserver(600) ECD Integrated PC board srvr, RPC 관련공격에 사용 www-ldap-gw(1760) HTTP to LDAP gateway, LDAP 이 웹서버로 데이터베이스의 정보를 전송할 때 사용
서비스 Banner관리(중요도 : 중)
시스템에 일반적인 서비스(TELNET, FTP, SMTP 등)의 접근 시 출력되는 Banner 설정
기준
가. Telnet, FTP, SMTP, DNS 서비스 사용시 접속 배너에 경고문 표시 및 정보 노출 방지 설정
설정방법
[Telnet Banner]
- 배너설정 / hostname 제거
# vi /etc/inetd.conf에 다음 내용 추가
telnet stream tcp6 nowait root /usr/lbin/telnetd telnetd -b /etc/issue (/etc/issue 파일은 banner가 작성되어 있는 파일) (-b : 뒤에 따라오는 banner 파일을 사용하겠다는 옵션)
/etc/issue 파일에 banner내용 삽입
[FTP Banner]
- 배너설정 / hostname 제거
1) # vi /etc/inetd.conf에 다음 내용 추가
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -a /etc/ftpd/ftpaccess (- a : 뒤에 따라오는 설정파일을 사용하겠다는 옵션)
2) wu-ftpd v2.4 미만
# vi /etc/ftpd/ftpaccess 파일 내 아래 내용 추가 suppresshostname yes (hostname 숨김) suppressversion yes (version 정보 숨김) banner /etc/ftpd/ftp_banner(FTP 배너가 작성된 파일)
3) wu-ftpd v2.4 이상
# vi /etc/ftpd/ftpaccess 파일 내에 아래 내용 추가 greeting terse (hostname 및 version 정보숨김)
※ /etc/ftpd/ftpaccess 파일이 없을 경우 아래와 같이 복사 cp /usr/newconfig/etc/ftpd/examples/ftpaccess /etc/ftpd/ftpaccess
[SMTP Banner]
# vi /etc/mail/sendmail.cf # SMTP initial login message (old $e macro) (수정 전) O SmtpGreetingMessage=$j Sendmail $v/$Z; $b (수정 후) O SmtpGreetingMessage= WARNING:Authorized use only ※ SMTP 설정에 따라 sendmail.cf 파일 위치가 다를 수 있음
[DNS Banner]
# vi /etc/named.conf version "Contact Another Administrator!";
상세설명
시스템에 일반적인 서비스(TELNET, FTP, SMTP 등)의 접근 시 출력되는 Banner를 관리하여 서비스 버전 유출을 막습니다.
- 서버 사용자 범위를 명시하고, 모든 활동이 모니터링 되고 있음을 표시
- 각 데몬 설정 파일에서 Default Banner 삭제 또는 경고 메시지를 삽입
- 해당 프로세스의 버전과 시스템의 호스트명이 노출되지 않도록 배너 설정
session timeout설정(중요도 : 하)
지정된 시간 동안 사용하지 않을 경우 접속된 session timeout 설정
기준
가. /etc/profile 파일 내 session timeout 설정
설정방법
1) sh(born shell) 및 ksh(korn shell) 에서는 /etc/profile 또는 .profile 수정 TMOUT=300, export TMOUT 삽입
# vi /etc/profile
(수정 후) TMOUT = 300
export TMOUT
2) csh 에서는 /etc/csh.login 파일 내에 set TMOUT=300을 추가
상세설명
사용하지 않는 session에 대한 time out을 설정하지 않을 경우 기밀성 뿐만 아니라 가용성 측면에서도 문제점이 발생할 수 있습니다.
지정된 시간 동안 사용하지 않을 경우 접속된 session을 해당 서버에서 끊도록 설정하는 것이 필요합니다. (300초 경과 시 timeout)
root계정 telnet, ssh접근 제한(중요도 : 상)
root 계정으로 telnet 및 ssh 직접 접근 제한 설정
기준
가. telnet 및 ssh 접속 시 root 계정으로의 접속 제한
설정방법
[telnet]
# vi /etc/securetty 파일 생성 후 console 삽입 # echo console > /etc/securetty
[ssh]
# vi /opt/ssh/etc/sshd_config 파일 수정 후 sshd 재구동 (수정 전) #PermitRootLogin no (수정 후) PermitRootLogin no
※ 재구동 시 반드시 연결된 세션을 모두 종료한 다음 /sbin/init.d/secsh stop 명령어 실행 후 start 해야 함
상세설명
root 계정의 직접적인 접근은 보안상 위험하므로, root 계정의 직접적인 원격 접속을 제한해야 합니다. 아래 옵션을 설정하여 일반 사용자를 통해 root 계정으로 전환될 수 있도록 하는 것이 보안상 필요합니다.
방화벽 정책 적용(중요도 : 상)
외부 공격 차단을 위한 방화벽 정책 적용
기준
가. 보안진단 신청 완료 후 방화벽 오픈 가능 ※ 단, Any Open 은 보안 취약점 조치완료 후 오픈 가능
설정방법
가. 서비스 오픈 전 ISS-D 를 통해 보안진단 신청 완료
상세설명
신규 서비스 오픈시 보안진단 신청을 완료해야 방화벽 오픈이 가능하며, Any Open(사내망 Any Open, 대외망 다수의 IP 오픈 포함)은 보안진단 후 발견된 취약점의 조치가 완료되야 방화벽 오픈이 가능합니다.
4. 로그관리
시스템 로그 설정(중요도 : 상)
su 로그 및 syslog 의 설정과 로그 파일과 디렉터리의 권한 설정
기준
가. su 로깅 기록
- /etc/syslog.conf 설정
나. syslog.conf 로그 설정
- *.notice, *.alert, *.emerg
다. 로그 파일 및 디렉터리에 대한 권한 설정
- root(또는 bin) 소유의 타사용자 쓰기 제거
※ 가, 나, 다 모든 항목 적용 해야 함
설정방법
1. su 로그 설정
# vi /etc/syslog.conf 파일에 아래의 내용이 없으면 설정 auth.notice /var/adm/sulog/syslog.log or *.notice /var/adm/sulog/syslog.log (auth.notice와 /var/adm/sulog/syslog.log 사이는 tap키를 이용)
2. syslog 설정 1) # vi /etc/syslog.conf 파일을 점검
- .notice /var/log/messages
- .alert /dev/console
- .emerg *
2) 위와 같이 /etc/syslog.conf 파일을 수정한 후에는 이것이 적용되도록 아래의 명령을 사용하여 syslogd를 restart
# ps –ef | grep syslogd root 7524 6970 0 Apr 23 - 0:02 /usr/sbin/syslogd # kill –HUP 7524
3. 로그 파일 권한 설정
- 아래의 로그 파일 권한은 시스템 사용자(root, adm, bin 등) 소유자의 타사용자 쓰기권한 제거 설정
<보안 강화 적용 대상> 로그파일 HP-UX 9.x HP-UX 10.x 이상 wtmpx, utmpx /usr/adm /var/adm wtmp, utmp /usr/adm /var/adm btmp /usr/adm /var/adm syslog /usr/adm/syslog/syslog.log /var/adm/syslog/syslog.log sulog /usr/adm /var/adm pacct /usr/adm /var/adm authlog – – messages /usr/adm /var/adm loginlog – – lastlog /usr/adm /var/adm 기타 – –
# chown root [로그파일명] # chmod o-w [로그파일명]
상세설명
1. su로그 설정
기본적으로 일반 사용자에서 Super User로 사용되는 기록을 남기기 위해서 su 사용로그를 남기도록 하는 보안 설정이 필요하며, 시스템의 가용성 및 무결성 등을 침해하는 사건이 발생할 경우 일반적으로 Super User 권한으로 사건이 진행되기 때문에 su의 로깅이 필요합니다.
su 로그를 기록하도록 syslog 설정 파일을 수정해야 하며, auth.notice에 관련된 로그를 파일로 남기고 있어야 합니다.
2. syslog 설정
기본적으로 시스템 운영 중 발생하는 Info 및 alert 등에 대한 기록을 남기기 위한 “syslog.conf” 파일의 보안 설정이 되었는지 점검합니다.
syslog 데몬은 시스템의 로그를 기록하는 전용 데몬으로 원격 또는 로컬 시스템의 커널 메시지 및 시스템로그를 감시하는 역할을 하며, 해당 설정이 제대로 되어 있지 않을 경우 적절한 로그가 시스템 로그파일에 남지 않아 침입자의 흔적이나 시스템 오류사항에 대해 분석 할 수 없습니다.
3. 로그파일 권한 설정
시스템의 기본 로깅 기록은 관리자 이외에 다른 일반 사용자에게 열람할 수 있는 권한을 부여할 필요가 없기 때문에 로깅 기록을 저장하는 파일의 소유자 및 읽기권한을 제한함으로써 보안을 강화하는 것이 필요합니다.
로그 저장주기(중요도 : 상)
법에 정해진 최소 로그 저장 기간 적용
기준
가. 로그 파일의 최소 저장 기간 적용
나. 로그 기록을 정기적으로 확인•감독
다. 로그 파일을 별도 저장 장치에 백업 보관 및 쓰기 권한 제한
설정방법
로그파일의 보유기관은 사업 환경에 따라 조정할 수 있으나, ‘정보통신망 이용촉진 및 정보보호 등에 관한 법률’, ‘개인정보보호법’, ‘회사 사규’ 등에 따라 최소 아래 기간 이상을 보관해야 함
1) 사용자 접속정보 기록
사용자 로그인/로그아웃/정보변경 6개월 이상
2) 개인정보취급자의 개인정보처리 시스템 접속 기록
정보주체 식별정보/개인정보취급자 식별정보/접속일시/접속지 정보/ 부여된 권한 유형에 따른 수행업무 등 2년 이상
3) 개인정보취급자 권한 변경 기록
개인정보취급자 권한생성/변경/삭제 3년 이상
담당자는 로그기록을 정기적으로 확인•감독하여 사용자 접속과 관련하여 오류 및 부정행위가 발생하거나 예상되는 경우 즉각적인 보고 조치가 되도록 해야 함
로그 파일이 위•변조되지 않도록 하기 위해 별도 저장 장치에 백업보관하고, 쓰기 권한을 제한하여 보관하는 것이 바람직함. 그 외 수정이 가능하더라도 위•변조 여부를 확인할 수 있는 정보(HMAC 값 또는 전자서명값) 등을 이용한 별도의 보호조치를 취할 수 있음
상세설명
‘정보통신망 이용 촉진 및 정보보호 등에 관한 법률’, ‘개인정보보호법’, ‘회사사규’ 등에 따라 로그 파일은 최소 6개월 이상의 기간은 보관해야 하며, 담당자는 로그 기록을 정기적으로 백업•확인•감독 하여야 합니다.
5. 주요 응용 설정
FTP(File Transfer Protocol)서비스 사용자 제한(중요도 : 상)
FTP 서비스 사용 여부와 사용시 사용자 UMASK, Anonymous FTP 설정
기준
가. root 및 불필요한 계정의 FTP 서비스 제한 나. FTP UMASK ‘077’ 설정 다. Anonymous FTP 제한 설정
※ 가, 나, 다 항목 모두 적용 해야 함
설정방법
1. root 및 불필요한 계정의 FTP 사용 제한 root 및 불필요한 시스템 계정의 FTP 사용이 제한되고 있는지 점검 설정파일 : /etc/ftpusers, /etc/ftpd/ftpusers
- /etc/ftpusers 파일에 root 계정 및 시스템 계정을 추가하여 FTP 로그인을 제한
# vi /etc/ftpusers root … (FTP 서비스 제한 방법 예) # echo root » /etc/ftpd/ftpusers 를 수행 vi로 ”/etc/ftpd/ftpusers“를 열어 root 삽입
- vsftp를 사용하는 경우
vsftpd.conf 파일에서 userlist_enable=YES인 경우 : vsftpd.userlist vsftpd.conf 파일에서 userlist_enable=NO 혹은 옵션이 존재하지 않을 경우 : vsftpd.ftpusers
2.FTP UMASK 제한 # vi /etc/inetd.conf 를 실행하여 아래와 같이 수정 ftp stream tcp nowait root /usr/lbin/ftpd ftpd -u 077 (-u : umask를 설정하겠다는 옵션)
3. Anonymous FTP 제한
- /etc/passwd 파일에 ftp 계정이 삭제되어 있는지 확인하여 있을 경우에 삭제
# cat /etc/passwd | grep ftp # cat /etc/shadow | grep ftp # userdel ftp
상세설명
<root 및 불필요한 계정의 FTP 사용 제한> FTP는 인터넷상이나 내부 네트워크로 연결될 컴퓨터들간에 파일을 교환하기 위한 프로그램으로 보통 서버에 FTP서버를 운용하여 Client로 하여금 FTP 서비스를 받을 수 있게 구성되어 있으며, FTP서버 자체의 버그 및 위험성 때문에 반드시 필요하지 않은 경우를 제외하고는 FTP서버의 사용을 제한해야 합니다.
FTP서비스를 사용할 경우는 높은 권한의 계정으로는 FTP를 사용할 수 없도록 해야 시스템 운영에 따른 위험성이 감소합니다.
불가피 하게 사용할 경우 FTP UMASK 설정하여 전송된 파일의 접근 권한이 적절하게 설정되어 있는지 점검해야 합니다. FTP UMASK 설정이 잘못 되어 있을 경우 FTP를 이용하여 생성된 파일을 누구나 삭제 및 수정 가능합니다.
또한 Anonymous 사용자 제한을 해야 합니다. Anonymous FTP를 사용할 경우 비 인가자가 시스템에 관한 정보를 획득할 수 있으며 디렉터리에 쓰기 권한이 설정되어 있을 경우 local exploit 을 사용하여 다양한 공격이 가능합니다. 반드시 필요한 사용자만 접속을 할 수 있도록 설정하며 이는 시스템 가용성 면에서도 바람직합니다.
SNMP(Simple Network Management Protocol)서비스 설정(중요도 : 중)
SNMP 서비스 확인 및 Community String 보안 설정
기준
가. 서비스 필요 시
- SNMP의 Community String 이 public private 아님
(SNMP Brute-Force Attack 또는 SNMP Dictionary Attack이 가능하므로 반드시 8자리 이상의 자릿수와 숫자, 기호를 혼합하여 강력한 패스워드 형식으로 설정)
나. 서비스 불필요 시
- 서비스 중지 및 시스템 재시작시 서비스가 실행되지 않도록 설정
설정방법
<SNMP 서비스 불필요 시>
# ps -ef | grep snmp root 9546 6970 0 Dec 05 - 1:11 /usr/sbin/snmpd # kill –9 9546 or # /sbin/SnmpAgtStart.d/S560SnmpMaster stop # mv /sbin/ /sbin/SnmpAgtStart.d/S560SnmpMaster /sbin/SnmpAgtStart.d/_S560SnmpMaster
<SNMP 서비스 필요 시> : ”/etc/snmp/snmpd.conf“ 파일 내 community string을 타인이 추측할 수 없도록 변경
‘read-community public‘ 부분의 public 을 <임의의 명>으로 변경 후 서비스 재구동
‘set-community-name:‘ 부분 사용시에는 주의 요망
(public, admin, private 등 쉬운 community name은 사용 제한)
| 항목 | 내용 | 대책 |
|---|---|---|
| SNMP Agent 에 디폴트 Community String 사용 | SNMP의 Community String이 각각 public, private으로 설정되어 있어서 이를 변경하지 않을 경우, 크래커는 해당 시스템의 중요한 정보를 가져갈 수 있음 | 권한을 수정하거나 제거하여 하는 것이 좋으며, 특별한 경우엔 정책에 따라 권한을 다르게 부여해야 함 |
| SNMP를 이용한 네트워크인터페이스 정보 획득 | SNMP를 통해서 원격 호스트의 네트워크 인터페이스의 리스트를 얻을 수 있음 | SNMP를 사용할 경우에는 community string 을 추측하기 어려운 것으로 설정하도록 함 |
| SNMP RPC 서비스 | community string 이 public 이나 private 과 같이 디폴트 상태로 되어 있는 경우 시스템 및 네트워크 장비의 정보를 원격에서 알아낼 수 있으며, 시스템의 설정을 변경할 수 있음 | SNMP를 사용할 경우 community string를 추측하기 어려운 것으로 변경해야 함 |
| SNMP 사용하여 OS type 획득 | SNMP를 사용하여 서버의 OS 및 버전정보를 알아낼 수 있음 | 권한을 수정하거나 제거하여 하는 것이 좋으며, 특별한 경우엔 정책에 따라 권한을 다르게 부여해야 함 |
상세설명
SNMP 서비스는 시스템 상태를 실시간으로 파악하는 NMS를 위하여 UNIX 시스템에서 기본적으로 제공하는 서비스이며, 해당 정보를 받기 위한 일종의 패스워드인 Community String이 Default 값인 public, private으로 설정되어 있는 경우가 많기 때문에 이를 변경하지 않으면 이 String을 악용하여 비인가 사용자가 시스템의 주요 정보 및 설정 상황을 파악 할 수 있는 취약성이 존재합니다.
서버에서 SNMP 서비스를 사용하지 않는다면, 즉 NMS에서 해당 서버를 모니터링 하지 않는 등 이라면 SNMP 서비스를 제거하는 것이 바람직합니다.
SNMP 서비스를 사용할 때는 ”/etc/snmp/conf/snmpd.conf 혹은 /etc/snmp/snmpd.conf“ 파일에서 community string을 어렵게 변경하는 것이 필요합니다.
SMTP(Send Mail Transfer Protocol)서비스 설정(중요도 : 중)
SMTP 서비스 사용유무 및 설정
기준
가. 서비스 필요 시
- Sendmail Abuse 방지 방법 및 일반 사용자 q옵션 사용제한
- Sendmail 8.14.4 이상의 버전 사용
나. 서비스 불필요 시
- 서비스 중지 및 시스템 재시작시 서비스가 실행되지 않도록 설정
설정방법
<SMTP 서비스 필요 시 >
1) Sendmail Abuse 방지 방법 및 일반 사용자 q옵션 사용 제한
- Sendmail의 기본적인 서비스인 VRFY, EXPN을 다음과 같이 설정 하고 q옵션 제한
# vi /etc/mail/sendmail.cf 파일을 아래와 같이 수정
O PrivacyOptions=authwarnings, noexpn, novrfy, restricqrun
2) 취약한 Senmail 버전 사용 제한
1) Sendmail 서비스가 실행되고 있는지 점검
# ps –ef | grep sendmail
2) Sendmail 버전 점검
# telnet localhost 25
3) Sendmail의 버전을 확인하고, ftp://ftp.sendmail.org/pub/sendmail 에서 보안 패치가 존재하는지 확인
4) O/S에 따라 설정하는 방법이 다를 수 있으므로, 홈페이지(http://www.sendmail.org/) 에서 해당 OS에 관한 정보를 확인 후 업그레이드
<SMTP 서비스 불필요 시>
1) 실행중인 서비스 중지
# ps –ef | grep sendmail root 441 1 0 Sep19 ? 00:00:00 sendmail: accepting connections # kill -9 441
2) 시스템 재 시작시 SMTP Server 가 시작되지 않게 하기 위해서 아래와 같이 수행
# mv /etc/rc2.d/S88sendmail /etc/rc2.d/_S88sendmail
상세설명
SMTP는 많은 보안취약성을 포함하고 있어 잠재적인 위험성들이 존재하며, 서버에서 SMTP를 사용하는 목적을 검토하여 사용할 필요가 없는 경우에는 서비스를 제거하는 것이 바람직합니다.
SMTP 서비스 운영 시 Sendmail Abuse를 방지하기 위해 Sendmail의 기본적인 서비스인 VRFY, EXPN을 막아야 하고 일반 사용자의 q 옵션을 사용한 Sendmail 실행을 방지하여 메일큐의 내용과 sendmail 설정을 보거나, 메일큐를 강제적으로 drop 할 수 있는 기능을 막아야 합니다.
또한, Sendmail 경우 8.13.8 이하 버전에서 대부분의 취약성이 발견되어 8.14.4 이상의 버전 사용을 권고하며, 아래는 최근 Sendmail의 취약점들이고 취약점 버전을 사용하는 시스템은 업그레이드가 필요합니다.
SSL Certificate NULL Character Spoofing(CVE-2009-4565) 취약점 : 8.14.3 이전 버전 Heap-based buffer overflow(CVE-2009-1490) 취약점 : 8.13.1.2 이전 버전
특별한 목적으로 사용하지 않는다면 SMTP 서비스를 제거합니다.
- sendmail 최신 버전 및 설정 적용 확인
① vrfy, expn 명령어 제거 및 일반 사용자의 q 옵션을 사용한 실행 방지
② sendmail 8.14.4 이상 사용
③ 메일 릴레이 기능 제한
④ Address Parser 취약점에 대한 패치 필요
※ SMTP 설정에 따라 sendmail.cf 파일 위치가 상이할 수 있습니다.
DNS(Domain Name Service)보안 설정(중요도 : 중)
DNS 서비스 사용유무 및 설정
기준
가. 서비스 필요 시
- 특정서버로만 전송 가능하도록 IP 제한
- BIND 9.9.2-P1 이상의 최신 버전 업데이트 권고
나. 서비스 불필요 시
- 서비스 중지 및 시스템 재 시작 시 서비스 시작되지 않도록 설정
설정방법
<DNS 서비스 필요 시>
<BIND8 DNS 설정(/etc/named.conf) 수정 예>
options {
allow-transfer {존 파일 전송을 허용하고자 하는 IP;};
};
<BIND4.9 DNS 설정(/etc/named.boot) 수정 예> Options xfrnets 허용하고자 하는 IP
<서비스 불필요 시> 1) 실행중인 서비스 중지
# ps -ef | grep named root 279 1 0 Sep 22 ? 1:17 /usr/sbin/in.named # kill -9 279
2) 시스템 재시작시 DNS Server 가 시작되지 않도록 함
# mv /etc/rc3.d/ S79named /etc/rc3.d/_S79named
상세설명
일반적으로 Zone Transfer는 Primary Name Server와 Secondary Name Server의 Zone 정보를 일관성 있게 유지하기 위해 이루어지기 때문에 Secondary Name Server로만 Zone Transfer를 할 수 있도록 하면 됩니다.
만약, 허가되지 않는 사용자에게 Zone Transfer를 허용할 경우 공격자는 전송 받은 Zone 정보를 이용하여 호스트 정보, 네트워크 구성 형태 등의 많은 정보를 파악할 수 있게 되며, DNS 서버를 디폴트로 설치할 경우 임의의 사용자가 Zone Transfer 를 할 수 있도록 설정됩니다.
시스템 초기 설치 후, Default 구성을 그대로 사용한다면 DNS서비스를 사용하지 않음에도 불구하고 DNS 서비스가 기동되어 있는 경우가 있으므로, 불필요한 DNS 서비스는 제거해야 합니다.
만약, DNS 서비스를 사용한다면, DNS설정을 통해 내부 Zone 파일을 임의의 외부 서버에서 전송 받지 못하게 하고, 아무나 쿼리 응답을 받을 수 없도록 수정해야 하고 보안을 위한 버전 패치를 해야 합니다.
BIND(Berkeley Internet Name Domain)는 현재(2012. 11)기준으로 BIND 9.9.2-P1 버전이 나왔으며, 이하 버전에서는 거의 모든 취약점이 존재하고 있습니다.
ISC의 BIND 8 버전에 대한 보안 및 시스템 업데이트 지원이 2007.8.27부터 중단됨에 따라, 향후에 발생할 수 있는 보안 취약점에 대비하고, 시스템 성능 향상을 위하여 BIND 9 버전으로의 업그레이드를 권고합니다. (https://www.isc.org/downloads)
- BIND는 거의 모든 버전이 취약한 상태로서 BIND 9.9.2-P1 이상 버전으로 업데이트 필요
- 다음은 최근 BIND 취약점들이며, 취약점 버전을 사용하는 시스템은 업그레이드 필요
서비스 거부(Denial-of-Service)(CVE-2009-4022) 취약점 : 9.6.0이전 버전
특별한 목적으로 사용하지 않는다면 DNS 서비스 제거합니다.
SWAT(Samba Web Administrator Tool)보안 설정(중요도 : 상)
SWAT 서비스 사용유무 및 설정
기준
가. SWAT 서비스 제거
※ 침입차단시스템을 사용하여 901번 포트 필터링 시 예외처리
설정방법
<SWAT 서비스 필요 시> 침입차단시스템을 사용한다면 침입차단시스템 관리자에게 연락하여 901번 포트를 필터링 함으로써 외부 네트워크로부터의 SWAT 접근을 막기를 권장함
<SWAT 서비스 불필요 시> 1) SWAT을 사용할 필요가 없다면 아래와 같이 구동 중지
# vi /etc/inetd.conf 파일 실행하여 아래와 같이 내용 수정 (수정 전) swat stream tcp nowait.400 root /opt/samba/bin/swat swat (수정 후) #swat stream tcp nowait.400 root /opt/samba/bin/swat swat
2) inetd 재구동
# inetd –c
상세설명
SWAT(Samba Web Administration Tool)은 잘못된 사용자와 비밀번호를 입력하였을 때 아래와 같이 서로 다른 메시지를 출력합니다.
사용자 ID는 맞고 비밀번호만 틀렸을 때 : 401 Authorization Required. You must be authenticated to use this service. 사용자 ID, 비밀번호 모두 틀렸을 때 : 401 Bad Authorization username/password must be supplied
이렇게 서로 다른 메시지를 이용하여 일률적으로 사용자 ID와 비밀번호를 대입하는 강제 공격(brute-force)으로 그 메시지에 따라 사용자 ID를 알아낼 수 있습니다.
Samba 버전 취약성
Samba 서비스 사용여부 및 버전 확인
기준
가. 서비스 필요 시
- Version 4.0.1 업그레이드
나. 서비스 불필요 시
- 서비스 제거
설정방법
<Samba 서비스 필요 시>
서비스를 위해 사용시에는 Version 3.6.2 업그레이드
<Samba 서비스 불필요 시>
1) Samba를 사용할 필요가 없다면 아래와 같이 구동중지
# ps –ef | grep smb 538 ? 00:00:00 smbd # kill -9 538
2) 부팅스크립트 삭제
# mv /etc/rc3.d/S90samba /etc/rc3.d/_S90samba
상세설명
Samba 서버는 다수의 취약점이 발견되고 있으며, 하위버전의 Samba를 사용할 경우 강제공격, Buffer overflow 등의 공격대상이 될 수 있습니다.
- Samba 경우 3.4 이하 버전에서 취약성이 대부분 발견되었으며, 현재(2012.11)기준으로 Samba 4.0.1이 최신 버전이기 때문에 Samba 4.0.1 이상의 버전을 사용할 것을 권장합니다.
- 다음은 최근 Samba 취약점들이며, 취약점 버전을 사용하는 시스템은 업그레이드 필요합니다.
Samba Information Disclosure and Denial of Service (CVE-2009-2906) 취약점 : 3.4 이전 버전
※ Samba 취약점 버전에 대해서 패치를 제공하므로 취약점에 대해서 패치 할 것을 권고(http://www.samba.org/samba/history/security.html)
SSH(Secure Shell)버전 취약성(중요도 : 중)
SSH 사용여부 따른 버전 확인
기준
가. 서비스 필요 시
- 최신버전의 SSH 를 설치하여 운영 (openSSH 6.1 2012.11)
나. 서비스 불필요 시
- 실행중인 SSH 서비스 제거
설정방법
<SSH 서비스 필요시>
1) 최신버전의 SSH를 설치하여 운영하는 것을 권고
최신 SSH버전은 현재(2012/11/31)기준으로 openSSH 6.1이며, openSSH 6.1이상의 버전을 사용할 것을 권장 (openSSH는 http://www.openssh.org에서 다운 가능)
<서비스 불필요시>
1) 실행중인 서비스를 중지
# ps –ef | grep sshd root 414 0.0 0.7 2672 1692 /usr/sbin/sshd # kill -9 414
2) SSH가 시작되지 않도록 시작스크립트의 파일명 변경 (OS 마다 시작스크립트 위치 다름)
# ls –al /etc/rc*.d/* | grep sshd (시작스크립트 파일 위치 확인) # mv /etc/rc2.d/S55sshd /etc/rc2.d/_S55sshd
※ SSH 설정에 따라 /opt/ssh/etc/sshd_config 파일 위치가 상이할 수 있음
상세설명
OpenSSH는 SSH(Secure Shell) 프로토콜을 구현한 오픈 소스 프로그램으로 telnet, ftp, rlogin, rsh 등을 대체하고 있으며, 네트워크 트래픽을 암호화하여 패킷 스니핑과 같은 공격으로부터 중요한 데이터를 보호할 수 있습니다.
그러나, OpenSSH의 낮은 버전에서는 다수의 취약점이 발견되고 있으며, 이러한 취약점으로 인해 root 계정 권한 획득, DoS공격 등 다양한 공격의 대상이 될 수 있습니다.
- 다음은 OpenSSH 취약점들이며, 취약점 버전을 사용하는 시스템은 업그레이드가 필요합니다.
Plaintext Recovery Attack Against SSH 취약점 : 5.1 이전 버전
X11UseLocalhost=no hijacking attack(CVE-2008-1483) 취약점 : OpenSSH 5.0 이전 버전
x-server접속 제한 설정(중요도 : 상)
임의의 호스트에서 해킹 대상 시스템의 x-server 접속 제한 설정
기준
가. 모든 사용자의 자동 실행파일 에서 ‘xhost +’ 와 같은 x-server 접속 설정 제거
설정방법
모든 사용자의 자동 실행화일(.login, .profile, .cshrc, .xinitrc, .xsession 등)에서 ‘xhost +’와 같은 명령은 모두 제거
상세설명
유닉스 시스템의 GUI 프로그램은 X-Window를 기반으로 수행되므로 이 X-Window를 사용하는 시스템의 경우에 임의의 호스트에서 해킹 대상 시스템의 X-Server에의 접속을 허용할 경우에 공격자는 대상 시스템의 X-Server에 접속한 뒤 다음과 같은 작업을 할 수 있습니다.
- 사용자가 타이핑하는 여러 가지 정보(예 : password 등)들을 키보드로부터 읽을 수 있는 것이 가능
- 스크린으로 출력되는 모든 정보를 볼 수 있는 것이 가능
- 임의의 정보를 스크린에 출력 가능
- 임의의 응용 프로그램을 실행시키거나 중지 가능
- 사용자의 세션을 제어 가능
6. 주요 응용 설정
보안 패치 적용(중요도 : 중)
서버 침해 방지를 위해 주기적으로 보안 패치 적용
기준
가. 최신 보안패치 및 버그 Fix 된 패치 적용
설정방법
최신 보안패치 및 버그 Fix 된 패치 설치
“swlist –l fileset | grep patch”로 서버에 적용되어 있는 패치 리스트를 확인
HPUX 는 다양한 하드웨어 플랫폼과 OS로 인해 General한 Security Patch가 공개되어 있지 않음 그리고, security_patch_check 라는 프로그램(펄 스크립트)을 서버에 설치/실행하여 서버의 취약한 Security Patch 리스트를 얻을 수 있음
security_patch_check 는 현재 적용되고 있는 패치 리스트를 분석 하는 툴 이며, 적용 가능한 패치 와 설치되지 않은 패치 정보를 리포트 형식으로 제공 하고, 시스템에서 보안 패치에 대한 오류정보를 자동으로 체크하여 알려주고 있음
security_patch_check 를 사용하기 위해서는 Service Control Manager 라는 도구를 서버에 설치하여야 하며, security_patch_check 사용관련 내용은 비고란을 참조 바람
<패치 적용의 예>
1) 수작업에 의한 패치 적용
운영자에 의한 패치 적용 방법은 아래와 같은 단계에 의해 설정
(1) http://www11.itrc.hp.com/service/patch/mainPage.do 접속
(2) HPUX 선택하여 해당 페이지 이동
(3) 해당되는 H/W, OS 를 선택
(4) 키워드, Patch-ID, Patch 리스트 옵션을 선택하여 검색
(5) 검색 결과를 받음
(6) 필요한 패치를 선택하여 다운로드 받음
(7) 패치간의 dependency를 고려하여 적용할 패치를 결정
2) Custom Patch Manager에 의한 패치 적용
CPM(Custom Patch Manager)는 해당 시스템에 적합한 패치를 선택하고 다운로드 받을 수 있도록 하는 툴임. CPM을 이용하여 환경에서 설정된 일정기간 간격 별로 패치를 자동 적용할 수 있으며, dependency관계나 conflict 관계를 자동 분석하여 적용할 패치를 결정해줌. CPM을 이용하는 단계는 다음과 같음
(1) ITRC 웹사이트에 (http://itrc.hp.com)이동하여 로그인
(2) maintenance/support 링크를 클릭한 후 customized patch bundles를 선택
(3) cpm_collect.sh 스크립트를 다운로드 받아 실행하여 현재 configuration에 대한 정보를 취합
(4) cpm_collect.sh 스크립트를 돌려 얻은 configuration에 대해 얻은 결과를 ITRC페이지에 업로드
(5) Perform Patch Analysis를 클릭함으로써 필요한 candidate patch list를 얻음
(6) 선택한 패치간의 conflict가 없는지 점검
(7) 선택한 패치를 Package버튼을 선택함으로써 다운로드 받은 후 패치를 설치
<패치적용>
- “swlist –l product” 로 서버에 적용되어 있는 패치 리스트를 확인
- OS별, 제품별, 보안관련 분류되어 패치파일을 제공 : http://itrc.hp.com/
: http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=B6834AA
<패치적용의 예>
# mkdir /var/spool/patch
위와 같은 디렉터리를 만들어 Patch 파일을 관리
- 패치 설치 순서
(예) : Patch: PHCO_16341: HP AutoRAID Manager cumulative patch 를 적용
# swlist –l fileset | grep PHCO_16341 (System에 patch가 설치 되어 있는 지 확인) PHCO_16341.txt # sh PHCO_16341.txt # ls PHCO_16341.txt PHCO_16341.depot PHCO_16341.text # swinstall –s /var/spool/patch /PHCO_16341.depot #swlist –l fileset | grep PHCO_16341 (설치된 patch 확인)
<설치 시 주의사항>
※ Patch적용 후에 Rebooting이 필요한 경우가 있으므로 README-Patch-ID 파일을 주의 깊게 보아야 함
상세설명
주기적인 패치 적용을 통하여 보안성 및 시스템 안정성을 확보하는 것이 시스템 운용의 중요한 요소이며, 서비스 중인 시스템의 경우 패치 적용에 따르는 문제점(현재 운용중인 응용프로그램의 예기치 않은 중지, 패치 자체의 버그등)과 재부팅의 어려움 등으로 많은 패치를 적용하는 것이 매우 어렵기 때문에 패치 적용 시 많은 부분을 고려해야 합니다.
시스템의 보안성 및 안전성을 위하여 주기적으로 패치를 적용하는 것이 바람직하나, 아래의 사항을 고려하여 OS벤더 엔지니어의 충분한 검토 후 서버에서 운용중인 서비스에 아무런 영향이 없다고 판단될 때 OS벤더 엔지니어의 작업 하에 패치를 적용해야 합니다.
| No | 패치 적용시 고려 및 준수해야 할 사항 |
|---|---|
| 1 | 해당 패치가 시스템 자체에 미칠 수 있는 영향을 OS 벤더측에서 검토 후, 이상이 없을 때 패치를 적용 |
| 2 | 해당 패치가 시스템에서 운용중인 서비스 프로그램에 미칠 수 있는 영향을 OS벤더측과 서비스 프로그램(즉 응용프로그램) 개발자측과 함께 검토 후, 이상이 없을 때 패치를 적용 |
| 3 | 패치 적용 후 예기치 않은 서비스의 중지에 대비하여, 패치 작업을 실시하기 전에 Roll-Back 및 비상복구 절차 수립 및 테스트 필요 |
| 4 | 패치 적용 전/후 시스템에 대한 Full Backup을 실시. |
