Tailsnitch: A Comprehensive Security Auditor for Tailscale Enterprises
Tailsnitch is a lightweight, CLIâdriven tool that scans Tailscale tailnets for over 50 misconfigurations and bestâpractice violations, ranging from overly permissive ACLs to stale or insecure auth keys. By supporting OAuth client credentials, it delivers scoped, auditable access and can remediate issues interactively via the Tailscale API, while also generating SOCâŻ2 evidence reports. Itâs a mustâhave for security teams that need repeatable, automated audits across multiple tailnets.
# Tailsnitch: A Comprehensive Security Auditor for Tailscale Enterprises
## Overview
Tailsnitch is a purposeâbuilt security auditor for Tailscale configurations. It performs an automated assessment of a tailnetâscanning for more than 50 potential vulnerabilitiesâincluding overly permissive access controls, insecure authentication keys, outdated device clients, and network exposure. The tool is designed to be run from a single command, to integrate into CI/CD pipelines, and to provide remediation hooks that interact directly with the Tailscale API.
## Quick Start Guide
```bash
# 1. Set your Tailscale API credentials
export TSKEY="tskey-api-..."
# 2. Run a full audit
tailsnitch
# 3. Show only highâseverity findings
tailsnitch --severity high
# 4. Interactively fix issues
tailsnitch --fix
```
## Installation
### 1. Download a Preâbuilt Binary
The latest release is available on the projectâs GitHub Releases page. macOS users should remove the quarantine flag after download:
```bash
sudo xattr -rd com.apple.quarantine tailsnitch
```
### 2. Install via Go
```bash
go install github.com/Adversis/tailsnitch@latest
```
### 3. Build from Source
```bash
git clone https://github.com/Adversis/tailsnitch.git
cd tailsnitch
go build -o tailsnitch .
```
## Authentication Methods
Tailsnitch supports two mechanisms, with OAuth client preferred when available.
### OAuth Client (Recommended)
* Store scoped credentials:
```bash
export TS_OAUTH_CLIENT_ID="..."
export TS_OAUTH_CLIENT_SECRET="tskey-client-..."
```
* Create the client in the Tailscale admin console under **Admin â Settings â OAuth**.
* Minimum scopes for a readâonly audit are `all:read` or the individual scopes:
- `policy_file:read`
- `devices:core:read`
- `dns:read`
- `auth_keys:read`
* Additional scopes for the `--fix` mode:
- `devices:core` (for deletion or tag modification)
- `auth_keys` (for key deletion)
### API Key
* Set
```bash
export TSKEY="tskey-api-..."
```
* Create under **Admin â Settings â Keys**. The key inherits the creatorâs permissions.
## Core Features
### Full Audit
The default call `tailsnitch` performs all 52 checks across 7 categories: Access Control, Authentication & Keys, Device Security, Network Exposure, SSH Rules, Logging & Admin, and DNS. Optionally, `--verbose` shows passing checks, while `--json` dumps the full report for downstream tooling.
### Filtering and Targeted Scans
| Flag | Purpose |
|------|---------|
| `--severity` | Minimum severity threshold (`critical`, `high`, `medium`, `low`, `info`). |
| `--category` | Narrow to a single category (`access`, `auth`, `device`, `network`, `ssh`, `log`, `dns`). |
| `--checks` | Run commaâseparated list of check IDs or slugs. |
| `--tailnet` | Explicitly audit a tailnet when the OAuth client has access to multiple. |
### Interactive Fix Mode
The `--fix` flag enables an interactive prompt that offers safe remediations for APIâfixable items:
| Check | Action |
|-------|--------|
| AUTHâ001, AUTHâ002, AUTHâ003 | Delete auth keys |
| AUTHâ004 | Replace with an ephemerals key |
| DEVâ002 | Remove tags from user devices |
| DEVâ004 | Delete stale devices |
| DEVâ005 | Authorise pending devices |
Additional options:
- `--dry-run`: Preview the changes.
- `--auto`: Autoâapply safe fixes (confirmation still required).
- `--no-audit-log`: Suppress audit logging of fix actions.
### SOCâŻ2 Evidence Export
Generate structured evidence for SOCâŻ2 audits that maps each check to Common Criteria (CC) control codes:
```bash
tailsnitch --soc2 json > soc2-evidence.json
```
or
```bash
tailsnitch --soc2 csv > soc2-evidence.csv
```
The export includes perâresource results, CC code mappings, and timestamps to support audit trails.
### Suppressing Known Risks
`tailsnitch` respects a `.tailsnitchâignore` file that can suppress specific checks with justification. Supported locations are the current directory and the userâs home (`~/.tailsnitchâignore`). A full example:
```
# .tailsnitch-ignore
# Informational checks
ACLâ008 # We intentionally donât use groups
ACLâ009 # Legacy ACLs are fine for our use case
# Mediumâseverity with justification
DEVâ006 # External devices are approved contractors
LOGâ001 # Flow logs require Enterprise plan
```
Use `--ignore-file` to point to a custom file or `--no-ignore` to bypass processing.
### JSON Export and Advanced Processing
```bash
# Full report
tailsnitch --json > audit.json
# Extract failures as TSV
jq '.suggestions
| map(select(.pass==false))
| .[]
| [.id,.title,.severity,.remediation]
| @tsv' audit.json > findings.tsv
```
### Command Reference
A concise reference for all flags is included in the original documentation; key flags include `--severity`, `--category`, `--check`, `--fix`, `--auto`, `--dry-run`, `--soc2`, and `--tailscale-path` for local TailnetâLock checks.
## Security Checks Landscape
Tailsnitch implements 52 checks grouped into 7 categories. Highlights include:
- **ACLâ001** (critical): Default "allow all" policy.
- **AUTHâ001** (high): Reusable auth keys.
- **DEVâ001** (high): Tagged devices lacking key expiry.
- **NETâ001** (high): Funnel exposure.
- **SSHâ002** (high): Root SSH without reâauthentication.
- **DEVâ004** (medium): Stale devices.
The detailed spec can be found in the projectâs `CHECKS.md`.
## Sample Report
```
+=====================================================================
| TAILSNITCH SECURITY AUDIT |
| Tailnet: example.com |
| Version: 1.0.0 (build: abc123) |
+=====================================================================
Using ignore file: .tailsnitchâignore (3 rules)
=== ACCESS CONTROLS ===================================================
[CRITICAL] ACLâ001: Default 'allow all' policy active
Your ACL policy omits the 'acls' field. Tailscale applies a default 'allow all' policy, granting all devices full access.
Remediation: Define explicit ACL rules following the least privilege principle.
Source: https://tailscale.com/kb/1192/acl-samples
=== AUTHENTICATION & KEYS =============================================
[HIGH] AUTHâ001: Reusable auth keys exist
Found 2 reusable auth key(s). These can be reused to add multiple devices if compromised.
Details:
- Key tskey-auth-xxx (expires in 45 days)
- Key tskey-auth-yyy (expires in 89 days)
Remediation: Store reusable keys in a secrets manager. Prefer oneâoff keys.
Source: https://tailscale.com/kb/1085/auth-keys
SUMMARY
=====================================================================
Critical: 1 High: 3 Medium: 5 Low: 2 Info: 8
Total findings: 19 | Passed: 33
```
## CI/CD Integration
Tailsnitch can be leveraged in automated pipelines to enforce security policies. A GitHub Actions example:
```yaml
- name: Audit Tailscale Security
env:
TS_OAUTH_CLIENT_ID: ${{ secrets.TS_OAUTH_CLIENT_ID }}
TS_OAUTH_CLIENT_SECRET: ${{ secrets.TS_OAUTH_CLIENT_SECRET }}
run: |
tailsnitch --json > audit.json
if tailsnitch --severity high --json | jq -e '.summary.critical + .summary.high > 0'; then
echo "Critical or high severity issues found!"
tailsnitch --severity high
exit 1
fi
```
## Conclusion
Tailsnitch brings disciplined, repeatable security auditing to any Tailscale deployment. Its concise CLI interface, support for OAuthâscoped access, interactive remediation, and SOCâ2 evidence export make it a decisive addition to the security toolchain of modern DevOps and platform teams.
---
### References
- Tailscale Security Hardening Guide
- ACL Syntax Reference
- Tailscale SSH
- Audit Logging
- Tailnet Lock
### License
MIT