Threat: Unauthorized Node Registration
- Description: An attacker might try to guess or obtain pre-auth keys to register malicious nodes. They could brute-force pre-auth key endpoints or trick legitimate users into revealing keys. Once registered, these nodes can access the private network.
- Impact: Unauthorized access to internal network resources, data breaches, network disruption, lateral movement within the network.
- Affected Headscale Component: Node Registration Module, Pre-auth Key Management
- Risk Severity: High
- Mitigation Strategies:
- Generate strong, unpredictable pre-auth keys.
- Implement short expiry times for pre-auth keys.
- Rate limit registration attempts to prevent brute-forcing.
- Regularly audit and revoke unused or suspicious pre-auth keys.
- Consider implementing node approval workflows for manual verification.
- Network segmentation to limit the blast radius of compromised nodes.
Threat: Pre-auth Key Compromise
- Description: Attackers could steal pre-auth keys through various means like phishing, insider threats, or by compromising systems where keys are stored. Compromised keys allow them to register unauthorized nodes.
- Impact: Unauthorized access to internal network resources, data breaches, network disruption, lateral movement within the network.
- Affected Headscale Component: Pre-auth Key Management, Key Storage
- Risk Severity: High
- Mitigation Strategies:
- Treat pre-auth keys as highly sensitive secrets.
- Securely store pre-auth keys (e.g., using secrets management tools).
- Use secure channels for distributing pre-auth keys.
- Implement access control to pre-auth key storage.
- Rotate pre-auth keys regularly.
- Monitor for unauthorized pre-auth key usage.
- Description: If Headscale uses user management (e.g., OIDC), attackers might attempt to compromise user accounts through password attacks, phishing, or exploiting vulnerabilities in the authentication provider. Successful takeover grants administrative control.
- Impact: Full control over Headscale instance, management of the private network, data breaches, service disruption, manipulation of network configuration.
- Affected Headscale Component: User Authentication Module, OIDC Integration (if used), Admin UI/API
- Risk Severity: Critical
- Mitigation Strategies:
- Enforce Multi-Factor Authentication (MFA) for all user accounts, especially administrators.
- Enforce strong password policies for user accounts (if applicable).
- Regularly audit user accounts and permissions.
- Securely configure and maintain the OIDC provider integration.
- Monitor for suspicious login attempts and account activity.
Threat: Headscale Server Compromise
- Description: Attackers could exploit vulnerabilities in the Headscale software, the underlying OS, or misconfigurations to gain access to the Headscale server. This could involve exploiting known CVEs, misconfiguration of services, or social engineering.
- Impact: Complete loss of control over the private network, data breaches, manipulation of network routing, service disruption, exposure of sensitive data (keys, configuration).
- Affected Headscale Component: Headscale Server Application, API, Control Plane Logic
- Risk Severity: Critical
- Mitigation Strategies:
- Keep Headscale software updated to the latest version with security patches.
- Harden the Headscale server operating system (OS hardening).
- Implement strong access controls to the Headscale server (firewall, SSH access).
- Regular security audits and vulnerability scanning of the Headscale server.
- Run Headscale in a containerized environment for isolation.
- Implement intrusion detection and prevention systems (IDS/IPS).
Threat: Database Compromise
- Description: Attackers could exploit vulnerabilities in the database software, weak database credentials, or insecure access controls to compromise the database used by Headscale. This could involve SQL injection, privilege escalation, or brute-forcing database credentials.
- Impact: Exposure of node keys, pre-auth keys, user data, network configuration, potential for unauthorized node registration, network manipulation, data breaches, loss of data integrity.
- Affected Headscale Component: Database, Data Storage Layer
- Risk Severity: Critical
- Mitigation Strategies:
- Securely configure and harden the database server.
- Use strong, randomly generated database credentials.
- Implement strict database access controls (least privilege).
- Use firewall rules to restrict database access to only necessary components.
- Regularly back up the database.
- Consider database encryption at rest and in transit.
- Regularly update the database software with security patches.