Usage¶
ts-obom follows the command conventions of ts-scan: verbs as sub-commands, -o/--output and -f/--format for results, --<front-end>:<option> for front-end specific switches, a profile based config file and an optional tsproject.toml in the scanned directory. If you know ts-scan, ts-obom will feel familiar.
Scan¶
The scan command searches one or more directories for infrastructure-as-code sources, builds the resource graph and extracts the IAM access grants.
Every directory produces one result document. Directories are scanned recursively by the IaC front-ends; a file argument is treated as its parent directory.
The -f <output format> option controls the output format and can be:
ts- the scanner's own JSON format (default), one document per scanned directory, see Result formatcyclonedx- a CycloneDX 1.6 Operations BOM. This is the format the TrustSource platform stores, and the onets-obom uploadsends. A CycloneDX document describes exactly one subject, so this format takes exactly one source directory:
dot- a Graphviz digraph of the access graph, one cluster per scanned directory. Render it with Graphviz, for example:
Without -o the result is printed to standard output.
Options¶
Front-end specific options are prefixed with the front-end name, like package manager options in ts-scan:
--cloudformation:ignore- Skip CloudFormation and AWS SAM templates--terraform:ignore- Skip Terraform and OpenTofu sources (OpenTofu is handled by theterraformfront-end; the two share the HCL language)
General options:
--cloudformation:parameters <FILE>- Applies a CloudFormation parameter file on top of the template defaults--terraform:var-file <FILE>- Applies a.tfvarsfile on top of the variable defaults, asterraform -var-filewould--deployment <NAME>- Names the deployment this OBOM describes: an environment (DEV,PRD) or a customer setup (kunde1). See Deployments and parameters--tag <TAG>- Stores the SCM tag<TAG>in the result--branch <BRANCH>- Stores the SCM branch<BRANCH>in the result--verbose- Enables verbose mode
User settings¶
Defaults are read from a TOML config file with profiles. The default location is ~/.ts-obom/config and the file is created on first run with an empty default profile.
ts-obom -p ci scan ...selects theciprofilets-obom --config <path> scan ...uses a different config file- environment variables prefixed with
TS_OBOM_override options, for exampleTS_OBOM_SCAN_OUTPUT_PATH=obom.jsonorTS_OBOM_UPLOAD_API_KEY=..., which is how a CI job passes the key without putting it on the command line - a
tsproject.tomlin a scanned directory provides per-project defaults with the same keys
The prefix deliberately differs from ts-scan's TS_ so that both tools can be configured side by side in the same CI job without one picking up the other's variables.
Scan exit codes¶
0- scan completed, including the case that no IAM grants were found2- usage error (no sources given, or-f cyclonedxwith more than one source) or the vendored graph builder's dependencies are missing
What the scan does not do¶
- It does not call any cloud API. Managed policies referenced by ARN (
arn:aws:iam::aws:policy/...) are reported underunresolvedrather than expanded. - It does not run
terraform initortofu init. Remote modules are not downloaded; local modules are followed. - It does not evaluate conditions, permission boundaries or SCPs. The graph is the declared intent, not the effective permission.
Next¶
- Deployments and parameters — describing one environment or customer setup rather than the sources' defaults
- Result format — what the two output formats contain
- Transferring to TrustSource — uploading a CycloneDX OBOM to the platform