ssl-tls-management – skill Khác cho agent AI
Quản lý chứng chỉ SSL/TLS với Let's Encrypt và PKI nội bộ. Cấu hình HTTPS an toàn, gia hạn chứng chỉ và bộ mã hóa. Dùng khi triển khai kênh liên lạc bảo mật.
Cài skill ssl-tls-management bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/ssl-tls-management-8933b.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /ssl-tls-management – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/ssl-tls-management-8933b.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $ssl-tls-management – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/ssl-tls-management-8933b.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /ssl-tls-management – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/ssl-tls-management-8933b.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /ssl-tls-management – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
SSL/TLS Management
Manage certificates and secure communications across web servers, Kubernetes clusters, and internal services.
Prerequisites
- Domain name with DNS control for public certificates
- Root/sudo access on web servers
certbotinstalled for Let's EncryptopensslCLI available (installed by default on most Linux distros)- Kubernetes cluster with Helm for cert-manager deployment
- Understanding of X.509 certificate chain of trust
Let's Encrypt with Certbot
Installation and Certificate Issuance
# Install certbot (Ubuntu/Debian)
apt update && apt install -y certbot python3-certbot-nginx
# Obtain certificate for nginx (interactive)
certbot --nginx -d example.com -d www.example.com
# Non-interactive mode for automation
certbot certonly --nginx \
-d example.com \
-d www.example.com \
--non-interactive \
--agree-tos \
--email [email protected]
# Standalone mode (when no web server is running)
certbot certonly --standalone \
-d example.com \
--preferred-challenges http
# DNS challenge (for wildcard certs)
certbot certonly --manual \
--preferred-challenges dns \
-d "*.example.com" \
-d example.com
# Using DNS plugin for automation (Cloudflare example)
pip install certbot-dns-cloudflare
install -m 600 /dev/null /etc/letsencrypt/cloudflare.ini
# Populate dns_cloudflare_api_token using the approved secret-manager workflow;
# do not paste tokens into shell history or commit the file.
certbot certonly --dns-cloudflare \
--dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini \
-d "*.example.com" \
-d example.comRenewal Automation
# Test renewal
certbot renew --dry-run
# Inspect existing package-managed certbot timers first; configure exactly one renewal schedule.
# Custom systemd timer example (confirm executable path for your installation)
cat > /etc/systemd/system/certbot-renewal.service << 'EOF'
[Unit]
Description=Certbot certificate renewal
After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --quiet --deploy-hook "systemctl reload nginx"
EOF
cat > /etc/systemd/system/certbot-renewal.timer << 'EOF'
[Unit]
Description=Run certbot renewal twice daily
[Timer]
OnCalendar=*-*-* 00,12:00:00
RandomizedDelaySec=3600
Persistent=true
[Install]
WantedBy=timers.target
EOF
systemctl enable --now certbot-renewal.timer
# Verify timer is active
systemctl list-timers certbot-renewal.timer
# Renewal hooks for post-renewal actions
mkdir -p /etc/letsencrypt/renewal-hooks/deploy
cat > /etc/letsencrypt/renewal-hooks/deploy/reload-services.sh << 'HOOK'
#!/bin/bash
systemctl reload nginx
# Also reload other services using the cert
systemctl reload haproxy 2>/dev/null || true
HOOK
chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload-services.shcert-manager for Kubernetes
Installation
# Install with Helm
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.14.0 \
--set installCRDs=true \
--set prometheus.enabled=true
# Verify installation
kubectl get pods -n cert-manager
kubectl get crds | grep cert-managerClusterIssuer Configurations
# letsencrypt-staging (use for testing first)
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: [email protected]
privateKeySecretRef:
name: letsencrypt-staging
solvers:
- http01:
ingress:
class: nginx
---
# letsencrypt-prod
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: [email protected]
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- http01:
ingress:
class: nginx
---
# DNS challenge solver (for wildcard certs with Cloudflare)
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod-dns
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: [email protected]
privateKeySecretRef:
name: letsencrypt-prod-dns
solvers:
- dns01:
cloudflare:
apiTokenSecretRef:
name: cloudflare-api-token
key: api-token
---
# Self-signed CA issuer for internal services
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: selfsigned-ca
spec:
selfSigned: {}Certificate Resources
# Public-facing certificate
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-cert
namespace: default
spec:
secretName: example-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- example.com
- www.example.com
duration: 2160h # 90 days
renewBefore: 720h # 30 days before expiry
---
# Wildcard certificate
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: wildcard-cert
namespace: default
spec:
secretName: wildcard-tls
issuerRef:
name: letsencrypt-prod-dns
kind: ClusterIssuer
dnsNames:
- "*.example.com"
- example.com
---
# Ingress with automatic TLS
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
tls:
- hosts:
- example.com
secretName: example-tls
rules:
- host: example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 80OpenSSL Commands Reference
# Generate a private key
umask 077
openssl genrsa -out server.key 4096
# Generate an ECDSA key (preferred for performance)
openssl ecparam -genkey -name prime256v1 -out server-ec.key
# Generate a CSR (Certificate Signing Request)
openssl req -new -key server.key -out server.csr \
-subj "/C=US/ST=California/L=San Francisco/O=Acme Corp/CN=example.com"
# Generate CSR with SAN (Subject Alternative Names)
openssl req -new -key server.key -out server.csr -config <(cat <<EOF
[req]
default_bits = 4096
distinguished_name = dn
req_extensions = san
prompt = no
[dn]
CN = example.com
O = Acme Corp
C = US
[san]
subjectAltName = DNS:example.com,DNS:www.example.com,DNS:api.example.com
EOF
)
# Generate self-signed certificate (development/testing)
openssl req -x509 -nodes -days 365 -newkey rsa:4096 \
-keyout selfsigned.key -out selfsigned.crt \
-subj "/CN=localhost" -addext "subjectAltName=DNS:localhost"
# View certificate details
openssl x509 -in cert.pem -noout -text
# Check certificate expiration date
openssl x509 -in cert.pem -noout -dates
# Check remote certificate
openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | \
openssl x509 -noout -dates -subject -issuer
# Verify certificate chain
openssl verify -CAfile ca-bundle.crt server.crt
# Check certificate chain from remote server
openssl s_client -connect example.com:443 -showcerts 2>/dev/null | \
openssl x509 -noout -text
# Convert PEM to PKCS12
openssl pkcs12 -export -out cert.pfx -inkey server.key -in server.crt -certfile ca.crt
# Convert PKCS12 to PEM
openssl pkcs12 -in cert.pfx -out cert.pem -nodes
# Test TLS connection and cipher negotiation
openssl s_client -connect example.com:443 -tls1_3
openssl s_client -connect example.com:443 -cipher 'ECDHE-RSA-AES256-GCM-SHA384'The remote openssl display examples inspect a peer certificate; they do not by themselves verify hostname/trust/complete chain. Test with explicit verification options and a trusted CA store. Start HSTS with a short approved max-age, verify all required hosts support HTTPS, then consider longer duration/subdomain/preload separately; those settings can create persistent outages. The selfSigned ClusterIssuer creates self-signed leaves; a managed internal CA requires a CA certificate/key and CA issuer plus trust distribution.
Strong TLS Configuration
Nginx
server {
listen 443 ssl http2;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
# Protocol versions
ssl_protocols TLSv1.2 TLSv1.3;
# Cipher suites (TLS 1.2)
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
# Session settings
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
# Enable stapling only for issuers that still provide a working OCSP responder.
# Let's Encrypt no longer supplies OCSP responses.
ssl_stapling off;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeo… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- stakeholder-investor-reports – Sổ đăng ký báo cáo bên liên quan: bên liên quan, kỳ báo cáo, chỉ số chính, người lập…
- startup-business-analyst-financial-projections – Lập mô hình tài chính chi tiết 3-5 năm với doanh thu, chi phí, dòng tiền và các kịch bản
- startup-it-troubleshooting – Sổ tay xử lý sự cố IT thực tế cho các nhóm nhỏ không có nhân sự IT chuyên trách.
- startup-metrics-framework – Hướng dẫn toàn diện về theo dõi, tính toán và tối ưu các chỉ số hiệu suất chính cho các…
- stellar-anchor-integration – Sổ đăng ký tuân thủ giao thức Stellar anchor: xác thực web SEP-10, nạp và rút tiền tương…
- stellar-escrow-timelock – Sổ đăng ký hợp đồng ký quỹ có điều kiện và timelock phi tập trung: điều kiện giải ngân…
- stellar-multisig-threshold-coordinator – Sổ đăng ký điều phối người ký đa chữ ký và ngưỡng: cấu hình trọng số, khóa chính và…
- steve-jobs – Agent mô phỏng Steve Jobs: đồng sáng lập Apple, CEO Pixar, người sáng lập NeXT, nhà…