System Hardening and Security Best Practices
Linux システムハードニングとセキュリティベストプラクティス 包括的ガイド
目次
- はじめに
- CIS Benchmarks 概要
- SSH ハードニング
- ファイアウォール設定
- 不要なサービスの無効化
- カーネルハードニング (sysctl)
- ファイル整合性監視
- auditd 設定
- パスワードポリシー
- アカウントロックアウトポリシー
- バナー設定
- USB デバイス制御
- 自動セキュリティアップデート
- セキュリティスキャンツール
- インシデントレスポンスの基本
- トラブルシューティング
- ベストプラクティスまとめ
- 参考文献
1. はじめに
Linux システムのセキュリティハードニングは、サーバーやワークステーションを不正アクセス、マルウェア、データ漏洩から保護するための不可欠なプロセスである。本ガイドでは、エンタープライズ環境で実践すべき包括的なセキュリティ対策について、具体的な設定例とともに詳細に解説する。
1.1 ハードニングの基本原則
| 原則 | 説明 |
|---|---|
| 最小権限の原則 | ユーザーやプロセスには必要最小限の権限のみを付与する |
| 多層防御 (Defense in Depth) | 複数の防御レイヤーを組み合わせて保護する |
| 攻撃表面の最小化 | 不要なサービス、ポート、ソフトウェアを削除・無効化する |
| フェイルセーフデフォルト | デフォルトでアクセスを拒否し、明示的に許可する |
| 完全な仲介 | すべてのアクセスを検証する |
1.2 ハードニングワークフロー
[ベースラインの確立] → [脆弱性評価] → [ハードニング適用] → [検証・テスト] → [監視・維持]
↑ |
└──────────────────────────────────────────────────────────────────────┘
2. CIS Benchmarks 概要
2.1 CIS Benchmarks とは
CIS (Center for Internet Security) Benchmarks は、IT システムを安全に構成するための業界標準のベストプラクティスガイドラインである。世界中のセキュリティ専門家によってコンセンサスベースで策定される。
2.2 プロファイルレベル
| プロファイル | 説明 | 影響 |
|---|---|---|
| Level 1 | 基本的なセキュリティ設定。運用への影響が最小限 | 低 |
| Level 2 | より厳格なセキュリティ設定。一部機能に制限が生じる可能性 | 中〜高 |
| STIG | 米国防総省の Security Technical Implementation Guide に準拠 | 高 |
2.3 主要な CIS Benchmark カテゴリ
CIS Benchmark Structure
├── 1. Initial Setup
│ ├── Filesystem Configuration
│ ├── Software Updates
│ └── Filesystem Integrity Checking
├── 2. Services
│ ├── Special Purpose Services
│ └── Service Clients
├── 3. Network Configuration
│ ├── Network Parameters (Host Only)
│ ├── Network Parameters (Host and Router)
│ └── Firewall Configuration
├── 4. Logging and Auditing
│ ├── Configure System Accounting (auditd)
│ └── Configure Logging
├── 5. Access, Authentication and Authorization
│ ├── Configure time-based job schedulers
│ ├── SSH Server Configuration
│ ├── Configure PAM
│ └── User Accounts and Environment
└── 6. System Maintenance
├── System File Permissions
└── User and Group Settings
2.4 CIS-CAT Pro の使用
# CIS-CAT Pro Assessor のダウンロードと実行
# (CIS SecureSuite メンバーシップが必要)
# 評価の実行
./Assessor-CLI.sh -b benchmarks/CIS_Ubuntu_Linux_22.04_LTS_Benchmark_v1.0.0-xccdf.xml \
-p "Level 1 - Server" \
-r /tmp/cis-report
# HTML レポートの確認
firefox /tmp/cis-report/CIS_Ubuntu_22.04_Assessment_Report.html
3. SSH ハードニング
3.1 SSH サーバー設定の強化
/etc/ssh/sshd_config の推奨設定:
# === 基本的なセキュリティ設定 ===
# SSHプロトコルバージョン2のみ使用 (SSH1は脆弱)
Protocol 2
# リスニングポートの変更 (デフォルト22からの変更を検討)
Port 2222
# リスニングアドレスの制限
ListenAddress 192.168.1.10
# root ログインの禁止
PermitRootLogin no
# パスワード認証の無効化 (鍵認証のみ)
PasswordAuthentication no
ChallengeResponseAuthentication no
# 空パスワードの禁止
PermitEmptyPasswords no
# 公開鍵認証の有効化
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
# === 暗号化設定 ===
# 強力な暗号スイートのみ使用
Ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512
# ホストキーアルゴリズム
HostKeyAlgorithms ssh-ed25519,rsa-sha2-512,rsa-sha2-256
# === アクセス制御 ===
# 許可するユーザーとグループ
AllowUsers admin deploy
AllowGroups ssh-users
# 拒否するユーザー
DenyUsers nobody
# 最大認証試行回数
MaxAuthTries 3
# 最大同時セッション数
MaxSessions 3
# 最大同時未認証接続数
MaxStartups 10:30:60
# === セッション設定 ===
# ログイン猶予時間 (秒)
LoginGraceTime 30
# クライアントキープアライブ
ClientAliveInterval 300
ClientAliveCountMax 2
# X11 フォワーディングの無効化
X11Forwarding no
# TCP フォワーディングの無効化 (必要な場合のみ有効化)
AllowTcpForwarding no
# エージェントフォワーディングの無効化
AllowAgentForwarding no
# ゲートウェイポートの無効化
GatewayPorts no
# トンネリングの無効化
PermitTunnel no
# === ログ設定 ===
# 詳細なログレベル
LogLevel VERBOSE
# Syslog ファシリティ
SyslogFacility AUTH
# === バナー ===
Banner /etc/ssh/banner
# === その他 ===
# SFTP サブシステム
Subsystem sftp internal-sftp
# 環境変数の受け渡し制限
AcceptEnv LANG LC_*
# UseDNS の無効化 (接続速度向上)
UseDNS no
# Strict モード
StrictModes yes
3.2 SSH 鍵の生成と管理
# Ed25519 鍵の生成 (推奨)
ssh-keygen -t ed25519 -C "admin@example.com" -f ~/.ssh/id_ed25519
# RSA 鍵の生成 (4096ビット以上)
ssh-keygen -t rsa -b 4096 -C "admin@example.com" -f ~/.ssh/id_rsa
# 鍵のパーミッション確認
ls -la ~/.ssh/
# 出力例:
# drwx------ 2 admin admin 4096 Jan 15 10:00 .
# -rw------- 1 admin admin 411 Jan 15 10:00 id_ed25519
# -rw-r--r-- 1 admin admin 100 Jan 15 10:00 id_ed25519.pub
# -rw------- 1 admin admin 740 Jan 15 10:00 authorized_keys
# 適切なパーミッションの設定
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub
3.3 SSH 設定の検証
# 設定ファイルの構文チェック
sshd -t
# 出力がなければ正常
# 拡張テスト (有効な設定値を表示)
sshd -T
# SSHサービスの再起動
systemctl restart sshd
# SSH接続のテスト (別ターミナルから)
ssh -v -p 2222 admin@server-ip
# 現在のSSH接続を確認
ss -tlnp | grep ssh
# 出力例:
# LISTEN 0 128 192.168.1.10:2222 *:* users:(("sshd",pid=1234,fd=3))
3.4 Fail2Ban による SSH 保護
# Fail2Ban のインストール
# Ubuntu/Debian
apt install fail2ban
# CentOS/RHEL
dnf install fail2ban
# SSH jail の設定 (/etc/fail2ban/jail.local)
cat > /etc/fail2ban/jail.local << 'EOF'
[DEFAULT]
bantime = 3600
findtime = 600
maxretry = 3
banaction = iptables-multiport
backend = systemd
[sshd]
enabled = true
port = 2222
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 86400
findtime = 600
EOF
# Fail2Ban の起動
systemctl enable --now fail2ban
# ステータス確認
fail2ban-client status sshd
# 出力例:
# Status for the jail: sshd
# |- Filter
# | |- Currently failed: 2
# | |- Total failed: 15
# | `- File list: /var/log/auth.log
# `- Actions
# |- Currently banned: 1
# |- Total banned: 5
# `- Banned IP list: 203.0.113.50
4. ファイアウォール設定
4.1 firewalld (RHEL/CentOS 系)
# firewalld の有効化
systemctl enable --now firewalld
# デフォルトゾーンの確認
firewall-cmd --get-default-zone
# 出力: public
# アクティブゾーンの確認
firewall-cmd --get-active-zones
# 出力:
# public
# interfaces: eth0
# 許可されたサービスの確認
firewall-cmd --list-all
# 出力例:
# public (active)
# target: default
# icmp-block-inversion: no
# interfaces: eth0
# sources:
# services: dhcpv6-client ssh
# ports:
# protocols:
# forward: no
# masquerade: no
# forward-ports:
# source-ports:
# icmp-blocks:
# rich rules:
# SSH ポートの変更 (2222)
firewall-cmd --permanent --remove-service=ssh
firewall-cmd --permanent --add-port=2222/tcp
# HTTP/HTTPS の許可
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
# 特定の IP からのみアクセスを許可 (リッチルール)
firewall-cmd --permanent --add-rich-rule='
rule family="ipv4"
source address="10.0.0.0/24"
port port="3306" protocol="tcp"
accept'
# ICMP のブロック
firewall-cmd --permanent --add-icmp-block=echo-request
# 設定の適用
firewall-cmd --reload
4.2 nftables
# nftables の設定 (/etc/nftables.conf)
cat > /etc/nftables.conf << 'NFTEOF'
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
# ループバック許可
iif "lo" accept
# 確立済み・関連する接続を許可
ct state established,related accept
# 無効なパケットのドロップ
ct state invalid drop
# ICMP (ping) の制限付き許可
ip protocol icmp icmp type echo-request \
limit rate 4/second accept
# ICMPv6 許可
ip6 nexthdr icmpv6 icmpv6 type {
echo-request,
nd-neighbor-solicit,
nd-router-advert,
nd-neighbor-advert
} accept
# SSH (カスタムポート)
tcp dport 2222 ct state new limit rate 4/minute accept
# HTTP/HTTPS
tcp dport { 80, 443 } accept
# 管理ネットワークからの全アクセス許可
ip saddr 10.0.0.0/24 accept
# ログしてドロップ
log prefix "nftables-drop: " flags all counter drop
}
chain forward {
type filter hook forward priority 0; policy drop;
}
chain output {
type filter hook output priority 0; policy accept;
}
}
# レート制限テーブル
table inet rate_limit {
set blacklist {
type ipv4_addr
flags dynamic,timeout
timeout 1h
}
chain input {
type filter hook input priority -1; policy accept;
# SYNフラッド保護
tcp flags syn tcp dport { 80, 443 } \
meter syn_flood { ip saddr limit rate over 25/second } drop
# ブラックリストのチェック
ip saddr @blacklist drop
}
}
NFTEOF
# nftables の有効化と適用
systemctl enable --now nftables
nft -f /etc/nftables.conf
# 現在のルールセットの確認
nft list ruleset
4.3 iptables (レガシー)
# iptables によるベースライン設定
#!/bin/bash
# すべてのルールをクリア
iptables -F
iptables -X
iptables -Z
# デフォルトポリシー
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# ループバック許可
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# 確立済み接続
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# 無効パケットのドロップ
iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
# SYNフラッド保護
iptables -A INPUT -p tcp --syn -m limit --limit 1/s --limit-burst 3 -j ACCEPT
# SSH (レート制限付き)
iptables -A INPUT -p tcp --dport 2222 -m conntrack --ctstate NEW \
-m recent --set --name SSH
iptables -A INPUT -p tcp --dport 2222 -m conntrack --ctstate NEW \
-m recent --update --seconds 60 --hitcount 4 --name SSH -j DROP
iptables -A INPUT -p tcp --dport 2222 -j ACCEPT
# HTTP/HTTPS
iptables -A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
# Ping (制限付き)
iptables -A INPUT -p icmp --icmp-type echo-request \
-m limit --limit 1/s --limit-burst 4 -j ACCEPT
# ログ
iptables -A INPUT -j LOG --log-prefix "iptables-drop: " --log-level 4
# ドロップ
iptables -A INPUT -j DROP
# ルールの保存
iptables-save > /etc/iptables/rules.v4
5. 不要なサービスの無効化
5.1 実行中のサービスの確認
# すべてのサービスの一覧
systemctl list-units --type=service --state=running
# 出力例:
# UNIT LOAD ACTIVE SUB DESCRIPTION
# auditd.service loaded active running Security Auditing Service
# chronyd.service loaded active running NTP client/server
# crond.service loaded active running Command Scheduler
# dbus.service loaded active running D-Bus System Message Bus
# firewalld.service loaded active running firewalld - dynamic firewall daemon
# ...
# 有効化されたサービスの一覧
systemctl list-unit-files --type=service --state=enabled
# リスニングポートの確認
ss -tlnp
# 出力例:
# State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
# LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=1234,fd=3))
# LISTEN 0 128 0.0.0.0:25 0.0.0.0:* users:(("master",pid=2345,fd=13))
5.2 不要なサービスの無効化リスト
# === 一般的に無効化すべきサービス ===
# Avahi (mDNS/DNS-SD) - サーバーでは不要
systemctl stop avahi-daemon
systemctl disable avahi-daemon
systemctl mask avahi-daemon
# CUPS (印刷サービス) - サーバーでは通常不要
systemctl stop cups
systemctl disable cups
# Bluetooth
systemctl stop bluetooth
systemctl disable bluetooth
# ModemManager
systemctl stop ModemManager
systemctl disable ModemManager
# rpcbind (NFS 不使用時)
systemctl stop rpcbind
systemctl disable rpcbind
systemctl mask rpcbind
# postfix (メールサーバー不使用時)
systemctl stop postfix
systemctl disable postfix
# 無効化の確認
systemctl is-enabled avahi-daemon cups bluetooth
# 出力:
# disabled
# disabled
# disabled
5.3 不要なパッケージの削除
# Ubuntu/Debian
apt purge telnet rsh-client rsh-redone-client nis
apt autoremove
# CentOS/RHEL
dnf remove telnet rsh ypserv tftp-server xinetd
dnf autoremove
# 不要なカーネルモジュールの無効化
cat > /etc/modprobe.d/hardening.conf << 'EOF'
# 不要なファイルシステムの無効化
install cramfs /bin/false
install freevxfs /bin/false
install hfs /bin/false
install hfsplus /bin/false
install jffs2 /bin/false
install squashfs /bin/false
install udf /bin/false
# 不要なネットワークプロトコルの無効化
install dccp /bin/false
install sctp /bin/false
install rds /bin/false
install tipc /bin/false
EOF
6. カーネルハードニング (sysctl)
6.1 ネットワークセキュリティパラメータ
# /etc/sysctl.d/99-security.conf
# === IP フォワーディングの無効化 ===
net.ipv4.ip_forward = 0
net.ipv6.conf.all.forwarding = 0
# === ソースルーティングの無効化 ===
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.conf.default.accept_source_route = 0
# === ICMP リダイレクトの拒否 ===
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
# === リバースパスフィルタリング ===
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
# === SYN Cookie 保護 ===
net.ipv4.tcp_syncookies = 1
# === ブロードキャスト ICMP への応答無効化 ===
net.ipv4.icmp_echo_ignore_broadcasts = 1
# === 不正な ICMP レスポンスの無視 ===
net.ipv4.icmp_ignore_bogus_error_responses = 1
# === マーシャンパケットのログ ===
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.default.log_martians = 1
# === IPv6 Router Advertisement の無効化 ===
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0
# === TCP タイムスタンプ ===
net.ipv4.tcp_timestamps = 0
6.2 カーネルセキュリティパラメータ
# /etc/sysctl.d/99-kernel-security.conf
# === ASLR (Address Space Layout Randomization) ===
kernel.randomize_va_space = 2
# === コアダンプの制限 ===
fs.suid_dumpable = 0
# === カーネルポインタの非表示 ===
kernel.kptr_restrict = 2
# === dmesg アクセスの制限 ===
kernel.dmesg_restrict = 1
# === perf_event アクセスの制限 ===
kernel.perf_event_paranoid = 3
# === SysRq キーの無効化 ===
kernel.sysrq = 0
# === BPF JIT の強化 ===
net.core.bpf_jit_harden = 2
# === Yama LSM ===
kernel.yama.ptrace_scope = 2
# === ハードリンク/シンボリックリンクの保護 ===
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
fs.protected_fifos = 2
fs.protected_regular = 2
# === Unprivileged user namespaces の制限 ===
kernel.unprivileged_userns_clone = 0
# === ExecShield (RHEL系) ===
# kernel.exec-shield = 1
6.3 sysctl の適用と検証
# 設定の適用
sysctl --system
# 特定の値の確認
sysctl net.ipv4.ip_forward
# 出力: net.ipv4.ip_forward = 0
# すべてのセキュリティ設定の確認
sysctl -a | grep -E "(forward|syncookies|rp_filter|randomize)"
# 出力例:
# net.ipv4.ip_forward = 0
# net.ipv4.tcp_syncookies = 1
# net.ipv4.conf.all.rp_filter = 1
# kernel.randomize_va_space = 2
7. ファイル整合性監視
7.1 AIDE (Advanced Intrusion Detection Environment)
# AIDE のインストール
# Ubuntu/Debian
apt install aide
# CentOS/RHEL
dnf install aide
# AIDE 設定ファイル (/etc/aide/aide.conf または /etc/aide.conf)
cat > /etc/aide/aide.conf << 'EOF'
# AIDE 設定
# データベースの場所
database_in=file:/var/lib/aide/aide.db
database_out=file:/var/lib/aide/aide.db.new
# ログファイル
report_url=file:/var/log/aide/aide.log
report_url=stdout
# ルール定義
# p: permissions
# i: inode
# n: number of links
# u: user
# g: group
# s: size
# b: block count
# m: mtime
# c: ctime
# S: check for growing size
# sha256: SHA-256 hash
# sha512: SHA-512 hash
# カスタムルール
NORMAL = p+i+n+u+g+s+m+c+sha256
DIR = p+i+n+u+g
PERMS = p+u+g
LOG = p+u+g+i+n+S
DATAONLY = p+u+g+sha256
# 監視対象ディレクトリ
/boot NORMAL
/bin NORMAL
/sbin NORMAL
/lib NORMAL
/lib64 NORMAL
/usr NORMAL
/etc NORMAL
/root NORMAL
# ログファイル (増大を許可)
/var/log LOG
# 除外
!/var/log/journal
!/var/lib/aide
!/proc
!/sys
!/dev
!/run
!/tmp
!/var/tmp
!/var/cache
!/var/lib/docker
EOF
# AIDE データベースの初期化
aide --init
# 出力例:
# AIDE, version 0.17.4
# ### AIDE database at /var/lib/aide/aide.db.new initialized.
# データベースの配置
mv /var/lib/aide/aide.db.new /var/lib/aide/aide.db
# 整合性チェックの実行
aide --check
# 出力例:
# AIDE 0.17.4 found differences between database and filesystem!!
#
# Summary:
# Total number of entries: 45231
# Added entries: 2
# Removed entries: 0
# Changed entries: 5
#
# ---------------------------------------------------
# Changed entries:
# ---------------------------------------------------
# f ... .C... : /etc/passwd
# f ... .C... : /etc/shadow
# d ... .C... : /etc/
7.2 AIDE の自動実行
# cron ジョブの設定
cat > /etc/cron.daily/aide-check << 'SCRIPT'
#!/bin/bash
MAILTO="security@example.com"
LOGFILE="/var/log/aide/aide-$(date +%Y%m%d).log"
/usr/bin/aide --check > "$LOGFILE" 2>&1
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
mail -s "AIDE Alert: Changes Detected on $(hostname)" \
"$MAILTO" < "$LOGFILE"
fi
# 30日以上古いログの削除
find /var/log/aide -name "aide-*.log" -mtime +30 -delete
SCRIPT
chmod 700 /etc/cron.daily/aide-check
7.3 Tripwire
# Tripwire のインストール
apt install tripwire # Ubuntu/Debian
# サイトキーとローカルキーの生成 (インストール時に設定)
# Tripwire ポリシーの初期化
tripwire --init
# 整合性チェック
tripwire --check
# レポートの表示
twprint --print-report --twrfile /var/lib/tripwire/report/hostname-YYYYMMDD-HHMMSS.twr
# ポリシーの更新
tripwire --update-policy /etc/tripwire/twpol.txt
8. auditd 設定
8.1 auditd の基本設定
# auditd のインストールと有効化
# Ubuntu/Debian
apt install auditd audispd-plugins
# CentOS/RHEL
dnf install audit audit-libs
systemctl enable --now auditd
# メイン設定ファイル (/etc/audit/auditd.conf)
cat > /etc/audit/auditd.conf << 'EOF'
# ログファイル
log_file = /var/log/audit/audit.log
log_group = root
log_format = ENRICHED
# ログローテーション
max_log_file = 50
max_log_file_action = ROTATE
num_logs = 10
# スペース不足時の動作
space_left = 75
space_left_action = SYSLOG
admin_space_left = 50
admin_space_left_action = SINGLE
disk_full_action = HALT
disk_error_action = HALT
# フラッシュ設定
flush = INCREMENTAL_ASYNC
freq = 50
# ネットワーク設定
tcp_listen_queue = 5
tcp_max_per_addr = 1
tcp_client_max_idle = 0
# 名前解決
name_format = HOSTNAME
EOF
8.2 監査ルールの設定
# /etc/audit/rules.d/hardening.rules
# バッファサイズ
-b 8192
# 失敗モード (1=printk, 2=panic)
-f 1
# === 時刻変更の監視 ===
-a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change
-a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change
-a always,exit -F arch=b64 -S clock_settime -k time-change
-w /etc/localtime -p wa -k time-change
# === ユーザー/グループ変更の監視 ===
-w /etc/group -p wa -k identity
-w /etc/passwd -p wa -k identity
-w /etc/gshadow -p wa -k identity
-w /etc/shadow -p wa -k identity
-w /etc/security/opasswd -p wa -k identity
# === ネットワーク設定変更 ===
-a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale
-w /etc/issue -p wa -k system-locale
-w /etc/issue.net -p wa -k system-locale
-w /etc/hosts -p wa -k system-locale
-w /etc/hostname -p wa -k system-locale
-w /etc/sysconfig/network -p wa -k system-locale
# === ログインイベント ===
-w /var/log/lastlog -p wa -k logins
-w /var/run/faillock/ -p wa -k logins
-w /var/log/tallylog -p wa -k logins
-w /var/log/wtmp -p wa -k logins
-w /var/log/btmp -p wa -k logins
# === セッション開始 ===
-w /var/run/utmp -p wa -k session
# === 権限変更 ===
-a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod
# === ファイル削除の監視 ===
-a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete
# === sudo の使用 ===
-w /etc/sudoers -p wa -k scope
-w /etc/sudoers.d/ -p wa -k scope
-a always,exit -F arch=b64 -S execve -F euid=0 -F auid>=1000 -F auid!=4294967295 -k sudo_log
# === カーネルモジュール ===
-w /sbin/insmod -p x -k modules
-w /sbin/rmmod -p x -k modules
-w /sbin/modprobe -p x -k modules
-a always,exit -F arch=b64 -S init_module -S delete_module -k modules
# === 監査設定の変更を不可に ===
-e 2
8.3 監査ログの検索と分析
# auditd ルールの読み込み
augenrules --load
# 監査ログの検索
# 特定のキーでフィルタ
ausearch -k identity
# 出力例:
# ----
# time->Thu Jan 15 14:30:22 2025
# type=CONFIG_CHANGE msg=audit(1705328422.123:456): auid=1000 ses=1
# op=add_rule key="identity" list=4 res=1
# 特定ユーザーのアクション
ausearch -ua 1000 --start today
# ファイルアクセス
ausearch -f /etc/passwd
# 認証失敗
ausearch -m USER_AUTH --success no
# レポート生成
aureport --summary
# 出力例:
# Summary Report
# ======================
# Range of time in logs: 01/01/2025 00:00:01 - 01/15/2025 23:59:59
# Selected time for report: 01/01/2025 00:00:01 - 01/15/2025 23:59:59
# Number of changes in configuration: 45
# Number of changes to accounts, groups, or roles: 12
# Number of logins: 234
# Number of failed logins: 15
# Number of authentications: 567
# Number of failed authentications: 23
# Number of anomaly events: 3
# 認証レポート
aureport --auth
# ログインレポート
aureport --login --failed
9. パスワードポリシー
9.1 パスワードエージングポリシー
# /etc/login.defs の設定
cat >> /etc/login.defs << 'EOF'
# パスワードの最大有効日数
PASS_MAX_DAYS 90
# パスワードの最小有効日数 (変更後すぐに再変更させない)
PASS_MIN_DAYS 7
# パスワード有効期限切れの警告日数
PASS_WARN_AGE 14
# パスワードの最小文字数
PASS_MIN_LEN 14
# SHA512 ハッシュの使用
ENCRYPT_METHOD SHA512
# ログイン試行回数
LOGIN_RETRIES 3
# ログインタイムアウト
LOGIN_TIMEOUT 60
EOF
# 既存ユーザーへのポリシー適用
chage -M 90 -m 7 -W 14 username
# ユーザーのパスワード情報確認
chage -l username
# 出力例:
# Last password change : Jan 15, 2025
# Password expires : Apr 15, 2025
# Password inactive : never
# Account expires : never
# Minimum number of days between password change : 7
# Maximum number of days between password change : 90
# Number of days of warning before password expires : 14
9.2 パスワード品質要件 (pam_pwquality)
# /etc/security/pwquality.conf
cat > /etc/security/pwquality.conf << 'EOF'
# パスワードの最小長
minlen = 14
# 最小文字クラス数 (大文字、小文字、数字、特殊文字)
minclass = 3
# 最小大文字数
ucredit = -1
# 最小小文字数
lcredit = -1
# 最小数字数
dcredit = -1
# 最小特殊文字数
ocredit = -1
# 旧パスワードとの最小差異文字数
difok = 8
# ユーザー名のチェック
usercheck = 1
# 辞書チェック
dictcheck = 1
# 連続する同一文字の最大数
maxrepeat = 3
# 連続する同一クラスの最大数
maxclassrepeat = 4
# 回文チェック
palindrome = 1
# パスワード履歴 (過去N個のパスワードを拒否)
remember = 12
# 不正なパスワード試行回数
retry = 3
# root にもポリシーを適用
enforce_for_root
EOF
10. アカウントロックアウトポリシー
10.1 pam_faillock の設定
# /etc/security/faillock.conf
cat > /etc/security/faillock.conf << 'EOF'
# ロックアウトまでの失敗回数
deny = 5
# ロックアウト期間 (秒) - 0 は管理者による手動解除のみ
unlock_time = 900
# 失敗カウントのリセット時間 (秒)
fail_interval = 900
# root にもロックアウトを適用
even_deny_root
# root のロックアウト期間
root_unlock_time = 60
# ログディレクトリ
dir = /var/run/faillock
# 監査ログの有効化
audit
# サイレントモード (ユーザーにロックアウトを通知しない)
# silent
EOF
# PAM 設定 (/etc/pam.d/system-auth または /etc/pam.d/common-auth)
# Ubuntu/Debian の場合
cat > /etc/pam.d/common-auth << 'EOF'
auth required pam_faillock.so preauth
auth [success=1 default=ignore] pam_unix.so nullok
auth [default=die] pam_faillock.so authfail
auth sufficient pam_faillock.so authsucc
auth requisite pam_deny.so
auth required pam_permit.so
EOF
10.2 ロックアウトの管理
# ユーザーのロックアウト状態確認
faillock --user username
# 出力例:
# username:
# When Type Source Valid
# 2025-01-15 14:30:22 RHOST 192.168.1.100 V
# 2025-01-15 14:30:25 RHOST 192.168.1.100 V
# 2025-01-15 14:30:28 RHOST 192.168.1.100 V
# 2025-01-15 14:30:31 RHOST 192.168.1.100 V
# 2025-01-15 14:30:34 RHOST 192.168.1.100 V
# ロックアウトの解除
faillock --user username --reset
# すべてのユーザーのロックアウト状態
faillock
11. バナー設定
11.1 ログインバナー
# SSH バナー (/etc/ssh/banner)
cat > /etc/ssh/banner << 'EOF'
*******************************************************************
* WARNING - AUTHORIZED USE ONLY *
* *
* This system is for the use of authorized users only. *
* Individuals using this computer system without authority, or *
* in excess of their authority, are subject to having all of *
* their activities on this system monitored and recorded. *
* *
* In the course of monitoring individuals improperly using this *
* system, or in the course of system maintenance, the activities *
* of authorized users may also be monitored. *
* *
* Anyone using this system expressly consents to such monitoring *
* and is advised that if such monitoring reveals possible *
* evidence of criminal activity, system personnel may provide *
* the evidence of such monitoring to law enforcement officials. *
*******************************************************************
EOF
# コンソールバナー
cat > /etc/issue << 'EOF'
Authorized access only. All activity may be monitored and reported.
EOF
# リモートバナー
cat > /etc/issue.net << 'EOF'
Authorized access only. All activity may be monitored and reported.
EOF
# MOTD (Message of the Day) - 情報表示は最小限に
cat > /etc/motd << 'EOF'
Authorized access only.
EOF
# バナーのパーミッション設定
chmod 644 /etc/issue /etc/issue.net /etc/motd /etc/ssh/banner
chown root:root /etc/issue /etc/issue.net /etc/motd /etc/ssh/banner
11.2 OS 情報の非表示
# /etc/issue から OS 情報を削除
# デフォルトでは \S (OS名)、\r (カーネルバージョン) 等が含まれる
echo "Authorized access only." > /etc/issue
echo "Authorized access only." > /etc/issue.net
12. USB デバイス制御
12.1 USB ストレージの無効化
# カーネルモジュールレベルでの無効化
cat > /etc/modprobe.d/usb-storage.conf << 'EOF'
install usb-storage /bin/false
blacklist usb-storage
blacklist uas
EOF
# 即時反映
modprobe -r usb-storage 2>/dev/null
modprobe -r uas 2>/dev/null
# USBGuard によるきめ細かな制御
# インストール
dnf install usbguard # RHEL/CentOS
apt install usbguard # Ubuntu/Debian
# 初期ポリシーの生成 (現在接続されているデバイスを許可)
usbguard generate-policy > /etc/usbguard/rules.conf
# USBGuard ルールの例
cat > /etc/usbguard/rules.conf << 'EOF'
# 既知のキーボードとマウスを許可
allow id 046d:c52b name "Logitech USB Receiver" with-interface { 03:01:01 03:01:02 }
# USB ストレージをブロック
reject with-interface equals { 08:*:* }
# その他のデバイスはブロック (デフォルト)
reject
EOF
# USBGuard の有効化
systemctl enable --now usbguard
# 接続されたデバイスの一覧
usbguard list-devices
# 出力例:
# 1: allow id 1d6b:0002 serial "0000:00:14.0" name "xHCI Host Controller"
# 2: allow id 046d:c52b serial "" name "USB Receiver"
# 3: block id 0781:5583 serial "4C530001234" name "Ultra Fit"
13. 自動セキュリティアップデート
13.1 unattended-upgrades (Ubuntu/Debian)
# インストール
apt install unattended-upgrades apt-listchanges
# 設定 (/etc/apt/apt.conf.d/50unattended-upgrades)
cat > /etc/apt/apt.conf.d/50unattended-upgrades << 'EOF'
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
"${distro_id}ESMApps:${distro_codename}-apps-security";
"${distro_id}ESM:${distro_codename}-infra-security";
};
// セキュリティアップデートのみ自動適用
Unattended-Upgrade::Package-Blacklist {
// "linux-image-*";
};
// 自動リブート
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "03:00";
Unattended-Upgrade::Automatic-Reboot-WithUsers "false";
// メール通知
Unattended-Upgrade::Mail "admin@example.com";
Unattended-Upgrade::MailReport "on-change";
// 未使用の依存関係を自動削除
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
// Syslog
Unattended-Upgrade::SyslogEnable "true";
Unattended-Upgrade::SyslogFacility "daemon";
// ダウンロード制限
Acquire::http::Dl-Limit "1000";
EOF
# 自動実行の有効化
cat > /etc/apt/apt.conf.d/20auto-upgrades << 'EOF'
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
EOF
# ドライランテスト
unattended-upgrade --dry-run --debug
13.2 dnf-automatic (RHEL/CentOS)
# インストール
dnf install dnf-automatic
# 設定 (/etc/dnf/automatic.conf)
cat > /etc/dnf/automatic.conf << 'EOF'
[commands]
# セキュリティアップデートのみ
upgrade_type = security
random_sleep = 0
download_updates = yes
apply_updates = yes
[emitters]
system_name = $(hostname)
emit_via = motd,email
[email]
email_from = dnf-automatic@example.com
email_to = admin@example.com
email_host = localhost
[command]
# 適用前に確認
# command_format = cat
# stdin_format = "{body}"
[base]
debuglevel = 1
EOF
# タイマーの有効化
systemctl enable --now dnf-automatic.timer
# タイマーの確認
systemctl status dnf-automatic.timer
# 出力例:
# ● dnf-automatic.timer - dnf-automatic timer
# Loaded: loaded (/usr/lib/systemd/system/dnf-automatic.timer; enabled)
# Active: active (waiting) since Thu 2025-01-15 00:00:00 UTC
# Trigger: Fri 2025-01-16 06:00:00 UTC; 5h left
14. セキュリティスキャンツール
14.1 Lynis
# インストール
# Ubuntu/Debian
apt install lynis
# CentOS/RHEL
dnf install lynis
# または Git からインストール
git clone https://github.com/CISOfy/lynis.git /opt/lynis
# システム監査の実行
lynis audit system
# 出力例 (要約部分):
# ================================================================================
# Lynis security scanning tool (version 3.0.9)
# ================================================================================
#
# [+] System Tools
# [+] Boot and services
# [+] Kernel
# [+] Memory and Processes
# [+] Users, Groups and Authentication
# [+] Shells
# [+] File systems
# [+] USB Devices
# [+] Storage
# [+] NFS
# [+] Software: name services
# [+] Ports and packages
# [+] Networking
# [+] Printers and Spools
# [+] Software: e-mail and messaging
# [+] Software: firewalls
# [+] Software: webserver
# [+] SSH Support
# [+] SNMP Support
# [+] Databases
# [+] LDAP Services
# [+] PHP
# [+] Squid Support
# [+] Logging and files
# [+] Insecure services
# [+] Banners and identification
# [+] Scheduled tasks
# [+] Accounting
# [+] Time and Synchronization
# [+] Cryptography
# [+] Virtualization
# [+] Containers
# [+] Security frameworks
# [+] Software: file integrity
# [+] Software: Malware
# [+] File Permissions
# [+] Home directories
# [+] Kernel Hardening
# [+] Hardening
# [+] Custom tests
#
# ================================================================================
# Hardening index : 72 [############## ]
# Tests performed : 268
# Plugins enabled : 2
# ================================================================================
# 特定のカテゴリのみスキャン
lynis audit system --tests-from-group "firewalls"
# 結果の表示
cat /var/log/lynis.log
cat /var/log/lynis-report.dat | grep suggestion
14.2 OpenSCAP
# インストール
# CentOS/RHEL
dnf install openscap-scanner scap-security-guide
# Ubuntu/Debian
apt install libopenscap8 ssg-debderived ssg-debian
# 利用可能なプロファイルの確認
oscap info /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
# 出力例:
# Profiles:
# Title: CIS Red Hat Enterprise Linux 9 Benchmark Level 1 - Server
# Id: xccdf_org.ssgproject.content_profile_cis
# Title: CIS Red Hat Enterprise Linux 9 Benchmark Level 2 - Server
# Id: xccdf_org.ssgproject.content_profile_cis_server_l1
# ...
# スキャンの実行 (CIS Level 1)
oscap xccdf eval \
--profile xccdf_org.ssgproject.content_profile_cis \
--results /tmp/scan-results.xml \
--report /tmp/scan-report.html \
/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
# HTMLレポートの確認
firefox /tmp/scan-report.html
# 修復スクリプトの生成
oscap xccdf generate fix \
--profile xccdf_org.ssgproject.content_profile_cis \
--fix-type bash \
--result-id "" \
/tmp/scan-results.xml > /tmp/remediation.sh
# Ansible Playbook の生成
oscap xccdf generate fix \
--profile xccdf_org.ssgproject.content_profile_cis \
--fix-type ansible \
--result-id "" \
/tmp/scan-results.xml > /tmp/remediation.yml
15. インシデントレスポンスの基本
15.1 インシデントレスポンスのフェーズ
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ 準備 │──→│ 検知 │──→│ 分析 │──→│ 封じ込め│──→│ 根絶 │──→│ 復旧 │
│ │ │ 識別 │ │ │ │ │ │ │ │ 教訓 │
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
15.2 初動対応のコマンド集
#!/bin/bash
# incident-response.sh - 初動対応スクリプト
INCIDENT_DIR="/tmp/incident-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$INCIDENT_DIR"
echo "=== Incident Response Collection ==="
echo "Date: $(date)" | tee "$INCIDENT_DIR/summary.txt"
echo "Hostname: $(hostname)" | tee -a "$INCIDENT_DIR/summary.txt"
# 1. 現在のユーザーセッション
echo "--- Current Users ---"
w > "$INCIDENT_DIR/current-users.txt"
who > "$INCIDENT_DIR/who.txt"
last -n 50 > "$INCIDENT_DIR/last-logins.txt"
lastb -n 50 > "$INCIDENT_DIR/failed-logins.txt" 2>/dev/null
# 2. ネットワーク接続
echo "--- Network Connections ---"
ss -tupan > "$INCIDENT_DIR/network-connections.txt"
ip addr > "$INCIDENT_DIR/ip-addresses.txt"
ip route > "$INCIDENT_DIR/routing-table.txt"
iptables-save > "$INCIDENT_DIR/iptables-rules.txt" 2>/dev/null
# 3. プロセス情報
echo "--- Processes ---"
ps auxf > "$INCIDENT_DIR/processes.txt"
ps -eo pid,ppid,user,args --sort=-pcpu | head -50 > "$INCIDENT_DIR/top-processes.txt"
# 4. 開いているファイル
echo "--- Open Files ---"
lsof -nP > "$INCIDENT_DIR/open-files.txt" 2>/dev/null
# 5. スケジュールされたタスク
echo "--- Scheduled Tasks ---"
for user in $(cut -f1 -d: /etc/passwd); do
crontab -l -u "$user" 2>/dev/null >> "$INCIDENT_DIR/crontabs.txt"
done
ls -la /etc/cron* >> "$INCIDENT_DIR/cron-directories.txt" 2>/dev/null
systemctl list-timers > "$INCIDENT_DIR/systemd-timers.txt"
# 6. 最近変更されたファイル
echo "--- Recently Modified Files ---"
find / -mtime -1 -type f -not -path "/proc/*" -not -path "/sys/*" \
-not -path "/run/*" 2>/dev/null > "$INCIDENT_DIR/recently-modified.txt"
# 7. 監査ログ
echo "--- Audit Logs ---"
ausearch --start today > "$INCIDENT_DIR/audit-today.txt" 2>/dev/null
# 8. システムログ
echo "--- System Logs ---"
journalctl --since today --no-pager > "$INCIDENT_DIR/journal-today.txt"
cp /var/log/auth.log "$INCIDENT_DIR/" 2>/dev/null
cp /var/log/secure "$INCIDENT_DIR/" 2>/dev/null
# 9. ハッシュ値の取得
echo "--- Critical File Hashes ---"
sha256sum /etc/passwd /etc/shadow /etc/group /etc/sudoers \
/etc/ssh/sshd_config > "$INCIDENT_DIR/critical-hashes.txt" 2>/dev/null
# アーカイブ
tar czf "${INCIDENT_DIR}.tar.gz" -C "$(dirname $INCIDENT_DIR)" \
"$(basename $INCIDENT_DIR)"
echo "=== Collection Complete ==="
echo "Evidence saved to: ${INCIDENT_DIR}.tar.gz"
15.3 不審なプロセスの調査
# 不審なプロセスの特定
ps aux | awk '$3 > 50.0 || $4 > 50.0'
# プロセスの詳細情報
ls -la /proc/<PID>/exe
cat /proc/<PID>/cmdline | tr '\0' ' '
cat /proc/<PID>/environ | tr '\0' '\n'
ls -la /proc/<PID>/fd/
# 不審なネットワーク接続
ss -tupan | grep ESTABLISHED
lsof -i -P -n | grep LISTEN
# 隠しファイルの検索
find / -name ".*" -type f -not -path "/proc/*" -not -path "/sys/*" 2>/dev/null
# SUID/SGID ファイルの検索
find / -perm /4000 -type f 2>/dev/null > /tmp/suid-files.txt
find / -perm /2000 -type f 2>/dev/null > /tmp/sgid-files.txt
# ワールドライタブルファイルの検索
find / -perm -o+w -type f -not -path "/proc/*" -not -path "/sys/*" 2>/dev/null
16. トラブルシューティング
16.1 一般的な問題と解決策
| 問題 | 原因 | 解決策 |
|---|---|---|
| SSH 接続不可 | ファイアウォール設定、ポート変更 | `ss -tlnp |
| ログイン不可 | pam_faillock によるロックアウト | faillock --user USER --reset |
| パスワード変更不可 | pwquality 要件未満 | /etc/security/pwquality.conf 確認 |
| サービス起動失敗 | SELinux/AppArmor | ausearch -m avc -ts recent |
| 監査ログ消失 | ディスク容量不足 | df -h /var/log/audit, ローテーション設定 |
| 自動更新失敗 | リポジトリ接続エラー | ログ確認, ネットワーク診断 |
16.2 SELinux トラブルシューティング
# SELinux ステータス確認
getenforce
# 出力: Enforcing
sestatus
# 出力例:
# SELinux status: enabled
# SELinuxfs mount: /sys/fs/selinux
# SELinux root directory: /etc/selinux
# Loaded policy name: targeted
# Current mode: enforcing
# Mode from config file: enforcing
# AVC 拒否メッセージの確認
ausearch -m avc -ts recent
# sealert による分析
sealert -a /var/log/audit/audit.log
# 一時的に Permissive モードに変更 (テスト目的)
setenforce 0
# ブール値の確認と変更
getsebool -a | grep httpd
setsebool -P httpd_can_network_connect on
# ファイルのコンテキスト修復
restorecon -Rv /var/www/html
17. ベストプラクティスまとめ
17.1 ハードニングチェックリスト
| カテゴリ | 項目 | 優先度 |
|---|---|---|
| OS | 最新のセキュリティパッチ適用 | 最高 |
| OS | 不要なパッケージ/サービスの削除 | 高 |
| アカウント | root 直接ログインの禁止 | 最高 |
| アカウント | 強力なパスワードポリシー | 高 |
| アカウント | アカウントロックアウト設定 | 高 |
| SSH | 鍵認証のみ、パスワード認証無効化 | 最高 |
| SSH | 強力な暗号スイートのみ | 高 |
| ネットワーク | ファイアウォール有効化 | 最高 |
| ネットワーク | 不要なポートの閉鎖 | 高 |
| カーネル | sysctl セキュリティパラメータ | 高 |
| 監査 | auditd の設定 | 高 |
| 監査 | ファイル整合性監視 | 中 |
| 物理 | USB デバイス制御 | 中 |
| バナー | 警告バナーの設定 | 低 |
| 自動化 | セキュリティアップデートの自動化 | 高 |
| 監視 | 定期的なセキュリティスキャン | 高 |
17.2 定期的なセキュリティレビュー
#!/bin/bash
# security-review.sh - 定期セキュリティレビュースクリプト
echo "=== Security Review Report - $(date) ==="
echo ""
echo "--- 1. OS Updates ---"
if command -v apt &>/dev/null; then
apt list --upgradable 2>/dev/null | grep -i security
elif command -v dnf &>/dev/null; then
dnf check-update --security 2>/dev/null
fi
echo ""
echo "--- 2. Listening Ports ---"
ss -tlnp
echo ""
echo "--- 3. Failed Login Attempts (last 7 days) ---"
journalctl _SYSTEMD_UNIT=sshd.service --since "7 days ago" | \
grep "Failed" | awk '{print $NF}' | sort | uniq -c | sort -rn | head -20
echo ""
echo "--- 4. SUID Files ---"
find / -perm /4000 -type f 2>/dev/null
echo ""
echo "--- 5. World-Writable Directories ---"
find / -perm -o+w -type d -not -path "/proc/*" -not -path "/sys/*" \
-not -path "/tmp" -not -path "/var/tmp" 2>/dev/null
echo ""
echo "--- 6. Users with UID 0 ---"
awk -F: '$3 == 0 {print $1}' /etc/passwd
echo ""
echo "--- 7. Empty Password Accounts ---"
awk -F: '($2 == "" || $2 == "!") {print $1}' /etc/shadow 2>/dev/null
echo ""
echo "--- 8. Expired Passwords ---"
for user in $(awk -F: '$3 >= 1000 {print $1}' /etc/passwd); do
chage -l "$user" 2>/dev/null | grep -q "password must be changed" && echo "$user"
done
echo ""
echo "=== Review Complete ==="
18. 参考文献
- CIS Benchmarks - https://www.cisecurity.org/cis-benchmarks
- NIST SP 800-123 - Guide to General Server Security
- NIST SP 800-53 - Security and Privacy Controls
- Red Hat Security Hardening Guide - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/security_hardening
- Ubuntu Security Documentation - https://ubuntu.com/security
- OpenSCAP Documentation - https://www.open-scap.org/
- Lynis Documentation - https://cisofy.com/lynis/
- AIDE Manual - https://aide.github.io/
- Linux Audit Documentation - https://github.com/linux-audit/audit-documentation
- SSH Hardening Guide - https://www.ssh.com/academy/ssh/sshd_config
- Fail2Ban Documentation - https://www.fail2ban.org/
- USBGuard Documentation - https://usbguard.github.io/
本ドキュメントは Linux システムハードニングとセキュリティベストプラクティスについて包括的にまとめたものである。実際の環境への適用にあたっては、事前にテスト環境での検証を十分に行い、組織のセキュリティポリシーに準拠した形で実装すること。