Skip to main content

Notarizer is a tool that provides a way of verifying the authenticity of docker images.

Project description

Notarizer

The following tool provides a way of verifying the authenticity of docker images. By providing a digital signature that gives a strong reason to believe that the image was created by a known source and was not altered. The following signature is generated by the content of the docker image history.

How does Notarizer work?

Notarizer signs each parent image with a private key and place that signature in a docker label LABEL signature=.... The signature contents are obtained through the docker history command. With this command it is possible to verify if the label exists and validate if the image has a digital signature.

Usage

Basic commands that are available in Notarizer.

Sign

python notarizer/cli.py sign -i image_name:image_tag -p private-key.pem

Options:

  • -i or --image: the image name to verify in the format image_name:image_tag. This option is required with at least one image and it can be used multiple times to validate multiple images at the same time.
  • -p or --private-key: represents the path where the custom private key will be placed.
  • -s or --signature-label: represents the custom label name given in the signature. Defaults to signature if the flag is not used.

Verify

python notarizer/cli.py verify -i "image_name:image_tag" -p "public-key.pub"

Options:

  • -i or --image: the image name to verify in the format image_name:image_tag. This option is required with at least one image and it can be used multiple times to validate multiple images at the same time.
  • -p or --public-key: represents the path where the custom public key will be placed.
  • -s or --signature-label: represents the custom label name given in the signature used in the sign command. Defaults to signature if the flag is not used.

Exit Codes

After the validation runs the following exit codes are thrown:

- 0  - Verification OK / Signature OK
- 1  - Generic error
- 10 - No Signature Found
- 11 - Invalid Image Signature
- 12 - Verification Failure
- 13 - No Public Key Provided
- 14 - Image Not Found
- 15 - No Private Key Provided
- 16 - Error Creating Signed Docker Image

If there's more than one error on the run (for instance if the verification runs for several images) the exit code will be from the first error found. Although, on the output it's provided the list of all errors found during the run.

Generate Private and Public Key

openssl genpkey -algorithm RSA -out private-key.pem -aes-256-cbc -pkeyopt rsa_keygen_bits:4096
openssl rsa -in private-key.pem -pubout -out public-key.pub

Contributing

  1. Fork this repository
  2. Follow project guidelines
  3. Do your stuff
  4. Open a pull request following conventional commits

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notarizer-0.1.352b15.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notarizer-0.1.352b15-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file notarizer-0.1.352b15.tar.gz.

File metadata

  • Download URL: notarizer-0.1.352b15.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for notarizer-0.1.352b15.tar.gz
Algorithm Hash digest
SHA256 7eb37edbee85af12a76ccc32b8bbcd40fb25802876c55be6de8968814cf2612c
MD5 e2d93f5556c4bf5d0b91972d422a4127
BLAKE2b-256 e1267b942d80edce6e871f5c9e9fe93cef57229572cc81de3369a40ac9d468bc

See more details on using hashes here.

File details

Details for the file notarizer-0.1.352b15-py3-none-any.whl.

File metadata

  • Download URL: notarizer-0.1.352b15-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for notarizer-0.1.352b15-py3-none-any.whl
Algorithm Hash digest
SHA256 0cf2701ad0fd8aa3be407347775c0df06ab97cdeb95116732115aedcb45d9d78
MD5 d9590640a38edf659c353faffe316b5e
BLAKE2b-256 b0e7fde46e68dd53723d03d947f3b9e1dabb7a530949a8619b8bc0a5a94eeb62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page