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:

  1. 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%
  2. 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%
  3. 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%
  4. 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)

  1. 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%
  2. fail2ban-setup - Automated intrusion prevention

    • Installing fail2ban
    • SSH protection
    • Custom filters and jails
    • Email alerts
    • Prerequisites: Firewall basics
    • Time: 2-3 hours
    • Resources: [โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 30%
  3. 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%
  4. 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%
  5. 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)

  1. 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%
  2. 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%
  3. 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%
  4. 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%
  5. 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)

  1. vault-introduction - HashiCorp Vault basics

    • Why Vault?
    • Vault architecture
    • Installation (docker-compose)
    • Initialization and unsealing
    • Prerequisites: Docker basics
    • Time: 2-3 hours
    • Resources: [โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 40%
  2. vault-secrets - Storing and retrieving secrets

    • KV secrets engine
    • Dynamic secrets
    • Database credentials
    • API integration
    • Prerequisites: Vault basics
    • Time: 3-4 hours
    • Resources: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘] 50%
  3. vault-authentication - Vault auth methods

    • Token authentication
    • AppRole for automation
    • LDAP/AD integration
    • Kubernetes auth
    • Prerequisites: Vault setup
    • Time: 3-4 hours
    • Resources: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘] 60%
  4. rbac-basics - Role-Based Access Control

    • RBAC principles
    • Policies and roles
    • Least privilege
    • Audit logging
    • Prerequisites: Security concepts
    • Time: 2-3 hours
    • Resources: [โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 40%
  5. 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)

  1. 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%
  2. 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%
  3. 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%
  4. 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
  5. 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%
  6. 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:

For Containers:

For CI/CD:

For Observability:

๐Ÿ“Š Resource Requirements

Password Manager (Bitwarden self-hosted):

Firewall/Fail2ban:

HashiCorp Vault:

Full Security Stack:

Learning Time Investment:

๐Ÿ› ๏ธ Recommended Tool Stack

Essential Tools:

Secret Management:

Security Tools:

Self-Hosted Alternatives:

๐Ÿ’ก Pro Tips for Security

  1. Defense in Depth: Never rely on single layer
  2. Least Privilege: Minimum permissions needed, always
  3. Assume Breach: Plan for when, not if, compromised
  4. Automate Hardening: Manual security = eventual mistakes
  5. Audit Everything: Logs, logs, logs - then monitor
  6. Test Restores: Backups are useless until restored
  7. Update Regularly: Patch management is security
  8. Encrypt by Default: Transit and at rest, always
  9. Separate Secrets: Never in code, never in Git
  10. Document Decisions: Why you chose each security control

๐Ÿ”„ Common Security Pitfalls

Pitfall 1: Security Through Obscurity

Pitfall 2: Weak Passwords

Pitfall 3: No Backups

Pitfall 4: Secrets in Git

Pitfall 5: No Monitoring

Pitfall 6: Trusting Internal Network

Pitfall 7: No Update Strategy

Pitfall 8: Over-Permissive Access

๐Ÿ”— Related KB Sections

๐Ÿ“ Change Log

2026-01-30


๐Ÿ”’ 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!

Choose Theme

Your selection is saved locally.

Neural Cacophony
Aperture v2
Flux v1
Mosaic Chaos
Nexus v1
Nexus Zest
Prism v2
Synapse