contract

module
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: Apache-2.0

README

contract

github.com/openctemio/contract holds the contracts between the OpenCTEM platform and its sensors: what a sensor can do, which options a tool takes, how settings are signed and layered, how a run reports its outcome, how politely it treats a target, and how scan data moves between them.

It is not a data format. The data format is CTIS, a pure document standard. The packages here are the orchestration side: the platform and the sensor SDK import them; a producer that only writes CTIS documents does not need them.

The root module has no dependencies outside the Go standard library (CI checks this).

Packages

Package What it is
capability The capability taxonomy: phases, typed ports, tier floors, standard params, and the output each capability must produce. Check tests a decoded CTIS document against a capability's contract.
tooloption The shared vocabulary of tool execution options (timeout, rate, concurrency, retries), defined once for tools, the sensor SDK and the platform.
settings The tool settings contract: the schema a tool declares for its configuration, and the layered values a scan runs with.
outcome The per-target outcome of a scan task: how each target ended, so the platform settles finished targets and hands out only the rest.
politeness The per-host politeness keys of scan work: which hosts a job touches and when two jobs conflict.
edgeprotect Recognises answers that came from an edge protection (CDN or WAF) instead of the service.
addrscope The one definition of an internal network address a shared scanner must never reach.
secretref How a secret reaches a tool a sensor runs: the secret refs a signed job carries (kind, class, slot, audience, local policy), the sealed per-task fetch (request, answer, HPKE info), the value shapes and their validators, and the registry of third-party providers with the hosts each key may be sent to.
source Where the code of a platform code scan comes from: repository, branch and exact commit.
transfer A separate Go module, github.com/openctemio/contract/transfer: downloads files from an ordered list of origins, and the signed bundle format. It is separate because it depends on the Prometheus client, which the root module must not.

Relation to CTIS

Asset type names in capability (the AssetType constants and the carries lists of the port types) follow CTIS 2.0. This module does not import CTIS. A parity test in the platform checks these names, and the JSON paths the capability rules require, against the CTIS 2.0 schema; it is not repeated here. When CTIS adds an asset type, add the constant here and update the parity test.

capability.Check takes the decoded JSON form of a CTIS document (map[string]any), so no CTIS Go types are needed.

Versioning

Semantic versioning, tags vX.Y.Z. The sensors and the platform are upgraded together; there is no compatibility promise across major versions.

Contributing

See CONTRIBUTING.md. The OpenCTEM Contributor License Agreement applies. Report security issues as in SECURITY.md.

License

Apache-2.0, see LICENSE.

Directories

Path Synopsis
Package addrscope is the one definition of an internal network address: an address a scanner that serves several organizations from an operator's network must never reach.
Package addrscope is the one definition of an internal network address: an address a scanner that serves several organizations from an operator's network must never reach.
Package capability is the OpenCTEM capability taxonomy: the closed, versioned list of acts a scan tool can perform ("scan.ports@1", "probe.http@1", ...), and the contract every implementation of an act honors.
Package capability is the OpenCTEM capability taxonomy: the closed, versioned list of acts a scan tool can perform ("scan.ports@1", "probe.http@1", ...), and the contract every implementation of an act honors.
Package edgeprotect recognizes when the answer to a request came from an edge protection (a CDN or WAF) in place of the service: a challenge page, a block page, a rate limit, or only the edge fronting real content.
Package edgeprotect recognizes when the answer to a request came from an edge protection (a CDN or WAF) in place of the service: a challenge page, a block page, a rate limit, or only the edge fronting real content.
Package outcome is the per-target outcome of a scan task: how each of the task's targets ended.
Package outcome is the per-target outcome of a scan task: how each of the task's targets ended.
Package politeness is the one definition of the per-host politeness keys of scan work: which hosts a job sends traffic to, and when two jobs touch the same host.
Package politeness is the one definition of the per-host politeness keys of scan work: which hosts a job sends traffic to, and when two jobs touch the same host.
Package secretref is the one definition of how a secret reaches a tool a sensor runs for the platform: the references a signed job carries, the per-task fetch that turns them into values, and the rules every value must meet.
Package secretref is the one definition of how a secret reaches a tool a sensor runs for the platform: the references a signed job carries, the per-task fetch that turns them into values, and the rules every value must meet.
Package settings is the tool settings contract: what a scan tool lets an administrator configure, declared as a small JSON Schema in the "config" of its tool manifest, and the layered values a scan runs with.
Package settings is the tool settings contract: what a scan tool lets an administrator configure, declared as a small JSON Schema in the "config" of its tool manifest, and the layered values a scan runs with.
Package source is the one definition of where the code of a platform code scan comes from: a repository, a branch and the exact commit to scan.
Package source is the one definition of where the code of a platform code scan comes from: a repository, a branch and the exact commit to scan.
Package tooloption is the shared vocabulary of tool execution options: the few knobs almost every scan tool has (per-request timeout, request rate, concurrency, retries), defined once so that every tool, the sensor SDK and the platform mean the same thing by each name.
Package tooloption is the shared vocabulary of tool execution options: the few knobs almost every scan tool has (per-request timeout, request rate, concurrency, retries), defined once so that every tool, the sensor SDK and the platform mean the same thing by each name.
transfer module
Package webpath is the one reading of a web request path shared by the platform and the sensor: how a server sees a path (CleanPath), whether a path falls under an excluded path (Denied) or an allowed prefix (Under), and whether a path names a state-changing action (Destructive).
Package webpath is the one reading of a web request path shared by the platform and the sensor: how a server sees a path (CleanPath), whether a path falls under an excluded path (Denied) or an allowed prefix (Under), and whether a path names a state-changing action (Destructive).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL