Server Security Baseline là bộ trạng thái bảo mật tối thiểu mà một web server phải đạt trước khi được release lên production. Bài này sở hữu một nhiệm vụ duy nhất: đưa ra quyết định GO / NO-GO / GO-WITH-EXCEPTION dựa trên expected state và evidence trước go-live.
Baseline không phải checklist bảo trì định kỳ. Sau khi server đã production, việc so trạng thái hiện tại với baseline, tìm configuration drift và đặt cadence review thuộc Server Security Maintenance Checklist.
Baseline khác hardening checklist thế nào?
Checklist chỉ liệt kê “cần xem gì”; baseline định nghĩa state phải đạt, evidence chứng minh state đó và blocking criteria trước release.
| Checklist item | Release-gate baseline |
|---|---|
| Kiểm tra SSH | Effective SSH policy có owner, authentication/root policy và login validation |
| Bật firewall | Allowed inbound khớp intended architecture và observed socket |
| Update server | OS còn support, blocking security updates đã xử lý hoặc exception được duyệt |
| Có backup | Backup có owner và restore evidence phù hợp trước release |
13 security gates trước production
Gate 1: Server identity và ownership
Trước go-live phải khóa hostname, environment, application, provider/project, public/private IP, business owner và technical owner. Không có owner thì exception, incident và rollback sau này không có người chịu trách nhiệm.
Gate 2: OS/runtime còn support và patch state chấp nhận được
Server không nên bắt đầu vòng đời production với OS/runtime đã hết support. Ghi release, package source, pending security update và restart/reboot requirement.
cat /etc/os-release
apt list --upgradable 2>/dev/nullĐây chỉ là ví dụ cho Debian/Ubuntu. Quy trình ưu tiên, rollout và rollback patch chi tiết thuộc Linux Patch Management.
Gate 3: Attack surface đã được inventory
Release gate cần biết mọi service/socket/account/control plane quan trọng đã được inventory và có owner/purpose. Không cần thực hiện inventory chi tiết trong bài này; sử dụng Attack Surface Web Server làm evidence source. Một failure mode cần đưa vào release review là dịch vụ và port không cần thiết làm tăng Server Attack Surface.
Blocking finding là exposure quan trọng chưa có owner/purpose hoặc service/admin path public ngoài intended design mà chưa có exception.
Gate 4: Firewall và network path khớp architecture
Allowed inbound phải được tài liệu hóa; host firewall và cloud/security-group state không mâu thuẫn. Admin/database service không public ngoài nhu cầu. Với remote management change, rollback/console path phải tồn tại.
Gate 5: SSH remote administration đã xác minh
SSH baseline cần effective authentication policy, root policy, user/group restriction khi dùng và login test thực tế. Không dùng “đổi port SSH” làm acceptance criterion chính. Để kiểm failure mode trước go-live, đối chiếu case SSH Brute Force dẫn tới truy cập trái phép.
sudo sshd -T | egrep 'permitrootlogin|passwordauthentication|maxauthtries|allowusers|allowgroups'Chi tiết config/rollback thuộc SSH Hardening.
Gate 6: Root, sudo và privileged access
Human admin phải có identity rõ; full sudo chỉ dành cho vai trò thật sự cần. Service/automation account có owner và privilege scope. Shared root/admin credential là finding cần xử lý hoặc exception trước release.
Chi tiết privilege path thuộc Root, sudo & Least Privilege.
Gate 7: File permission và writable path
Source/config/secret không world-writable; runtime chỉ ghi đúng path cần thiết; deploy và runtime identity được tách khi architecture yêu cầu. Không dùng chmod -R 777 như acceptance fix.
Gate 8: Web server và runtime đã harden theo role
Nginx/Apache/PHP-FPM hoặc runtime khác phải dùng package còn support, chỉ expose interface/path cần thiết, process identity phù hợp và config test PASS. Mỗi stack có owner page riêng; baseline chỉ thu evidence cuối.
Gate 9: Database/internal services không overexposed
Database/cache/search/queue/admin API bind đúng network path. Application account và remote-admin path được kiểm soát. Nếu cùng host, public DB exposure thường cần justification rõ.
Gate 10: Secrets và deployment credential có owner
SSH key, DB credential, API token, cloud token và environment secret có owner, consumer, storage và rotation/revocation path. Secret không nằm trong public web root hoặc log. Failure mode cần kiểm trước production là API Key và file cấu hình bị lộ.
Management plane cũng phải nằm trong baseline: control panel public, MFA yếu hoặc admin path không được giới hạn có thể thay đổi host ngoài SSH. Xem case aaPanel/Control Panel Exposure dẫn tới Server Compromise.
Gate 11: Logging và time sync sẵn sàng
Clock phải đúng; auth/system/web logs cần đủ để điều tra login, privilege, service failure và web incident. Baseline không yêu cầu log mọi event vô hạn; chỉ yêu cầu evidence source thiết yếu tồn tại và có owner.
Gate 12: Backup và recovery có evidence
Backup production có owner, storage/access policy và restore path. Job “success” không đủ nếu chưa có evidence rằng dữ liệu có thể phục hồi theo nhu cầu dịch vụ.
Gate 13: Blocking controls và exceptions đã đóng
Trước release, mọi finding phải có final state:
- PASS: expected state đã được chứng minh.
- FAIL/BLOCK: chưa được release.
- EXCEPTION: risk owner chấp nhận, có compensating control và expiry/review date.
Không dùng trạng thái “tạm thời” không owner/deadline cho production release.
Quy trình GO / NO-GO trước production
- Read current state.
- Snapshot các control quan trọng.
- Thu evidence cho 13 gate.
- Đánh dấu PASS/FAIL/EXCEPTION.
- Xử lý blocking finding theo owner page chuyên biệt.
- Read-back effective/runtime state.
- Functional test website, deploy, cron, backup và monitoring.
- Risk owner duyệt exception nếu có.
- Ra quyết định GO / NO-GO / GO-WITH-EXCEPTION.
Server Security Baseline worksheet
Đây là template release gate, không phải audit result của SecureWebOps.
| Gate | Expected state | Evidence | Owner | Result | Exception/Next action |
|---|---|---|---|---|---|
| OS/Patch | Supported + no blocking overdue risk | Release/package/advisory | Platform | PASS/FAIL | Patch/upgrade plan |
| Exposure | Only intended services | Attack Surface Register + firewall | Platform/Network | PASS/FAIL | Restrict/remediate |
| Privilege | Named admin + least privilege | User/sudo/key inventory | Identity/Ops | PASS/FAIL | Revoke/reduce |
| Logging | Required evidence sources ready | Log/read test | Ops/Security | PASS/FAIL | Enable/route |
| Backup | Recovery path verified | Backup + restore evidence | Service owner | PASS/FAIL | Fix before release |
Sau khi GO-LIVE thì dùng bài nào?
Baseline là snapshot/expected state tại release. Sau go-live, patch, deploy, account changes và automation có thể làm trạng thái drift. Từ thời điểm đó, dùng Server Security Maintenance Checklist để so previous baseline → observed state → delta → action → final state.
Như vậy owner boundary rõ: Baseline = release decision trước production; Maintenance = recurring drift review sau production.
Checklist Release Gate
- Server identity/owner đầy đủ.
- OS/runtime còn support.
- Blocking patch risk đã xử lý/exception.
- Attack surface inventory hoàn tất.
- Firewall/network path khớp architecture.
- SSH effective state đã test.
- Privileged access đã review.
- File permission/write path hợp lý.
- Web stack/runtime validation PASS.
- Database/internal service không overexposed.
- Secrets có owner/storage/rotation path.
- Logging/time sync sẵn sàng.
- Backup/recovery có evidence.
- Exception có risk owner + expiry.
- Functional test sau hardening PASS.
- Quyết định GO/NO-GO được ghi.
Nguồn kỹ thuật tham khảo
Kết luận
Server Security Baseline là release gate trước production. Nó không sở hữu việc maintenance định kỳ hay configuration-drift review sau go-live.
Một server chỉ nên GO khi các control blocking có evidence PASS hoặc exception đã được risk owner chấp nhận. Sau release, baseline này trở thành mốc để bài Maintenance đo drift theo thời gian.
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 hardening và bảo mật server.
