[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74X12PAMG9GSZDM2PXM08QM":3,"skill-same:01M74X12PAMG9GSZDM2PXM08QM":93},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":39,"commitSha":40,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":6,"updatedAt":44,"install":45,"resources":58},"01M74X12PAMG9GSZDM2PXM08QM","deploying-tailscale-for-zero-trust-vpn",null,"Deploy and configure Tailscale as a WireGuard-based zero trust mesh VPN with identity-aware access controls, ACLs, and exit nodes for secure peer-to-peer connectivity.","SamuelChien\u002Fmega-skills-collection","SamuelChien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4652114?v=4","01M74KK34WVHA0P5ZYSJRDDFMG","Samuel Chien","01M74KK35FQN1N9VZ9EPTH3P2S",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fdeploying-tailscale-for-zero-trust-vpn\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fdeploying-tailscale-for-zero-trust-vpn\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: deploying-tailscale-for-zero-trust-vpn\ndescription: Deploy and configure Tailscale as a WireGuard-based zero trust mesh VPN with identity-aware access controls, ACLs, and exit nodes for secure peer-to-peer connectivity.\ndomain: cybersecurity\nsubdomain: zero-trust-architecture\ntags: [zero-trust, tailscale, wireguard, mesh-vpn, ztna, peer-to-peer, acl, identity-aware, headscale]\nversion: \"1.0\"\nauthor: mahipal\nlicense: Apache-2.0\n---\n\n# Deploying Tailscale for Zero Trust VPN\n\n## Overview\n\nTailscale is a zero trust mesh VPN built on WireGuard that creates encrypted peer-to-peer connections between devices without requiring traditional VPN servers or complex network configuration. Every connection in a Tailscale network (tailnet) is end-to-end encrypted using WireGuard's Noise protocol framework with Curve25519 key exchange. Tailscale implements zero trust networking by authenticating every connection request through identity providers, enforcing granular Access Control Lists (ACLs), and supporting features like exit nodes, subnet routers, MagicDNS, and Tailscale SSH. For organizations preferring self-hosted infrastructure, Headscale provides an open-source implementation of the Tailscale control server.\n\n\n## When to Use\n\n- When deploying or configuring deploying tailscale for zero trust vpn capabilities in your environment\n- When establishing security controls aligned to compliance requirements\n- When building or improving security architecture for this domain\n- When conducting security assessments that require this implementation\n\n## Prerequisites\n\n- Identity provider (Okta, Azure AD, Google Workspace, GitHub, or OIDC-compatible)\n- Devices running supported OS (Linux, Windows, macOS, iOS, Android, FreeBSD)\n- Administrative access to configure DNS and firewall rules\n- Understanding of WireGuard protocol fundamentals\n- Network planning documentation for subnet routing requirements\n\n## Architecture\n\n```\n                    Tailscale Coordination Server\n                    (or self-hosted Headscale)\n                           |\n                    Key Distribution\n                    & NAT Traversal\n                           |\n         +-----------------+-----------------+\n         |                 |                 |\n    +----+----+      +----+----+      +----+----+\n    | Node A  |\u003C---->| Node B  |\u003C---->| Node C  |\n    | (Linux) |      | (macOS) |      |(Windows)|\n    +---------+      +---------+      +---------+\n    WireGuard         WireGuard        WireGuard\n    Encrypted         Encrypted        Encrypted\n    P2P Tunnel        P2P Tunnel       P2P Tunnel\n\n    Each node connects directly to every other node.\n    DERP relay servers used only when direct P2P fails.\n```\n\n## Installation and Setup\n\n### Linux Installation\n\n```bash\n# Add Tailscale repository and install\ncurl -fsSL https:\u002F\u002Ftailscale.com\u002Finstall.sh | sh\n\n# Start Tailscale and authenticate\nsudo tailscale up\n\n# Check connection status\ntailscale status\n\n# View assigned IP address\ntailscale ip -4\ntailscale ip -6\n```\n\n### Windows \u002F macOS Installation\n\n```bash\n# Windows: Download from https:\u002F\u002Ftailscale.com\u002Fdownload\u002Fwindows\n# macOS: Install via Homebrew\nbrew install --cask tailscale\n\n# Or download from https:\u002F\u002Ftailscale.com\u002Fdownload\u002Fmac\n```\n\n### Docker Deployment\n\n```yaml\n# docker-compose.yml for Tailscale sidecar\nversion: '3.8'\nservices:\n  tailscale:\n    image: tailscale\u002Ftailscale:latest\n    container_name: tailscale\n    hostname: my-service\n    environment:\n      - TS_AUTHKEY=tskey-auth-xxxxx  # Pre-auth key\n      - TS_STATE_DIR=\u002Fvar\u002Flib\u002Ftailscale\n      - TS_EXTRA_ARGS=--advertise-tags=tag:container\n    volumes:\n      - tailscale-state:\u002Fvar\u002Flib\u002Ftailscale\n      - \u002Fdev\u002Fnet\u002Ftun:\u002Fdev\u002Fnet\u002Ftun\n    cap_add:\n      - net_admin\n      - sys_module\n    restart: unless-stopped\n\nvolumes:\n  tailscale-state:\n```\n\n### Kubernetes Deployment\n\n```yaml\n# Tailscale operator for Kubernetes\napiVersion: v1\nkind: Secret\nmetadata:\n  name: tailscale-auth\n  namespace: tailscale\ntype: Opaque\nstringData:\n  TS_AUTHKEY: \"tskey-auth-xxxxx\"\n---\napiVersion: apps\u002Fv1\nkind: DaemonSet\nmetadata:\n  name: tailscale\n  namespace: tailscale\nspec:\n  selector:\n    matchLabels:\n      app: tailscale\n  template:\n    metadata:\n      labels:\n        app: tailscale\n    spec:\n      containers:\n      - name: tailscale\n        image: tailscale\u002Ftailscale:latest\n        env:\n        - name: TS_AUTHKEY\n          valueFrom:\n            secretKeyRef:\n              name: tailscale-auth\n              key: TS_AUTHKEY\n        - name: TS_KUBE_SECRET\n          value: tailscale-state\n        - name: TS_USERSPACE\n          value: \"true\"\n        securityContext:\n          capabilities:\n            add: [\"NET_ADMIN\"]\n```\n\n## Access Control Lists (ACLs)\n\nTailscale ACLs define who can access what within your tailnet using a declarative JSON format. The default policy is deny-all, making it zero trust by design.\n\n```json\n{\n  \"acls\": [\n    \u002F\u002F Engineering team can access development servers\n    {\n      \"action\": \"accept\",\n      \"src\": [\"group:engineering\"],\n      \"dst\": [\"tag:dev-server:*\"]\n    },\n    \u002F\u002F SRE team can access production infrastructure\n    {\n      \"action\": \"accept\",\n      \"src\": [\"group:sre\"],\n      \"dst\": [\"tag:production:22,443,8080\"]\n    },\n    \u002F\u002F Database access restricted to backend services\n    {\n      \"action\": \"accept\",\n      \"src\": [\"tag:backend\"],\n      \"dst\": [\"tag:database:5432,3306,27017\"]\n    },\n    \u002F\u002F All employees can access internal tools\n    {\n      \"action\": \"accept\",\n      \"src\": [\"group:employees\"],\n      \"dst\": [\"tag:internal-tools:443\"]\n    }\n  ],\n\n  \"groups\": {\n    \"group:engineering\": [\"user@company.com\", \"dev@company.com\"],\n    \"group:sre\": [\"sre@company.com\", \"oncall@company.com\"],\n    \"group:employees\": [\"autogroup:members\"]\n  },\n\n  \"tagOwners\": {\n    \"tag:dev-server\": [\"group:engineering\"],\n    \"tag:production\": [\"group:sre\"],\n    \"tag:backend\": [\"group:sre\"],\n    \"tag:database\": [\"group:sre\"],\n    \"tag:internal-tools\": [\"group:sre\"],\n    \"tag:container\": [\"group:sre\"]\n  },\n\n  \"ssh\": [\n    {\n      \"action\": \"check\",\n      \"src\": [\"group:sre\"],\n      \"dst\": [\"tag:production\"],\n      \"users\": [\"root\", \"admin\"]\n    },\n    {\n      \"action\": \"accept\",\n      \"src\": [\"group:engineering\"],\n      \"dst\": [\"tag:dev-server\"],\n      \"users\": [\"autogroup:nonroot\"]\n    }\n  ],\n\n  \"nodeAttrs\": [\n    {\n      \"target\": [\"autogroup:members\"],\n      \"attr\": [\"funnel:deny\"]\n    }\n  ]\n}\n```\n\n## Exit Nodes and Subnet Routing\n\n### Configure Exit Node\n\n```bash\n# On the exit node machine\nsudo tailscale up --advertise-exit-node\n\n# On the client machine, use the exit node\nsudo tailscale up --exit-node=\u003Cexit-node-ip>\n\n# Verify exit node routing\ncurl ifconfig.me  # Should show exit node's public IP\n```\n\n### Subnet Router Configuration\n\n```bash\n# Advertise local subnets through Tailscale\nsudo tailscale up --advertise-routes=10.0.0.0\u002F24,192.168.1.0\u002F24\n\n# Enable IP forwarding on Linux\necho 'net.ipv4.ip_forward = 1' | sudo tee -a \u002Fetc\u002Fsysctl.conf\necho 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a \u002Fetc\u002Fsysctl.conf\nsudo sysctl -p\n\n# Accept routes on client\nsudo tailscale up --accept-routes\n```\n\n## Tailscale SSH (Zero Trust SSH)\n\nTailscale SSH replaces traditional SSH key management with identity-based access.\n\n```bash\n# Enable Tailscale SSH on a server\nsudo tailscale up --ssh\n\n# Connect using Tailscale SSH (no SSH keys needed)\nssh user@hostname  # Authenticates via Tailscale identity\n\n# Session recording (audit logging)\n# Configure in ACL policy:\n# \"ssh\": [{\"action\": \"check\", \"src\": [...], \"dst\": [...], \"users\": [...]}]\n# \"check\" action requires re-authentication and records sessions\n```\n\n## MagicDNS Configuration\n\n```bash\n# MagicDNS is enabled by default in new tailnets\n# Access devices by hostname instead of IP\nping my-server  # Resolves via MagicDNS\n\n# Custom DNS configuration via admin console\n# Split DNS: route specific domains to internal DNS servers\n# Global nameservers: override default DNS resolution\n```\n\n## Self-Hosted with Headscale\n\n```bash\n# Install Headscale (open-source Tailscale control server)\nwget https:\u002F\u002Fgithub.com\u002Fjuanfont\u002Fheadscale\u002Freleases\u002Flatest\u002Fdownload\u002Fheadscale_linux_amd64\nchmod +x headscale_linux_amd64\nsudo mv headscale_linux_amd64 \u002Fusr\u002Flocal\u002Fbin\u002Fheadscale\n\n# Create configuration\nsudo mkdir -p \u002Fetc\u002Fheadscale\nsudo headscale generate config > \u002Fetc\u002Fheadscale\u002Fconfig.yaml\n\n# Edit config for your environment\n# Key settings:\n#   server_url: https:\u002F\u002Fheadscale.example.com\n#   listen_addr: 0.0.0.0:8080\n#   private_key_path: \u002Fetc\u002Fheadscale\u002Fprivate.key\n#   db_type: sqlite3\n#   db_path: \u002Fvar\u002Flib\u002Fheadscale\u002Fdb.sqlite\n\n# Start Headscale\nsudo headscale serve\n\n# Create user and pre-auth key\nheadscale users create myorg\nheadscale preauthkeys create --user myorg --reusable --expiration 24h\n\n# Connect Tailscale client to Headscale\ntailscale up --login-server https:\u002F\u002Fheadscale.example.com\n```\n\n## Security Hardening\n\n### Key Expiry and Rotation\n\n```bash\n# Set key expiry in admin console (default: 180 days)\n# Force re-authentication periodically\n\n# Disable key expiry for servers (use auth keys instead)\nsudo tailscale up --authkey=tskey-auth-xxxxx\n\n# Pre-auth keys for automated deployment\n# Create ephemeral, single-use keys for CI\u002FCD\n```\n\n### Device Authorization\n\n```json\n{\n  \"nodeAttrs\": [\n    {\n      \"target\": [\"autogroup:members\"],\n      \"attr\": [\n        \"mullvad:deny\",\n        \"funnel:deny\"\n      ]\n    }\n  ],\n  \"autoApprovers\": {\n    \"routes\": {\n      \"10.0.0.0\u002F24\": [\"group:sre\"],\n      \"192.168.0.0\u002F16\": [\"group:sre\"]\n    },\n    \"exitNode\": [\"group:sre\"]\n  }\n}\n```\n\n### Network Lock (Tailnet Lock)\n\n```bash\n# Initialize network lock with signing keys\ntailscale lock init\n\n# Add trusted signing keys\ntailscale lock add nodekey:xxxxx\n\n# All new nodes require signing before joining\n# Prevents unauthorized nodes from joining the tailnet\n```\n\n## Monitoring and Observability\n\n```bash\n# View network status\ntailscale status --json | jq '.Peer | to_entries[] | {name: .value.HostName, online: .value.Online, os: .value.OS}'\n\n# Check connection quality\ntailscale ping \u003Cpeer-ip>\n\n# View network map\ntailscale netcheck\n\n# Audit logs available in Tailscale admin console\n# Integration with SIEM via webhook or API\n```\n\n## Integration Patterns\n\n### Service Mesh Integration\n\n```bash\n# Tailscale as sidecar for service-to-service communication\n# Each service gets a Tailscale identity\n# ACLs enforce service-to-service access policies\n\n# Example: API service can only reach database service\n# ACL: tag:api -> tag:database:5432\n```\n\n### CI\u002FCD Pipeline Integration\n\n```bash\n# Use ephemeral auth keys in CI\u002FCD\nexport TS_AUTHKEY=tskey-auth-xxxxx-ephemeral\ntailscale up --authkey=$TS_AUTHKEY --hostname=ci-runner-$CI_JOB_ID\n\n# Access internal resources during build\u002Fdeploy\n# Node automatically removed when container stops\n```\n\n## References\n\n- [Tailscale Documentation](https:\u002F\u002Ftailscale.com\u002Fkb\u002F)\n- [How Tailscale Works](https:\u002F\u002Ftailscale.com\u002Fblog\u002Fhow-tailscale-works)\n- [Tailscale ACL Documentation](https:\u002F\u002Ftailscale.com\u002Fkb\u002F1018\u002Facls\u002F)\n- [Headscale - Open Source Control Server](https:\u002F\u002Fgithub.com\u002Fjuanfont\u002Fheadscale)\n- [WireGuard Protocol](https:\u002F\u002Fwww.wireguard.com\u002Fprotocol\u002F)\n- [Tailscale SSH](https:\u002F\u002Ftailscale.com\u002Fkb\u002F1193\u002Ftailscale-ssh\u002F)\n","# Deploying Tailscale for Zero Trust VPN\n\n## Overview\n\nTailscale is a zero trust mesh VPN built on WireGuard that creates encrypted peer-to-peer connections between devices without requiring traditional VPN servers or complex network configuration. Every connection in a Tailscale network (tailnet) is end-to-end encrypted using WireGuard's Noise protocol framework with Curve25519 key exchange. Tailscale implements zero trust networking by authenticating every connection request through identity providers, enforcing granular Access Control Lists (ACLs), and supporting features like exit nodes, subnet routers, MagicDNS, and Tailscale SSH. For organizations preferring self-hosted infrastructure, Headscale provides an open-source implementation of the Tailscale control server.\n\n\n## When to Use\n\n- When deploying or configuring deploying tailscale for zero trust vpn capabilities in your environment\n- When establishing security controls aligned to compliance requirements\n- When building or improving security architecture for this domain\n- When conducting security assessments that require this implementation\n\n## Prerequisites\n\n- Identity provider (Okta, Azure AD, Google Workspace, GitHub, or OIDC-compatible)\n- Devices running supported OS (Linux, Windows, macOS, iOS, Android, FreeBSD)\n- Administrative access to configure DNS and firewall rules\n- Understanding of WireGuard protocol fundamentals\n- Network planning documentation for subnet routing requirements\n\n## Architecture\n\n```\n                    Tailscale Coordination Server\n                    (or self-hosted Headscale)\n                           |\n                    Key Distribution\n                    & NAT Traversal\n                           |\n         +-----------------+-----------------+\n         |                 |                 |\n    +----+----+      +----+----+      +----+----+\n    | Node A  |\u003C---->| Node B  |\u003C---->| Node C  |\n    | (Linux) |      | (macOS) |      |(Windows)|\n    +---------+      +---------+      +---------+\n    WireGuard         WireGuard        WireGuard\n    Encrypted         Encrypted        Encrypted\n    P2P Tunnel        P2P Tunnel       P2P Tunnel\n\n    Each node connects directly to every other node.\n    DERP relay servers used only when direct P2P fails.\n```\n\n## Installation and Setup\n\n### Linux Installation\n\n```bash\n# Add Tailscale repository and install\ncurl -fsSL https:\u002F\u002Ftailscale.com\u002Finstall.sh | sh\n\n# Start Tailscale and authenticate\nsudo tailscale up\n\n# Check connection status\ntailscale status\n\n# View assigned IP address\ntailscale ip -4\ntailscale ip -6\n```\n\n### Windows \u002F macOS Installation\n\n```bash\n# Windows: Download from https:\u002F\u002Ftailscale.com\u002Fdownload\u002Fwindows\n# macOS: Install via Homebrew\nbrew install --cask tailscale\n\n# Or download from https:\u002F\u002Ftailscale.com\u002Fdownload\u002Fmac\n```\n\n### Docker Deployment\n\n```yaml\n# docker-compose.yml for Tailscale sidecar\nversion: '3.8'\nservices:\n  tailscale:\n    image: tailscale\u002Ftailscale:latest\n    container_name: tailscale\n    hostname: my-service\n    environment:\n      - TS_AUTHKEY=tskey-auth-xxxxx  # Pre-auth key\n      - TS_STATE_DIR=\u002Fvar\u002Flib\u002Ftailscale\n      - TS_EXTRA_ARGS=--advertise-tags=tag:container\n    volumes:\n      - tailscale-state:\u002Fvar\u002Flib\u002Ftailscale\n      - \u002Fdev\u002Fnet\u002Ftun:\u002Fdev\u002Fnet\u002Ftun\n    cap_add:\n      - net_admin\n      - sys_module\n    restart: unless-stopped\n\nvolumes:\n  tailscale-state:\n```\n\n### Kubernetes Deployment\n\n```yaml\n# Tailscale operator for Kubernetes\napiVersion: v1\nkind: Secret\nmetadata:\n  name: tailscale-auth\n  namespace: tailscale\ntype: Opaque\nstringData:\n  TS_AUTHKEY: \"tskey-auth-xxxxx\"\n---\napiVersion: apps\u002Fv1\nkind: DaemonSet\nmetadata:\n  name: tailscale\n  namespace: tailscale\nspec:\n  selector:\n    matchLabels:\n      app: tailscale\n  template:\n    metadata:\n      labels:\n        app: tailscale\n    spec:\n      containers:\n      - name: tailscale\n        image: tailscale\u002Ftailscale:latest\n        env:\n        - name: TS_AUTHKEY\n          valueFrom:\n            secretKeyRef:\n              name: tailscale-auth\n              key: TS_AUTHKEY\n        - name: TS_KUBE_SECRET\n          value: tailscale-state\n        - name: TS_USERSPACE\n          value: \"true\"\n        securityContext:\n          capabilities:\n            add: [\"NET_ADMIN\"]\n```\n\n## Access Control Lists (ACLs)\n\nTailscale ACLs define who can access what within your tailnet using a declarative JSON format. The default policy is deny-all, making it zero trust by design.\n\n```json\n{\n  \"acls\": [\n    \u002F\u002F Engineering team can access development servers\n    {\n      \"action\": \"accept\",\n      \"src\": [\"group:engineering\"],\n      \"dst\": [\"tag:dev-server:*\"]\n    },\n    \u002F\u002F SRE team can access production infrastructure\n    {\n      \"action\": \"accept\",\n      \"src\": [\"group:sre\"],\n      \"dst\": [\"tag:production:22,443,8080\"]\n    },\n    \u002F\u002F Database access restricted to backend services\n    {\n      \"action\": \"accept\",\n      \"src\": [\"tag:backend\"],\n      \"dst\": [\"tag:database:5432,3306,27017\"]\n    },\n    \u002F\u002F All employees can access internal tools\n    {\n      \"action\": \"accept\",\n      \"src\": [\"group:employees\"],\n      \"dst\": [\"tag:internal-tools:443\"]\n    }\n  ],\n\n  \"groups\": {\n    \"group:engineering\": [\"user@company.com\", \"dev@company.com\"],\n    \"group:sre\": [\"sre@company.com\", \"oncall@company.com\"],\n    \"group:employees\": [\"autogroup:members\"]\n  },\n\n  \"tagOwners\": {\n    \"tag:dev-server\": [\"group:engineering\"],\n    \"tag:production\": [\"group:sre\"],\n    \"tag:backend\": [\"group:sre\"],\n    \"tag:database\": [\"group:sre\"],\n    \"tag:internal-tools\": [\"group:sre\"],\n    \"tag:container\": [\"group:sre\"]\n  },\n\n  \"ssh\": [\n    {\n      \"action\": \"check\",\n      \"src\": [\"group:sre\"],\n      \"dst\": [\"tag:production\"],\n      \"users\": [\"root\", \"admin\"]\n    },\n    {\n      \"action\": \"accept\",\n      \"src\": [\"group:engineering\"],\n      \"dst\": [\"tag:dev-server\"],\n      \"users\": [\"autogroup:nonroot\"]\n    }\n  ],\n\n  \"nodeAttrs\": [\n    {\n      \"target\": [\"autogroup:members\"],\n      \"attr\": [\"funnel:deny\"]\n    }\n  ]\n}\n```\n\n## Exit Nodes and Subnet Routing\n\n### Configure Exit Node\n\n```bash\n# On the exit node machine\nsudo tailscale up --advertise-exit-node\n\n# On the client machine, use the exit node\nsudo tailscale up --exit-node=\u003Cexit-node-ip>\n\n# Verify exit node routing\ncurl ifconfig.me  # Should show exit node's public IP\n```\n\n### Subnet Router Configuration\n\n```bash\n# Advertise local subnets through Tailscale\nsudo tailscale up --advertise-routes=10.0.0.0\u002F24,192.168.1.0\u002F24\n\n# Enable IP forwarding on Linux\necho 'net.ipv4.ip_forward = 1' | sudo tee -a \u002Fetc\u002Fsysctl.conf\necho 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a \u002Fetc\u002Fsysctl.conf\nsudo sysctl -p\n\n# Accept routes on client\nsudo tailscale up --accept-routes\n```\n\n## Tailscale SSH (Zero Trust SSH)\n\nTailscale SSH replaces traditional SSH key management with identity-based access.\n\n```bash\n# Enable Tailscale SSH on a server\nsudo tailscale up --ssh\n\n# Connect using Tailscale SSH (no SSH keys needed)\nssh user@hostname  # Authenticates via Tailscale identity\n\n# Session recording (audit logging)\n# Configure in ACL policy:\n# \"ssh\": [{\"action\": \"check\", \"src\": [...], \"dst\": [...], \"users\": [...]}]\n# \"check\" action requires re-authentication and records sessions\n```\n\n## MagicDNS Configuration\n\n```bash\n# MagicDNS is enabled by default in new tailnets\n# Access devices by hostname instead of IP\nping my-server  # Resolves via MagicDNS\n\n# Custom DNS configuration via admin console\n# Split DNS: route specific domains to internal DNS servers\n# Global nameservers: override default DNS resolution\n```\n\n## Self-Hosted with Headscale\n\n```bash\n# Install Headscale (open-source Tailscale control server)\nwget https:\u002F\u002Fgithub.com\u002Fjuanfont\u002Fheadscale\u002Freleases\u002Flatest\u002Fdownload\u002Fheadscale_linux_amd64\nchmod +x headscale_linux_amd64\nsudo mv headscale_linux_amd64 \u002Fusr\u002Flocal\u002Fbin\u002Fheadscale\n\n# Create configuration\nsudo mkdir -p \u002Fetc\u002Fheadscale\nsudo headscale generate config > \u002Fetc\u002Fheadscale\u002Fconfig.yaml\n\n# Edit config for your environment\n# Key settings:\n#   server_url: https:\u002F\u002Fheadscale.example.com\n#   listen_addr: 0.0.0.0:8080\n#   private_key_path: \u002Fetc\u002Fheadscale\u002Fprivate.key\n#   db_type: sqlite3\n#   db_path: \u002Fvar\u002Flib\u002Fheadscale\u002Fdb.sqlite\n\n# Start Headscale\nsudo headscale serve\n\n# Create user and pre-auth key\nheadscale users create myorg\nheadscale preauthkeys create --user myorg --reusable --expiration 24h\n\n# Connect Tailscale client to Headscale\ntailscale up --login-server https:\u002F\u002Fheadscale.example.com\n```\n\n## Security Hardening\n\n### Key Expiry and Rotation\n\n```bash\n# Set key expiry in admin console (default: 180 days)\n# Force re-authentication periodically\n\n# Disable key expiry for servers (use auth keys instead)\nsudo tailscale up --authkey=tskey-auth-xxxxx\n\n# Pre-auth keys for automated deployment\n# Create ephemeral, single-use keys for CI\u002FCD\n```\n\n### Device Authorization\n\n```json\n{\n  \"nodeAttrs\": [\n    {\n      \"target\": [\"autogroup:members\"],\n      \"attr\": [\n        \"mullvad:deny\",\n        \"funnel:deny\"\n      ]\n    }\n  ],\n  \"autoApprovers\": {\n    \"routes\": {\n      \"10.0.0.0\u002F24\": [\"group:sre\"],\n      \"192.168.0.0\u002F16\": [\"group:sre\"]\n    },\n    \"exitNode\": [\"group:sre\"]\n  }\n}\n```\n\n### Network Lock (Tailnet Lock)\n\n```bash\n# Initialize network lock with signing keys\ntailscale lock init\n\n# Add trusted signing keys\ntailscale lock add nodekey:xxxxx\n\n# All new nodes require signing before joining\n# Prevents unauthorized nodes from joining the tailnet\n```\n\n## Monitoring and Observability\n\n```bash\n# View network status\ntailscale status --json | jq '.Peer | to_entries[] | {name: .value.HostName, online: .value.Online, os: .value.OS}'\n\n# Check connection quality\ntailscale ping \u003Cpeer-ip>\n\n# View network map\ntailscale netcheck\n\n# Audit logs available in Tailscale admin console\n# Integration with SIEM via webhook or API\n```\n\n## Integration Patterns\n\n### Service Mesh Integration\n\n```bash\n# Tailscale as sidecar for service-to-service communication\n# Each service gets a Tailscale identity\n# ACLs enforce service-to-service access policies\n\n# Example: API service can only reach database service\n# ACL: tag:api -> tag:database:5432\n```\n\n### CI\u002FCD Pipeline Integration\n\n```bash\n# Use ephemeral auth keys in CI\u002FCD\nexport TS_AUTHKEY=tskey-auth-xxxxx-ephemeral\ntailscale up --authkey=$TS_AUTHKEY --hostname=ci-runner-$CI_JOB_ID\n\n# Access internal resources during build\u002Fdeploy\n# Node automatically removed when container stops\n```\n\n## References\n\n- [Tailscale Documentation](https:\u002F\u002Ftailscale.com\u002Fkb\u002F)\n- [How Tailscale Works](https:\u002F\u002Ftailscale.com\u002Fblog\u002Fhow-tailscale-works)\n- [Tailscale ACL Documentation](https:\u002F\u002Ftailscale.com\u002Fkb\u002F1018\u002Facls\u002F)\n- [Headscale - Open Source Control Server](https:\u002F\u002Fgithub.com\u002Fjuanfont\u002Fheadscale)\n- [WireGuard Protocol](https:\u002F\u002Fwww.wireguard.com\u002Fprotocol\u002F)\n- [Tailscale SSH](https:\u002F\u002Ftailscale.com\u002Fkb\u002F1193\u002Ftailscale-ssh\u002F)\n",{"name":5,"tags":25,"author":35,"domain":36,"license":15,"version":37,"subdomain":38,"description":7},[26,27,28,29,30,31,32,33,34],"zero-trust","tailscale","wireguard","mesh-vpn","ztna","peer-to-peer","acl","identity-aware","headscale","mahipal","cybersecurity","1.0","zero-trust-architecture","main","c2b1fdccc779e99ac814e55fb69ca8d71215dd0f","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection","https:\u002F\u002Fgithub.com\u002FSamuelChien","http:\u002F\u002Fsamuelchien.com\u002F","2026-05-26 08:27:14",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add SamuelChien\u002Fmega-skills-collection --skill deploying-tailscale-for-zero-trust-vpn",{"tool":51,"command":52},"bunx","bunx skills add SamuelChien\u002Fmega-skills-collection --skill deploying-tailscale-for-zero-trust-vpn",{"tool":54,"command":55},"pnpm","pnpm dlx skills add SamuelChien\u002Fmega-skills-collection --skill deploying-tailscale-for-zero-trust-vpn","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fdeploying-tailscale-for-zero-trust-vpn\u002FSKILL.md",true,[59,65,69,75,79,83,89],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"assets\u002Ftemplate.md","ASSET","资产文件",2377,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fdeploying-tailscale-for-zero-trust-vpn\u002Fassets\u002Ftemplate.md",{"path":66,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fapi-reference.md","REFERENCE","参考文档",1815,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fdeploying-tailscale-for-zero-trust-vpn\u002Freferences\u002Fapi-reference.md",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fstandards.md",1986,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fdeploying-tailscale-for-zero-trust-vpn\u002Freferences\u002Fstandards.md",{"path":80,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fworkflows.md",3334,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fdeploying-tailscale-for-zero-trust-vpn\u002Freferences\u002Fworkflows.md",{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"scripts\u002Fagent.py","SCRIPT","脚本",5131,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fdeploying-tailscale-for-zero-trust-vpn\u002Fscripts\u002Fagent.py",{"path":90,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":91,"sourceHtmlUrl":92},"scripts\u002Fprocess.py",11884,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fdeploying-tailscale-for-zero-trust-vpn\u002Fscripts\u002Fprocess.py",[94,102,109,116,123,130],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":20},"01M76R4WZQZAXGGXMQCA0FZ716","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.","MIT","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-ts\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":20},"01M76R4T9KENDH7FENGZQHBW4G","zustand-store-creator","Zustand Store Creator - Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":20},"01M76R3YWN84B7SANJ52X799ZE","zero-trust-config-helper","Zero Trust Config Helper - Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":20},"01M76R3HNSV2AEYSKHM915GJ58","zapier-integration-helper","Zapier Integration Helper - Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":20},"01M76R3DJSKAT4FA7DV4BF3GCE","zai-cli","Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP.\nUse when user needs image\u002Fvideo analysis, OCR, UI-to-code conversion, error diagnosis,\nreal-time web search, web page to markdown extraction, or GitHub code exploration.\nTrigger with phrases like \"analyze this image\", \"search the web for\", \"read this page\",\n\"explore this repo\", or \"use zai\". Requires Z_AI_API_KEY.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzai-cli\u002FSKILL.md",[],[],{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":98,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":20},"01M76R2KAM699XE9AJVAWE4H2E","yt-research","Research competitor YouTube channels, niches, and trending topics for your content strategy.\nUse this skill whenever the user says \"research channels\", \"analyze competitors\", \"find trending topics\",\n\"niche analysis\", \"competitive research\", \"what are other creators doing\", \"scrape YouTube channels\",\nor wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fyt-research\u002FSKILL.md",[],[]]