-
Notifications
You must be signed in to change notification settings - Fork 19
chore: Create and rework docs for topic Security & Trust #731
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
morri-son
wants to merge
44
commits into
open-component-model:main
Choose a base branch
from
morri-son:create-new-security-docs
base: main
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.
Open
Changes from 12 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
1c9e785
add new how-tos and concept
morrison-sap a3b0fb1
adopt existing guides to how-to design and move to different folder
morrison-sap 001e4d2
rework tutorial in diataxis format
morrison-sap f19bed5
add guide to configure crendentials for OCM controllers
morrison-sap 70a82af
correct linter issues
morrison-sap b5a98ef
correct linter issues
morrison-sap 8f92710
correct linter issues
morrison-sap 4721578
correct spellcheck issues
morrison-sap b20b464
correct linter issues
morrison-sap fb37a0d
merge from upstream/main
morrison-sap 51f5b25
adopt better to diataxis: move best practices from concept to tutoria…
morrison-sap 7b303e6
rebase
morrison-sap 1d5870b
correct broken links
morrison-sap 3e276de
correct broken links
morrison-sap 88d688c
update hugo
morrison-sap 8bd0cf1
correct linter issues
morrison-sap 08b3fed
correct linter issues
morrison-sap a0cd980
Merge branch 'main' into create-new-security-docs
matthiasbruns 863a944
Merge remote-tracking branch 'upstream/main' into create-new-security…
morrison-sap 4ef9aae
correct order of docs, now starting with weight=1 gor the first doc o…
morrison-sap 0df5847
Merge branch 'create-new-security-docs' of github.com:morri-son/ocm-w…
morrison-sap 294479d
restore key pair creation
morrison-sap a6bcfdc
add callout for sigstore support and change version for jsonNormalisa…
morrison-sap b80de4d
change order
morrison-sap 0b28a10
Merge remote-tracking branch 'upstream/main' into create-new-security…
morrison-sap 1ae9c35
remove hugo update from this PR
morrison-sap c2697e6
remove hugo update from this PR
morrison-sap 494ce80
replace `~` with $HOME everwhere. Use example component from getting …
morrison-sap 62d2ad2
correct docs and integrate feedback from reviewers.
morrison-sap 0aca291
move tutorial to correct ocm cli v2 commands and test.
morrison-sap 5b1ff09
add back link to json normalization in the ocm spec.
morrison-sap ae43a39
add reference for consumer identities and link it from the other docs.
morrison-sap 465cd05
update with decriptor
morrison-sap 9221dd9
add signatureEncodingPolicy section and explain Plain vs. PEM
morrison-sap 51ca1eb
Apply suggestions from code review
morri-son 27c7c6f
hide large decriptor example behind {{< details >}} section
morrison-sap b5b2ca6
Merge branch 'main' into create-new-security-docs
morri-son 89b8d0c
Merge remote-tracking branch 'upstream/main' into create-new-security…
morrison-sap b596ea0
integrate commenbts from review
morrison-sap c923437
switch back to "~" for crdnetials that touch repositories
morrison-sap 607f1db
Update content/docs/concepts/signing-and-verification-concept.md
morri-son 3e5ee09
cleanup inconsistencies in paths for keys. Correct cleanup of tmp fol…
morrison-sap a33fdb9
correct inconsistencies in paths for ctf locations.
morrison-sap c30699d
Merge remote-tracking branch 'upstream/main' into create-new-security…
morrison-sap 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
Some comments aren't visible on the classic Files Changed page.
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
156 changes: 156 additions & 0 deletions
156
content/docs/concepts/signing-and-verification-concept.md
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,156 @@ | ||
| --- | ||
| title: "Signing and Verification" | ||
| description: "Understanding how OCM ensures component integrity and authenticity through cryptographic signatures." | ||
| weight: 40 | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| toc: true | ||
| --- | ||
|
|
||
| OCM uses cryptographic signatures to guarantee that component versions are authentic (created by a trusted party) and have not been tampered with during storage or transfer. | ||
|
|
||
| ## Why Sign Components? | ||
|
|
||
| Software supply chains involve multiple stages: development, build, packaging, distribution, and deployment. At each stage, components could potentially be: | ||
|
|
||
| - **Modified** — malicious actors could inject code or alter resources | ||
| - **Replaced** — components could be swapped for compromised versions | ||
| - **Misattributed** — components could falsely claim to come from a trusted source | ||
morri-son marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Signing addresses these risks by creating a cryptographic proof that: | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 1. **Integrity**: The component has not changed since it was signed | ||
| 2. **Authenticity**: The signature was created by someone with access to the private key | ||
| 3. **Non-repudiation**: The signer cannot deny having signed the component | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## How OCM Signing Works | ||
|
|
||
| ```mermaid | ||
| flowchart TB | ||
| subgraph sign ["Sign (Producer)"] | ||
| direction TB | ||
| A[Component Version] --> B[Normalize & Hash] | ||
| B --> C[Sign with Private Key] | ||
| C --> D["Signature embedded in CV"] | ||
| end | ||
|
|
||
| sign --> T["Transfer Component Version"] | ||
|
|
||
| T --> verify | ||
|
|
||
| subgraph verify ["Verify (Consumer)"] | ||
| direction TB | ||
| E[Component Version] --> F[Extract Signature] | ||
| E --> G[Normalize & Hash] | ||
| F --> H[Verify with Public Key] | ||
| G --> H | ||
| H --> I{Valid?} | ||
| I -->|Yes| VALID["✓ Trusted"] | ||
| I -->|No| INVALID["✗ Rejected"] | ||
| end | ||
| ``` | ||
|
|
||
| ### Normalization and Digest Calculation | ||
|
|
||
| OCM uses a two-layer approach to ensure consistent and reproducible digests: | ||
|
|
||
| #### Component Descriptor Normalization | ||
|
|
||
| Before hashing, the component descriptor is normalized to produce consistent digests regardless of: | ||
|
|
||
| - Field ordering in YAML/JSON | ||
| - Whitespace variations | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Optional fields with default values | ||
|
|
||
| The default algorithm (`jsonNormalisation/v2`) produces a canonical JSON representation that ensures identical component descriptors always yield the same digest. | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| #### Artifact Digest Normalization | ||
|
|
||
| Each artifact's digest is calculated using a type-specific normalization algorithm: | ||
|
|
||
| | Artifact Type | Algorithm | Description | | ||
| |---------------|-----------|-------------| | ||
| | Generic blob | `genericBlobDigest/v1` | Direct hash of blob content | | ||
| | OCI artifact | `ociArtifactDigest/v1` | Uses OCI manifest digest | | ||
jakobmoellerdev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This allows OCM to use the most appropriate digest mechanism for each artifact type. For example, OCI artifacts use their manifest digest rather than re-hashing the blob, ensuring consistency with OCI registry behavior. | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| #### Recursive Component References | ||
|
|
||
| When a component references other components, their digests are calculated recursively and embedded: | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```yaml | ||
| references: | ||
| - componentName: ocm.software/helper | ||
| name: helper | ||
| version: 1.0.0 | ||
| digest: | ||
| hashAlgorithm: SHA-256 | ||
| normalisationAlgorithm: jsonNormalisation/v2 | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| value: 01c211f5c9cfd7c40e5b84d66a2fb7d19cb0... | ||
| ``` | ||
|
|
||
| This creates a **complete integrity chain** — verifying the root component automatically verifies all transitive dependencies. | ||
|
|
||
| ### What Gets Signed? | ||
|
|
||
| OCM signs a **digest** of the component descriptor, which includes: | ||
|
|
||
| - Component metadata (name, version, provider) | ||
| - Resource declarations with their digests | ||
| - Source references | ||
| - Component references | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The signature does **not** cover the raw resource content directly—instead, it covers the **digests** of those resources as recorded in the component descriptor. This means: | ||
|
|
||
| - Any change to resource content changes its digest, invalidating the signature | ||
| - Signature verification is fast (no need to re-hash large binaries) | ||
| - Resources can be stored separately while still being integrity-protected | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Signature Storage | ||
|
|
||
| Signatures are stored as part of the component version: | ||
|
|
||
| ```yaml | ||
| signatures: | ||
| - name: acme-release-signing | ||
| digest: | ||
| hashAlgorithm: SHA-256 | ||
| normalisationAlgorithm: jsonNormalisation/v1 | ||
| value: abc123... | ||
| signature: | ||
| algorithm: RSASSA-PKCS1-V1_5 | ||
| mediaType: application/vnd.ocm.signature.rsa | ||
| value: <base64-encoded-signature> | ||
| ``` | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| A component version can have **multiple signatures** from different parties, enabling: | ||
|
|
||
| - Separation of build and release signing | ||
| - Multiple approval workflows | ||
| - Cross-organizational trust chains | ||
|
|
||
| ## Supported Algorithms | ||
jakobmoellerdev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| OCM supports RSA-based signature algorithms: | ||
|
|
||
| | Algorithm | Type | Use Case | | ||
| |-----------|------|----------| | ||
| | RSA-PKCS#1 v1.5 | Asymmetric | Traditional PKI, widely supported | | ||
| | RSASSA-PSS | Asymmetric | Modern RSA with better security properties | | ||
jakobmoellerdev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| For key management, OCM uses PEM-encoded key files: | ||
|
|
||
| - **Private keys**: Used by producers to sign component versions | ||
| - **Public keys**: Distributed to consumers for verification | ||
|
|
||
| See [How-to: Generate Signing Keys]({{< relref "docs/how-to/generate-signing-keys.md" >}}) for creating RSA key pairs. | ||
|
|
||
| ## Next Steps | ||
|
|
||
| - [How-to: Generate Signing Keys]({{< relref "generate-signing-keys.md" >}}) - Step-by-step creating RSA key pairs. | ||
morri-son marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - [How-to: Configure Signing Credentials]({{< relref "configure-signing-credentials.md" >}}) - Set up OCM to use your keys for signing and verification | ||
| - [How-to: Sign a Component Version]({{< relref "sign-component-version.md" >}}) - Step-by-step signing instructions | ||
| - [How-to: Verify a Component Version]({{< relref "verify-component-version.md" >}}) - Step-by-step verification instructions | ||
|
|
||
| ## Related Documentation | ||
|
|
||
| - [Concept: Component Versions]({{< relref "components.md" >}}) - Understanding component structure | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.