A configuration service that provides cryptographically signed tokens containing Woodpecker CI build and repository information, enabling plugins to verify pipeline details like repository name, branch, and build information.
When building Woodpecker CI plugins that need to trust pipeline information (like repository name, current branch, or build details), relying on environment variables isn't always secure as they can be modified by pipeline steps. This service solves this problem by providing cryptographically signed tokens that plugins can verify, ensuring the authenticity of pipeline information they depend on.
The service is configured using the following environment variables:
JWT_PRIVATE_KEY
: Ed25519 private key in PEM format used to sign the JWTsLISTEN_ADDR
: Address where the service should listen (e.g.,:8080
orlocalhost:8080
)
WOODPECKER_SIGNATURE_PUBLIC_KEY
: Ed25519 public key in PEM format used to verify incoming Woodpecker requests. Can be retrieved fromhttps://your-woodpecker-instance/api/signature/public-key
. Required unless signature verification is disabled.WOODPECKER_SIGNATURE_NOVERIFY
: Set to1
to disable signature verification of incoming requests. See Security Considerations before disabling.JWT_EXPIRATION_TIME
: JWT expiration time in minutes. Defaults to 15 minutes if not specified.
The service injects the following environment variables into each pipeline step:
WOODPECKER_SIGNED_REPO
: JWT containing repository informationWOODPECKER_SIGNED_BUILD
: JWT containing build information
The payload of these JWTs corresponds to Woodpecker's repository and pipeline models. For detailed information about the payload structure, refer to:
- Repository payload: model.Repo
- Pipeline payload: model.Pipeline
- The service must be configured with a private key to sign JWTs. Keep this key secure and rotate it periodically.
- By default, the service verifies that requests come from your Woodpecker instance using Ed25519 signatures.
- IMPORTANT: If signature verification is disabled (
WOODPECKER_SIGNATURE_NOVERIFY=1
), the service MUST NOT be accessible from pipeline steps. In this configuration, any access to the service would allow obtaining signed tokens for any repository or build. - The JWT expiration time should be set short enough to minimize the risk of token reuse while being long enough to accommodate your longest pipeline runs.
- Generate an Ed25519 key pair for JWT signing
- Deploy this service with the appropriate environment variables
- Configure your Woodpecker server to use this service by setting
WOODPECKER_CONFIG_SERVICE_ENDPOINT
to point to this service's URL (do not forget the/ciconfig
part)