Server Security Maintenance là vòng rà soát sau khi server đã production để phát hiện patch gap, exposure mới, privilege drift, secret/token cũ, logging/backup failure và configuration drift. Bài này không quyết định server có được go-live hay không; release decision trước production thuộc Server Security Baseline.
Owner task của Maintenance là: previous baseline → observed state → delta → owner → action → validation → final state. Một server từng PASS release gate vẫn có thể drift sau patch, deploy, thay đổi nhân sự, control-panel update hoặc automation.
Maintenance khác Baseline ở điểm nào?
| Baseline | Maintenance |
|---|---|
| Trước production | Sau production |
| Expected state / release gate | Observed state / drift review |
| GO / NO-GO / EXCEPTION | PASS / FOLLOW-UP / EXCEPTION / INCIDENT |
| Thiết lập mốc ban đầu | So current state với mốc trước |
Nếu server chưa có baseline ban đầu, hãy tạo baseline trước; maintenance không nên tự phát minh expected state theo từng lần review.
Patch, exposure và access deltas
1. Patch delta
So package/security-update state hiện tại với lần review trước. Ghi package mới pending, package bị hold, restart/reboot requirement và lý do defer.
apt list --upgradable 2>/dev/null
systemctl status unattended-upgrades --no-pagerQuy trình rollout/rollback chi tiết thuộc Linux Patch Management.
2. Exposure delta
So listening socket và network rule hiện tại với approved baseline. Port/service mới phải có owner/purpose. Port biến mất cũng cần giải thích: decommission có chủ đích hay service failure. Nếu cần inventory lại toàn bộ, dùng Attack Surface Web Server. Một failure mode nên dùng làm review case là dịch vụ và port không cần thiết làm tăng Server Attack Surface.
3. Service/startup delta
systemctl --type=service --state=running
systemctl list-unit-files --type=serviceTìm service mới, unit bị enable lại, timer/socket mới hoặc automation thay source of truth. Nếu finding cần restrict/disable/remove, handoff sang Giảm Server Attack Surface.
4. Firewall/cloud-rule delta
So rule hiện tại với approved inbound policy. Temporary allow rule không được đóng, admin/database port mở rộng source hoặc IPv6 policy lệch IPv4 là các delta cần owner.
5. Privileged-access delta
Review user/group sudo/wheel, authorized_keys, vendor access và break-glass account. Tập trung vào thay đổi kể từ baseline: account mới, key mới, quyền tăng hoặc account lẽ ra đã offboard. Nếu SSH đang public hoặc authentication policy đã drift, đối chiếu với case SSH Brute Force dẫn tới truy cập trái phép để kiểm impact và evidence cần giữ.
6. Secret/token lifecycle delta
Tìm secret sắp hết hạn, rotation overdue, token không owner, credential dùng chung hoặc secret của nhân sự/service đã decommission. Không dump plaintext secret vào maintenance report. Handoff remediation sang Server Secrets Management. Nếu phát hiện secret hoặc config artifact có khả năng đã lộ, dùng case API Key và File cấu hình bị lộ làm failure-mode reference.
Configuration, management và control-health deltas
7. Web stack/database configuration drift
So effective config/version của Nginx/Apache/PHP-FPM/database/runtime với config repository, image, IaC hoặc snapshot đã duyệt. File mtime khác chỉ là signal; cần biết thay đổi có expected hay không.
8. File permission/ownership drift
Deploy, restore hoặc plugin có thể tạo file sai owner/mode. So source/config/secret/upload/runtime path với expected model. Nếu permission thay đổi không owner, mở finding thay vì chạy chmod hàng loạt.
9. Management-plane drift
Review aaPanel/cPanel/Plesk/cloud console/API integrations: admin/reseller user mới, MFA bị tắt, token mới hoặc network exposure thay đổi. Management plane có thể thay host mà không đi qua SSH. Một failure mode cần correlation là aaPanel/Control Panel Exposure dẫn tới Server Compromise.
10. Logging health delta
Xác minh journal/audit/web/database logs vẫn ghi, timestamp đúng, rotation hoạt động và disk đủ chỗ. Tạo một test event hợp lệ khi phù hợp để xác minh retrieval. Chi tiết event taxonomy thuộc Server Audit Logging.
11. Backup và restore readiness
So latest backup age, failed job, storage access/retention và restore evidence với policy. “Job success” không đủ nếu restore path chưa được kiểm chứng theo cadence/risk.
12. Failed service và recurring error
systemctl --failed
journalctl -p err --since '24 hours ago' --no-pagerPhân loại recurring error theo evidence; không biến mọi error thành security incident, nhưng cũng không để security/logging/backup service fail kéo dài.
Capacity, automation, source-of-truth và exceptions
13. Disk và inode capacity
df -h
df -iDisk/inode pressure có thể làm log, database hoặc backup lỗi và khiến evidence bị mất. Đây là availability/security dependency cần owner.
14. Certificate/TLS lifecycle
Review certificate expiry, auto-renew result và renewal owner cho website, panel, database hoặc internal service. “ACME enabled” không chứng minh renewal đang hoạt động.
15. Scheduled task và automation drift
Review cron, systemd timer, CI/CD, backup script và automation có privilege cao. Task cũ sau migration hoặc account rotation có thể trở thành stale privileged path.
16. Source-of-truth drift
NIST security-focused configuration management nhấn mạnh quản lý và monitor configuration. Nếu production được sửa thủ công mà repo/IaC/CM chưa cập nhật, lần deploy/rebuild sau có thể ghi đè hoặc tái tạo exposure cũ.
17. Delta không owner
Mọi thay đổi quan trọng cần change ticket, commit, automation run hoặc owner explanation. “Không biết ai đổi” không chứng minh malicious, nhưng là governance gap cần follow-up.
18. Exception phải có tuổi thọ
Exception từ release gate hoặc maintenance trước phải có risk owner, compensating control và review/expiry date. Định kỳ kiểm tra exception còn lý do tồn tại hay đã có thể đóng.
Cadence là risk-based, không phải chuẩn cố định
| Cadence mẫu | Ưu tiên review |
|---|---|
| Liên tục/hằng ngày | Critical alerts, backup job, failed security service, urgent patches |
| Hằng tuần | Exposure delta, privileged access, recurring errors, log health |
| Hằng tháng | Privilege/key/token, config drift, package/service inventory, restore evidence |
| Theo quý/risk | Baseline revalidation, recovery drill, architecture/owner review |
Cadence phải điều chỉnh theo criticality, Internet exposure, compliance và tốc độ thay đổi của hệ thống.
Server Security Maintenance Record
Đây là template delta review, không phải audit result của SecureWebOps.
| Control | Previous baseline | Observed | Delta | Owner | Action | Final state |
|---|---|---|---|---|---|---|
| Patch | Known state | Current state | New/none | Platform | Patch/defer | PASS/FOLLOW-UP |
| Exposure | Approved ports | Current sockets/rules | New/removed | Platform/Network | Investigate/remediate | PASS/FAIL |
| Privilege | Approved admins | Current users/keys | Added/removed | Identity/Ops | Retain/revoke | PASS/FOLLOW-UP |
| Config | Baseline hash/repo | Current state | Drift | Service owner | Accept/revert/update source | PASS/EXCEPTION |
Checklist Recurring Drift Review
- Patch delta reviewed.
- Listening-port delta reviewed.
- Service/startup delta reviewed.
- Firewall/cloud-rule delta reviewed.
- Admin/sudo/key delta reviewed.
- Secret/token lifecycle reviewed.
- Web stack/database drift reviewed.
- File permission drift reviewed.
- Management-plane access reviewed.
- Logging pipeline healthy.
- Backup/restore evidence current.
- Failed service/error reviewed.
- Disk/inode healthy.
- Certificate renewal healthy.
- Timers/cron/automation reviewed.
- Source of truth synchronized.
- Unknown delta assigned owner.
- Exceptions revalidated.
- Final state + next review recorded.
Nguồn kỹ thuật tham khảo
- Ubuntu Server — Security suggestions
- Ubuntu Server — Automatic updates
- NIST SP 800-128 — Security-Focused Configuration Management
Kết luận
Server Security Maintenance là recurring drift review sau production, không phải release checklist. Nó dùng baseline đã duyệt làm mốc và chỉ hỏi: điều gì đã thay đổi, thay đổi đó có intended không, owner là ai và final state là gì.
Owner boundary giờ rõ: Server Security Baseline = GO/NO-GO trước production; Server Security Maintenance = previous baseline → observed delta → action sau production.
Dịch vụ liên quan: Nếu bạn cần triển khai hoặc vận hành chuyên sâu, xem vận hành Server Security.
