lynis check log

來源:互聯網
上載者:User

標籤:

lynis check System Tools

檢查系統可執行程式環境變數路徑

Boot and services

GRUB2 功能表項目進入單一使用者模式已經設定密碼

其他是檢查開始啟動並執行服務,目前是運行24項服務,開機啟動是21項服務
* 服務指令碼目錄: /lib/systemd/system/
* service檔案許可權: 0644

Kernel

運行層級、已裝入模組、核心配置和核心轉儲

  1. 檢查運行層級 RUNLEVEL 5
  2. 檢查核心版本類型,以及載入模組數量
  3. 檢查核心config檔案,default I/O kernel scheduler,
  4. core dumps 配置,預設沒有開啟,
  5. setuid core dumps 配置為預設
  6. 檢查是否需要重啟
Kernel Hardening
  • Comparing sysctl key pairs with scan profile ,每一項後面是lynis給出的建議值,例如 (exp: 1)
    - kernel.core_uses_pid (exp: 1)                           每個訊息佇列的大小(單位:位元組)限制                      - kernel.ctrl-alt-del (exp: 0)                            是否捕獲ctrl+alt+delete按鍵組合時的訊號, 0,捕獲,1,不捕獲    - kernel.sysrq (exp: 0)                                   是否開啟SysRq功能,0,禁用,1,啟用     - net.ipv4.conf.all.accept_redirects (exp: 0)             ICMP接收重新導向報文(全域設定)         0,忽略, 1 ,轉寄    - net.ipv4.conf.all.accept_source_route (exp: 0)          接受所有源地址資訊包(全域設定)               0,丟棄, 1 ,轉寄    - net.ipv4.conf.all.bootp_relay (exp: 0)                      - net.ipv4.conf.all.forwarding (exp: 0)                   配置主機網路介面的行為,                      0 禁止轉寄,1,允許轉寄    - net.ipv4.conf.all.log_martians (exp: 1)                 將包含非法地址資訊的ip包記錄到核心日誌(全域設定)  0 關閉, 1 開啟    - net.ipv4.conf.all.mc_forwarding (exp: 0)                多播路由                                  0 關閉, 1 開啟    - net.ipv4.conf.all.proxy_arp (exp: 0)                    ARP代理                                  0 關閉, 1 開啟    - net.ipv4.conf.all.rp_filter (exp: 1)                    逆向路徑過濾 (Reverse Path Filtering)0 關閉, 1 Strict mode, 2 Loose mode     - net.ipv4.conf.all.send_redirects (exp: 0)               ICMP發送重新導向報文                        0 關閉, 1 開啟    - net.ipv4.conf.default.accept_redirects (exp: 0)         ICMP接收重新導向報文(預設設定)                0 忽略, 1 轉寄    - net.ipv4.conf.default.accept_source_route (exp: 0)      接受所有源地址資訊包(預設設定)               0 丟棄, 1 轉寄    - net.ipv4.conf.default.log_martians (exp: 1)             將包含非法地址資訊的ip包記錄到核心日誌(預設設定) 0 關閉, 1 開啟    - net.ipv4.icmp_echo_ignore_broadcasts (exp: 1)           設定是否響應icmp echo請求廣播,              0 響應, 1 忽略    - net.ipv4.icmp_ignore_bogus_error_responses (exp: 1)     忽略由網路中的那些聲稱回應地址是廣播位址的主機產生的ICMP錯誤 0 響應, 1 忽略    - net.ipv4.tcp_syncookies (exp: 1)                        表示開啟SYN Cookies,當出現SYN等待隊列溢出時,啟用cookies來處理,可防範少量SYN攻擊, 0 關閉, 1 啟用                         - net.ipv4.tcp_timestamps (exp: 0)                        開啟時間戳記,防範那些偽造的 sequence 號碼        0 關閉, 1 開啟以下是針對ipv6的,和ipv4 的同參數功能相同        - net.ipv6.conf.all.accept_redirects (exp: 0)                 - net.ipv6.conf.all.accept_source_route (exp: 0)              - net.ipv6.conf.default.accept_redirects (exp: 0)             - net.ipv6.conf.default.accept_source_route (exp: 0)      
  • 參考文檔
  1. man proc
  2. 網路部分 https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
Memory and processes

檢查殭屍進程和輸入輸出等待進程,ps -aux

  1. /proc/memento
  2. dead/zombie processes
  3. IO waiting processes
Users, Groups and Authentication

使用者組編號、sudoers檔案、可插拔驗證模組(PAM)配置、密碼老化和預設掩碼

  1. 檢查 UID ID groupname 的唯一性
  2. 檢查 group files 和 password file 檔案的一致性 (TODO)
  3. 檢查命名服務:
  • 網路資訊服務 (Network Information Service, NIS)
  • 輕量型目錄存取通訊協定(Lightweight Directory Access Protocol,LDAP)
  1. 檢查sudo配置及其許可權, /etc/sudoers 預設許可權 0440
  2. PAM認證設定檔檢查,密碼強度配置檢查
  3. 檢查 LDAP module in PAM 是否配置,及其 LDAP authentication Support
  4. 檢查賬戶的到期日,密碼為空白的配置情況
  5. default umask (todo)
    /etc/profile 755
    /etc/login.defs 644
    /etc/init.d/rc 644
Shells
  1. /etc/shells 查看當前系統存在的shell數量
  2. 測試是否存在 Shellshock 漏洞
File systems

掛載點、臨時檔案和根檔案系統

  1. 檢查 /home /tmp 掛載點
  2. 檢查 是否存在UNIX檔案系統 FFS/UFS (BSD體系)
  3. 檢查 swap分區,測試swap分區狀態
  4. 檢查 /tmp old files 和 sticky bit,正確的許可權 (1777)
  5. 檢查 根分區是否開啟 ACL 支援 已經開啟 (todo)
  6. 檢查 Locate database (todo)
  7. 檢查是否存在加密檔案系統 否
Storage

檢查 USB儲存(usb-storage)和火線開放式主機控制器介面(firewire ohci) NOT DISABLED

相關設定檔

  • /lib/modprobe.d/aliases.conf
  • /etc/modprobe.d/*
NFS
  1. 查詢 是否存在 rpc 程式 (Remote Procedure Call,遠端程序呼叫)
  2. 查詢 NFS 版本,協議,服務
Software: name services
  1. 檢查預設的 DNS search domain
  2. 檢查 search domains
  3. 檢查 /etc/resolv.conf 是否存在 options 配置項
  4. 檢查 DNS domain name
  5. 檢查 nscd,bind,PowerDNS,ypbind 運行狀態
  6. 檢查 /etc/hosts
  • duplicates
  • hostname
  • localhost
Ports and packages
  • 包管理套件: dpkg apt-get
  • 檢查設定檔,以及是否存在安裝更新倉庫: 相關配置 /etc/apt/sources.list.d/*
  • 包管理套件對應的資料庫完整性和一致性檢查,是針對包依賴關係,而不是包的檔案內容,相關命令 dpkg -C
  • 檢查 vulnerable packages (還沒太理解含義)
Networking

名稱伺服器、混雜介面和串連狀態

  • 檢查是否配置nameservers 建議至少兩個可用的nameserver
  • 檢查是否存在預設的網關,
  • 檢查listening ports (TCP/UDP) 發現22個,通過下面命令可以查詢

    netstat -tlnp netstat -ulnp
  • 檢查網卡是否支援Promiscuous工作模式(混雜工作模式)

    ifconfig [interface] promiscifconfig [interface] -promisc
  • 檢查當前串連狀態,可執行命令查看 netstat -nat
  • 檢查DHCP用戶端程式運行狀態
Printers and Spools

列印服務預設不安裝

  • cups daemon
  • lp daemon
Software: e-mail and messaging

檢查系統中 Exim Postfix Qmail Sendmail 的運行狀態

Software: firewalls
  • 檢查 iptables 運行狀態
  • 檢查 PF firewall (UNIX BSD 體系防火牆)
  • 檢查 host based firewall 配置是否開啟
SSH Support
  • 檢查ssh運行狀態,配置
  • 檢查安全配置項,
  1. PermitRootLogin 設定root遠程登入策略,預設是 without-password
  2. StrictModes 設定ssh在接收登入請求之前是否檢查使用者家目錄和rhosts檔案的許可權和所有權
  3. AllowUsers 使用者白名單
  4. AllowGroups 使用者組白名單
  5. Protocol 支援的協議版本
Logging and files
  • 檢查Log Service運行狀態,當前系統是rsyslog,
  • 其他同類軟體Syslog-NG,RFC 3195,minilogd
  • logrotate進程是否運行,記錄檔管理工具,用於截斷(或輪循)、壓縮,刪除舊記錄檔,備份曆史記錄檔等
  • 檢查是否在使用已經刪除的檔案(deleted files in use)
  • log directories (static list) (todo)
  • open log files (todo)
Insecure services
  • inetd守護進程是否開啟(預設關閉)
Banners and identification
  • 檢查 /etc/motd /etc/issue /etc/issue.net
Scheduled tasks
  1. 檢查 crontab atd 服務運行狀態
  2. 檢查 計劃任務運行狀態
Accounting
  1. 檢查 賬戶資訊
  2. sysstat accounting data 預設沒有開啟
  3. auditd 檢查規則,設定檔,記錄檔
Time and Synchronization
  1. 檢查 ntp 服務或者用戶端是否存在
  2. 檢查 NTP client是否在/etc/anacrontab,/etc/crontab 或 cron.d files 中
Cryptography
  1. 檢查SSL認證是否到期
Virtualization Security frameworks
  1. 檢查 AppArmor,SELinux,Grsecurity 是否開啟或支援
Software: file integrity

檢查以下檔案完整性檢查工具是否存在

AFICK,AIDE,Osiris,Samhain,Tripwire,syscheck,mtree

Software: System tooling

saltstack,puppet,cfengine,chef,func,fabric

File Permissions
  • 檢查 /etc/lilo.conf 和 $HOME/.ssh
Home directories
  • 檢查記錄檔案
Hardening
  1. 檢查是否存在編譯器
  2. 檢查是否存在惡意軟體掃描工具
檢查是否存在以下軟體或服務
  • apache
  • nginx
  • PHP
  • MySQL
  • PostgreSQL
  • Oracle
  • Squid
  • OpenLDAP 運行執行個體
  • SNMP 服務

lynis check log

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.