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
-
Create a repository in your org from the template (Use this template), or create any repository and add
templates/apisec-scan.ymlas.github/workflows/apisec-scan.yml. -
Add secrets (Settings → Secrets and variables → Actions, at org or repository level):
Secret Value APISEC_TOKENAPIsec personal access token ORG_READ_TOKENFine-grained GitHub PAT for the org with Contents: read and Metadata: read -
Add the variable
APISEC_ENDPOINTwith your APIsec API URL, e.g.https://api.apisecapps.com. -
Actions → APIsec Surface org scan → Run workflow. Optionally enable dry_run first to verify setup (repos are analyzed locally; nothing is uploaded to APIsec).
-
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.ymlwithtemplates/apisec-scan.ymland deletescripts/. 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
- Set
__version__insrc/apisec_orgscan/__init__.pyand runpython scripts/sync_templates.py(pins the workflow and regenerates the standalone template). - Merge, then push tag
vX.Y.Z. The release workflow tests, publishes to PyPI and movesvX.
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)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| apisec_orgscan-1.0.0.tar.gz | 20.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.