Tailscale

Visão geral

Tailscale é uma mesh VPN zero-config baseada em WireGuard que facilita conectar dispositivos, serviços e usuários em qualquer rede. O bloco Tailscale permite automatizar tarefas de gerenciamento de rede como provisionamento de dispositivos, controle de acesso, gerenciamento de rotas e configuração de DNS diretamente a partir dos seus fluxos de trabalho no Zoen.

Autenticação

O bloco Tailscale usa autenticação por API key. Para obter uma API key:

  1. Acesse o console de admin do Tailscale
  2. Vá em Settings > Keys
  3. Clique em Generate API key
  4. Defina uma validade (1–90 dias) e copie a chave (começa com tskey-api-)

É necessário ter o papel de Owner, Admin, IT admin ou Network admin para gerar API keys.

Identificador do Tailnet

Toda operação exige um parâmetro tailnet. Em geral, é o domínio da sua organização (ex.: example.com). Você também pode usar "-" para se referir ao seu tailnet padrão.

Casos de uso comuns

  • Inventário de dispositivos: Listar e monitorar todos os dispositivos conectados à sua rede
  • Provisionamento automatizado: Criar e gerenciar auth keys para pré-autorizar novos dispositivos
  • Controle de acesso: Autorizar ou desautorizar dispositivos e gerenciar tags de dispositivo para políticas ACL
  • Gerenciamento de rotas: Ver e habilitar rotas de subnet para dispositivos que atuam como subnet routers
  • Gerenciamento de DNS: Configurar nameservers, MagicDNS e search paths
  • Ciclo de vida de chaves: Criar, listar, inspecionar e revogar auth keys
  • Auditoria de usuários: Listar todos os usuários no tailnet e seus papéis
  • Revisão de política: Recuperar a política ACL atual para inspeção ou backup

Usage Instructions

Interact with the Tailscale API to manage devices, DNS, ACLs, auth keys, users, and routes across your tailnet.

Actions

tailscale_list_devices

List all devices in the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default

Output

ParameterTypeDescription
devicesarrayList of devices in the tailnet
idstringLegacy device ID
nodeIdstringPreferred device ID
namestringDevice name
hostnamestringDevice hostname
userstringAssociated user
osstringOperating system
clientVersionstringTailscale client version
addressesarrayTailscale IP addresses
tagsarrayDevice tags
authorizedbooleanWhether the device is authorized
blocksIncomingConnectionsbooleanWhether the device blocks incoming connections
keyExpiryDisabledbooleanWhether the device key is exempt from expiring
expiresstringThe device's auth key expiration timestamp
lastSeenstringLast seen timestamp
createdstringCreation timestamp
countnumberTotal number of devices

tailscale_get_device

Get details of a specific device by ID

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
deviceIdstringYesDevice ID

Output

ParameterTypeDescription
idstringLegacy device ID
nodeIdstringPreferred device ID
namestringDevice name
hostnamestringDevice hostname
userstringAssociated user
osstringOperating system
clientVersionstringTailscale client version
addressesarrayTailscale IP addresses
tagsarrayDevice tags
authorizedbooleanWhether the device is authorized
blocksIncomingConnectionsbooleanWhether the device blocks incoming connections
keyExpiryDisabledbooleanWhether the device key is exempt from expiring
expiresstringThe device's auth key expiration timestamp
lastSeenstringLast seen timestamp
createdstringCreation timestamp
isExternalbooleanWhether the device is external
updateAvailablebooleanWhether an update is available
machineKeystringMachine key
nodeKeystringNode key

tailscale_delete_device

Remove a device from the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
deviceIdstringYesDevice ID to delete

Output

ParameterTypeDescription
successbooleanWhether the device was successfully deleted
deviceIdstringID of the deleted device

tailscale_authorize_device

Authorize or deauthorize a device on the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
deviceIdstringYesDevice ID to authorize
authorizedbooleanYesWhether to authorize (true) or deauthorize (false) the device

Output

ParameterTypeDescription
successbooleanWhether the operation succeeded
deviceIdstringDevice ID
authorizedbooleanAuthorization status after the operation

tailscale_set_device_tags

Set tags on a device in the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
deviceIdstringYesDevice ID
tagsstringYesComma-separated list of tags (e.g., "tag:server,tag:production")

Output

ParameterTypeDescription
successbooleanWhether the tags were successfully set
deviceIdstringDevice ID
tagsarrayTags set on the device

tailscale_get_device_routes

Get the subnet routes for a device

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
deviceIdstringYesDevice ID

Output

ParameterTypeDescription
advertisedRoutesarraySubnet routes the device is advertising
enabledRoutesarraySubnet routes that are approved/enabled

tailscale_set_device_routes

Set the enabled subnet routes for a device

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
deviceIdstringYesDevice ID
routesstringYesComma-separated list of subnet routes to enable (e.g., "10.0.0.0/24,192.168.1.0/24")

Output

ParameterTypeDescription
advertisedRoutesarraySubnet routes the device is advertising
enabledRoutesarraySubnet routes that are now enabled

tailscale_update_device_key

Enable or disable key expiry on a device

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
deviceIdstringYesDevice ID
keyExpiryDisabledbooleanYesWhether to disable key expiry (true) or enable it (false)

Output

ParameterTypeDescription
successbooleanWhether the operation succeeded
deviceIdstringDevice ID
keyExpiryDisabledbooleanWhether key expiry is now disabled

tailscale_expire_device_key

Immediately expire a device's node key, requiring it to re-authenticate before it can reconnect to the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
deviceIdstringYesDevice ID to expire the key for

Output

ParameterTypeDescription
successbooleanWhether the device's key was successfully expired
deviceIdstringDevice ID

tailscale_list_dns_nameservers

Get the DNS nameservers configured for the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default

Output

ParameterTypeDescription
dnsarrayList of DNS nameserver addresses

tailscale_set_dns_nameservers

Set the DNS nameservers for the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
dnsstringYesComma-separated list of DNS nameserver IP addresses (e.g., "8.8.8.8,8.8.4.4")

Output

ParameterTypeDescription
dnsarrayUpdated list of DNS nameserver addresses
magicDNSbooleanWhether MagicDNS is enabled

tailscale_get_dns_preferences

Get the DNS preferences for the tailnet including MagicDNS status

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default

Output

ParameterTypeDescription
magicDNSbooleanWhether MagicDNS is enabled

tailscale_set_dns_preferences

Set DNS preferences for the tailnet (enable/disable MagicDNS)

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
magicDNSbooleanYesWhether to enable (true) or disable (false) MagicDNS

Output

ParameterTypeDescription
magicDNSbooleanUpdated MagicDNS status

tailscale_get_dns_searchpaths

Get the DNS search paths configured for the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default

Output

ParameterTypeDescription
searchPathsarrayList of DNS search path domains

tailscale_set_dns_searchpaths

Set the DNS search paths for the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
searchPathsstringYesComma-separated list of DNS search path domains (e.g., "corp.example.com,internal.example.com")

Output

ParameterTypeDescription
searchPathsarrayUpdated list of DNS search path domains

tailscale_list_users

List all users in the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default

Output

ParameterTypeDescription
usersarrayList of users in the tailnet
idstringUser ID
displayNamestringDisplay name
loginNamestringLogin name / email
profilePicURLstringProfile picture URL
rolestringUser role (owner, admin, member, etc.)
statusstringUser status (active, suspended, etc.)
typestringUser type (member, shared, tagged)
createdstringCreation timestamp
lastSeenstringLast seen timestamp
deviceCountnumberNumber of devices owned by user
countnumberTotal number of users

tailscale_suspend_user

Suspend a user's access to the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
userIdstringYesUser ID to suspend

Output

ParameterTypeDescription
successbooleanWhether the user was successfully suspended
userIdstringID of the suspended user

tailscale_delete_user

Delete a user from the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
userIdstringYesUser ID to delete

Output

ParameterTypeDescription
successbooleanWhether the user was successfully deleted
userIdstringID of the deleted user

tailscale_create_auth_key

Create a new auth key for the tailnet to pre-authorize devices

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
reusablebooleanNoWhether the key can be used more than once
ephemeralbooleanNoWhether devices authenticated with this key are ephemeral
preauthorizedbooleanNoWhether devices are pre-authorized (skip manual approval)
tagsstringNoComma-separated list of tags for devices using this key (e.g., "tag:server,tag:prod")
descriptionstringNoDescription for the auth key
expirySecondsnumberNoKey expiry time in seconds (default: 90 days)

Output

ParameterTypeDescription
idstringAuth key ID
keystringThe auth key value (only shown once at creation)
descriptionstringKey description
createdstringCreation timestamp
expiresstringExpiration timestamp
revokedstringRevocation timestamp (empty if not revoked)
capabilitiesobjectKey capabilities
reusablebooleanWhether the key is reusable
ephemeralbooleanWhether devices are ephemeral
preauthorizedbooleanWhether devices are pre-authorized
tagsarrayTags applied to devices using this key

tailscale_list_auth_keys

List all auth keys in the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default

Output

ParameterTypeDescription
keysarrayList of auth keys
idstringAuth key ID
descriptionstringKey description
createdstringCreation timestamp
expiresstringExpiration timestamp
revokedstringRevocation timestamp
capabilitiesobjectKey capabilities
reusablebooleanWhether the key is reusable
ephemeralbooleanWhether devices are ephemeral
preauthorizedbooleanWhether devices are pre-authorized
tagsarrayTags applied to devices
countnumberTotal number of auth keys

tailscale_get_auth_key

Get details of a specific auth key

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
keyIdstringYesAuth key ID

Output

ParameterTypeDescription
idstringAuth key ID
descriptionstringKey description
createdstringCreation timestamp
expiresstringExpiration timestamp
revokedstringRevocation timestamp
capabilitiesobjectKey capabilities
reusablebooleanWhether the key is reusable
ephemeralbooleanWhether devices are ephemeral
preauthorizedbooleanWhether devices are pre-authorized
tagsarrayTags applied to devices using this key

tailscale_delete_auth_key

Revoke and delete an auth key

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
keyIdstringYesAuth key ID to delete

Output

ParameterTypeDescription
successbooleanWhether the auth key was successfully deleted
keyIdstringID of the deleted auth key

tailscale_get_acl

Get the current ACL policy for the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default

Output

ParameterTypeDescription
aclstringACL policy as JSON string
etagstringETag for the current ACL version (use with If-Match header for updates)

tailscale_set_acl

Replace the ACL policy file for the tailnet

Input

ParameterTypeRequiredDescription
apiKeystringYesTailscale API key
tailnetstringYesTailnet name (e.g., example.com) or "-" for default
aclstringYesThe new ACL policy file, as a JSON string
ifMatchstringNoETag from a prior Get ACL call to avoid overwriting concurrent updates. Use "ts-default" to only replace an untouched default policy file.

Output

ParameterTypeDescription
aclstringUpdated ACL policy as JSON string
etagstringETag for the new ACL version (use with If-Match header for future updates)

On this page