-
Notifications
You must be signed in to change notification settings - Fork 797
NIST artifact signing #11723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
katarzyna-koltun-mx
wants to merge
1
commit into
development
Choose a base branch
from
kk-nist10
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+115
−0
Open
NIST artifact signing #11723
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| --- | ||
| title: "Accessing Artifacts and Verifying the Signature" | ||
| url: /private-mendix-platform/access-artifacts/ | ||
| description: "Documents the artifacts signing and verification for the Private Mendix Platform." | ||
| weight: 21 | ||
| --- | ||
|
|
||
| ## Introduction | ||
|
|
||
| To satisfy various regulatory requirements, all container images, Helm charts and artifacts downloaded from the Private Mendix Platform download portal need to be signed. Private Mendix Platform stores them in the Mendix central OCI (Open Container Initiative) registry (`registry.mendix.com`). | ||
|
|
||
| ## Getting Access to the Mendix Central OCI Registry | ||
|
|
||
| The Mendix central OCI registry uses Personal Access Token (PAT) for authentication, and only approved Private Mendix Platform customers can access it. To create your PAT, perform the following steps: | ||
|
|
||
| 1. Sign in to [Mendix](https://home.mendix.com/) | ||
| 2. Click **User Settings > Developer Settings > Personal Access Token** | ||
| 3. Click **New Token** | ||
| 4. In the **OCI registry** section, select `mx:registry:access`. | ||
| 5. Dependsing on what OCI tools you use, use a command like the following to log in to the registry. | ||
|
|
||
| Most OCI tools store the credentials in a local `~/.docker/config.json` file. After logging in, you can use all tools without any further logins. | ||
|
|
||
| ```text | ||
| # docker for images | ||
| $ docker login -u pat -p ${YOUR_PAT} registry.mendix.com | ||
|
|
||
| # helm for helm charts | ||
| $ helm [command] --username pat --password ${YOUR_PAT} oci://registry.mendix.com/${HELM_CHART_PATH}:${HELM_CHART_VERSION} | ||
|
|
||
| # oras for any files | ||
| $ oras login -u pat -p ${YOUR_PAT} registry.mendix.com | ||
|
|
||
| # crane | ||
| $ crane auth login -u pat -p ${YOUR_PAT} registry.mendix.com | ||
|
|
||
| # cosign for signatature | ||
| $ cosign login -u pat -p ${YOUR_PAT} registry.mendix.com | ||
| ``` | ||
|
|
||
| ## Artifacts Signing and Verification | ||
|
|
||
| Private Mendix Platform uses cosign to sign OCI container images, Helm charts and any other artifacts stored in the Mendix central registry (`registry.mendix.com`). | ||
|
|
||
| Files stored in the Mendix CDN (`cdn.mendix.com`) are also signed, but with a different cosign subcommand. | ||
|
|
||
| ### Mendix Central Registry | ||
|
|
||
| Private Mendix Platform images, Helm charts, and some other CLI tools are published to central registry in a Gitlab CI pipeline. According to the OCI spec, every artifacts is identified by its sha256 hash (image digest). The image's sha256 digest is based on the image contents and is validated by OCI registries. Uploading an image that does not match its sha256 digest is not possible - the container registry will reject the upload. | ||
|
|
||
| Firstly, a CI job builds a container image and records the resulting image's sha256 digest. | ||
|
|
||
| After that, a follow-up signing job uses the following command to sign the image's sha256 digest with a Mendix private signing key: | ||
|
|
||
| ```text | ||
| cosign sign --key "$COSIGN_PRIVATE_KEY" registry.mendix.com/${IMAGE_PATH}:${IMAGE_TAG} | ||
|
|
||
| Any image signed this way can be verified by running below command (${IMAGE_TAG} can be the image’s sha256 digest or tag). | ||
|
|
||
| cosign verify --key "$COSIGN_PUBLIC_KEY" registry.mendix.com/${IMAGE_PATH}:${IMAGE_TAG} | ||
| ``` | ||
|
|
||
| To obtain the public signing key, contact the Mendix Support team. | ||
|
|
||
| Depending on the type of artifact, you can obtain them through commands such as the following: | ||
|
|
||
| ```text | ||
| # docker for images | ||
| $ docker pull registry.mendix.com/${IMAGE_PATH}:${IMAGE_TAG} | ||
|
|
||
| # helm for helm charts | ||
| $ helm [pull|install|upgrade] oci://registry.mendix.com/${HELM_CHART_PATH} --version ${HELM_CHART_VERSION} | ||
|
|
||
| # oras for files | ||
| $ oras pull registry.mendix.com/${PATH}:${TAG} | ||
|
|
||
| # crane for all types | ||
| $ crane pull registry.mendix.com/${PATH}:${TAG} ${LOCAL_FILE_NAME} | ||
| ``` | ||
|
|
||
| ### CDN Files | ||
|
|
||
| Some components, such as the Private Mendix Platform installer, are provided as downloadable packages in the Private Mendix Platform Download Portal. Those files are stored in the Mendix CDN. Any artifacts available on that portal are signed using the following command: | ||
|
|
||
| ```text | ||
| cosign sign-blob --key "$COSIGN_PRIVATE_KEY" --bundle $FILE.sig https://cdn.mendix.com/$FILE | ||
| ``` | ||
|
|
||
| The `$FILE.sig` file is distributed together with any downloadable files and can be used to verify the signature by using the following command: | ||
|
|
||
| ```text | ||
| cosign verify-blob --key "$COSIGN_PUBLIC_KEY" --bundle $FILE.sig https://cdn.mendix.com/$FILE | ||
| ``` | ||
|
|
||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the original draft, there was the following line here: "These CDN files may be transferred to central registry in the future. In that case, user need oras tool to download them." I removed it - if this is actually implemented, we'll need to update the doc anyway. |
||
| ## Known Limitations | ||
|
|
||
| * When Private Mendix Platform builds an image of an Mendix app, the image is not signed. | ||
|
|
||
| The build happens within the customer's secure environment. Mendix is only responsible for signing artifacts generated by Mendix. | ||
|
|
||
| * The following artifacts downloaded from Private Mendix Platform are not signed through cosign: | ||
|
|
||
| * Studio Pro - This is signed through standard desktop software signing (that is, the standard signing process for Microsoft or Apple). | ||
| * Studio Pro patch files | ||
| * mxpc-cli | ||
|
|
||
| * For bundles from the Private Mendix Platform download portal, the customer selects the components from the Private Mendix Platform download portal, and creates a new bundle. The bundle is created dynamically and is not signed when downloaded. | ||
|
|
||
| ## Read More | ||
|
|
||
| * [Docker](https://www.docker.com/) | ||
| * [Helm](https://helm.sh/) | ||
| * [oras](https://github.com/oras-project/oras) | ||
| * [crane](https://github.com/google/go-containerregistry) | ||
| * [cosign](https://github.com/sigstore/cosign) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [vale] reported by reviewdog 🐶
[Microsoft.Ordinal] Don't add -ly to an ordinal number.