Skip to content

LeanIX EAM Executor

Category: Asset Inventory and Network Management Script: leanix_eam.py Integration: REST API (OAuth2) Faraday Plugin: Raw JSON Website: https://www.leanix.net

Description

Imports the fact sheets (applications, IT components, business capabilities and other EAM records) of a LeanIX workspace into Faraday as an asset inventory. Each fact sheet becomes a host with one informational entry.

Prerequisites

  • A LeanIX workspace
  • A LeanIX API token of a technical user (Administration > Technical Users) that can read fact sheets

Configuration

Environment Variables (Setup)

Variable Required Description
LEANIX_HOST No LeanIX host URL (default: https://app.leanix.net). Use your regional or tenant URL if it differs.
LEANIX_API_TOKEN Yes API token of the LeanIX technical user

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

Execution Arguments

Parameter Type Mandatory Description
LEANIX_WORKSPACE_ID string No Workspace ID or slug (e.g., acme-prod) to import from. Default: the workspace the token belongs to.
LEANIX_FACTSHEET_TYPE string No Only import fact sheets of this type, in PascalCase (e.g., Application, ITComponent, BusinessCapability). Default: all types.

YAML Configuration Example

executors:
  leanix_eam:
    repo_executor: leanix_eam.py
    max_size: 65536
    varenvs:
      LEANIX_HOST: "https://app.leanix.net"
      LEANIX_API_TOKEN: "<leanix_api_token>"
    params:
      LEANIX_WORKSPACE_ID:
        mandatory: false
        type: string
        base: string
      LEANIX_FACTSHEET_TYPE:
        mandatory: false
        type: string
        base: string

How It Works

  1. Exchanges LEANIX_API_TOKEN for a bearer token at {LEANIX_HOST}/services/mtm/v1/oauth2/token (HTTP Basic with apitoken as username, client credentials grant)
  2. Reads GET /services/pathfinder/v1/factSheets page by page (100 per page, up to 200 pages), filtered by LEANIX_WORKSPACE_ID and LEANIX_FACTSHEET_TYPE when set
  3. Creates one host per fact sheet, named after its display name, with the operating system field set to LeanIX <type> (e.g., LeanIX Application)
  4. Adds one vulnerability with severity info to each host. It holds the fact sheet ID, status, completion, tags and a link to the fact sheet in LeanIX.

Notes

  • The vulnerabilities are inventory entries, not security findings. Their severity is always info.
  • Every host has IP 0.0.0.0, because fact sheets are not network endpoints.
  • If no fact sheets are returned, the executor creates one placeholder host that records the empty result.
  • LEANIX_WORKSPACE_ID and LEANIX_FACTSHEET_TYPE are validated. An invalid value (for example a type that is not alphanumeric) stops the run.
  • The setup variables can also be passed as execution arguments.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.