Skip to content

OpsLevel Executor

Category: Asset Inventory and Network Management Script: opslevel.py Integration: GraphQL API Faraday Plugin: Raw JSON Website: https://www.opslevel.com

Description

Imports the service catalog of an OpsLevel account into Faraday as an asset inventory. Each OpsLevel service becomes a host with one informational entry that holds its tier, lifecycle, owner and links.

Prerequisites

  • An OpsLevel account with an API token (created in the OpsLevel console under Account Settings, API Tokens) that can read services
  • Network access to app.opslevel.com, or to your own OpsLevel host

Configuration

Environment Variables (Setup)

Variable Required Description
OPSLEVEL_TOKEN Yes OpsLevel API token
OPSLEVEL_HOST No OpsLevel URL (default: https://app.opslevel.com). Set it for EU or self-hosted deployments.

These variables are also accepted as execution arguments, so a single run can override them.

Execution Arguments

Parameter Type Mandatory Description
OPSLEVEL_TIER string No Only import services of this tier, for example tier_1. Values such as 1 or t1 are accepted (default: all tiers).
OPSLEVEL_LIFECYCLE string No Only import services in this lifecycle alias, for example beta or general_availability (default: all lifecycles)

YAML Configuration Example

executors:
  opslevel:
    repo_executor: opslevel.py
    max_size: 65536
    varenvs:
      OPSLEVEL_TOKEN: "<opslevel_token>"
      OPSLEVEL_HOST: "https://app.opslevel.com"
    params:
      OPSLEVEL_TIER:
        mandatory: false
        type: string
        base: string
      OPSLEVEL_LIFECYCLE:
        mandatory: false
        type: string
        base: string

How It Works

  1. Sends GraphQL queries to {OPSLEVEL_HOST}/graphql with the token as a Bearer credential, asking for account.services, filtered by tier and lifecycle if set
  2. Follows the cursor pagination, 100 services per page, until there are no more pages
  3. Creates one host per service, with its aliases as hostnames and its type, tier, lifecycle, owner and timestamps in the description
  4. Adds one vulnerability to each host, named [ASSET-INVENTORY] OpsLevel <type>: <service>, with the service details and OpsLevel link as references

Notes

  • Hosts have IP 0.0.0.0, because services are catalog entries rather than network endpoints.
  • The vulnerabilities are inventory records, not findings. Their severity is always info, and the tier and lifecycle are added as tags.
  • If the query returns no services, the executor creates one empty placeholder host.
  • A 401 response stops the run. Rate limits (429), 403 and GraphQL errors stop pagination and keep what was already read.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.