Run Collectors
Gather evidence from GitHub, AWS, Okta, and other systems automatically.
Prerequisites
- epack installed with
-tags components - An
epack.yamlwith collectors configured - Collector credentials available either as environment variables or managed credential sets
1. Configure collectors in epack.yaml
Add collectors to your configuration file:
stream: myorg/prod credential_sets: github_repo: credset_abc123 collectors: github: source: locktivity/epack-collector-github@^0.2.0 config: organization: myorg credentials: - github_repo # For manual setups, use secrets instead: # secrets: # - GITHUB_TOKEN aws: source: locktivity/epack-collector-aws@^0.2.0 config: regions: - us-east-1 - us-west-2 secrets: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY
2. Set environment variables if needed
If you use manual secrets, export them before running collection. If you use
managed credentials, epack resolves them through the configured broker at runtime.
In a folder epack remote clone created, epack secret setup keeps the
listed variables in your keychain instead, so every terminal finds them. The environment still
wins when both are set.
export GITHUB_TOKEN="ghp_xxxxxxxxxxxx" export AWS_ACCESS_KEY_ID="AKIA..." export AWS_SECRET_ACCESS_KEY="..."
3. Run collection
Run all collectors and build the pack:
epack collect
Locking collectors... added github@v0.2.4 added aws@v0.2.3 installed github@v0.2.4 installed aws@v0.2.3 collected github collected aws Lockfile was updated. Remember to commit epack.lock.yaml Building evidence pack... ✓ Evidence pack created in 38.4s Summary: • Collectors: 2 successful • Pack size: 52.1 KB • Stream: myorg/prod ... Output: evidence-20261105-153000.epack
Collectors can also package binary evidence such as PDFs, screenshots, and archives.
epack gives each collector a private staging directory during execution and packages
emitted file entries as raw artifact bytes.
4. Sign the pack
epack sign packs/*.epack
Choose what each collector shares
Two keys in a collector's config decide what it adds to the pack. level sets how much detail
it collects. collect lists the kinds of evidence it adds.
collectors: aws: source: locktivity/epack-collector-aws@^0.7 config: level: trust collect: [cloud-posture] github: source: locktivity/epack-collector-github@^0.4 config: level: audit collect: [vcs-posture, details]
| Level | What it adds |
|---|---|
trust |
Settings, percentages, and pass or fail posture. This is the default, and it fits packs you share with customers. Normalized files leave out their counts at this level, except in the TLS and email-dns summaries. A present flag, such as members_present, says whether there is anything to count. |
audit |
Counts and per-resource breakdowns, so an auditor can see where a gap is. |
internal |
Raw detail such as user lists, for ongoing internal monitoring and review. |
Each level adds to the one before it. collect works at every level, and the level still decides what
each kind holds. A kind is the name in a schema ID, such as cloud-posture, and a collector's own detailed
file is the kind details. Without collect, a collector adds every kind its level allows.
Each artifact sits at artifacts/<collector>.<kind>.json, such as
artifacts/aws.cloud-posture.json or artifacts/aws.details.json. The collector part is the
name the collector is configured with in epack.yaml. Two copies of one collector in a pack, such as
github-acme and github-labs, therefore write different files.
A pack can hold several files of one kind, such as an access-posture file from each system's collector,
or idp-posture files from two identity providers. A profile requirement that every system must meet sets
artifacts: all. See
requirements that read every artifact of a type.
A collector can mark its detailed file audit as a whole when its normalized evidence, such as
cloud-posture, carries what profiles read. A trust pack then leaves the detailed file out, even
when collect lists it.
A kind that collect leaves out appears in the collector result as a not_shared gap. It needs no
fix and does not make the run partial. At the trust level, the collector result also leaves out the tenant ID
and every count and time, since those grow with the size of the account. It keeps retried,
status_codes, error_codes, and any_failed, which show which calls failed or were
retried. See reserved collector config keys for the rules.
Preview an upgrade
Before you move a collector to a new version, run epack shadow with that version. It runs the locked
version, the new one, and the locked version again with your config and secrets, and shows what would change. Your
lockfile does not change, and no pack is built.
epack shadow aws --version v0.7.0
Shadow run of aws at trust: locked v0.6.2, candidate v0.7.0
locked run 1 collected, run 2 collected
candidate partial (permission_denied)
Kinds
details its own file, unchanged
cloud-posture evidencepack/cloud-posture@v1, unchanged
Fields
added cloud-posture /accounts/*/threat_detection/enabled
/accounts/0/threat_detection/enabled: (none) -> true
/accounts/1/threat_detection/enabled: (none) -> false
changed cloud-posture /accounts/*/network/ssh_open_to_world_pct
/accounts/1/network/ssh_open_to_world_pct: 3 -> 4
removed cloud-posture /accounts/*/storage/storage_resource_count now audit level
/accounts/0/storage/storage_resource_count: 41 -> (none)
/accounts/1/storage/storage_resource_count: 6 -> (none)
Noise, left out because the two locked runs also differ
cloud-posture /collected_at
Gaps
new permission_denied at cloud-posture /accounts/*/database/encryption_pct
needs rds:DescribeDBInstances
Operations
new guardduty.ListDetectors needs guardduty:ListDetectors
new rds.DescribeDBInstances needs rds:DescribeDBInstances
Controls
threat-detection Threats are detected in every account: Not collected -> Needs attention
read (none) -> false
Report written to shadow-aws-v0.7.0.json. It holds no values from your account.
A field that also differs between the two locked runs, such as a timestamp, is listed as noise. The controls come from
the project's validate tool, run on a pack built from each run. The report file holds no values from your account, so
you can share it, such as in a pull request. The values in the output show only at a terminal outside CI. Add
--no-values to hide them.
When the changes look right, run epack update aws to move to the newest version the range in
epack.yaml allows. For a version outside the range, raise the range and run epack lock.
Variations
Run a single collector
epack collector run --only github
Run in CI with locked versions
Use --frozen to fail if the lockfile doesn't match:
epack collect --frozen
Update collector versions
Re-resolve all collectors to their latest matching versions:
epack lock --all-platforms
Run individual steps
The collect command runs lock → sync → run → build. You can run these separately:
epack lock # Resolve versions to digests epack sync # Download collector binaries epack collector run # Execute all collectors epack build out.pack ./artifacts/*
Related
- CLI Reference: collect, with all flags and options
- CLI Reference: shadow
- Config Reference: reserved collector config keys
- Collection Security, on how epack protects the machine and credentials a collector uses
- Automate in CI/CD, to run collectors in GitHub Actions