Security - From Basics to Zero Trust
Status: Active
Last Updated: 2026-01-30
Category: Security & Compliance
Prerequisites: kb/basics/, kb/sysadmin/
Tags: security, zero-trust, hardening, encryption, compliance, self-hosted, vault
Summary
Complete security learning path from password management through Zero Trust architecture. Focused on practical, self-hosted security tools and patterns for homelabs and small-medium infrastructure.
๐ฏ Learning Philosophy
Security in Layers - Defense in Depth:
Passwords โ SSH โ Firewall โ TLS โ Secrets โ Zero Trust
(User) (Access) (Network) (Transit) (Storage) (Architecture)
This directory teaches security assuming basic system knowledge but no prior security expertise. Progressive hardening from individual systems through complete infrastructure security.
๐ Learning Path
Prerequisites: Linux & Networking Basics
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 1: Foundation Security โ
โ โโ Password management โ
โ โโ 2FA/MFA basics โ
โ โโ SSH hardening โ
โ โโ User account security โ
โ โโ Security mindset โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 2: Network Security โ
โ โโ Firewall basics (iptables/nftables)โ
โ โโ Fail2ban intrusion prevention โ
โ โโ VPN setup (WireGuard) โ
โ โโ Network segmentation โ
โ โโ Port scanning & monitoring โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 3: Encryption & TLS โ
โ โโ Certificate fundamentals โ
โ โโ Let's Encrypt automation โ
โ โโ TLS/SSL configuration โ
โ โโ Disk encryption (LUKS) โ
โ โโ Encrypted backups โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 4: Secret & Access Management โ
โ โโ HashiCorp Vault setup โ
โ โโ Dynamic secrets โ
โ โโ Secret rotation โ
โ โโ RBAC (Role-Based Access Control) โ
โ โโ Identity management basics โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 5: Advanced & Zero Trust โ
โ โโ Container security โ
โ โโ Image scanning (Trivy) โ
โ โโ Service mesh mTLS โ
โ โโ Zero Trust principles โ
โ โโ Policy as Code (OPA) โ
โ โโ Compliance automation โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Articles in This Directory
๐ข Phase 1: Foundation Security (Start Here)
Personal Security First:
password-management - Strong password practices
- Password managers (Bitwarden self-hosted)
- Passphrase generation
- Password rotation policies
- Recovery strategies
- Prerequisites: None
- Time: 1-2 hours
- Resources:
[โโโโโโโโโโ]20%
two-factor-authentication - MFA everywhere
- TOTP basics (Authenticator apps)
- Hardware keys (YubiKey)
- Backup codes
- MFA on all services
- Prerequisites: Password management
- Time: 2 hours
- Resources:
[โโโโโโโโโโ]20%
ssh-security-hardening - Secure SSH access
- Disable password authentication
- Key-only access
- SSH config hardening
- Port knocking
- Bastion hosts
- Cross-reference: kb/basics/ssh-basics
- Prerequisites: SSH basics
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]30%
user-account-security - Secure user management
- Principle of least privilege
- sudo configuration
- Disabling root login
- Account auditing
- Prerequisites: Linux user management
- Time: 2 hours
- Resources:
[โโโโโโโโโโ]30%
๐ก Phase 2: Network Security (Perimeter Defense)
firewall-basics - iptables and nftables
- Firewall fundamentals
- iptables rules
- nftables (modern alternative)
- Default deny policy
- Common port configurations
- Prerequisites: Networking basics
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]40%
fail2ban-setup - Automated intrusion prevention
- Installing fail2ban
- SSH protection
- Custom filters and jails
- Email alerts
- Prerequisites: Firewall basics
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]30%
wireguard-vpn - Modern VPN setup
- WireGuard installation
- Peer configuration
- Road warrior setup
- Site-to-site VPN
- DNS configuration
- Prerequisites: Networking concepts
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]50%
network-segmentation - VLAN and isolation
- Network segmentation benefits
- VLAN basics
- DMZ setup
- Firewall zones
- Isolating services
- Prerequisites: Advanced networking
- Time: 4-5 hours
- Resources:
[โโโโโโโโโโ]60%
intrusion-detection - Monitoring for attacks
- Port scan detection
- Log analysis
- OSSEC/Wazuh basics
- Security alerts
- Prerequisites: Network monitoring
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]50%
๐ Phase 3: Encryption & TLS (Data Protection)
certificate-fundamentals - PKI basics
- X.509 certificates explained
- Certificate authorities (CA)
- Certificate signing requests (CSR)
- Self-signed vs CA-signed
- Certificate chains
- Prerequisites: Cryptography basics
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]30%
letsencrypt-automation - Free TLS certificates
- Let's Encrypt explained
- Certbot installation
- DNS-01 challenge
- Wildcard certificates
- Auto-renewal
- Prerequisites: Certificate fundamentals
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]40%
tls-configuration - Secure web servers
- TLS versions and ciphers
- Perfect Forward Secrecy
- HSTS configuration
- SSL Labs A+ rating
- Nginx/Apache TLS
- Prerequisites: Web server basics
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]50%
disk-encryption-luks - Encrypt at rest
- LUKS explained
- Full disk encryption
- Encrypted volumes
- Key management
- Remote unlock (Dropbear)
- Prerequisites: Linux storage
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]60%
encrypted-backups - Secure backup strategies
- Encryption at rest
- Borgbackup setup
- Restic alternative
- Offsite encrypted backups
- Recovery testing
- Prerequisites: Backup basics
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]50%
๐ด Phase 4: Secret & Access Management (Identity)
vault-introduction - HashiCorp Vault basics
- Why Vault?
- Vault architecture
- Installation (docker-compose)
- Initialization and unsealing
- Prerequisites: Docker basics
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]40%
vault-secrets - Storing and retrieving secrets
- KV secrets engine
- Dynamic secrets
- Database credentials
- API integration
- Prerequisites: Vault basics
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]50%
vault-authentication - Vault auth methods
- Token authentication
- AppRole for automation
- LDAP/AD integration
- Kubernetes auth
- Prerequisites: Vault setup
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]60%
rbac-basics - Role-Based Access Control
- RBAC principles
- Policies and roles
- Least privilege
- Audit logging
- Prerequisites: Security concepts
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]40%
identity-management - Centralized identity
- SSO concepts
- Keycloak setup
- LDAP integration
- OAuth2/OIDC
- Prerequisites: Auth concepts
- Time: 4-5 hours
- Resources:
[โโโโโโโโโโ]70%
โซ Phase 5: Advanced & Zero Trust (Enterprise)
container-security - Securing Docker
- Container isolation
- User namespaces
- Read-only containers
- Capabilities and seccomp
- AppArmor/SELinux profiles
- Prerequisites: Docker proficiency
- Time: 4-5 hours
- Resources:
[โโโโโโโโโโ]60%
image-scanning - Vulnerability scanning
- Trivy installation
- Scanning Docker images
- CI/CD integration
- Harbor with Trivy
- Remediation workflows
- Prerequisites: Docker, CI/CD
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]50%
service-mesh-security - mTLS with Linkerd
- Service mesh concepts
- Linkerd mTLS
- Zero Trust networking
- Traffic policies
- Prerequisites: k0s cluster
- Time: 4-5 hours
- Resources:
[โโโโโโโโโโ]80%
zero-trust-principles - Never trust, always verify
- Zero Trust explained
- Micro-segmentation
- Identity-based access
- Continuous verification
- Implementation roadmap
- Prerequisites: Advanced security
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]50% - Conceptual
policy-as-code - Open Policy Agent (OPA)
- Policy as Code benefits
- OPA introduction
- Rego language basics
- Kubernetes admission control
- CI/CD policy enforcement
- Prerequisites: Programming basics
- Time: 4-6 hours
- Resources:
[โโโโโโโโโโ]70%
compliance-automation - CIS, PCI-DSS, etc.
- Compliance frameworks
- Automated scanning (OpenSCAP)
- InSpec tests
- Audit logging
- Reporting
- Prerequisites: Security mastery
- Time: 4-6 hours
- Resources:
[โโโโโโโโโโ]80%
๐ What Comes Next?
After mastering security:
For Infrastructure:
- kb/infrastructure/secrets-in-iac - Secure IaC
- kb/infrastructure/hardening-automation - Automated hardening
For Containers:
- kb/containers/k0s-security - Kubernetes security
- kb/containers/pod-security - Pod security standards
For CI/CD:
- kb/cicd/secrets-management - Secrets in pipelines
- kb/cicd/security-scanning - Scanning in CI
For Observability:
- kb/observability/security-monitoring - Security metrics
๐ Resource Requirements
Password Manager (Bitwarden self-hosted):
- Minimal: 512MB RAM, 1 CPU
[โโโโโโโโโโ]20% - Comfortable: 1GB RAM, 1 CPU
[โโโโโโโโโโ]30%
Firewall/Fail2ban:
- Overhead: <100MB RAM
[โโโโโโโโโโ]10%
HashiCorp Vault:
- Development: 512MB RAM, 1 CPU
[โโโโโโโโโโ]30% - Production: 2GB RAM, 2 CPU, HA cluster
[โโโโโโโโโโ]70%
Full Security Stack:
- Homelab: 4GB RAM
[โโโโโโโโโโ]50% - Small Team: 8GB RAM
[โโโโโโโโโโ]70% - Production: 16GB+ RAM
[โโโโโโโโโโ]90%
Learning Time Investment:
- Foundation Security: 1-2 weeks
[โโโโโโโโโโ]40% - Network Security: 2-3 weeks
[โโโโโโโโโโ]50% - Encryption & TLS: 2-3 weeks
[โโโโโโโโโโ]50% - Secret Management: 3-4 weeks
[โโโโโโโโโโ]60% - Zero Trust: 2-3 months
[โโโโโโโโโโ]80% - Security Mastery: 12+ months
[โโโโโโโโโโ]100%
๐ ๏ธ Recommended Tool Stack
Essential Tools:
- Bitwarden
[โโโโโโโโโโ]80% - Password manager - iptables/nftables
[โโโโโโโโโโ]Required - Firewall - Fail2ban
[โโโโโโโโโโ]80% - Intrusion prevention - Let's Encrypt
[โโโโโโโโโโ]Required - Free TLS
Secret Management:
- HashiCorp Vault
[โโโโโโโโโโ]90% - Industry standard - SOPS
[โโโโโโโโโโ]60% - Encrypted files alternative - Sealed Secrets
[โโโโโโโโโโ]70% - Kubernetes secrets
Security Tools:
- Trivy
[โโโโโโโโโโ]80% - Vulnerability scanning - OpenSCAP
[โโโโโโโโโโ]60% - Compliance scanning - OPA
[โโโโโโโโโโ]70% - Policy as Code - Wazuh
[โโโโโโโโโโ]60% - SIEM/IDS
Self-Hosted Alternatives:
- WireGuard
[โโโโโโโโโโ]90% - vs commercial VPN - Keycloak
[โโโโโโโโโโ]80% - vs Auth0/Okta - Harbor
[โโโโโโโโโโ]80% - Registry with scanning
๐ก Pro Tips for Security
- Defense in Depth: Never rely on single layer
- Least Privilege: Minimum permissions needed, always
- Assume Breach: Plan for when, not if, compromised
- Automate Hardening: Manual security = eventual mistakes
- Audit Everything: Logs, logs, logs - then monitor
- Test Restores: Backups are useless until restored
- Update Regularly: Patch management is security
- Encrypt by Default: Transit and at rest, always
- Separate Secrets: Never in code, never in Git
- Document Decisions: Why you chose each security control
๐ Common Security Pitfalls
Pitfall 1: Security Through Obscurity
- Relying on non-standard ports, hidden services
- Fix: Real security controls, assume discovery
Pitfall 2: Weak Passwords
- Human-memorable passwords, no MFA
- Fix: Password manager + 2FA everywhere
Pitfall 3: No Backups
- Ransomware = total loss
- Fix: 3-2-1 backup rule, test restores
Pitfall 4: Secrets in Git
- API keys, passwords committed
- Fix: Vault, encrypted secrets, git-secrets
Pitfall 5: No Monitoring
- Breached but don't know for months
- Fix: Log aggregation, alerts, SIEM
Pitfall 6: Trusting Internal Network
- No internal security
- Fix: Zero Trust, segment everything
Pitfall 7: No Update Strategy
- Old vulnerable software
- Fix: Automated patching, LTS versions
Pitfall 8: Over-Permissive Access
- Everyone is admin
- Fix: RBAC, least privilege
๐ Related KB Sections
- kb/basics/ssh-basics - SSH foundation
- kb/containers/ - Container security
- kb/infrastructure/ - IaC security
- kb/cicd/ - Pipeline security
- kb/sysadmin/dotenvx - Environment secrets
- kb/networking/ - Network hardening
๐ Change Log
2026-01-30
- Created security directory structure
- Defined complete learning path from passwords to Zero Trust
- Established self-hosted security tool focus
- Listed all planned articles with time estimates
- Added resource requirements for security tools
- Emphasized practical, homelab-friendly approach
- Organized by learning phases (1-5)
- Added tool recommendations and alternatives
- Cross-referenced related KB sections
- Included compliance automation path
๐ Remember: Security is not a product - it's a process. Layer defenses, assume breach, automate hardening, monitor everything, and never stop learning. Start with foundations (passwords, SSH, firewall) and build toward Zero Trust!