|
libmemalloc 0.0.0-alpha
The Magic of Memory Transmutation
|
DCO means Developer Certificate of Origin.
A DCO sign-off is a contributor certification attached to a commit message. It states that the contributor has the right to submit the contribution under the project license and understands that the contribution will be public.
The required trailer format is:
Signed-off-by: Full Name <email@example.com>
For this repository, commits authored by the project maintainer should use:
Signed-off-by: Rafael V. Volkmer <rafael.v.volkmer@gmail.com>
Add a sign-off automatically:
git commit -s -m "feat(scope): add short imperative summary"
Add a sign-off and sign the commit cryptographically:
git commit -s -S -m "fix(allocator): validate free list links"
Add a sign-off to the most recent commit:
git commit --amend -s --no-edit
Add sign-offs while replaying commits:
git rebase --signoff main
All non-merge commits submitted to protected branches should contain a valid Signed-off-by trailer.
Recommended rules:
GPG/OpenPGP signing is used to cryptographically sign Git commits and tags.
DCO sign-off and GPG signing are different:
| Mechanism | Purpose |
|---|---|
| Signed-off-by | Contributor certification and DCO intent. |
| GPG/OpenPGP commit signature | Verifies that a commit was signed by a trusted private key. |
| GPG/OpenPGP tag signature | Verifies that a release tag was signed by a trusted private key. |
git config --global user.name "Rafael V. Volkmer" git config --global user.email "rafael.v.volkmer@gmail.com"
Generate a new key when needed:
gpg --full-generate-key
List available secret keys:
gpg --list-secret-keys --keyid-format=long
Export the public key:
gpg --armor --export <KEY_ID>
The exported public key can be added to GitHub or another forge so commit and tag signatures can be verified.
Configure the signing key globally:
git config --global user.signingkey <KEY_ID> git config --global gpg.program gpg git config --global commit.gpgSign true git config --global tag.gpgSign true
Configure signing only for this repository:
git config user.signingkey <KEY_ID> git config commit.gpgSign true git config tag.gpgSign true
Signed commit with DCO:
git commit -s -S -m "feat(scope): add short imperative summary"
Signed amend with DCO:
git commit --amend -s -S --no-edit
Verify the latest commit signature:
git log --show-signature -1
Create a signed release tag:
git tag -s v1.0.0 -m "libmemalloc v1.0.0"
Verify a signed tag:
git tag -v v1.0.0
Push the signed tag:
git push origin v1.0.0
Recommended rules:
Cosign is used to sign and verify release artifacts that are not Git commits or Git tags.
Recommended artifacts to sign:
Example artifact:
dist/libmemalloc-v1.0.0.tar.gz
Create a keyless signature bundle:
cosign sign-blob \
--yes \
--bundle dist/libmemalloc-v1.0.0.tar.gz.cosign.bundle \
dist/libmemalloc-v1.0.0.tar.gz
Verify the signed blob:
cosign verify-blob \
--bundle dist/libmemalloc-v1.0.0.tar.gz.cosign.bundle \
--certificate-identity-regexp "https://github.com/RafaelVVolkmer/libmemalloc/.github/workflows/.*" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
dist/libmemalloc-v1.0.0.tar.gz
Generate a checksum:
sha256sum dist/libmemalloc-v1.0.0.tar.gz \
> dist/libmemalloc-v1.0.0.tar.gz.sha256
Sign the checksum file:
cosign sign-blob \
--yes \
--bundle dist/libmemalloc-v1.0.0.tar.gz.sha256.cosign.bundle \
dist/libmemalloc-v1.0.0.tar.gz.sha256
Example image:
ghcr.io/rafaelvvolkmer/libmemalloc:v1.0.0
Sign the image:
cosign sign --yes ghcr.io/rafaelvvolkmer/libmemalloc:v1.0.0
Verify the image:
cosign verify \
--certificate-identity-regexp "https://github.com/RafaelVVolkmer/libmemalloc/.github/workflows/.*" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/rafaelvvolkmer/libmemalloc:v1.0.0
Attach an SPDX SBOM as an attestation:
cosign attest \
--yes \
--predicate dist/sbom.spdx.json \
--type spdx \
ghcr.io/rafaelvvolkmer/libmemalloc:v1.0.0
Verify the SBOM attestation:
cosign verify-attestation \
--type spdx \
--certificate-identity-regexp "https://github.com/RafaelVVolkmer/libmemalloc/.github/workflows/.*" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/rafaelvvolkmer/libmemalloc:v1.0.0