turbot/tailscale

GitHub
steampipe plugin install tailscalesteampipe plugin install tailscale

Table: tailscale_device

A Tailscale device is any computer in the Tailnet.

Examples

Basic info

select
id,
name,
addresses,
hostname,
created,
user
from
tailscale_device;

Device count per OS

select
os,
count(*)
from
tailscale_device
group by
os
order by
count desc;

Device details of a particular user

select
name,
id,
created,
expires,
hostname
from
tailscale_device d
where
d.user = 'luis@turbot.com'
order by
d.name;

Unauthorized devices

select
name,
id,
created,
expires,
hostname
from
tailscale.tailscale_device d
where
d.authorized = false;

Devices without tags

select
name,
id,
hostname
from
tailscale_device
where
tags is null;

Devices that block incoming connections

select
name,
id,
os,
user,
created,
tailnet_name
from
tailscale_device
where
blocks_incoming_connections;

External devices

select
name,
id,
os,
user,
created,
tailnet_name
from
tailscale_device
where
is_external;

Devices that have been inactive for the last 90 days

select
name,
id,
os,
user,
created,
tailnet_name,
last_seen
from
tailscale_device
where
last_seen <= (now() - interval '90' day);

Devices that will expire in the next 90 days

select
name,
id,
os,
user,
created,
tailnet_name,
expires
from
tailscale_device
where
expires <= (now() + interval '90' day);

Devices running on older Tailscale client versions

select
name,
id,
os,
user,
created,
tailnet_name
from
tailscale_device
where
update_available;

Control examples

.inspect tailscale_device

A Tailscale Device represents the devices under a tailnet.

NameTypeDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
addressesjsonbThe list of device's IPs.
authorizedbooleanWhether the device is authorized.
blocks_incoming_connectionsbooleanWhether the device blocks incoming connections.
client_versiontextVersion of the client.
createdtimestamp with time zoneDevice creation time.
device_subnet_routesjsonbA list of the device subnet routes.
expirestimestamp with time zoneDevice expiry time.
hostnametextName of the host.
idtextAn unique identifier of the device.
is_externalbooleanWhether the device is external.
key_expiry_disabledbooleanWhether the key expiration is disabled.
last_seentimestamp with time zoneDevice last active time.
machine_keytextMachine key of the device.
nametextThe name of the device.
node_keytextNode key of the device.
ostextOS information of the device.
tagsjsonbThe tags applied to the device.
tailnet_nametextThe name of your tailnet.
titletextTitle of the resource.
update_availablebooleanWhether an update is available.
usertextName of the owner of the device.