diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 19437595..91379a5f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -25,6 +25,7 @@ /plugins/Ivanti-ITSM/ @shawn149 /plugins/LaunchDarkly/ @clarkd /plugins/MetOffice/ @blackgrouse +/plugins/ngrok/ @clarkd /plugins/Notion/ @clarkd /plugins/OctopusDeploy/ @clarkd /plugins/Phare/ @vinbab diff --git a/plugins/ngrok/v1/configValidation.json b/plugins/ngrok/v1/configValidation.json new file mode 100644 index 00000000..46818c8f --- /dev/null +++ b/plugins/ngrok/v1/configValidation.json @@ -0,0 +1,11 @@ +{ + "steps": [ + { + "displayName": "Authenticate", + "dataStream": { "name": "apiKeys" }, + "required": true, + "error": "Could not authenticate with ngrok. Check that the value is an API key (not an agent authtoken) and that it has not been deleted.", + "success": "Connected to ngrok successfully." + } + ] +} diff --git a/plugins/ngrok/v1/custom_types.json b/plugins/ngrok/v1/custom_types.json new file mode 100644 index 00000000..6e5ba021 --- /dev/null +++ b/plugins/ngrok/v1/custom_types.json @@ -0,0 +1,30 @@ +[ + { + "name": "Endpoint", + "sourceType": "Endpoint", + "icon": "plug", + "singular": "Endpoint", + "plural": "Endpoints" + }, + { + "name": "Reserved Domain", + "sourceType": "Reserved Domain", + "icon": "globe", + "singular": "Reserved Domain", + "plural": "Reserved Domains" + }, + { + "name": "TLS Certificate", + "sourceType": "TLS Certificate", + "icon": "certificate", + "singular": "TLS Certificate", + "plural": "TLS Certificates" + }, + { + "name": "Reserved Address", + "sourceType": "Reserved Address", + "icon": "network-wired", + "singular": "Reserved Address", + "plural": "Reserved Addresses" + } +] diff --git a/plugins/ngrok/v1/dataStreams/agentSessions.json b/plugins/ngrok/v1/dataStreams/agentSessions.json new file mode 100644 index 00000000..f2b91e36 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/agentSessions.json @@ -0,0 +1,79 @@ +{ + "name": "agentSessions", + "displayName": "Agent Sessions", + "description": "ngrok agents currently connected to the account, with version, OS, IP and region", + "tags": [ + "Network" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "tunnel_sessions", + "expandInnerObjects": true, + "pathToData": "tunnel_sessions", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "Agent session ID", + "role": "id", + "visible": false + }, + { + "name": "ip", + "displayName": "IP address", + "role": "label" + }, + { + "name": "agent_version", + "displayName": "Agent version" + }, + { + "name": "os", + "displayName": "OS" + }, + { + "name": "region", + "displayName": "Region" + }, + { + "name": "transport", + "displayName": "Transport" + }, + { + "name": "started_at", + "displayName": "Started", + "shape": "date" + }, + { + "name": "uptime", + "displayName": "Uptime", + "computed": true, + "shape": "seconds", + "valueExpression": "{{ $['started_at'] ? Math.floor((Date.now() - new Date($['started_at']).getTime()) / 1000) : null }}" + }, + { + "name": "credential.id", + "displayName": "Authtoken ID" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/apiKeys.json b/plugins/ngrok/v1/dataStreams/apiKeys.json new file mode 100644 index 00000000..b915f89a --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/apiKeys.json @@ -0,0 +1,23 @@ +{ + "name": "apiKeys", + "displayName": "API Keys", + "description": "API keys in the ngrok account (first page only)", + "tags": ["Security"], + "baseDataSourceName": "httpRequestUnscoped", + "visibility": { "type": "hidden" }, + "config": { + "httpMethod": "get", + "endpointPath": "api_keys", + "getArgs": [{ "key": "limit", "value": "1" }], + "pathToData": "keys", + "paging": { "mode": "none" }, + "errorHandling": { "type": "path", "realm": "payload", "path": "msg" } + }, + "matches": "none", + "metadata": [ + { "name": "id", "displayName": "ID", "role": "id" }, + { "name": "description", "displayName": "Description", "role": "label" }, + { "name": "created_at", "displayName": "Created", "shape": "date" } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/authtokens.json b/plugins/ngrok/v1/dataStreams/authtokens.json new file mode 100644 index 00000000..e7769a23 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/authtokens.json @@ -0,0 +1,60 @@ +{ + "name": "authtokens", + "displayName": "Authtokens", + "description": "Agent authtokens in the ngrok account with their description and creation date (token values excluded)", + "tags": [ + "Security" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "credentials", + "postRequestScript": "authtokens.js", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "Authtoken ID", + "role": "id" + }, + { + "name": "description", + "displayName": "Description", + "role": "label" + }, + { + "name": "hasAcl", + "displayName": "Restricted by ACL", + "shape": "boolean" + }, + { + "name": "ownerId", + "displayName": "Owner ID", + "visible": false + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/certificateAuthorities.json b/plugins/ngrok/v1/dataStreams/certificateAuthorities.json new file mode 100644 index 00000000..ecf68ae8 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/certificateAuthorities.json @@ -0,0 +1,97 @@ +{ + "name": "certificateAuthorities", + "displayName": "Certificate Authorities", + "description": "Certificate authorities used for mutual TLS, with days until expiry", + "tags": [ + "Certificates", + "Security" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "certificate_authorities", + "pathToData": "certificate_authorities", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "CA ID", + "role": "id", + "visible": false + }, + { + "name": "subject_common_name", + "displayName": "Common name", + "role": "label" + }, + { + "name": "description", + "displayName": "Description" + }, + { + "name": "not_before", + "displayName": "Valid from", + "shape": "date" + }, + { + "name": "not_after", + "displayName": "Expires", + "shape": "date" + }, + { + "name": "daysUntilExpiry", + "displayName": "Days until expiry", + "computed": true, + "shape": "number", + "role": "value", + "valueExpression": "{{ $['not_after'] ? Math.floor((new Date($['not_after']).getTime() - Date.now()) / 86400000) : null }}" + }, + { + "name": "expiryStatus", + "displayName": "Expiry status", + "computed": true, + "valueExpression": "{{ !$['not_after'] ? null : (new Date($['not_after']).getTime() - Date.now()) < 0 ? 'Expired' : (new Date($['not_after']).getTime() - Date.now()) <= 7 * 86400000 ? 'Expires within 7 days' : (new Date($['not_after']).getTime() - Date.now()) <= 30 * 86400000 ? 'Expires within 30 days' : 'Valid' }}", + "shape": [ + "state", + { + "map": { + "error": [ + "Expired", + "Expires within 7 days" + ], + "warning": [ + "Expires within 30 days" + ], + "success": [ + "Valid" + ] + } + } + ] + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/endpointStatus.json b/plugins/ngrok/v1/dataStreams/endpointStatus.json new file mode 100644 index 00000000..ec9ecbd0 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/endpointStatus.json @@ -0,0 +1,101 @@ +{ + "name": "endpointStatus", + "displayName": "Endpoint Status", + "description": "Whether each selected endpoint is currently online, with the number of live endpoints serving its URL", + "tags": [ + "Network", + "Availability" + ], + "baseDataSourceName": "httpRequestScoped", + "config": { + "httpMethod": "get", + "endpointPath": "endpoints", + "getArgs": [ + { + "key": "filter", + "value": "{{ 'obj.url in [' + objects.flatMap((o) => o.rawId).filter((u) => String(u).includes('://')).map((u) => '\"' + u + '\"').join(',') + ']' }}" + }, + { + "key": "limit", + "value": "100" + } + ], + "postRequestScript": "endpointStatus.js", + "paging": { + "mode": "none" + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Endpoint" + ] + } + }, + "metadata": [ + { + "name": "url", + "displayName": "URL", + "role": "label" + }, + { + "sourceId": "url", + "sourceType": "Endpoint", + "name": "url" + }, + { + "name": "status", + "displayName": "Status", + "shape": [ + "state", + { + "map": { + "success": [ + "Online" + ], + "error": [ + "Offline" + ], + "unknown": [ + "Unknown" + ] + } + } + ] + }, + { + "name": "liveEndpoints", + "displayName": "Live endpoints", + "shape": "number", + "role": "value" + }, + { + "name": "endpointTypes", + "displayName": "Type", + "shape": [ + "array", + { + "itemShape": "string" + } + ] + }, + { + "name": "agentSessionIds", + "displayName": "Agent session IDs", + "shape": [ + "array", + { + "itemShape": "string" + } + ], + "visible": false + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/endpoints.json b/plugins/ngrok/v1/dataStreams/endpoints.json new file mode 100644 index 00000000..9164bafb --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/endpoints.json @@ -0,0 +1,153 @@ +{ + "name": "endpoints", + "displayName": "Endpoints", + "description": "Active ngrok endpoints with their URL, type, protocol and traffic policy usage", + "tags": [ + "Network" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "endpoints", + "expandInnerObjects": true, + "getArgs": [ + { + "key": "filter", + "value": "{{ (typeof endpoint !== 'undefined' && endpoint && endpoint.length ? 'obj.url in [' + endpoint.flatMap((o) => o.rawId).filter((u) => String(u).includes('://')).map((u) => '\"' + u + '\"').join(',') + ']' : null) }}" + } + ], + "pathToData": "endpoints", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "ui": [ + { + "type": "objects", + "name": "endpoint", + "label": "Endpoint(s)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Endpoint" + ] + } + } + } + ], + "metadata": [ + { + "name": "id", + "displayName": "Endpoint ID", + "role": "id", + "visible": false + }, + { + "name": "url", + "displayName": "URL", + "role": "label" + }, + { + "sourceId": "url", + "sourceType": "Endpoint", + "name": "url" + }, + { + "name": "type", + "displayName": "Type (raw)", + "visible": false + }, + { + "name": "endpointType", + "displayName": "Type", + "computed": true, + "valueExpression": "{{ ({ ephemeral: 'Agent', cloud: 'Cloud', edge: 'Edge' })[$['type']] || $['type'] }}" + }, + { + "name": "proto", + "displayName": "Protocol" + }, + { + "name": "bindings", + "displayName": "Bindings", + "shape": [ + "array", + { + "itemShape": "string" + } + ] + }, + { + "name": "region", + "displayName": "Region" + }, + { + "name": "name", + "displayName": "Name" + }, + { + "name": "description", + "displayName": "Description" + }, + { + "name": "upstream_url", + "displayName": "Upstream URL" + }, + { + "name": "pooling_enabled", + "displayName": "Pooling enabled", + "shape": "boolean" + }, + { + "name": "traffic_policy", + "displayName": "Traffic policy", + "visible": false + }, + { + "name": "hasTrafficPolicy", + "displayName": "Has traffic policy", + "computed": true, + "shape": "boolean", + "valueExpression": "{{ !!($['traffic_policy'] && String($['traffic_policy']).trim()) }}" + }, + { + "name": "aiGateway", + "displayName": "AI Gateway", + "computed": true, + "shape": "boolean", + "valueExpression": "{{ /ai-gateway/.test(String($['traffic_policy'] || '')) }}" + }, + { + "name": "domain.id", + "displayName": "Domain ID", + "visible": false + }, + { + "name": "tunnel_session.id", + "displayName": "Agent session ID", + "visible": false + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/eventDestinations.json b/plugins/ngrok/v1/dataStreams/eventDestinations.json new file mode 100644 index 00000000..c1d4b390 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/eventDestinations.json @@ -0,0 +1,63 @@ +{ + "name": "eventDestinations", + "displayName": "Event Destinations", + "description": "Log export destinations with their target service and location (credentials excluded)", + "tags": [ + "Logs" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "event_destinations", + "postRequestScript": "eventDestinations.js", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "Destination ID", + "role": "id", + "visible": false + }, + { + "name": "description", + "displayName": "Description", + "role": "label" + }, + { + "name": "targetType", + "displayName": "Target" + }, + { + "name": "location", + "displayName": "Location" + }, + { + "name": "format", + "displayName": "Format" + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/eventSubscriptions.json b/plugins/ngrok/v1/dataStreams/eventSubscriptions.json new file mode 100644 index 00000000..a8273369 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/eventSubscriptions.json @@ -0,0 +1,76 @@ +{ + "name": "eventSubscriptions", + "displayName": "Event Subscriptions", + "description": "Log export subscriptions with the event types they export and their destination count", + "tags": [ + "Logs" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "event_subscriptions", + "postRequestScript": "eventSubscriptions.js", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "Subscription ID", + "role": "id", + "visible": false + }, + { + "name": "description", + "displayName": "Description", + "role": "label" + }, + { + "name": "eventTypes", + "displayName": "Event types", + "shape": [ + "array", + { + "itemShape": "string" + } + ] + }, + { + "name": "destinationIds", + "displayName": "Destination IDs", + "shape": [ + "array", + { + "itemShape": "string" + } + ] + }, + { + "name": "destinationCount", + "displayName": "Destinations", + "shape": "number" + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/reservedAddresses.json b/plugins/ngrok/v1/dataStreams/reservedAddresses.json new file mode 100644 index 00000000..c7b85712 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/reservedAddresses.json @@ -0,0 +1,85 @@ +{ + "name": "reservedAddresses", + "displayName": "Reserved Addresses", + "description": "Reserved TCP addresses with their region and description", + "tags": [ + "Network" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "reserved_addrs", + "getArgs": [ + { + "key": "filter", + "value": "{{ (typeof address !== 'undefined' && address && address.length ? 'obj.id in [' + address.flatMap((o) => o.rawId).map((i) => '\"' + i + '\"').join(',') + ']' : null) }}" + } + ], + "pathToData": "reserved_addrs", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "ui": [ + { + "type": "objects", + "name": "address", + "label": "Reserved address(es)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Reserved Address" + ] + } + } + } + ], + "metadata": [ + { + "name": "id", + "displayName": "Address ID", + "role": "id", + "visible": false + }, + { + "name": "addr", + "displayName": "Address", + "role": "label" + }, + { + "sourceId": "id", + "sourceType": "Reserved Address", + "name": "addr" + }, + { + "name": "description", + "displayName": "Description" + }, + { + "name": "region", + "displayName": "Region" + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/reservedDomains.json b/plugins/ngrok/v1/dataStreams/reservedDomains.json new file mode 100644 index 00000000..86ee9845 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/reservedDomains.json @@ -0,0 +1,136 @@ +{ + "name": "reservedDomains", + "displayName": "Reserved Domains", + "description": "Reserved domains with certificate management and provisioning status", + "tags": [ + "Network", + "Certificates" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "reserved_domains", + "getArgs": [ + { + "key": "filter", + "value": "{{ (typeof domain !== 'undefined' && domain && domain.length ? 'obj.id in [' + domain.flatMap((o) => o.rawId).map((i) => '\"' + i + '\"').join(',') + ']' : null) }}" + } + ], + "postRequestScript": "reservedDomains.js", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "ui": [ + { + "type": "objects", + "name": "domain", + "label": "Reserved domain(s)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Reserved Domain" + ] + } + } + } + ], + "metadata": [ + { + "name": "id", + "displayName": "Domain ID", + "role": "id", + "visible": false + }, + { + "name": "domain", + "displayName": "Domain", + "role": "label" + }, + { + "sourceId": "id", + "sourceType": "Reserved Domain", + "name": "domain" + }, + { + "name": "description", + "displayName": "Description" + }, + { + "name": "isDev", + "displayName": "Dev domain", + "shape": "boolean" + }, + { + "name": "cnameTarget", + "displayName": "CNAME target" + }, + { + "name": "certificateSource", + "displayName": "Certificate source" + }, + { + "name": "certificateId", + "displayName": "Certificate ID" + }, + { + "name": "renewsAt", + "displayName": "Certificate renews", + "shape": "date" + }, + { + "name": "certificateStatus", + "displayName": "Certificate status", + "shape": [ + "state", + { + "map": { + "error": [ + "DNS error", + "Provisioning error", + "No certificate" + ], + "warning": [ + "Provisioning", + "Renewal overdue" + ], + "success": [ + "OK" + ] + } + } + ] + }, + { + "name": "provisioningError", + "displayName": "Provisioning error" + }, + { + "name": "provisioningRetriesAt", + "displayName": "Provisioning retries", + "shape": "date" + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/scripts/authtokens.js b/plugins/ngrok/v1/dataStreams/scripts/authtokens.js new file mode 100644 index 00000000..de272855 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/scripts/authtokens.js @@ -0,0 +1,8 @@ +// Return only descriptive fields; never pass through the token or ACL rules. +result = (data?.credentials || []).map((c) => ({ + id: c.id, + description: c.description || c.id, + hasAcl: Array.isArray(c.acl) && c.acl.length > 0, + ownerId: c.owner_id || null, + created_at: c.created_at, +})); diff --git a/plugins/ngrok/v1/dataStreams/scripts/endpointStatus.js b/plugins/ngrok/v1/dataStreams/scripts/endpointStatus.js new file mode 100644 index 00000000..f31cb93a --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/scripts/endpointStatus.js @@ -0,0 +1,30 @@ +// ngrok only lists endpoints that are online, so an indexed endpoint whose URL +// is missing from the live list is offline. Several endpoints can share a URL +// (endpoint pooling), so count them rather than expecting exactly one. +// Post-request scripts run once per page and cannot combine pages, so only the +// first page (up to 100 endpoints) is read. When ngrok reports more pages, a URL +// missing from this page may still be online, so report it as Unknown instead +// of raising a false Offline. +const live = data?.endpoints || []; +const truncated = Boolean(data?.next_page_uri); +const unwrap = (v) => (Array.isArray(v) ? v[0] : v); +const typeNames = { ephemeral: 'Agent', cloud: 'Cloud', edge: 'Edge' }; + +const statusOf = (isUrl, matchCount) => { + if (!isUrl) return 'Unknown'; + if (matchCount) return 'Online'; + return truncated ? 'Unknown' : 'Offline'; +}; + +result = (context.objects || []).map((o) => { + const url = unwrap(o.rawId); + const isUrl = String(url).includes('://'); + const matches = isUrl ? live.filter((e) => e.url === url) : []; + return { + url, + status: statusOf(isUrl, matches.length), + liveEndpoints: matches.length, + endpointTypes: _.uniq(matches.map((e) => typeNames[e.type] || e.type)), + agentSessionIds: matches.map((e) => e.tunnel_session?.id).filter(Boolean), + }; +}); diff --git a/plugins/ngrok/v1/dataStreams/scripts/eventDestinations.js b/plugins/ngrok/v1/dataStreams/scripts/eventDestinations.js new file mode 100644 index 00000000..f2aca1ae --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/scripts/eventDestinations.js @@ -0,0 +1,38 @@ +// Only non-sensitive target details are returned: event destination targets +// can embed credentials (e.g. Datadog API keys, Azure client secrets). +const targetNames = { + datadog: 'Datadog', + cloudwatch_logs: 'Amazon CloudWatch Logs', + kinesis: 'Amazon Kinesis', + firehose: 'Amazon Data Firehose', + azure_logs_ingestion: 'Azure Monitor Logs', +}; + +const locationOf = (type, target) => { + switch (type) { + case 'datadog': + return target.ddsite || target.intake_host || null; + case 'cloudwatch_logs': + return target.log_group_arn || null; + case 'kinesis': + case 'firehose': + return target.stream_arn || target.delivery_stream_arn || null; + case 'azure_logs_ingestion': + return target.logs_ingestion_uri || null; + default: + return null; + } +}; + +result = (data?.event_destinations || []).map((d) => { + const target = d.target || {}; + const type = Object.keys(target).find((k) => target[k]); + return { + id: d.id, + description: d.description || d.id, + targetType: targetNames[type] || type || null, + location: type ? locationOf(type, target[type]) : null, + format: d.format || null, + created_at: d.created_at, + }; +}); diff --git a/plugins/ngrok/v1/dataStreams/scripts/eventSubscriptions.js b/plugins/ngrok/v1/dataStreams/scripts/eventSubscriptions.js new file mode 100644 index 00000000..520fcddf --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/scripts/eventSubscriptions.js @@ -0,0 +1,9 @@ +// sources and destinations are arrays of objects; reduce them to lists of primitives. +result = (data?.event_subscriptions || []).map((s) => ({ + id: s.id, + description: s.description || s.id, + eventTypes: (s.sources || []).map((src) => src.type), + destinationIds: (s.destinations || []).map((dst) => dst.id), + destinationCount: (s.destinations || []).length, + created_at: s.created_at, +})); diff --git a/plugins/ngrok/v1/dataStreams/scripts/reservedDomains.js b/plugins/ngrok/v1/dataStreams/scripts/reservedDomains.js new file mode 100644 index 00000000..de481775 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/scripts/reservedDomains.js @@ -0,0 +1,37 @@ +// Certificate health is spread across two levels of nested objects +// (certificate_management_status.provisioning_job), so derive it here. +const statusOf = (d) => { + const status = d.certificate_management_status || {}; + const job = status.provisioning_job; + if (job && job.error_code === 'DNS_ERROR') return 'DNS error'; + if (job && job.error_code) return 'Provisioning error'; + if (job) return 'Provisioning'; + if (status.renews_at && new Date(status.renews_at).getTime() < Date.now()) return 'Renewal overdue'; + // A custom (CNAME) domain with neither automatic nor uploaded certificate cannot serve TLS. + if (d.cname_target && !d.certificate_management_policy && !d.certificate) return 'No certificate'; + return 'OK'; +}; + +const sourceOf = (d) => { + if (d.certificate_management_policy) return `Automatic (${d.certificate_management_policy.authority || 'letsencrypt'})`; + if (d.certificate) return 'Uploaded'; + return d.cname_target ? 'None' : 'ngrok'; +}; + +result = (data?.reserved_domains || []).map((d) => { + const job = d.certificate_management_status?.provisioning_job; + return { + id: d.id, + domain: d.domain, + description: d.description || null, + isDev: !!d.is_dev, + cnameTarget: d.cname_target || null, + certificateSource: sourceOf(d), + certificateId: d.certificate?.id || null, + renewsAt: d.certificate_management_status?.renews_at || null, + certificateStatus: statusOf(d), + provisioningError: job?.msg || job?.error_code || null, + provisioningRetriesAt: job?.retries_at || null, + created_at: d.created_at, + }; +}); diff --git a/plugins/ngrok/v1/dataStreams/scripts/trafficSessions.js b/plugins/ngrok/v1/dataStreams/scripts/trafficSessions.js new file mode 100644 index 00000000..66c0fe8b --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/scripts/trafficSessions.js @@ -0,0 +1,18 @@ +// Browser details are nested two levels deep (browser_session.user_agent / .location). +result = (data?.application_sessions || []).map((s) => { + const browser = s.browser_session || {}; + const ua = browser.user_agent || {}; + return { + id: s.id, + publicUrl: s.public_url || null, + userId: s.application_user?.id || null, + ipAddress: browser.ip_address || null, + countryCode: browser.location?.country_code || null, + browser: [ua.browser_name, ua.browser_version].filter(Boolean).join(' ') || null, + os: [ua.os_name, ua.os_version].filter(Boolean).join(' ') || null, + deviceType: ua.device_type || null, + created_at: s.created_at, + last_active: s.last_active || null, + expires_at: s.expires_at || null, + }; +}); diff --git a/plugins/ngrok/v1/dataStreams/tlsCertificates.json b/plugins/ngrok/v1/dataStreams/tlsCertificates.json new file mode 100644 index 00000000..6e1a727a --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/tlsCertificates.json @@ -0,0 +1,158 @@ +{ + "name": "tlsCertificates", + "displayName": "TLS Certificates", + "description": "TLS certificates with issuer, validity dates and days until expiry", + "tags": [ + "Certificates", + "Security" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "tls_certificates", + "expandInnerObjects": true, + "getArgs": [ + { + "key": "filter", + "value": "{{ (typeof certificate !== 'undefined' && certificate && certificate.length ? 'obj.id in [' + certificate.flatMap((o) => o.rawId).map((i) => '\"' + i + '\"').join(',') + ']' : null) }}" + } + ], + "pathToData": "tls_certificates", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "ui": [ + { + "type": "objects", + "name": "certificate", + "label": "TLS certificate(s)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "TLS Certificate" + ] + } + } + } + ], + "metadata": [ + { + "name": "id", + "displayName": "Certificate ID", + "role": "id", + "visible": false + }, + { + "name": "subject_common_name", + "displayName": "Common name", + "role": "label" + }, + { + "sourceId": "id", + "sourceType": "TLS Certificate", + "name": "subject_common_name" + }, + { + "name": "description", + "displayName": "Description" + }, + { + "name": "subject_alternative_names.dns_names", + "displayName": "DNS names", + "shape": [ + "array", + { + "itemShape": "string" + } + ] + }, + { + "name": "issuer_common_name", + "displayName": "Issuer" + }, + { + "name": "issued_at", + "displayName": "Issued", + "shape": "date" + }, + { + "name": "managedBy", + "displayName": "Managed by", + "computed": true, + "valueExpression": "{{ $['issued_at'] ? 'ngrok (automatic)' : 'Uploaded' }}" + }, + { + "name": "not_before", + "displayName": "Valid from", + "shape": "date" + }, + { + "name": "not_after", + "displayName": "Expires", + "shape": "date" + }, + { + "name": "daysUntilExpiry", + "displayName": "Days until expiry", + "computed": true, + "shape": "number", + "role": "value", + "valueExpression": "{{ $['not_after'] ? Math.floor((new Date($['not_after']).getTime() - Date.now()) / 86400000) : null }}" + }, + { + "name": "expiryStatus", + "displayName": "Expiry status", + "computed": true, + "valueExpression": "{{ !$['not_after'] ? null : (new Date($['not_after']).getTime() - Date.now()) < 0 ? 'Expired' : (new Date($['not_after']).getTime() - Date.now()) <= 7 * 86400000 ? 'Expires within 7 days' : (new Date($['not_after']).getTime() - Date.now()) <= 30 * 86400000 ? 'Expires within 30 days' : 'Valid' }}", + "shape": [ + "state", + { + "map": { + "error": [ + "Expired", + "Expires within 7 days" + ], + "warning": [ + "Expires within 30 days" + ], + "success": [ + "Valid" + ] + } + } + ] + }, + { + "name": "private_key_type", + "displayName": "Key type" + }, + { + "name": "serial_number", + "displayName": "Serial number", + "visible": false + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/trafficIdentities.json b/plugins/ngrok/v1/dataStreams/trafficIdentities.json new file mode 100644 index 00000000..f4dfef14 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/trafficIdentities.json @@ -0,0 +1,75 @@ +{ + "name": "trafficIdentities", + "displayName": "Traffic Identities", + "description": "Users who have signed in to endpoints protected by OAuth, OIDC or SAML, with last activity", + "tags": [ + "User", + "Security" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "app/users", + "expandInnerObjects": true, + "pathToData": "application_users", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "Identity ID", + "role": "id", + "visible": false + }, + { + "name": "name", + "displayName": "Name", + "role": "label" + }, + { + "name": "email", + "displayName": "Email" + }, + { + "name": "username", + "displayName": "Username" + }, + { + "name": "identity_provider.name", + "displayName": "Identity provider" + }, + { + "name": "last_login", + "displayName": "Last login", + "shape": "date" + }, + { + "name": "last_active", + "displayName": "Last active", + "shape": "date" + }, + { + "name": "created_at", + "displayName": "First seen", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/dataStreams/trafficSessions.json b/plugins/ngrok/v1/dataStreams/trafficSessions.json new file mode 100644 index 00000000..ab5de187 --- /dev/null +++ b/plugins/ngrok/v1/dataStreams/trafficSessions.json @@ -0,0 +1,86 @@ +{ + "name": "trafficSessions", + "displayName": "Traffic Sessions", + "description": "Signed-in browser sessions on endpoints protected by OAuth, OIDC or SAML, with the endpoint, browser and expiry", + "tags": [ + "User", + "Security" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "app/sessions", + "postRequestScript": "trafficSessions.js", + "paging": { + "mode": "nextUrl", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "100" + }, + "in": { + "realm": "payload", + "path": "next_page_uri" + } + }, + "errorHandling": { + "type": "path", + "realm": "payload", + "path": "msg" + } + }, + "matches": "none", + "metadata": [ + { + "name": "id", + "displayName": "Session ID", + "role": "id", + "visible": false + }, + { + "name": "publicUrl", + "displayName": "Endpoint URL", + "role": "label" + }, + { + "name": "userId", + "displayName": "Identity ID" + }, + { + "name": "ipAddress", + "displayName": "IP address" + }, + { + "name": "countryCode", + "displayName": "Country" + }, + { + "name": "browser", + "displayName": "Browser" + }, + { + "name": "os", + "displayName": "OS" + }, + { + "name": "deviceType", + "displayName": "Device" + }, + { + "name": "created_at", + "displayName": "Started", + "shape": "date" + }, + { + "name": "last_active", + "displayName": "Last active", + "shape": "date" + }, + { + "name": "expires_at", + "displayName": "Expires", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/ngrok/v1/defaultContent/endpoint.dash.json b/plugins/ngrok/v1/defaultContent/endpoint.dash.json new file mode 100644 index 00000000..6ba23cee --- /dev/null +++ b/plugins/ngrok/v1/defaultContent/endpoint.dash.json @@ -0,0 +1,626 @@ +{ + "name": "Endpoint", + "schemaVersion": "1.5", + "timeframe": "none", + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "9a6af9d3-6a72-490c-adc7-4b4707e8df1b", + "x": 0, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Status", + "description": "Whether this endpoint is currently online", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[endpointStatus]}}", + "name": "endpointStatus", + "pluginConfigId": "{{configId}}" + }, + "scope": { + "scope": "{{scopes.[ngrok Endpoints]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[ngrok Endpoint]}}" + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "url", + "type": "nominal", + "title": "URL" + }, + "status": { + "field": "status", + "type": "nominal", + "title": "Status" + } + }, + "style": { + "statusGridColumnsPerRow": 1, + "statusGridLabelWrap": true, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{liveEndpoints}} live endpoint(s){{{{/raw}}}}", + "mappedColors": { + "Online": "#16a34a", + "Offline": "#ef4444", + "Unknown": "#9ca3af" + }, + "statusGridPrimaryTemplate": "{{{{raw}}}}{{#if liveEndpoints}}Online{{else}}Offline{{/if}}{{{{/raw}}}}" + } + } + }, + "monitor": { + "_type": "simple", + "tileRollsUp": true, + "monitorType": "state", + "column": "status", + "aggregation": "top", + "condition": { + "columns": [ + "status" + ] + }, + "frequency": 15 + } + } + }, + { + "i": "172433e1-3a12-402a-b61d-719454fd2396", + "x": 1, + "y": 0, + "w": 3, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Agent Session", + "description": "The ngrok agent serving this endpoint (agent endpoints only)", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "datastream-sql", + "dataSourceConfig": { + "version": "2.0", + "sql": "SELECT a.\"ip\", t.\"description\" AS \"authtoken\", a.\"agent_version\", a.\"os\", a.\"region\", a.\"transport\", a.\"started_at\", a.\"uptime\" FROM \"agents\" a LEFT JOIN \"authtokens\" t ON a.\"credential.id\" = t.\"id\" WHERE a.\"id\" IN (SELECT \"tunnel_session.id\" FROM \"endpoint\")", + "tables": [ + { + "tableName": "endpoint", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[endpoints]}}", + "name": "endpoints", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "endpoint": { + "variable": "{{variables.[ngrok Endpoint]}}", + "workspace": "{{workspaceId}}", + "scope": "{{scopes.[ngrok Endpoints]}}" + } + } + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ] + } + }, + { + "tableName": "agents", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[agentSessions]}}", + "name": "agentSessions", + "pluginConfigId": "{{configId}}" + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ] + } + }, + { + "tableName": "authtokens", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[authtokens]}}", + "name": "authtokens", + "pluginConfigId": "{{configId}}" + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ] + } + } + ] + }, + "metadata": [ + { + "name": "ip", + "displayName": "IP address", + "shape": "string", + "role": "label" + }, + { + "name": "authtoken", + "displayName": "Authtoken", + "shape": "string" + }, + { + "name": "agent_version", + "displayName": "Agent version", + "shape": "string" + }, + { + "name": "os", + "displayName": "OS", + "shape": "string" + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "transport", + "displayName": "Transport", + "shape": "string" + }, + { + "name": "started_at", + "displayName": "Started", + "shape": "date" + }, + { + "name": "uptime", + "displayName": "Uptime", + "shape": [ + "seconds", + { + "formatDuration": true + } + ] + }, + { + "pattern": ".*" + } + ] + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "ip", + "title": "IP address", + "renderer": { + "type": "text" + } + }, + { + "field": "authtoken", + "title": "Authtoken", + "renderer": { + "type": "text" + } + }, + { + "field": "agent_version", + "title": "Agent version", + "renderer": { + "type": "text" + } + }, + { + "field": "os", + "title": "OS", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "transport", + "title": "Transport", + "renderer": { + "type": "text" + } + }, + { + "field": "started_at", + "title": "Started", + "renderer": { + "type": "date", + "relative": true + } + } + ] + }, + "style": {} + } + } + } + }, + { + "i": "bd3a3f29-157e-41e2-b654-4907b9e49586", + "x": 0, + "y": 2, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Endpoint Configuration", + "description": "Live configuration of this endpoint", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[endpoints]}}", + "name": "endpoints", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "endpoint": { + "variable": "{{variables.[ngrok Endpoint]}}", + "workspace": "{{workspaceId}}", + "scope": "{{scopes.[ngrok Endpoints]}}" + } + } + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "url", + "title": "URL", + "renderer": { + "type": "link" + } + }, + { + "field": "endpointType", + "title": "Type", + "renderer": { + "type": "badge" + } + }, + { + "field": "proto", + "title": "Protocol", + "renderer": { + "type": "text" + } + }, + { + "field": "bindings", + "title": "Bindings", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "upstream_url", + "title": "Upstream URL", + "renderer": { + "type": "text" + } + }, + { + "field": "pooling_enabled", + "title": "Pooling enabled", + "renderer": { + "type": "boolean" + } + }, + { + "field": "hasTrafficPolicy", + "title": "Traffic policy", + "renderer": { + "type": "boolean" + } + }, + { + "field": "aiGateway", + "title": "AI Gateway", + "renderer": { + "type": "boolean" + } + }, + { + "field": "name", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "description", + "title": "Description", + "renderer": { + "type": "text" + } + }, + { + "field": "created_at", + "title": "Created", + "renderer": { + "type": "date" + } + } + ] + }, + "style": { + "richTableTranspose": true, + "richTableWrapText": true + } + } + } + } + }, + { + "i": "d0b7f811-d54f-4500-b7b6-ef83b54147f9", + "x": 2, + "y": 2, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Endpoint Details", + "description": "Properties imported for this endpoint", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "scope": { + "scope": "{{scopes.[ngrok Endpoints]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[ngrok Endpoint]}}" + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ], + "visualisation": { + "type": "data-stream-table", + "config": { + "data-stream-table": { + "transpose": true, + "hiddenColumns": [ + "id", + "link", + "links", + "label" + ] + } + } + } + } + }, + { + "i": "0c44fe5e-11f5-4248-938e-6fc988772202", + "x": 0, + "y": 6, + "w": 4, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Domain Certificate", + "description": "Certificate health of the reserved domain this endpoint is served on", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "datastream-sql", + "dataSourceConfig": { + "version": "2.0", + "sql": "SELECT d.\"domain\", d.\"certificateStatus\", d.\"certificateSource\", d.\"renewsAt\", d.\"provisioningError\" FROM \"endpoints\" e JOIN \"domains\" d ON e.\"domain.id\" = d.\"id\"", + "tables": [ + { + "tableName": "endpoints", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[endpoints]}}", + "name": "endpoints", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "endpoint": { + "variable": "{{variables.[ngrok Endpoint]}}", + "workspace": "{{workspaceId}}", + "scope": "{{scopes.[ngrok Endpoints]}}" + } + } + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ] + } + }, + { + "tableName": "domains", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[reservedDomains]}}", + "name": "reservedDomains", + "pluginConfigId": "{{configId}}" + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ] + } + } + ] + }, + "metadata": [ + { + "name": "domain", + "displayName": "Domain", + "shape": "string", + "role": "label" + }, + { + "name": "certificateStatus", + "displayName": "Certificate status", + "shape": "string" + }, + { + "name": "certificateSource", + "displayName": "Certificate source", + "shape": "string" + }, + { + "name": "renewsAt", + "displayName": "Renews", + "shape": "date" + }, + { + "name": "provisioningError", + "displayName": "Provisioning error", + "shape": "string" + }, + { + "pattern": ".*" + } + ] + }, + "variables": [ + "{{variables.[ngrok Endpoint]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "domain", + "title": "Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "certificateStatus", + "title": "Certificate status", + "renderer": { + "type": "badge", + "colors": { + "OK": "#16a34a", + "Provisioning": "#f59e0b", + "Renewal overdue": "#f59e0b", + "DNS error": "#ef4444", + "Provisioning error": "#ef4444", + "No certificate": "#ef4444" + } + } + }, + { + "field": "certificateSource", + "title": "Certificate source", + "renderer": { + "type": "text" + } + }, + { + "field": "renewsAt", + "title": "Renews", + "renderer": { + "type": "date" + } + }, + { + "field": "provisioningError", + "title": "Provisioning error", + "renderer": { + "type": "text" + } + } + ] + }, + "style": { + "richTableWrapText": true + } + } + } + } + } + ] + } +} diff --git a/plugins/ngrok/v1/defaultContent/manifest.json b/plugins/ngrok/v1/defaultContent/manifest.json new file mode 100644 index 00000000..fd5ecfd2 --- /dev/null +++ b/plugins/ngrok/v1/defaultContent/manifest.json @@ -0,0 +1,20 @@ +{ + "items": [ + { + "name": "overview", + "type": "dashboard" + }, + { + "name": "endpoint", + "type": "dashboard" + }, + { + "name": "reservedDomain", + "type": "dashboard" + }, + { + "name": "tlsCertificate", + "type": "dashboard" + } + ] +} diff --git a/plugins/ngrok/v1/defaultContent/overview.dash.json b/plugins/ngrok/v1/defaultContent/overview.dash.json new file mode 100644 index 00000000..6b7c6e3d --- /dev/null +++ b/plugins/ngrok/v1/defaultContent/overview.dash.json @@ -0,0 +1,1348 @@ +{ + "name": "Overview", + "schemaVersion": "1.5", + "timeframe": "none", + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "7152fc40-6ca4-4527-bc78-1fe080866621", + "x": 0, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Endpoints", + "description": "Active endpoints across the account", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[endpoints]}}", + "name": "endpoints", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Endpoints" + } + ] + }, + "style": { + "scalarLabelText": "Endpoints" + } + } + } + } + }, + { + "i": "ab478c54-b630-4139-bb96-39645d470af4", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Online Agents", + "description": "ngrok agents currently connected", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[agentSessions]}}", + "name": "agentSessions", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Agents" + } + ] + }, + "style": { + "scalarLabelText": "Agents" + } + } + } + } + }, + { + "i": "b6e7a17d-75e0-457e-8eeb-73fb19b99e7e", + "x": 2, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Reserved Domains", + "description": "Domains reserved in the account", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[reservedDomains]}}", + "name": "reservedDomains", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Domains" + } + ] + }, + "style": { + "scalarLabelText": "Domains" + } + } + } + } + }, + { + "i": "8ad47f7c-25f5-4b7e-9adf-2461cbf80018", + "x": 3, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "TLS Certificates", + "description": "TLS certificates uploaded or managed by ngrok", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[tlsCertificates]}}", + "name": "tlsCertificates", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Certificates" + } + ] + }, + "style": { + "scalarLabelText": "Certificates" + } + } + } + } + }, + { + "i": "87f791a5-06ca-41a6-9923-99c974ceb48a", + "x": 0, + "y": 2, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Endpoint Status", + "description": "Whether each indexed endpoint is currently online", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[endpointStatus]}}", + "name": "endpointStatus", + "pluginConfigId": "{{configId}}", + "sort": { + "by": [ + [ + "url", + "asc" + ] + ] + } + }, + "scope": { + "scope": "{{scopes.[ngrok Endpoints]}}", + "workspace": "{{workspaceId}}" + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "url", + "type": "nominal", + "title": "URL" + }, + "status": { + "field": "status", + "type": "nominal", + "title": "Status" + } + }, + "style": { + "statusGridColumnsPerRow": 3, + "statusGridLabelWrap": true, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{liveEndpoints}} live{{{{/raw}}}}", + "mappedColors": { + "Online": "#16a34a", + "Offline": "#ef4444", + "Unknown": "#9ca3af" + } + } + } + }, + "monitor": { + "_type": "simple", + "tileRollsUp": true, + "monitorType": "state", + "column": "status", + "aggregation": "top", + "condition": { + "columns": [ + "status" + ] + }, + "frequency": 15 + } + } + }, + { + "i": "03cb7b79-3aaf-47d3-9d7e-2d53adbe6927", + "x": 2, + "y": 2, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Endpoints by Type", + "description": "Agent, cloud and edge endpoints", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[endpoints]}}", + "name": "endpoints", + "pluginConfigId": "{{configId}}", + "group": { + "by": [ + [ + "endpointType", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "count" + } + ] + }, + "sort": { + "by": [ + [ + "count", + "desc" + ] + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "pie", + "encoding": { + "label": { + "field": "endpointType_uniqueValues", + "type": "nominal", + "title": "Type" + }, + "value": { + "field": "count", + "type": "quantitative", + "aggregate": "sum", + "title": "Endpoints" + } + }, + "style": { + "pieInnerRadius": 60, + "pieDonutCenterValue": "total", + "labelFontSize": 16, + "pieLegendStyle": "table" + } + } + } + } + }, + { + "i": "221b585b-210d-4e6b-a079-be2826b84288", + "x": 0, + "y": 5, + "w": 4, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Endpoints", + "description": "Active endpoints, newest first", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[endpoints]}}", + "name": "endpoints", + "pluginConfigId": "{{configId}}", + "sort": { + "by": [ + [ + "created_at", + "desc" + ] + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "url", + "title": "URL", + "renderer": { + "type": "link" + } + }, + { + "field": "endpointType", + "title": "Type", + "renderer": { + "type": "badge" + } + }, + { + "field": "proto", + "title": "Protocol", + "renderer": { + "type": "text" + } + }, + { + "field": "aiGateway", + "title": "AI Gateway", + "renderer": { + "type": "boolean" + } + }, + { + "field": "hasTrafficPolicy", + "title": "Traffic policy", + "renderer": { + "type": "boolean" + } + }, + { + "field": "created_at", + "title": "Created", + "renderer": { + "type": "date", + "relative": true + } + } + ] + }, + "style": {} + } + } + } + }, + { + "i": "d763b5b2-6ea0-41ef-b448-43a39c145d45", + "x": 0, + "y": 8, + "w": 4, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Online Agents", + "description": "ngrok agents currently connected to the account, with the authtoken each one uses", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "datastream-sql", + "dataSourceConfig": { + "version": "2.0", + "sql": "SELECT a.\"ip\", t.\"description\" AS \"authtoken\", a.\"agent_version\", a.\"os\", a.\"region\", a.\"started_at\", a.\"uptime\" FROM \"agents\" a LEFT JOIN \"authtokens\" t ON a.\"credential.id\" = t.\"id\" ORDER BY a.\"uptime\" DESC", + "tables": [ + { + "tableName": "agents", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[agentSessions]}}", + "name": "agentSessions", + "pluginConfigId": "{{configId}}" + } + } + }, + { + "tableName": "authtokens", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[authtokens]}}", + "name": "authtokens", + "pluginConfigId": "{{configId}}" + } + } + } + ] + }, + "metadata": [ + { + "name": "ip", + "displayName": "IP address", + "shape": "string", + "role": "label" + }, + { + "name": "authtoken", + "displayName": "Authtoken", + "shape": "string" + }, + { + "name": "agent_version", + "displayName": "Agent version", + "shape": "string" + }, + { + "name": "os", + "displayName": "OS", + "shape": "string" + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "started_at", + "displayName": "Started", + "shape": "date" + }, + { + "name": "uptime", + "displayName": "Uptime", + "shape": [ + "seconds", + { + "formatDuration": true + } + ] + }, + { + "pattern": ".*" + } + ] + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "ip", + "title": "IP address", + "renderer": { + "type": "text" + } + }, + { + "field": "authtoken", + "title": "Authtoken", + "renderer": { + "type": "text" + } + }, + { + "field": "agent_version", + "title": "Agent version", + "renderer": { + "type": "text" + } + }, + { + "field": "os", + "title": "OS", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "started_at", + "title": "Started", + "renderer": { + "type": "date", + "relative": true + } + } + ] + }, + "style": {} + } + } + } + }, + { + "i": "599bbcf1-e54e-44c6-a756-149c14bca347", + "x": 0, + "y": 11, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Domain Certificate Status", + "description": "Certificate state of each reserved domain", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[reservedDomains]}}", + "name": "reservedDomains", + "pluginConfigId": "{{configId}}" + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "domain", + "type": "nominal", + "title": "Domain" + }, + "status": { + "field": "certificateStatus", + "type": "nominal", + "title": "Certificate status" + } + }, + "style": { + "statusGridColumnsPerRow": 2, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{certificateSource}}{{{{/raw}}}}", + "mappedColors": { + "OK": "#16a34a", + "Provisioning": "#f59e0b", + "Renewal overdue": "#f59e0b", + "DNS error": "#ef4444", + "Provisioning error": "#ef4444", + "No certificate": "#ef4444" + } + } + } + }, + "monitor": { + "_type": "simple", + "tileRollsUp": true, + "monitorType": "state", + "column": "certificateStatus", + "aggregation": "top", + "condition": { + "columns": [ + "certificateStatus" + ] + }, + "frequency": 15 + } + } + }, + { + "i": "0afdaef1-51ed-42fd-a7db-15fbcf33d2c2", + "x": 2, + "y": 11, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Reserved Addresses", + "description": "Reserved TCP addresses", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[reservedAddresses]}}", + "name": "reservedAddresses", + "pluginConfigId": "{{configId}}", + "sort": { + "by": [ + [ + "created_at", + "desc" + ] + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "addr", + "title": "Address", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "badge" + } + }, + { + "field": "description", + "title": "Description", + "renderer": { + "type": "text" + } + }, + { + "field": "created_at", + "title": "Created", + "renderer": { + "type": "date" + } + } + ] + }, + "style": {} + } + } + } + }, + { + "i": "9019022b-f2fd-45b6-8f0b-dfae43ae98ff", + "x": 0, + "y": 14, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Certificates Expiring Soonest", + "description": "TLS certificates ordered by days until expiry", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[tlsCertificates]}}", + "name": "tlsCertificates", + "pluginConfigId": "{{configId}}", + "sort": { + "by": [ + [ + "daysUntilExpiry", + "asc" + ] + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "subject_common_name", + "title": "Common name", + "renderer": { + "type": "text" + } + }, + { + "field": "expiryStatus", + "title": "Expiry status", + "renderer": { + "type": "badge", + "colors": { + "Valid": "#16a34a", + "Expires within 30 days": "#f59e0b", + "Expires within 7 days": "#ef4444", + "Expired": "#ef4444" + } + } + }, + { + "field": "daysUntilExpiry", + "title": "Days left", + "renderer": { + "type": "number", + "decimals": 0, + "thresholds": [ + { + "to": 7, + "color": "#ef4444" + }, + { + "to": 30, + "color": "#f59e0b" + }, + { + "to": 100000, + "color": "#16a34a" + } + ] + }, + "align": "right" + }, + { + "field": "not_after", + "title": "Expires", + "renderer": { + "type": "date" + } + }, + { + "field": "managedBy", + "title": "Managed by", + "renderer": { + "type": "text" + } + }, + { + "field": "issuer_common_name", + "title": "Issuer", + "renderer": { + "type": "text" + } + } + ] + }, + "style": {} + } + }, + "monitor": { + "_type": "simple", + "tileRollsUp": true, + "monitorType": "state", + "column": "expiryStatus", + "aggregation": "top", + "condition": { + "columns": [ + "expiryStatus" + ] + }, + "frequency": 15 + } + } + }, + { + "i": "8cfcd0aa-5651-42fb-983e-b1e21a993b14", + "x": 2, + "y": 14, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Certificate Authorities Expiry", + "description": "Mutual TLS certificate authorities ordered by days until expiry", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[certificateAuthorities]}}", + "name": "certificateAuthorities", + "pluginConfigId": "{{configId}}", + "sort": { + "by": [ + [ + "daysUntilExpiry", + "asc" + ] + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "subject_common_name", + "title": "Common name", + "renderer": { + "type": "text" + } + }, + { + "field": "expiryStatus", + "title": "Expiry status", + "renderer": { + "type": "badge", + "colors": { + "Valid": "#16a34a", + "Expires within 30 days": "#f59e0b", + "Expires within 7 days": "#ef4444", + "Expired": "#ef4444" + } + } + }, + { + "field": "daysUntilExpiry", + "title": "Days left", + "renderer": { + "type": "number", + "decimals": 0, + "thresholds": [ + { + "to": 7, + "color": "#ef4444" + }, + { + "to": 30, + "color": "#f59e0b" + }, + { + "to": 100000, + "color": "#16a34a" + } + ] + }, + "align": "right" + }, + { + "field": "not_after", + "title": "Expires", + "renderer": { + "type": "date" + } + } + ] + }, + "style": {} + } + }, + "monitor": { + "_type": "simple", + "tileRollsUp": true, + "monitorType": "state", + "column": "expiryStatus", + "aggregation": "top", + "condition": { + "columns": [ + "expiryStatus" + ] + }, + "frequency": 15 + } + } + }, + { + "i": "6145da23-1907-4890-9cdd-c71d9243b346", + "x": 0, + "y": 17, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Traffic Identities", + "description": "Users who signed in to protected endpoints, most recently active first", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[trafficIdentities]}}", + "name": "trafficIdentities", + "pluginConfigId": "{{configId}}", + "sort": { + "by": [ + [ + "last_active", + "desc" + ] + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "name", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "email", + "title": "Email", + "renderer": { + "type": "text" + } + }, + { + "field": "identity_provider.name", + "title": "Identity provider", + "renderer": { + "type": "badge" + } + }, + { + "field": "last_active", + "title": "Last active", + "renderer": { + "type": "date", + "relative": true + } + } + ] + }, + "style": {} + } + } + } + }, + { + "i": "bfcf2b96-ef01-47db-9692-75d61004bcdc", + "x": 2, + "y": 17, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Active Sessions", + "description": "Traffic sessions of users signed in through endpoint identity policies", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "datastream-sql", + "dataSourceConfig": { + "version": "2.0", + "sql": "SELECT i.\"name\", i.\"email\", s.\"publicUrl\", s.\"browser\", s.\"countryCode\", s.\"last_active\", s.\"expires_at\" FROM \"sessions\" s LEFT JOIN \"identities\" i ON s.\"userId\" = i.\"id\" ORDER BY s.\"last_active\" DESC", + "tables": [ + { + "tableName": "sessions", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[trafficSessions]}}", + "name": "trafficSessions", + "pluginConfigId": "{{configId}}" + } + } + }, + { + "tableName": "identities", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[trafficIdentities]}}", + "name": "trafficIdentities", + "pluginConfigId": "{{configId}}" + } + } + } + ] + }, + "metadata": [ + { + "name": "name", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "email", + "displayName": "Email", + "shape": "string" + }, + { + "name": "publicUrl", + "displayName": "Endpoint URL", + "shape": "url" + }, + { + "name": "browser", + "displayName": "Browser", + "shape": "string" + }, + { + "name": "countryCode", + "displayName": "Country", + "shape": "string" + }, + { + "name": "last_active", + "displayName": "Last active", + "shape": "date" + }, + { + "name": "expires_at", + "displayName": "Expires", + "shape": "date" + }, + { + "pattern": ".*" + } + ] + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "name", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "email", + "title": "Email", + "renderer": { + "type": "text" + } + }, + { + "field": "publicUrl", + "title": "Endpoint URL", + "renderer": { + "type": "link" + } + }, + { + "field": "browser", + "title": "Browser", + "renderer": { + "type": "text" + } + }, + { + "field": "countryCode", + "title": "Country", + "renderer": { + "type": "badge" + } + }, + { + "field": "last_active", + "title": "Last active", + "renderer": { + "type": "date", + "relative": true + } + }, + { + "field": "expires_at", + "title": "Expires", + "renderer": { + "type": "date" + } + } + ] + }, + "style": {} + } + } + } + }, + { + "i": "a21988fc-95a5-4a7d-ad73-1d1769dbaa31", + "x": 0, + "y": 20, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Log Export Destinations", + "description": "Where ngrok exports event logs", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[eventDestinations]}}", + "name": "eventDestinations", + "pluginConfigId": "{{configId}}", + "sort": { + "by": [ + [ + "created_at", + "desc" + ] + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "description", + "title": "Description", + "renderer": { + "type": "text" + } + }, + { + "field": "targetType", + "title": "Target", + "renderer": { + "type": "badge" + } + }, + { + "field": "location", + "title": "Location", + "renderer": { + "type": "text" + } + }, + { + "field": "format", + "title": "Format", + "renderer": { + "type": "text" + } + }, + { + "field": "created_at", + "title": "Created", + "renderer": { + "type": "date" + } + } + ] + }, + "style": {} + } + } + } + }, + { + "i": "ea07aac1-b9fc-46fa-9b64-e0ce56e279c8", + "x": 2, + "y": 20, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Event Subscriptions", + "description": "Event subscriptions that forward ngrok events to log export destinations", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[eventSubscriptions]}}", + "name": "eventSubscriptions", + "pluginConfigId": "{{configId}}", + "sort": { + "by": [ + [ + "created_at", + "desc" + ] + ] + } + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "description", + "title": "Description", + "renderer": { + "type": "text" + } + }, + { + "field": "eventTypes", + "title": "Event types", + "renderer": { + "type": "tag-list" + } + }, + { + "field": "destinationCount", + "title": "Destinations", + "renderer": { + "type": "number", + "decimals": 0 + }, + "align": "right" + }, + { + "field": "created_at", + "title": "Created", + "renderer": { + "type": "date" + } + } + ] + }, + "style": { + "richTableWrapText": true + } + } + } + } + } + ] + } +} diff --git a/plugins/ngrok/v1/defaultContent/reservedDomain.dash.json b/plugins/ngrok/v1/defaultContent/reservedDomain.dash.json new file mode 100644 index 00000000..2775699b --- /dev/null +++ b/plugins/ngrok/v1/defaultContent/reservedDomain.dash.json @@ -0,0 +1,379 @@ +{ + "name": "Reserved Domain", + "schemaVersion": "1.5", + "timeframe": "none", + "variables": [ + "{{variables.[ngrok Reserved Domain]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "441ed66f-423b-4f40-b588-cb745cecd5a9", + "x": 0, + "y": 0, + "w": 1, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Certificate Status", + "description": "Certificate state for this domain", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[reservedDomains]}}", + "name": "reservedDomains", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "domain": { + "variable": "{{variables.[ngrok Reserved Domain]}}", + "workspace": "{{workspaceId}}", + "scope": "{{scopes.[ngrok Reserved Domains]}}" + } + } + }, + "variables": [ + "{{variables.[ngrok Reserved Domain]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "domain", + "type": "nominal", + "title": "Domain" + }, + "status": { + "field": "certificateStatus", + "type": "nominal", + "title": "Certificate status" + } + }, + "style": { + "statusGridColumnsPerRow": 1, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{certificateSource}}{{{{/raw}}}}", + "mappedColors": { + "OK": "#16a34a", + "Provisioning": "#f59e0b", + "Renewal overdue": "#f59e0b", + "DNS error": "#ef4444", + "Provisioning error": "#ef4444", + "No certificate": "#ef4444" + } + } + } + }, + "monitor": { + "_type": "simple", + "tileRollsUp": true, + "monitorType": "state", + "column": "certificateStatus", + "aggregation": "top", + "condition": { + "columns": [ + "certificateStatus" + ] + }, + "frequency": 15 + } + } + }, + { + "i": "94f4a9dc-3ce4-49e3-a8b7-654ab69f34c6", + "x": 1, + "y": 0, + "w": 3, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Certificate Renewal", + "description": "Certificate management and provisioning for this domain", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[reservedDomains]}}", + "name": "reservedDomains", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "domain": { + "variable": "{{variables.[ngrok Reserved Domain]}}", + "workspace": "{{workspaceId}}", + "scope": "{{scopes.[ngrok Reserved Domains]}}" + } + } + }, + "variables": [ + "{{variables.[ngrok Reserved Domain]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "certificateStatus", + "title": "Certificate status", + "renderer": { + "type": "badge", + "colors": { + "OK": "#16a34a", + "Provisioning": "#f59e0b", + "Renewal overdue": "#f59e0b", + "DNS error": "#ef4444", + "Provisioning error": "#ef4444", + "No certificate": "#ef4444" + } + } + }, + { + "field": "certificateSource", + "title": "Certificate source", + "renderer": { + "type": "text" + } + }, + { + "field": "renewsAt", + "title": "Renews", + "renderer": { + "type": "date" + } + }, + { + "field": "provisioningError", + "title": "Provisioning error", + "renderer": { + "type": "text" + } + }, + { + "field": "provisioningRetriesAt", + "title": "Provisioning retries", + "renderer": { + "type": "date" + } + }, + { + "field": "cnameTarget", + "title": "CNAME target", + "renderer": { + "type": "text" + } + }, + { + "field": "certificateId", + "title": "Certificate ID", + "renderer": { + "type": "text" + } + } + ] + }, + "style": { + "richTableTranspose": true, + "richTableWrapText": true + } + } + } + } + }, + { + "i": "66107657-5444-4260-9f4d-035df3e147a1", + "x": 0, + "y": 3, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Domain Details", + "description": "Properties imported for this domain", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "scope": { + "scope": "{{scopes.[ngrok Reserved Domains]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[ngrok Reserved Domain]}}" + }, + "variables": [ + "{{variables.[ngrok Reserved Domain]}}" + ], + "visualisation": { + "type": "data-stream-table", + "config": { + "data-stream-table": { + "transpose": true, + "hiddenColumns": [ + "id", + "link", + "links", + "label" + ] + } + } + } + } + }, + { + "i": "21d07848-ab8e-4544-8df7-0fd170459d13", + "x": 2, + "y": 3, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Endpoints on This Domain", + "description": "Active endpoints served on this domain", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "datastream-sql", + "dataSourceConfig": { + "version": "2.0", + "sql": "SELECT e.\"url\", e.\"endpointType\", e.\"proto\", e.\"created_at\" FROM \"endpoints\" e WHERE e.\"domain.id\" IN (SELECT \"id\" FROM \"domain\") ORDER BY e.\"created_at\" DESC", + "tables": [ + { + "tableName": "domain", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[reservedDomains]}}", + "name": "reservedDomains", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "domain": { + "variable": "{{variables.[ngrok Reserved Domain]}}", + "workspace": "{{workspaceId}}", + "scope": "{{scopes.[ngrok Reserved Domains]}}" + } + } + }, + "variables": [ + "{{variables.[ngrok Reserved Domain]}}" + ] + } + }, + { + "tableName": "endpoints", + "config": { + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[endpoints]}}", + "name": "endpoints", + "pluginConfigId": "{{configId}}" + }, + "variables": [ + "{{variables.[ngrok Reserved Domain]}}" + ] + } + } + ] + }, + "metadata": [ + { + "name": "url", + "displayName": "URL", + "shape": "string", + "role": "label" + }, + { + "name": "endpointType", + "displayName": "Type", + "shape": "string" + }, + { + "name": "proto", + "displayName": "Protocol", + "shape": "string" + }, + { + "name": "created_at", + "displayName": "Created", + "shape": "date" + }, + { + "pattern": ".*" + } + ] + }, + "variables": [ + "{{variables.[ngrok Reserved Domain]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "url", + "title": "URL", + "renderer": { + "type": "link" + } + }, + { + "field": "endpointType", + "title": "Type", + "renderer": { + "type": "badge" + } + }, + { + "field": "proto", + "title": "Protocol", + "renderer": { + "type": "text" + } + }, + { + "field": "created_at", + "title": "Created", + "renderer": { + "type": "date" + } + } + ] + }, + "style": {} + } + } + } + } + ] + } +} diff --git a/plugins/ngrok/v1/defaultContent/scopes.json b/plugins/ngrok/v1/defaultContent/scopes.json new file mode 100644 index 00000000..268a61ad --- /dev/null +++ b/plugins/ngrok/v1/defaultContent/scopes.json @@ -0,0 +1,53 @@ +[ + { + "name": "ngrok Endpoints", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Endpoint" + ] + } + }, + "variable": { + "name": "ngrok Endpoint", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + }, + { + "name": "ngrok Reserved Domains", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Reserved Domain" + ] + } + }, + "variable": { + "name": "ngrok Reserved Domain", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + }, + { + "name": "ngrok TLS Certificates", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "TLS Certificate" + ] + } + }, + "variable": { + "name": "ngrok TLS Certificate", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + } +] diff --git a/plugins/ngrok/v1/defaultContent/tlsCertificate.dash.json b/plugins/ngrok/v1/defaultContent/tlsCertificate.dash.json new file mode 100644 index 00000000..72cd7a5d --- /dev/null +++ b/plugins/ngrok/v1/defaultContent/tlsCertificate.dash.json @@ -0,0 +1,320 @@ +{ + "name": "TLS Certificate", + "schemaVersion": "1.5", + "timeframe": "none", + "variables": [ + "{{variables.[ngrok TLS Certificate]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "f556d287-a19c-4f23-927c-5d321172f508", + "x": 0, + "y": 0, + "w": 2, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Days Until Expiry", + "description": "Days left before this certificate expires", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[tlsCertificates]}}", + "name": "tlsCertificates", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "certificate": { + "variable": "{{variables.[ngrok TLS Certificate]}}", + "workspace": "{{workspaceId}}", + "scope": "{{scopes.[ngrok TLS Certificates]}}" + } + } + }, + "variables": [ + "{{variables.[ngrok TLS Certificate]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "daysUntilExpiry", + "type": "quantitative", + "title": "Days", + "aggregate": "min" + } + ] + }, + "style": { + "scalarLabelText": "Days" + } + } + } + } + }, + { + "i": "ba7633f1-dba6-4326-80b3-90b356c87a0e", + "x": 2, + "y": 0, + "w": 2, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Expiry Status", + "description": "Expiry state of this certificate", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[tlsCertificates]}}", + "name": "tlsCertificates", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "certificate": { + "variable": "{{variables.[ngrok TLS Certificate]}}", + "workspace": "{{workspaceId}}", + "scope": "{{scopes.[ngrok TLS Certificates]}}" + } + } + }, + "variables": [ + "{{variables.[ngrok TLS Certificate]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "subject_common_name", + "type": "nominal", + "title": "Common name" + }, + "status": { + "field": "expiryStatus", + "type": "nominal", + "title": "Expiry status" + } + }, + "style": { + "statusGridColumnsPerRow": 1, + "statusGridSecondaryTemplate": "{{{{raw}}}}Expires {{date not_after}}{{{{/raw}}}}", + "mappedColors": { + "Valid": "#16a34a", + "Expires within 30 days": "#f59e0b", + "Expires within 7 days": "#ef4444", + "Expired": "#ef4444" + } + } + } + }, + "monitor": { + "_type": "simple", + "tileRollsUp": true, + "monitorType": "state", + "column": "expiryStatus", + "aggregation": "top", + "condition": { + "columns": [ + "expiryStatus" + ] + }, + "frequency": 15 + } + } + }, + { + "i": "ced3aaaf-ef7c-4cc6-b6e2-15c3a4ae36cf", + "x": 0, + "y": 2, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Certificate Validity", + "description": "Issuer and validity window of this certificate", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "{{dataStreams.[tlsCertificates]}}", + "name": "tlsCertificates", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "certificate": { + "variable": "{{variables.[ngrok TLS Certificate]}}", + "workspace": "{{workspaceId}}", + "scope": "{{scopes.[ngrok TLS Certificates]}}" + } + } + }, + "variables": [ + "{{variables.[ngrok TLS Certificate]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "expiryStatus", + "title": "Expiry status", + "renderer": { + "type": "badge", + "colors": { + "Valid": "#16a34a", + "Expires within 30 days": "#f59e0b", + "Expires within 7 days": "#ef4444", + "Expired": "#ef4444" + } + } + }, + { + "field": "daysUntilExpiry", + "title": "Days until expiry", + "renderer": { + "type": "number", + "decimals": 0, + "thresholds": [ + { + "to": 7, + "color": "#ef4444" + }, + { + "to": 30, + "color": "#f59e0b" + }, + { + "to": 100000, + "color": "#16a34a" + } + ] + } + }, + { + "field": "not_before", + "title": "Valid from", + "renderer": { + "type": "date" + } + }, + { + "field": "not_after", + "title": "Expires", + "renderer": { + "type": "date" + } + }, + { + "field": "issuer_common_name", + "title": "Issuer", + "renderer": { + "type": "text" + } + }, + { + "field": "managedBy", + "title": "Managed by", + "renderer": { + "type": "text" + } + }, + { + "field": "subject_alternative_names.dns_names", + "title": "DNS names", + "renderer": { + "type": "text" + } + }, + { + "field": "private_key_type", + "title": "Key type", + "renderer": { + "type": "text" + } + }, + { + "field": "issued_at", + "title": "Issued", + "renderer": { + "type": "date" + } + } + ] + }, + "style": { + "richTableTranspose": true, + "richTableWrapText": true + } + } + } + } + }, + { + "i": "f5e710b1-d261-45e3-9ddb-51a11a88a0bb", + "x": 2, + "y": 2, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Certificate Details", + "description": "Properties imported for this certificate", + "activePluginConfigIds": [ + "{{configId}}" + ], + "timeframe": "none", + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "scope": { + "scope": "{{scopes.[ngrok TLS Certificates]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[ngrok TLS Certificate]}}" + }, + "variables": [ + "{{variables.[ngrok TLS Certificate]}}" + ], + "visualisation": { + "type": "data-stream-table", + "config": { + "data-stream-table": { + "transpose": true, + "hiddenColumns": [ + "id", + "link", + "links", + "label" + ] + } + } + } + } + } + ] + } +} diff --git a/plugins/ngrok/v1/docs/README.md b/plugins/ngrok/v1/docs/README.md new file mode 100644 index 00000000..009e3fc6 --- /dev/null +++ b/plugins/ngrok/v1/docs/README.md @@ -0,0 +1,70 @@ +Monitor your [ngrok](https://ngrok.com) account in SquaredUp: endpoints, connected agents, reserved domains, reserved TCP addresses, and TLS certificates, including certificate expiry and certificate provisioning health. Data comes from the [ngrok API](https://ngrok.com/docs/api/). + +## Setup + +1. Sign in to the [ngrok dashboard](https://dashboard.ngrok.com). +2. Go to **API Keys** ([dashboard.ngrok.com/api-keys](https://dashboard.ngrok.com/api-keys)) and select **New API Key**. +3. Optionally give the key a description (for example `SquaredUp`), and choose an owner with access to the resources you want to monitor. +4. Copy the key. ngrok shows it only once. +5. In SquaredUp, paste the key into the **API key** field and save. + +> ⚠️ Use an **API key**, not an agent **authtoken**. Authtokens start ngrok agents and cannot call the ngrok API. + +## Configuration fields + +| Field | What it is | Where to find it | Required | +| ----- | ---------- | ---------------- | -------- | +| **API key** | An ngrok API key, sent as a bearer token | ngrok dashboard → **API Keys** | Yes | + +When you save, SquaredUp makes a lightweight call to the ngrok API to confirm the key works. If that fails, check that you pasted an API key (not an authtoken) and that it hasn't been deleted. + +## What this plugin monitors + +- **Endpoints**: every online endpoint (agent, cloud and edge), with its URL, protocol, bindings, upstream, pooling, and whether it uses a Traffic Policy or the AI Gateway +- **Endpoint availability**: whether each indexed endpoint is online or offline +- **Agents**: ngrok agents currently connected, with agent version, OS, IP address, region, uptime and the authtoken they use +- **Domains and certificates**: reserved domains and their certificate management status (provisioning errors such as DNS problems, renewal dates), TLS certificates and certificate authorities with days until expiry +- **Reserved TCP addresses** +- **Traffic identities and sessions**: users who have signed in to endpoints protected by OAuth, OIDC or SAML, their active browser sessions, and when they were last active +- **Log exporting**: event subscriptions and the destinations they export to + +Out-of-the-box dashboards: **Overview**, plus **Endpoint**, **Reserved Domain** and **TLS Certificate** perspectives. Endpoint status, domain certificate status and certificate expiry tiles carry health monitors, so they can raise notifications. + +## Data streams + +- **Endpoints**: online endpoints with type, protocol, bindings, upstream URL and Traffic Policy/AI Gateway flags (account-wide, or filtered to selected endpoints) +- **Endpoint Status**: whether each selected endpoint is online, and how many live endpoints serve its URL (per endpoint) +- **Agent Sessions**: connected ngrok agents with version, OS, IP, region and uptime (account-wide) +- **Reserved Domains**: reserved domains with certificate source, renewal date, provisioning error and a certificate status health state (account-wide, or filtered to selected domains) +- **TLS Certificates**: certificates with issuer, validity dates, days until expiry and an expiry status health state (account-wide, or filtered to selected certificates) +- **Reserved Addresses**: reserved TCP addresses with region and description (account-wide, or filtered to selected addresses) +- **Authtokens**: agent authtokens with their description and whether an ACL restricts them. Token values are never returned (account-wide) +- **Certificate Authorities**: mutual TLS certificate authorities with days until expiry and an expiry status health state (account-wide) +- **Traffic Identities**: users who have signed in through an endpoint's OAuth, OIDC or SAML policy, with identity provider and last activity (account-wide) +- **Traffic Sessions**: signed-in browser sessions with endpoint URL, browser, OS, country and expiry (account-wide) +- **Event Subscriptions**: log export subscriptions with the event types they export and how many destinations they use (account-wide) +- **Event Destinations**: log export destinations with the target service (Datadog, CloudWatch Logs, Kinesis, Firehose or Azure Monitor Logs) and location. Credentials are never returned (account-wide) + +Certificate and expiry health states: **Expired** and **Expires within 7 days** are errors, and **Expires within 30 days** is a warning. A domain certificate with a DNS or provisioning error is an error, and one that is still provisioning or overdue for renewal is a warning. + +## What gets indexed + +| Object type | API source | Represents | +| ----------- | ---------- | ---------- | +| Endpoint | `GET /endpoints` | An online ngrok endpoint (agent, cloud or edge), identified by its URL. Pooled endpoints that share a URL are one object | +| Reserved Domain | `GET /reserved_domains` | A domain reserved in the account, including ngrok dev domains | +| TLS Certificate | `GET /tls_certificates` | An uploaded or automatically issued TLS certificate | +| Reserved Address | `GET /reserved_addrs` | A reserved TCP address | + +**Relationships:** endpoints carry the ID of their reserved domain (`domainId`), and reserved domains carry the ID of their uploaded certificate (`certificateId`). + +## Known limitations + +- **No traffic, usage or cost metrics.** The ngrok API does not expose request counts, data transfer, latency, Traffic Inspector data, billing, or any AI Gateway usage (providers, models, cost). To chart traffic, set up **Log Exporting** in the ngrok dashboard to send `http_request_complete` events to Datadog, Amazon CloudWatch Logs, Amazon Kinesis or Azure Monitor Logs, and use the matching SquaredUp data source. +- **Current state only.** No data stream supports a timeframe; each returns the current state. +- **Agent endpoints are short-lived.** An agent endpoint exists only while its agent is running, and ngrok gives it a new ID each time the agent restarts. The plugin identifies endpoints by URL, so an endpoint on a reserved or dev domain keeps the same object across restarts. An agent using a random URL creates a new object for each new URL. Indexed endpoints are refreshed on each import (every 12 hours by default), so the **Endpoints** stream is always more current than the indexed objects. An endpoint that goes offline can remain as an indexed object for a while after imports stop returning it. +- **Agents are not indexed.** Agent sessions change too often to import, so they are only available through the **Agent Sessions** stream. +- **Edges are not covered separately.** ngrok deprecated Edges, Routes, Backends and labeled tunnels on 31 December 2025. Edge-type endpoints still appear in **Endpoints**. +- **Rate limit.** The ngrok API allows 120 requests per minute per account. Each data stream a tile uses makes one request per 100 rows it reads, so tiles that combine streams (such as **Online Agents**, **Active Sessions** and **Agent Session**) make one or more requests per stream. +- **Endpoint status for large pools.** **Endpoint Status** reads up to 100 live endpoints for the selected URLs in one request. If more match, endpoints not in that first page show as **Unknown** rather than **Offline**, and live endpoint counts are a lower bound. +- **Read-only.** The plugin only reads from the ngrok API and never changes anything in your ngrok account. diff --git a/plugins/ngrok/v1/icon.svg b/plugins/ngrok/v1/icon.svg new file mode 100644 index 00000000..680701b4 --- /dev/null +++ b/plugins/ngrok/v1/icon.svg @@ -0,0 +1 @@ + diff --git a/plugins/ngrok/v1/indexDefinitions/default.json b/plugins/ngrok/v1/indexDefinitions/default.json new file mode 100644 index 00000000..66436a94 --- /dev/null +++ b/plugins/ngrok/v1/indexDefinitions/default.json @@ -0,0 +1,114 @@ +{ + "steps": [ + { + "name": "endpoints", + "dataStream": { + "name": "endpoints" + }, + "timeframe": "none", + "objectMapping": { + "id": "url", + "name": "url", + "type": { + "value": "Endpoint" + }, + "properties": [ + "endpointType", + "proto", + "bindings", + "region", + "description", + { + "upstreamUrl": "upstream_url" + }, + { + "poolingEnabled": "pooling_enabled" + }, + "hasTrafficPolicy", + "aiGateway", + { + "domainId": "domain.id" + }, + { + "createdAt": "created_at" + } + ] + } + }, + { + "name": "reservedDomains", + "dataStream": { + "name": "reservedDomains" + }, + "timeframe": "none", + "objectMapping": { + "id": "id", + "name": "domain", + "type": { + "value": "Reserved Domain" + }, + "properties": [ + "description", + "isDev", + "cnameTarget", + "certificateSource", + "certificateId", + { + "createdAt": "created_at" + } + ] + } + }, + { + "name": "tlsCertificates", + "dataStream": { + "name": "tlsCertificates" + }, + "timeframe": "none", + "objectMapping": { + "id": "id", + "name": "subject_common_name", + "type": { + "value": "TLS Certificate" + }, + "properties": [ + "description", + { + "dnsNames": "subject_alternative_names.dns_names" + }, + { + "issuer": "issuer_common_name" + }, + "managedBy", + { + "expiresAt": "not_after" + }, + { + "createdAt": "created_at" + } + ] + } + }, + { + "name": "reservedAddresses", + "dataStream": { + "name": "reservedAddresses" + }, + "timeframe": "none", + "objectMapping": { + "id": "id", + "name": "addr", + "type": { + "value": "Reserved Address" + }, + "properties": [ + "description", + "region", + { + "createdAt": "created_at" + } + ] + } + } + ] +} diff --git a/plugins/ngrok/v1/metadata.json b/plugins/ngrok/v1/metadata.json new file mode 100644 index 00000000..2c78e51c --- /dev/null +++ b/plugins/ngrok/v1/metadata.json @@ -0,0 +1,53 @@ +{ + "name": "ngrok", + "displayName": "ngrok", + "version": "1.0.0", + "author": { "name": "@clarkd", "type": "community" }, + "description": "Monitor your ngrok endpoints, agents, domains, and TLS certificates, including certificate expiry and provisioning health.", + "category": "Network", + "type": "hybrid", + "schemaVersion": "2.1", + "importNotSupported": false, + "restrictedToPlatforms": [], + "keywords": [ + "ngrok", + "tunnel", + "ingress", + "gateway", + "endpoints", + "domains", + "certificates", + "tls" + ], + "objectTypes": ["Endpoint", "Reserved Domain", "TLS Certificate", "Reserved Address"], + "links": [ + { + "category": "documentation", + "url": "https://github.com/squaredup/plugins/blob/main/plugins/ngrok/v1/docs/README.md", + "label": "Help adding this plugin" + }, + { + "category": "source", + "url": "https://github.com/squaredup/plugins/tree/main/plugins/ngrok", + "label": "Repository" + } + ], + "screenshots": [ + "https://github.com/squaredup/plugins/blob/main/plugins/ngrok/v1/screenshots/overview.png", + "https://github.com/squaredup/plugins/blob/main/plugins/ngrok/v1/screenshots/endpoint.png", + "https://github.com/squaredup/plugins/blob/main/plugins/ngrok/v1/screenshots/reserved-domain.png", + "https://github.com/squaredup/plugins/blob/main/plugins/ngrok/v1/screenshots/tls-certificate.png" + ], + "base": { + "plugin": "WebAPI", + "majorVersion": "1", + "config": { + "baseUrl": "https://api.ngrok.com", + "authMode": "none", + "headers": [ + { "key": "Authorization", "value": "Bearer {{apiKey}}" }, + { "key": "Ngrok-Version", "value": "2" } + ] + } + } +} diff --git a/plugins/ngrok/v1/screenshots/endpoint.png b/plugins/ngrok/v1/screenshots/endpoint.png new file mode 100644 index 00000000..2105de28 Binary files /dev/null and b/plugins/ngrok/v1/screenshots/endpoint.png differ diff --git a/plugins/ngrok/v1/screenshots/overview.png b/plugins/ngrok/v1/screenshots/overview.png new file mode 100644 index 00000000..26ca8858 Binary files /dev/null and b/plugins/ngrok/v1/screenshots/overview.png differ diff --git a/plugins/ngrok/v1/screenshots/reserved-domain.png b/plugins/ngrok/v1/screenshots/reserved-domain.png new file mode 100644 index 00000000..41f14fd2 Binary files /dev/null and b/plugins/ngrok/v1/screenshots/reserved-domain.png differ diff --git a/plugins/ngrok/v1/screenshots/tls-certificate.png b/plugins/ngrok/v1/screenshots/tls-certificate.png new file mode 100644 index 00000000..f7354507 Binary files /dev/null and b/plugins/ngrok/v1/screenshots/tls-certificate.png differ diff --git a/plugins/ngrok/v1/ui.json b/plugins/ngrok/v1/ui.json new file mode 100644 index 00000000..9410fa51 --- /dev/null +++ b/plugins/ngrok/v1/ui.json @@ -0,0 +1,10 @@ +[ + { + "type": "password", + "name": "apiKey", + "label": "API key", + "placeholder": "Enter the ngrok API key", + "help": "Create an API key in the [ngrok dashboard](https://dashboard.ngrok.com/api-keys). This is not the same as an agent authtoken.", + "validation": { "required": true } + } +]