Skip to main content

APIsec Surface org scan

Scans the repositories in your GitHub organization every night with APIsec Surface and uploads the results to APIsec. Only repositories pushed to since the last scan are analyzed.

It runs in your organization, on your runners, with your secrets. Only the Surface analysis results are sent to APIsec.

Setup

  1. Create a repository in your org from the template (Use this template), or create any repository and add templates/apisec-scan.yml as .github/workflows/apisec-scan.yml.

  2. Add secrets (Settings → Secrets and variables → Actions, at org or repository level):

    Secret Value
    APISEC_TOKEN APIsec personal access token
    ORG_READ_TOKEN Fine-grained GitHub PAT for the org with Contents: read and Metadata: read
  3. Add the variable APISEC_ENDPOINT with your APIsec API URL, e.g. https://api.apisecapps.com.

  4. Actions → APIsec Surface org scan → Run workflow. Optionally enable dry_run first to verify setup (repos are analyzed locally; nothing is uploaded to APIsec).

  5. Run without dry_run to upload results. After that, scans run nightly at 02:00 UTC.

For a first scan of a large org, set max_repos (e.g. 100) and run until the plan is empty.

Optional variables

Variable Default Purpose
THROUGHPUT 2 Repositories scanned in parallel (1–10)
ORCHESTRATOR_RUNNER github-hosted self-hosted runs every job on runners labelled self-hosted and apisec
APISEC_RUN_PROFILE surface legacy publishes only a committed OpenAPI contract
TARGET_ORG this org Scan a different org
EXCLUDE_REPOS Comma-separated owner/repo names to skip
APISEC_LLM_ENRICHMENT on 0 keeps source snippets out of LLM-assisted route discovery
APISEC_CLI_VERSION pinned Override the Surface CLI version

Self-hosted runners need Python 3.10+, git, and outbound access to GitHub, PyPI and APISEC_ENDPOINT.

Updates

Your workflow calls scan.yml@v1. Each release moves v1, so fixes reach you on the next nightly run with no change on your side. Breaking changes ship as v2. To control updates yourself, replace @v1 with a release tag such as @v1.0.0.

Organizations that only allow their own workflows

If your org policy blocks workflows from apisec-inc, use templates/apisec-scan-standalone.yml instead. It runs the same jobs inline and installs the latest apisec-orgscan 1.x from PyPI on each run, so fixes still arrive without editing it. Setup is otherwise identical.

Moving from the zip version

Either way, applications in APIsec are matched by each scanned repository's GitHub id, so no duplicates are created.

  • Start fresh: delete the old orchestrator repository and follow Setup. The first run rescans every repository once.
  • Keep your repository: replace .github/workflows/orchestrator.yml with templates/apisec-scan.yml and delete scripts/. Secrets, variables and the record of scanned repositories carry over, so nothing is rescanned.

If APIsec created applications for your repositories from OpenAPI specs before you used this workflow, ask APIsec to link them to their repositories before the first full scan.

Development

pip install -e ".[dev]"
ruff check . && ruff format --check . && pytest

src/apisec_orgscan holds the logic (plan, scan, record, merge); .github/workflows/scan.yml holds the GitHub-only parts (matrix fan-out, runners, artifacts).

Releasing

  1. Set __version__ in src/apisec_orgscan/__init__.py and run python scripts/sync_templates.py (pins the workflow and regenerates the standalone template).
  2. Merge, then push tag vX.Y.Z. The release workflow tests, publishes to PyPI and moves vX.

Tags such as v1.1.0rc1 publish a pre-release without moving v1; point a test caller at that tag.

Metadata

Release files for apisec-orgscan 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apisec-orgscan 1.0.0
File Size Uploaded Provenance
apisec_orgscan-1.0.0.tar.gz 20.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for apisec-orgscan 1.0.0
File Interpreter ABI Platform
apisec_orgscan-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.1 kB

Release files / apisec_orgscan-1.0.0.tar.gz

Download URL apisec_orgscan-1.0.0.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aa9328e6ef736a6a34bb19c2e7cf281e9e7976b9cbe564c600f2bb5418d737e8
BLAKE2b-256 checksum
How to use checksums
6e195cbe594f4e87ee9eca8d0fd011444bf162e2b44b0b5e7443ae20310d9662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / apisec_orgscan-1.0.0-py3-none-any.whl

Download URL apisec_orgscan-1.0.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5129b2fd97518d26dd008d00e219baf7bd0b1b5db7ae8b7fa0a8cbdc1a6c5f0b
BLAKE2b-256 checksum
How to use checksums
5656f0b02f6c10ec52e6bd0b5c73a6b018a7a22c64b36a2a5142c7e3926ba3fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for apisec-orgscan 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for apisec_orgscan-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page