Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบเครือข่าย >> ความปลอดภัยเครือข่าย

Certificate ใน Network Security คืออะไร (Digital Certificate / PKI)

Digital Certificate (ใบรับรองดิจิทัล) ใน Network Security คืออะไร?

Digital Certificate (X.509 Certificate) เป็น "บัตรประจำตัวดิจิทัล" ที่ใช้ยืนยันตัวตน (Identity) ของ Entity (User, Device, Server, Service, Code) บนเครือข่าย โดยใช้ Public Key Infrastructure (PKI) เป็นพื้นฐาน

โครงสร้าง Certificate (X.509 v3)

Fieldคำอธิบาย
Versionv3 (รองรับ Extensions)
Serial Numberเลขลำดับที่ CA มอบหมาย (Unique per CA)
Signature Algorithmอัลกอริทึมที่ CA ใช้ลงนาม (เช่น sha256WithRSAEncryption)
Issuer (CA)ชื่อผู้ออก Certificate (CA Distinguished Name)
Validity PeriodNot Before / Not After (วันหมดอายุ - มัก 1 ปี, 90 วันสำหรับ Public TLS)
Subjectเจ้าของ Certificate (CN=common name, O=org, OU=unit, C=country)
Subject Public Key InfoPublic Key + Algorithm (RSA 2048/3072/4096, ECDSA P-256/P-384, Ed25519)
Extensions (v3)Key Usage, Extended Key Usage, Subject Alternative Name (SAN), Basic Constraints, CRL/OCSP Distribution Points
Signature Valueลายเซ็นดิจิทัลของ CA บน tbsCertificate (To Be Signed Certificate)

ประเภท Certificate ตามการใช้งาน (Key Usage / EKU)

ประเภทExtended Key Usage (EKU)ใช้ทำอะไร
TLS/SSL Server CertificateServer Authentication (1.3.6.1.5.5.7.3.1)HTTPS, LDAPS, FTPS, SMTP STARTTLS - ยืนยัน Server Identity
Client Authentication CertClient Authentication (1.3.6.1.5.5.7.3.2)802.1X (Wi-Fi/VPN), Mutual TLS (mTLS), Smart Card Logon
Code Signing CertificateCode Signing (1.3.6.1.5.5.7.3.3)ลงนาม Software, Driver, Script, Firmware, Container Image
Email Signing/Encryption (S/MIME)Email Protection (1.3.6.1.5.5.7.3.4)Sign/Encrypt Email, Document Signing
Document SigningDocument Signing (1.3.6.1.5.5.7.3.36)PDF Signing (PAdES), Legal Documents
TimestampingTime Stamping (1.3.6.1.5.5.7.3.8)พิสูจน์เวลาที่ข้อมูลมีอยู่ (Long-term Validation)
OCSP SigningOCSP Signing (1.3.6.1.5.5.7.3.9)ลงนาม Response ตรวจสอบสถานะ Certificate

PKI (Public Key Infrastructure) - โครงสร้างพื้นฐาน

  1. Root CA (Offline, Highly Secured): Self-signed, จำกัดการใช้งาน มักอยู่ใน HSM/Air-gapped
  2. Intermediate/Subordinate CA (Online): ออก Certificate ให้ End-Entities, สามารถ Revoke ได้
  3. End-Entity (Leaf) Certificate: Certificate ของ User/Device/Server จริง
  4. Certificate Chain (Chain of Trust): Leaf → Intermediate → Root (Trust Anchor ใน Trust Store)
  5. Revocation Checking: CRL (Certificate Revocation List) หรือ OCSP (Online Certificate Status Protocol)

Certificate Formats (File Extensions)

FormatExtensionคำอธิบาย
PEM (Base64).pem, .crt, .cer, .keyText-based, เริ่ม/จบด้วย -----BEGIN/END CERTIFICATE----- (Linux/Unix Standard)
DER (Binary).der, .cerBinary encoded (Windows/Java บางครั้ง)
PKCS#7 / CMS.p7b, .p7cCertificate Chain only (No Private Key)
PKCS#12 / PFX.p12, .pfxCertificate + Private Key + Chain (Encrypted with Password) - Windows/IIS/Java Keystore
JKS / JCEKS.jks, .jceksJava KeyStore (Keytool)

การใช้งานใน Network Security

  • TLS/SSL (HTTPS): Server Cert + CA Chain → Browser/Client Verify Trust
  • Mutual TLS (mTLS): Client Cert + Server Cert → Two-way Authentication (Zero Trust, Service Mesh)
  • 802.1X (Wi-Fi/VPN Enterprise): Client Cert (EAP-TLS) หรือ User/Pass (PEAP-MSCHAPv2) → RADIUS
  • IPsec VPN: Machine Certificates (IKEv2) หรือ PSK
  • Code Signing: Driver, App, Script, Firmware, Container (Notary, Cosign, Sigstore)
  • S/MIME: Email Signing + Encryption
  • Device Identity (IoT/MDM): SCEP/EST Enrollment, Certificate-based Auth

Certificate Lifecycle Management

  1. Enrollment/Request: CSR (Certificate Signing Request) → Submit to CA
  2. Issuance: CA Validate → Sign → Issue Cert
  3. Deployment/Installation: Install on Server/Device/App (with Private Key)
  4. Monitoring: Expiry Alert (30/60/90 days), CT Logs Monitoring
  5. Renewal/Re-issuance: Before Expiry (Automated: ACME/Let's Encrypt, Cert-Manager, Venafi)
  6. Revocation: Compromise, Name Change, CA Compromise → CRL/OCSP Update
  7. Archival/Backup: Private Key Backup (HSM, Secure Vault)

สรุป

Digital Certificate = Identity + Public Key + CA Signature ใช้ PKI (Root → Intermediate → Leaf) จัดการวงจรชีวิต: Request → Issue → Deploy → Monitor → Renew → Revoke สำคัญสำหรับ TLS, mTLS, 802.1X, VPN, Code Signing, S/MIME, IoT Identity ต้อง Automate (ACME/Cert-Manager) เพื่อป้องกัน Outage จาก Expired Cert