You can optionally sign your configuration file to verify authenticity and prevent tampering. This is useful if your repository is public and you need to prevent unauthorized changes to your configuration.
If a user modifies the configuration and signature verification fails, the pipeline is blocked pending manual approval by an authorized user with write or administrative access to the repository.
To enforce signature verification you need to enable Protected mode for your repository. Navigate to your repository Settings screen and check the Protected checkbox.
Signatures are stored in the Yaml configuration file as a
signature resource. The signature resource provides an hmac signature of your configuration.
2 kind: pipeline
3 type: docker
4 name: default
7 - name: build
8 image: golang
10 - go build
11 - go test
14 kind: signature
15 hmac: F10E2821BBBEA527EA02200352313BC059445190
The contents of each yaml resource, excluding any existing signature resources, are signed using a 256-bit secret key. The secret key is unique per-repository, and never leaves the Drone server.
The signature is created using the Drone command line utility. This command makes an authenticated request to the Drone server, posting your yaml configuration file, to calculate and return the hmac signature.
$ drone sign octocat/hello-world --save