Skip to content

Fly.io

Fly.io is an application platform that runs apps close to users; one connector covers one Fly.io organization.

  • What DRACO uses: Organization settings for posture scans and app logs.
  • What for: Compliance and attack paths, detections and hunts on app logs, the ID directory, response on apps.

Add it in Connectors > Add connector: pick Fly.io, then choose what DRACO collects and what it may change. Add more later with Add a part on its connector page. See Connectors for how connectors, sign-in and tags work.

Parts

Part What DRACO uses Access Permissions
Posture Fly.io read A read-only organization token (fly tokens create readonly --org --expiry 8760h); the member, invitation and token checks see partial data with it (Fly.io shows them to Admins only).
Logs Fly.io logs read Pull: the provider's read-only organization token reads the logs of every app.
Push: a read-only token for fly-log-shipper (fly tokens create readonly --org --expiry 8760h) and the source token; DRACO needs a public HTTPS address with a publicly trusted certificate.
Directory Fly.io logs read None beyond the logs part: names are learned from its events.
Response Revoke token (Fly.io), Rotate app secret (Fly.io), Stop or scale down an app (Fly.io) write Revoke token (Fly.io), Rotate app secret (Fly.io), Stop or scale down an app (Fly.io): an organization token that may change apps (fly tokens create org)

Posture

DRACO scans a Fly.io organization: its apps, Machines, volumes, certificates, members, invitations and tokens. The provider is DRACO's own (the open-source Prowler project has no Fly.io provider).

What is checked

Service Checks
Apps HTTPS forced, health checks configured, more than one Machine, Fly-managed images up to date, no secrets in plain environment variables, no sensitive ports (SSH, databases, Docker) exposed
Certificates Configured and issued, not expiring soon
Volumes Encryption enabled, snapshots enabled
Organization Members with the least privilege, no stale invitations, token lifetime within the limit

Create a token

DRACO only reads. A read-only organization token is enough for the scan:

fly tokens create readonly --org <org-slug> --name DRACO --expiry 8760h

Without --expiry the token lasts 20 years: one year is recommended.

The output starts with FlyV1 fm2_...; copy all of it. Fly.io shows the members, invitations and access tokens of an organization to its Admins only: with a read-only token the member, invitation and token checks report what they can see, and Attack Paths skips members and tokens.

Tip

Keep the read-only token on the provider. Fly.io response actions (revoke a token, scale an app, rotate a secret) need an organization token that may change apps: create one with fly tokens create org --org <org-slug> --name DRACO-response --expiry 2160h, save it in Settings > Credentials as a Token credential, and pick it as the action's Write credential. The action still uses this provider for the organization; without a write credential it is refused with needs a write credential (DRACO never makes a change with the provider's token).

Connect the provider in DRACO

  1. Open Connectors, click Add connector and pick Fly.io: the wizard opens at Link a Provider.
  2. Enter the Organization Slug (personal or your organization's slug, as in fly orgs list) and an optional alias, then click Next.
  3. Paste the API Token and click Next. DRACO checks that the token can list the organization's apps.
  4. Launch the first scan.

A revoked token shows as "Invalid, expired or revoked Fly.io token"; an organization the token cannot see shows as "not found or not accessible with this token".

The organization, members, tokens, apps, Machines, volumes, certificates and IP addresses also appear as a graph in Attack Paths.

Logs

The Fly.io logs data source reads the application, runner and proxy logs of every app of the organization with the provider's read-only organization token.

Two modes:

  • Pull via API (default): DRACO reads the logs of every app (apps created later included) every 5 minutes. No deployment is needed, but logs are lost if the source is paused (or DRACO is down) for longer than Fly.io keeps them (about 7 days). The endpoint DRACO reads is the one flyctl logs uses, which is not part of Fly.io's documented API.
  • Push via fly-log-shipper: deploy superfly/fly-log-shipper with ORG, ACCESS_TOKEN, HTTP_URL (the ingest endpoint) and HTTP_TOKEN (the source token); the wizard prints the commands and fly.toml. Lossless, at the cost of an app to run.

Both modes give the same fields:

  • App and machine: host is the app (fly.app.name); the machine is fly.app.instance, the region fly.region, and event.provider says app, runner or proxy.
  • The app's line is read, because Fly.io marks every line info. ANSI colours are removed. JSON printed by the app (pino, NestJS, winston...) and text access lines (nginx, uvicorn, tornado, method=GET url=/ statusCode=200, GET /path 200 12ms) give http.request.method, url.path, http.response.status_code, http.duration_ms, http.request.id, user.id, client.ip and user_agent.original; JSON also gives log.message, log.logger, error.type and error.message. Request bodies, payloads and headers are never copied into fields (the whole line stays in the raw event).
  • Client address: Fly-Client-IP or X-Forwarded-For when the line has them; Fly.io's proxy addresses (172.16.x.x) are never taken for the client.
  • Level: the level the app printed (pino numbers, ERROR, WARN...), else error markers such as Python tracebacks and TypeError: ....
  • Stack traces: a Python traceback or a Node.js error with its at ... lines, printed line by line, becomes one error event (log.lines tells how many lines).

Search examples: source_type=flyio_logs http.response.status_code>=500 | stats count by host, url, source_type=flyio_logs severity_id>=4 host=shop-api.

Directory

Names the vendor's IDs (hosts, agents, users) in the ID directory, learned from the events of the logs part.

Setup: Fly.io logs.

Response

Runs response actions on the Fly.io organization from incidents and workflows: Revoke token (Fly.io), Rotate app secret (Fly.io) and Stop or scale down an app (Fly.io).

Setup: Response actions.

If you turn on several parts

When you connect Fly.io once and tick several parts, the wizard shows one guide for all of them: what to check first, the access to create once, one list of permissions that names the part each one is for, the extra steps of each part, and one test that checks every part on its own. Turning a part on later shows only what it adds.

Posture, logs and the ID directory read with the same read-only organization token. Response actions need an organization token that may change apps, saved as the separate write access.