OPAL's bundle path has no signature verification
I've been reading the policy bundle code path and wanted to flag something I found, then check whether a contribution would fit.
bundle_utils.py sorts policy and data modules by the manifest, but there is no signature verification anywhere in the bundle path. The PolicyBundle schema carries manifest, hash, and old_hash - no signature field - and PolicyFetcher pulls from the OPAL server's /policy endpoint with an auth token. The HttpFetchProvider can fetch an arbitrary URL, but it hands back the raw response without verifying it.
Proposed design
A fetcher that takes a signed OPA bundle (a tarball with a .signatures.json):
- Fetch the bundle from a configured URL
- Verify the RS256 signature against a configured public key (out-of-band, not from the same server)
- Extract the data files as
JsonableValue for OPAL's data path, leaving Rego to the existing policy channel
Question
Would this fit as a community fetcher, or would you prefer signature verification inside OPAL's own bundle path instead? Happy to build either way.
As a test fixture, there's a signed bundle already published at stigmer.network/opa/bundle.tar.gz (RS256, public key at /opa/signing.pub) that a fetcher can be pointed at to verify the flow.
OPAL's bundle path has no signature verification
I've been reading the policy bundle code path and wanted to flag something I found, then check whether a contribution would fit.
bundle_utils.pysorts policy and data modules by the manifest, but there is no signature verification anywhere in the bundle path. ThePolicyBundleschema carriesmanifest,hash, andold_hash- no signature field - andPolicyFetcherpulls from the OPAL server's/policyendpoint with an auth token. TheHttpFetchProvidercan fetch an arbitrary URL, but it hands back the raw response without verifying it.Proposed design
A fetcher that takes a signed OPA bundle (a tarball with a
.signatures.json):JsonableValuefor OPAL's data path, leaving Rego to the existing policy channelQuestion
Would this fit as a community fetcher, or would you prefer signature verification inside OPAL's own bundle path instead? Happy to build either way.
As a test fixture, there's a signed bundle already published at
stigmer.network/opa/bundle.tar.gz(RS256, public key at/opa/signing.pub) that a fetcher can be pointed at to verify the flow.