Linux System Deployment Specification v1.0

Source: Internet
Author: User
Tags ossec

  1. Linux System Deployment Specification v1.0
  2. Objective:
  3. 1, to minimize the operation of the line;
  4. 2, as far as possible to achieve automated deployment;
  5. 3, as far as possible to reduce installation services and start-up services;
  6. 4, the use of security protocols as far as possible to provide services;
  7. 5, as far as possible to make business systems single;
  8. 6, as far as possible to monitor all the information can be monitored;
  9. 7, as far as possible to control all controllable security policies;
  10. 8. Update patches to patch bugs as regularly as possible;
  11. Specific specifications:
  12. A, account and password
  13. Account:
  14. 1. For each system maintenance personnel to establish a separate general rights account, for monitoring machine to establish a monitoring account, respectively, for daily system maintenance and system monitoring;
  15. 2. FTP server configuration virtual account;
  16. 3. Except the root account, the system maintenance personnel account and the monitoring machine account for all accounts outside the use of shell permissions;
  17. 4. Lock all accounts that are automatically created when the system is installed;
  18. Password:
  19. 1. Strength: 15 or more; Contains letters (uppercase and lowercase letters), numbers and special symbols; English words are not allowed;
  20. 2. Change frequency: 120 days;
  21. 3. Recommended way to choose a password: Come up with a sentence, with each word of the first letter and its inclusion, and replace the letter with its similar numbers or symbols to generate a password, but according to the first rule;
  22. B, program deployment
  23. 1, before deployment pay attention to check whether there are conflicting business ports and programs;
  24. 2, the use of automated installation scripts deployed to the Convention directory;
  25. 3. Delete temporary files and information files with confidentiality restrictions after deployment;
  26. 4, the command operation should not be directly with the password operation, such as: mysql–uroot–p123456
  27. 5, after the completion of service deployment, it is easy not to change the system environment, so as not to cause business failure;
  28. C, System optimization
  29. Adjust the following kernel parameters to improve the system's ability to prevent IP spoofing and Dos attacks:
  30. Example:
  31. Net.ipv4.ip_forward = 0 # for LVS, gateways or VPN servers, to be set to 1
  32. Net.ipv4.tcp_syncookies = 1
  33. Net.ipv4.conf.all.accept_source_route = 0
  34. net.ipv4.conf.all.accept_redirects = 0
  35. Net.ipv4.conf.all.rp_filter = 1 # for LVS back-end servers, set to 0
  36. Net.ipv4.icmp_echo_ignore_broadcasts = 1
  37. net.ipv4.icmp_ignore_bogus_error_responses = 1
  38. Net.ipv4.conf.all.log_martians = 1
  39. KERNEL.SYSRQ = 0
  40. Kernel.core_uses_pid = 1
  41. D. Service Optimization and security
  42. 1, the specific performance optimization, according to the hardware , the general need to modify less, depending on the circumstances;
  43. 2. Service Security
  44. For reference only:
  45. Apache
  46. 1, hidden version number
  47. Servertokens productonly
  48. Serversignature OFF
  49. Or
  50. Servertokens Prod
  51. Serversignature OFF
  52. 2. Disable Symbolic Links
  53. 3. Run nobody with a specific user
  54. 4, specify the listening port and IP (if no multi-IP service required)
  55. 5. root directory Permissions
  56. 6. Mod_security is an open source Web Application Security program (or Web application firewall) that integrates intrusion detection and defense engine functionality. It runs as a module of the Apache Web server, and the goal is to enhance the security of the Web application. Prevent Web applications from being exposed to known or unknown attacks.
  57. 7, Mod_evasive is an Apache (httpd) server anti-DDoS module
  58. 8, Mod_cband module, can limit the user and virtual host bandwidth. Includes: bandwidth limit, maximum download speed, Access request speed per second, and maximum number of concurrent access IP connections
  59. Php
  60. 1, hidden version number
  61. 2. Prohibit remote file function
  62. 3. Improve program Security
  63. 4, does not display the error message, needs to check the wrong turn on
  64. 5. Prohibit global variables (subject to availability)
  65. Sed-i ' s/expose_php = on/expose_php = Off/g '/home/system/php/lib/php.ini
  66. Sed-i ' S/allow_url_fopen = On/allow_url_fopen = Off/g '/home/system/php/lib/php.ini
  67. Sed-i ' S/MAGIC_QUOTES_GPC = OFF/MAGIC_QUOTES_GPC = On/g '/home/system/php/lib/php.ini
  68. Sed-i ' s/display_errors = on/display_errors = Off/g '/home/system/php/lib/php.ini
  69. Sed-i ' s/register_globals= on/register_globals= off/g '/home/system/php/lib/php.ini
  70. 5, Php-ids
  71. 6. Strengthen PHP scripting language security with Suhosin
  72. Mysql
  73. 1. Modify the root user password to remove the empty password
  74. 2. Delete the default test database
  75. 3. Run MSYQL with an independent user
  76. 4. Disable remote connection to the database (turn on specific IP as required)
  77. 5. Limit the number of connected users
  78. 6, strict control of user rights: To give users only the minimum required to complete their work, prohibit the grant process, SUPER, FILE permissions to non-administrative accounts;
  79. 7, prohibit the MySQL data directory to grant Read and write permissions to the MySQL user outside the OS user;
  80. E, System security
  81. Security measures for reference only, because the basic software implementation of only a small number of attacks effective, encountered a lot of attacks by the hardware firewall processing.
  82. Security measures for the CentOS system
  83. 1. Open Iptables
  84. Limit port scanning;
  85. Open the appropriate port for the business;
  86. Restricted port access for source IP restrictions;
  87. 2. Install Ossec-hids Intrusion Detection Program
  88. Ossec is an open-source intrusion detection system, including log analysis, comprehensive detection, rook-kit detection.
  89. 3. Protection against attacks
  90. Protection against a small number of Syn-flood attacks
  91. echo "1″>/proc/sys/net/ipv4/tcp_syn_retries
  92. echo "1″>/proc/sys/net/ipv4/tcp_synack_retries
  93. echo "1″>/proc/sys/net/ipv4/tcp_syncookies
  94. echo "4096″>/proc/sys/net/ipv4/tcp_max_syn_backlog
  95. Protection against a small number of DDoS attacks
  96. The first method:
  97. Installation
  98. wget http://www.inetbase.com/scripts/ddos/install.sh
  99. Chmod 0700 install.sh
  100. ./install.sh
  101. Uninstallation
  102. wget Http://www.inetbase.com/scripts/ddos/uninstall.ddos
  103. Chmod 0700 Uninstall.ddos
  104. ./uninstall.ddos
  105. The second method:
  106. [Email protected]]# cat ddos.sh
  107. #!/bin/bash
  108. /bin/netstat-na|grep Established|awk ' {print $ $} ' |awk-f: ' {print '} ' |sort|uniq-c|sort-rn|head-10|grep-v-e ' 192.168 |127.0′|awk ' {if ($2!=null && $1>4) {print $}} ' >/tmp/dropip
  109. For I in $ (CAT/TMP/DROPIP)
  110. Do
  111. /sbin/iptables-i input-s $i-j DROP
  112. /sbin/iptables-d input-s 122.228.193.245-j DROP
  113. echo "$i kill at ' Date '" >>/var/log/ddos
  114. Done
  115. [Email protected] ddos]#
  116. Protection against ARP attacks
  117. Binding to Ip+mac on a hardware device
  118. To the computer room to do two-way binding (pay)
  119. Protection against CC attacks
  120. Limit the number of connections per unit of time:
  121. Protection for Windows Server
  122. (1), install [Symantec Terminal Protection 12. Small Business Edition]. Endpoint_12, the virus and port scanning and other protection;
  123. (2), open firewall, IPSec.
  124. F. Security audits
  125. Frequency of Audit object tools
  126. Linux system nmap 1 months
  127. Nessus 3 months
  128. Password file John the Ripper 3 months
  129. Web Business Nikto 1 months
  130. AppScan 1 months
  131. Zed Attack Proxy 1 months
  132. Skipfish 1 months
  133. Note: Newly installed servers must undergo security audits before they are allowed into the product environment;
  134. After the new application is released, security audits must be conducted immediately;
  135. G, monitoring and alerting
  136. 1, using Nagios for different hardware and different services to monitor, to give the corresponding thresholds, to provide alarm;
  137. 2, using cacti to generate performance charts for system history data, easy to troubleshoot and prevent;
  138. Summarize:
  139. The above specifications are limited to understand the implementation of the system deployment needs to be noted, can be understood as, installation deployment, performance security, fault alarm and other stages of the work content, each need to be specific implementation of the operation, although not strictly according to the document description of an item completed, but must be in each phase of the corresponding treatment to ensure that the business system

Http://www.brentron.com/xitong/linux/6344.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.