Skip to content

docs: adds initial spec and plan for export functionality#431

Open
gvauter wants to merge 1 commit intocomplytime:mainfrom
gvauter:003-complybeacon-export
Open

docs: adds initial spec and plan for export functionality#431
gvauter wants to merge 1 commit intocomplytime:mainfrom
gvauter:003-complybeacon-export

Conversation

@gvauter
Copy link
Member

@gvauter gvauter commented Mar 23, 2026

Summary

  • Adds feature specification and implementation plan for a new complyctl export command that ships scan results to a ComplyBeacon OTEL collector
  • Proposes extending the plugin gRPC contract with an Export RPC so scanning providers can emit evidence directly via ProofWatch

The export command orchestrates evidence delivery without touching evidence data itself. Plugins that opt in (via a new supports_export capability on Describe) use ProofWatch to emit GemaraEvidence as OTLP log records directly to the collector. Enrichment is handled downstream by TruthBeam in the Beacon collector pipeline.

Key decisions documented in the spec:

  • Standalone commandcomplyctl export --policy-id <ID> runs after scan, keeping the two as composable steps
  • Plugins export directly — complyctl passes collector config via gRPC; plugins own OTLP emission
  • Zero new deps in complyctl core — ProofWatch/OTEL SDK only in plugins that implement Export
  • Collector config in complytime.yaml — new optional collector: section with endpoint and auth

The implementation plan breaks work into four areas: proto contract changes, plugin SDK extension, CLI command, and config/doctor additions.

Files

  • specs/003-complybeacon-export/spec.md — feature specification with clarifications, user stories, acceptance scenarios, functional requirements, and success criteria
  • specs/003-complybeacon-export/plan.md — implementation plan with project structure, proto schema, config schema, data flow, and test architecture

Review Hints

This PR is spec and plan only — no code changes. Looking for feedback on:

  1. The decision to have plugins export directly vs. complyctl exporting centrally
  2. The Export RPC contract and CollectorConfig shape
  3. Whether the supports_export capability discovery approach is sufficient
  4. Any missing edge cases or requirements

@gvauter gvauter requested a review from jpower432 March 23, 2026 23:30
@gvauter gvauter requested a review from a team as a code owner March 23, 2026 23:30
Copy link
Member

@huiwangredhat huiwangredhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gvauter Thanks for your PR. The core logic LGTM. It's a solid implementation of the proposed plan. I’ve tagged a few minor nits and my questions.

backends (Loki, S3) and reporting tools (Hyperproof).

- **ProofWatch**: A Go instrumentation library
(`github.com/complytime/complybeacon/proofwatch`) that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This library link is outdated.

An auditor needs to verify that compliance evidence in the
downstream reporting system traces back to the original
scan. The evidence exported by complyctl via ProofWatch
carries integrity attributes (assessment IDs, timestamps,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that Assessment IDs, timestamps, and Evaluator Identity could provide a sufficient Chain of Custody. To satisfy a rigorous audit, we should ensure the evidence is immutable and verifiable. Do we need to include a cryptographic hash in the results?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Sophia - this is a good question, perhaps we can table it for now and discuss more with @jpower432 to understand the chain of custody in more detail.

reports back the number of records exported and any errors.

**Why this priority**: At least one plugin must implement
export for the feature to be usable. The OpenSCAP and AMPEL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question: are both OpenSCAP and AMPEL being developed in parallel, or will AMPEL be the first plugin to support export?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which would be first, but perhaps AMPEL would be easiest to start with here?


- Q: Where does collector endpoint and authentication
configuration live? → A: `complytime.yaml` top-level
`collector` section with `endpoint` and `auth` fields.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The authtoken could be generated by the client ID and client secret dynamically, so do we need to add the two input fields?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good callout @huiwangredhat. I would think the token would generated dynamically with the client_id, client_secret, and token_endpoint, right? Then complyctl does the handshake and passes the temporary access token to the plugin which they include in the request headers along with some plugin specific identifier.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpower432, Oh, yes, that's right. We also need the token_endpoint.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thank you, I've updated this in the spec.

6. Display terminal summary:
PROVIDER EXPORTED FAILED STATUS
openscap 47 0 ✅
ampel 5 0 ✅
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it show the friendly error message if the status is FAILED?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated FR-008 to require that the plugin's error message is displayed below the summary table when failures occur


## Summary

Add a `complyctl export` command that orchestrates evidence
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this a required feature of every plugin? Seems like it would be lightweight if it were optional. Could this be an optional "output" of complyctl scan instead?

Copy link
Member Author

@gvauter gvauter Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpower432 I have no strong opinions on making it mandatory. I can't think of a plugin where we wouldn't want the evidence exported. Are you thinking we should drop the export command and instead have scan handle the export? I guess this depends how coupled we want those workflows to be? A few possible thoughts

  • initial users may not have the collector components running, so exporting isn't something they would want to happen by default (making them use --skip-export or similar flag) on every scan
  • a user may want to inspect the results before exporting? e.g. dont export failures, fix the issue, run a clean scan, then export

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I was thinking it would be something controls by a flag on scan. Right now we have --format oscal, pretty, sarif. Could we tweak that? To me, this seems like just another way to aggregate and report the information.

It could be

--export oscal,sarif,pretty,otel

Signed-off-by: George Vauter <gvauter@redhat.com>
@gvauter gvauter force-pushed the 003-complybeacon-export branch from 2ea5229 to 8be651d Compare March 25, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants