This document explains the requirements and security considerations for using Tailscale to provision API keys between OSCAR nodes.
To use the automated provisioning scripts (provision-node.sh and provision-node.bat), the following Tailscale features must be configured on both the Central Station (Source) and the Federated Node (Target).
The scripts use tailscale file cp to transfer the API key.
- Action: Ensure Taildrop is enabled in your Tailscale network (Tailnet) settings.
- Target Node: Must be online and capable of receiving files.
The scripts use tailscale ssh to move the key into the final configuration directory and set appropriate permissions.
- Target Node: Must have Tailscale SSH enabled.
- On Linux:
tailscale up --ssh - On Windows: Enabled via the Tailscale UI or CLI.
- On Linux:
- Access Controls (ACLs): Your Tailnet ACLs must allow the administrator (Source) to SSH into the Target node.
You should restrict access so that only authorized administrators can push keys. Example ACL snippet:
{
"ssh": [
{
"action": "accept",
"src": ["group:admin"],
"dst": ["tag:oscar-node"],
"users": ["root", "oscar-user"]
}
]
}- Tagging: Tag OSCAR nodes (e.g.,
tag:oscar-node) to apply specific security policies. - Key Expiry: Disable key expiry for long-lived federated nodes or ensure a process is in place to renew node keys.
- SSH Policies: Audit who has SSH access to the nodes via Tailscale.
- API Key ownership: Assign API keys to service accounts with the minimum necessary permissions (Least Privilege). Do not use the primary
adminaccount for machine-to-machine federation if possible. - Key Revocation: If a node is decommissioned or a Tailnet key is compromised, immediately Revoke the API key in the OSCAR Admin UI.
- Audit Logs: Monitor OSCAR logs for unusual API activity associated with specific API keys.
- Local Generation: The admin generates a random 32-byte API key in the OSCAR Admin UI.
- Hash Storage: OSCAR stores only the PBKDF2 hash of this key.
- Secure Transfer:
- The
provision-nodescript writes the raw key to a temporary local file. tailscale file cpencrypts and transfers the file directly to the target node over the Tailnet (WireGuard).
- The
- Remote Placement:
tailscale sshexecutes a command on the target to move the file from the Tailscale "received" folder to/opt/sensorhub/secrets/api_key(Linux) orC:\ProgramData\SensorHub\secrets\api_key(Windows).- Permissions are set to
600(read/write by owner only) to prevent local exposure.
- Cleanup: The temporary local file is deleted immediately.
- "Permission Denied" (SSH): Check your Tailscale ACLs and ensure the source user has permission to SSH into the target as the specified user.
- "File not found": Ensure Taildrop is enabled. On some systems, you may need to manually accept the file if Tailscale is not configured to auto-receive.
- Connection Timeout: Verify both nodes are logged into the same Tailnet and are visible to each other (
tailscale status).