Skip to main content

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

Metadata

Release files for notarizer 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for notarizer 1.0.1
File Size Uploaded Provenance Actions
notarizer-1.0.1.tar.gz 8.2 kB Without provenance Details for notarizer-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for notarizer 1.0.1
File Interpreter ABI Platform Actions
notarizer-1.0.1-py3-none-any.whl Python 3 none any Details for notarizer-1.0.1-py3-none-any.whl

Total release size: 19.3 kB

Release files / notarizer-1.0.1.tar.gz

Download URL notarizer-1.0.1.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
37c7111826fc35edc7694a9e58df099f1dafdc512079d0d6daf24af8acb268bd
BLAKE2b-256 checksum
How to use checksums
4830476647515350acab3554edccb1604abdfb73a501b8dad29053f1cb6c7c87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Release files / notarizer-1.0.1-py3-none-any.whl

Download URL notarizer-1.0.1-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aba25377f19f1323fd8f29622f61c7664877f1809ba1f46f509b6c73af8ba116
BLAKE2b-256 checksum
How to use checksums
2710021aa3904fd99991f826d33a5e430c33bd875ec2b32c7903f40c1336a1e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Security for notarizer 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page