Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
c4fce5d
Added Sigstore workload attestor for SPIRE
willallves Jun 10, 2022
ddc2f14
Fix hcl on k8s tests
willallves Jun 14, 2022
8401e1b
Adjust on log message
willallves Jun 14, 2022
1a6ebf9
Adjust lint error
willallves Jun 14, 2022
7f7fa32
removed unnecessary code
willallves Jun 14, 2022
99cd939
refactor: A check has been created to verify if p.sigstore is differe…
Jun 15, 2022
06f50e6
fix: fixed lint errors
Jun 16, 2022
ef113d8
fix: fixed lint errors
Jun 16, 2022
626e65b
fix: fixed lint errors
Jun 16, 2022
484f203
refactor: pr adjustments related to cosign
Jun 22, 2022
3f350ce
refactor: pr adjustments of logs of errors
Jun 23, 2022
ee57747
refactor: pr adjustments of logs for errors
Jun 23, 2022
2e59f95
fixing CI error
willallves Jun 29, 2022
0309e5e
dependency test
willallves Jun 30, 2022
7375df4
progress: solving dependency errors, apply marcos diff (#36)
willallves Jun 30, 2022
c0d8bea
PR adjustments of code organization and change imageID to a list of s…
matheusdefarias Jun 30, 2022
26c469f
feat: adding plugin mutex lock to configureSigstore. (#37)
rodrigolc Jul 1, 2022
cd0a350
SelectorsFromSignature pointer refactor (#33)
rodrigolc Jul 2, 2022
99132f1
K8s test refactor (#43)
rodrigolc Jul 8, 2022
d1832ca
Moving the initial state of sigstore on suite to setup (#40)
tjamir Jul 13, 2022
b28df1d
refactor: refactor of sigstorecache code (#44)
matheusdefarias Jul 14, 2022
680744e
Refactor of ValidateImage and validateRefDigest functions (#48)
matheusdefarias Jul 14, 2022
cdcb7cf
refactor: refactor of sigstore.go code related to subject assignment …
matheusdefarias Jul 14, 2022
43953d2
Removed RFC doc link (#57)
willallves Jul 18, 2022
cb3f0e4
Add sigstore toggle (#56)
rodrigolc Jul 18, 2022
296a8c4
Adding sigstore cosign adjustments pr 20220715 (#59)
matheusdefarias Jul 18, 2022
7609c37
Adding log label (#60)
rodrigolc Jul 19, 2022
5e9c2cd
Fixed dependencies
willallves Jul 20, 2022
3fb506d
Fix k8s posix (#70)
rodrigolc Aug 31, 2022
558ebbc
Fixing sigstore docs (#71)
rodrigolc Aug 31, 2022
18da14d
Fix sigstore (#72)
rodrigolc Aug 31, 2022
45f6ad4
fixing rebase
willallves Sep 7, 2022
02c548e
Refactory on k8s unit tests (#90)
willallves Sep 12, 2022
525d7ea
refactor: deleted commented code, empty lines and changed code locati…
matheusdefarias Sep 13, 2022
9611882
refactor: changed DeepEqual to require.Equal and other changes (#81)
matheusdefarias Sep 13, 2022
cda7f50
Update doc/plugin_agent_workloadattestor_k8s.md
willallves Sep 14, 2022
8f934a2
refactor: pr requests to change from deepEqual to require.Equal, remo…
matheusdefarias Sep 15, 2022
09d16b4
Removed unnecessary code (#99)
willallves Sep 15, 2022
3dc5505
Added rekor text in docs (#101)
willallves Sep 15, 2022
ce48b93
Added test case for last element added as first of list (#106)
willallves Sep 20, 2022
0d6903c
fix: refactoring so sigstore errors make attestation fail completely …
rodrigolc Sep 20, 2022
01d87eb
tests: removed repeated tests of failing parsing rekorURL on mock (#112)
rodrigolc Sep 20, 2022
99c39fb
Fix sigstore_tests (#91)
rodrigolc Sep 20, 2022
e022699
Refactor hook struct (#122)
rodrigolc Sep 22, 2022
1f933d7
Fixed shorts comments (#114)
willallves Sep 22, 2022
c484d0f
Refactor: made requested changes in the sigstore.go file (#94)
joaoguazzelli Sep 22, 2022
8446994
Fix check empty rekorURL (#128)
rodrigolc Sep 23, 2022
e08825d
refactor: refactored SelectorValuesFromSignature to error out on all …
rodrigolc Sep 23, 2022
c2ea801
Removed private functions on tests (#135)
willallves Sep 26, 2022
28d9a09
Refactor contains usage (#129)
rodrigolc Sep 26, 2022
6a7143c
Adding error SelectorsFromSignatures (#136)
rodrigolc Sep 26, 2022
65fd90b
test: add hashed manifest test case (#137)
joaoguazzelli Sep 27, 2022
7322b8c
fix: fixed lint errors
willallves Sep 28, 2022
d7a6c75
cosign v1.9.0 for v1.12.1
willallves Sep 29, 2022
382eb84
Move sigstore out of windows build (#150)
Oct 4, 2022
ddd0d6d
Update pkg/agent/plugin/workloadattestor/k8s/k8s_posix_test.go
willallves Oct 10, 2022
abef8bd
Update pkg/agent/plugin/workloadattestor/k8s/k8s_posix_test.go
willallves Oct 10, 2022
27cfc53
Update pkg/agent/plugin/workloadattestor/k8s/k8s_posix_test.go
willallves Oct 10, 2022
db72307
fixed: tables md (#156)
willallves Oct 17, 2022
834ab88
Validation changed if key present (#158)
willallves Oct 17, 2022
7288800
Added more a test case (#160)
willallves Oct 17, 2022
37386f8
fixing rekorUrl handling (#163)
rodrigolc Oct 17, 2022
c1986c0
feat: implementation of sigstore cache check overflow test function (…
matheusdefarias Oct 17, 2022
d2c1f64
fix: removed unnecessary if statement (#166)
joaoguazzelli Oct 18, 2022
1373575
fix: added independent cache for each test in TestCacheimpl_PutSignat…
joaoguazzelli Oct 18, 2022
0e8bcf8
Adding sigstore cosign pr adjustments 01112022 (#169)
matheusdefarias Nov 10, 2022
6c4cec1
Adjusting Marcos's comments (#174)
willallves Nov 23, 2022
e6634a9
refactor: added a comment to verifyFunction in sigstore.go file (#179)
matheusdefarias Dec 1, 2022
b1c7fb7
Adding sigstore cosign pr adjustments 24112022 (#180)
matheusdefarias Dec 1, 2022
4488f2c
Fix error declaration (#182)
joaoguazzelli Dec 1, 2022
b0cc07b
fix: per marcos' comments (#181)
rodrigolc Dec 1, 2022
764ed3c
Moving functions and declarations (#183)
rodrigolc Dec 1, 2022
f41fb65
Empty scheme not allowed anymore (#184)
rodrigolc Dec 1, 2022
4fe4258
cleanup test structs (#185)
rodrigolc Dec 1, 2022
36e05dc
misc: simplified errors and code flow (#186)
rodrigolc Dec 1, 2022
5ff4f7f
fix: removed noop false early return (#187)
rodrigolc Dec 1, 2022
a93dc2b
misc: reordered shouldSkipImage returns so images with empty IDs are …
rodrigolc Dec 1, 2022
2858b2f
misc: removed unused "verified" bool (#189)
rodrigolc Dec 1, 2022
7c06461
Add OIDC issuer to allowed subject list (#175)
rodrigolc Dec 1, 2022
0b171a2
fix: added error message validation (#195)
joaoguazzelli Dec 2, 2022
a30f06e
Removing default rekor url (#178)
rodrigolc Dec 2, 2022
37bcb4f
misc: removed ineffective called boolean (#191)
rodrigolc Dec 2, 2022
122a16c
misc: hardcoding AttestContainerSignature reference values (#194)
rodrigolc Dec 2, 2022
7d5069d
misc: moved fields from single field struct (#193)
rodrigolc Dec 2, 2022
5e87db1
refactor: changed some sigstore_test.go code as suggested (#190)
matheusdefarias Dec 2, 2022
51e071a
misc: removed verbose message from require statements (#192)
rodrigolc Dec 2, 2022
917443e
feat: add private deployment validator (#170)
joaoguazzelli Dec 2, 2022
0a85665
missing refactor comments (#196)
rodrigolc Dec 5, 2022
1844192
fix: added missing arg to checkOptsFunction call (#197)
rodrigolc Dec 5, 2022
fae20d1
fix: updated loglines and tests (#198)
rodrigolc Dec 5, 2022
322f4cf
Merge commit '84aa2c1eb9724ab55cb7eb791628b18c57d3ffcd' into adding-s…
rodrigolc Dec 7, 2022
d6989be
fixing go.mod and go.sum
rodrigolc Dec 7, 2022
58841eb
misssing typo fix from merge
rodrigolc Dec 7, 2022
fd38fb0
fixed go mod
willallves Dec 16, 2022
ad249c5
fix merge
willallves Dec 16, 2022
eaf5c50
Adjusting on go.mod
willallves Dec 16, 2022
66b9b66
adjust *.md
willallves Dec 16, 2022
f81bdcc
adjust *.md
willallves Dec 16, 2022
66d3b01
adjust *.md
willallves Dec 16, 2022
c875b50
Missing Fixes (#199)
rodrigolc Dec 20, 2022
05520d1
merge spire/main into adding-sigstore-cosign
willallves Dec 20, 2022
1f4a382
refactor: removed some empty lines and moved unexported functions and…
matheusdefarias Dec 22, 2022
2e693e3
Add fixes (#201)
joaoguazzelli Dec 22, 2022
ba9e424
refactor: removed some tests from k8s_windows_test.go file as suggest…
matheusdefarias Dec 22, 2022
feb4f85
markdown table fixes (#203)
rodrigolc Dec 22, 2022
ef3aa2e
moved OIDC token issuer Object Identifier var to sigstore.go (#204)
rodrigolc Dec 22, 2022
3306e22
Clean some code
Jan 3, 2023
7a9a5bb
Merge remote-tracking branch 'upstream/main' into adding-sigstore-cosign
Jan 3, 2023
1399ff5
minor change
Jan 3, 2023
7c333d5
clean code and solve a configuration issue
Jan 4, 2023
2a1b78a
Merge main
Jan 4, 2023
abf8449
Merge branch 'main' into adding-sigstore-cosign
Jan 4, 2023
3ea2c7d
Merge main into branch
Jan 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions conf/agent/agent_full.conf
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,30 @@ plugins {
# node_name: The name of the node. Overrides the value obtained by
# the environment variable specified by node_name_env.
# node_name = ""

# experimental: Experimental features.
experimental {
# sigstore: sigstore options. Enables signature checking.
# sigstore {
# rekor_url: The URL for the rekor STL Server to use with cosign. Required.
# rekor_url = "https://rekor.sigstore.dev"

# skip_signature_verification_image_list: List of images that should
# not be verified by cosign. They will receive a default
# sigstore-validation:passed selector, but no other sigstore related selectors.
# skip_signature_verification_image_list = ["sha:image1hash","sha:image2hash"]

# allowed_subjects_list: Map of subjects that image signatures
# will be checked against, keyed by OIDC Provider URI.
# Signatures from subjects outside this list will be ignored. These should be email addresses.
# allowed_subjects_list {
# "https://accounts.google.com" = ["[email protected]","[email protected]"]
# }

# enforce_sct: to be set as false in case of a private deployment not using the public CT
# enforce_sct = true
# }
}
}
}

Expand Down
46 changes: 46 additions & 0 deletions doc/plugin_agent_workloadattestor_k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,43 @@ since [hostprocess](https://kubernetes.io/docs/tasks/configure-pod-container/cre
| `use_anonymous_authentication` | If true, use anonymous authentication for kubelet communication |
| `node_name_env` | The environment variable used to obtain the node name. Defaults to `MY_NODE_NAME`. |
| `node_name` | The name of the node. Overrides the value obtained by the environment variable specified by `node_name_env`. |
| `experimental` | The experimental options that are subject to change or removal. |

| Experimental options | Description |
|----------------------|----------------------------------------------------------------------------------------------------------------------------- |
| `sigstore` | Sigstore options. Options described below. See [Sigstore workload attestor for SPIRE](#sigstore-workload-attestor-for-spire) |

| Sigstore options | Description |
|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `skip_signature_verification_image_list` | The list of images, described as digest hashes, that should be skipped in signature verification. Defaults to empty list. |
| `allowed_subjects_list` | A map of allowed subject strings, keyed by the OIDC Provider URI, that are trusted and are allowed to sign container images artifacts. Defaults to empty. If empty, no workload will pass signature validation, unless listed on `skip_signature_verification_image_list`. (eg. `"https://accounts.google.com" = ["[email protected]","[email protected]"]`). |
| `rekor_url` | The rekor URL to use with cosign. Required. See notes below. |
| `enforce_sct` | A boolean to be set to false in case of a private deployment, not using public CT |

> **Note** Cosign discourages the use of image tags for referencing docker images, and this plugin does not support attestation of sigstore selectors for workloads running on containers using tag-referenced images, which will then fail attestation for both sigstore and k8s selectors. In cases where this is necessary, add the digest string for the image in the `skip_signature_verification_image_list` setting (eg. `"sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"`). Note that sigstore signature attestation will still not be performed, but this will allow k8s selectors to be returned, along with the `"k8s:sigstore-validation:passed"` selector.

<!-- different notes -->

> **Note** Since the SPIRE Agent can also go through workload attestation, it will also need to be included in the skip list if either its image is not signed or has a digest reference string.

<!-- different notes -->

> **Note** The sigstore project contains a transparency log called Rekor that provides an immutable, tamper-resistant ledger to record signed metadata to an immutable record. While it is possible to run your own instance, a public instance of rekor is available at `https://rekor.sigstore.dev/`.

## Sigstore workload attestor for SPIRE

### Platform support

This capability is only supported on Unix systems.

The k8s workload attestor plugin also has capabilities to validate container images signatures through [sigstore](https://www.sigstore.dev/)

Cosign supports container signing, verification, and storage in an OCI registry. Cosign aims to make signatures invisible infrastructure. For this, we’ve chosen the Sigstore ecosystem and artifacts. Digging deeper, we are using: Rekor (signature transparency log), Fulcio (signing certificate issuer and certificate transparency log) and Cosign (container image signing tool) to guarantee the authenticity of the running workload.

> **Note** you can provide your own CA roots signed through TUF via the cosign initialize command.
This effectively securely pins the CA roots. We allow you to also specify trusted roots via the `SIGSTORE_ROOT_FILE` flag

### K8s selectors

| Selector | Value |
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand All @@ -77,6 +114,15 @@ since [hostprocess](https://kubernetes.io/docs/tasks/configure-pod-container/cre
| k8s:pod-init-image | An Image OR ImageID of any init container in the workload's pod, [as reported by K8S](https://pkg.go.dev/k8s.io/api/core/v1#ContainerStatus). Selector value may be an image tag, such as: `docker.io/envoyproxy/envoy-alpine:v1.16.0`, or a resolved SHA256 image digest, such as `docker.io/envoyproxy/envoy-alpine@sha256:bf862e5f5eca0a73e7e538224578c5cf867ce2be91b5eaed22afc153c00363eb` |
| k8s:pod-init-image-count | The number of init container images in workload's pod |

Sigstore enabled selectors (available when configured to use sigstore)

| Selector | Value |
|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| k8s:${containerID}:image-signature-content | A containerID is an unique alphanumeric number for each container. The value of the signature itself in a hash (eg. "k8s:000000:image-signature-content:MEUCIQCyem8Gcr0sPFMP7fTXazCN57NcN5+MjxJw9Oo0x2eM+AIgdgBP96BO1Te/NdbjHbUeb0BUye6deRgVtQEv5No5smA=") |
| k8s:${containerID}:image-signature-subject | OIDC principal that signed it​ (eg. "k8s:000000:image-signature-subject:[email protected]") |
| k8s:${containerID}:image-signature-logid | A unique LogID for the Rekor transparency log​ (eg. "k8s:000000:image-signature-logid:samplelogID") |
| k8s:${containerID}:image-signature-integrated-time | The time (in Unix timestamp format) when the image signature was integrated into the signature transparency log​ (eg. "k8s:000000:image-signature-integrated-time:12345") |
| k8s:sigstore-validation | The confirmation if the signature is valid, has value of "passed" (eg. "k8s:sigstore-validation:passed") |
> **Note** `container-image` will ONLY match against the specific container in the pod that is contacting SPIRE on behalf of
> the pod, whereas `pod-image` and `pod-init-image` will match against ANY container or init container in the Pod,
> respectively.
Expand Down
Loading