Sign OPA bundle
opa_bundle_signSign an OPA bundle directory or .tar.gz archive with a PEM private key, generating a .signatures.json file that enables trusted verification of the bundle.
Instructions
Sign a bundle directory or .tar.gz archive with opa sign. A directory is signed in place: .signatures.json is written into it and files are recorded as <directory name>/<file>, so the signed directory verifies wherever it is placed as long as its name is unchanged, with opa_bundle_verify or with opa build or opa run --bundle <name> from its parent. For an archive the signature is written beside it, into outputDir or the archive's own directory, and the archive is not modified; a signed archive comes from opa_bundle_build with signingKey. The key is a PEM private key (RSA or ECDSA); for HMAC algorithms pass a file holding the secret. Extra claims such as keyid and scope come from claimsFile. Returns the path written, the algorithm, and the number of files covered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bundle | Yes | Path to a bundle directory or `.tar.gz` archive. Must be inside an allowed root. | |
| outputDir | No | For an archive, the directory that receives `.signatures.json`; defaults to the archive's own directory. Must exist and be inside an allowed root. Not accepted for a directory bundle, which is signed in place. | |
| claimsFile | No | Path to a JSON file of extra claims to sign, such as {"keyid": "...", "scope": "..."}. Must be inside an allowed root. | |
| signingAlg | No | Signing algorithm: RS256 (default), RS384, RS512, PS256, PS384, PS512, ES256, ES384, ES512, HS256, HS384, HS512. | |
| signingKey | Yes | Path to the PEM private key (RSA or ECDSA), or for HMAC algorithms a file holding the secret. Must be inside an allowed root. |