Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
fcb5722
Added Sigstore workload attestor for SPIRE
willallves Jun 10, 2022
1f0d339
Fix hcl on k8s tests
willallves Jun 14, 2022
36e45e9
Adjust on log message
willallves Jun 14, 2022
c5bebad
Adjust lint error
willallves Jun 14, 2022
adae94c
removed unnecessary code
willallves Jun 14, 2022
f46329f
refactor: A check has been created to verify if p.sigstore is differe…
Jun 15, 2022
f3b79bd
fix: fixed lint errors
Jun 16, 2022
ead4c2c
fix: fixed lint errors
Jun 16, 2022
c0afd10
fix: fixed lint errors
Jun 16, 2022
a296371
refactor: pr adjustments related to cosign
Jun 22, 2022
95f79a7
refactor: pr adjustments of logs of errors
Jun 23, 2022
3f8a6a6
refactor: pr adjustments of logs for errors
Jun 23, 2022
7985cd5
fixing CI error
willallves Jun 29, 2022
97542d1
dependency test
willallves Jun 30, 2022
66208ec
progress: solving dependency errors, apply marcos diff (#36)
willallves Jun 30, 2022
2978f01
PR adjustments of code organization and change imageID to a list of s…
matheusdefarias Jun 30, 2022
b7fc703
feat: adding plugin mutex lock to configureSigstore. (#37)
rodrigolc Jul 1, 2022
5eb944e
SelectorsFromSignature pointer refactor (#33)
rodrigolc Jul 2, 2022
5bf47f7
K8s test refactor (#43)
rodrigolc Jul 8, 2022
458747f
Moving the initial state of sigstore on suite to setup (#40)
tjamir Jul 13, 2022
b997cc6
refactor: refactor of sigstorecache code (#44)
matheusdefarias Jul 14, 2022
5580709
Refactor of ValidateImage and validateRefDigest functions (#48)
matheusdefarias Jul 14, 2022
06306eb
refactor: refactor of sigstore.go code related to subject assignment …
matheusdefarias Jul 14, 2022
f8ef633
Removed RFC doc link (#57)
willallves Jul 18, 2022
cead68d
Add sigstore toggle (#56)
rodrigolc Jul 18, 2022
f98455a
Adding sigstore cosign adjustments pr 20220715 (#59)
matheusdefarias Jul 18, 2022
304fb25
Adding log label (#60)
rodrigolc Jul 19, 2022
8e861d0
Fixed dependencies
willallves Jul 20, 2022
4eb796a
Fix k8s posix (#70)
rodrigolc Aug 31, 2022
7bd0e72
Fixing sigstore docs (#71)
rodrigolc Aug 31, 2022
9afe5d0
Fix sigstore (#72)
rodrigolc Aug 31, 2022
a1db718
fixing rebase
willallves Sep 7, 2022
bca7dbb
Refactory on k8s unit tests (#90)
willallves Sep 12, 2022
d0c17a2
refactor: deleted commented code, empty lines and changed code locati…
matheusdefarias Sep 13, 2022
4de6f25
refactor: changed DeepEqual to require.Equal and other changes (#81)
matheusdefarias Sep 13, 2022
a6a9926
Update doc/plugin_agent_workloadattestor_k8s.md
willallves Sep 14, 2022
95cd6b6
refactor: pr requests to change from deepEqual to require.Equal, remo…
matheusdefarias Sep 15, 2022
f9dc801
Removed unnecessary code (#99)
willallves Sep 15, 2022
18eee2f
Added rekor text in docs (#101)
willallves Sep 15, 2022
ba370da
Added test case for last element added as first of list (#106)
willallves Sep 20, 2022
a0b14d2
fix: refactoring so sigstore errors make attestation fail completely …
rodrigolc Sep 20, 2022
da26276
tests: removed repeated tests of failing parsing rekorURL on mock (#112)
rodrigolc Sep 20, 2022
e97bec8
Fix sigstore_tests (#91)
rodrigolc Sep 20, 2022
6257b2e
Refactor hook struct (#122)
rodrigolc Sep 22, 2022
aedcbb3
Fixed shorts comments (#114)
willallves Sep 22, 2022
e0f5d44
Refactor: made requested changes in the sigstore.go file (#94)
joaoguazzelli Sep 22, 2022
5446f51
Fix check empty rekorURL (#128)
rodrigolc Sep 23, 2022
2a516d8
refactor: refactored SelectorValuesFromSignature to error out on all …
rodrigolc Sep 23, 2022
e07f1d8
Removed private functions on tests (#135)
willallves Sep 26, 2022
30d708f
Refactor contains usage (#129)
rodrigolc Sep 26, 2022
eda481d
Adding error SelectorsFromSignatures (#136)
rodrigolc Sep 26, 2022
43b40ae
test: add hashed manifest test case (#137)
joaoguazzelli Sep 27, 2022
4af1423
fix: fixed lint errors
willallves Sep 28, 2022
96ecc8e
cosign v1.9.0 for v1.12.1
willallves Sep 29, 2022
1e548a5
Move sigstore out of windows build (#150)
Oct 4, 2022
0052820
Added integration tests Sigstore workload attestor for SPIRE
willallves Jun 10, 2022
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.
# 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"]

# enable_allowed_subjects_list: Boolean indicating whether image
# signatures will be checked against a list of subjects.
# enable_allowed_subjects_list = false

# allowed_subjects_list: List of subjects that image signatures
# will be checked against, if enabled through the above option.
# signatures from subjects outside this list will receive
# no sigstore-related selectors. These should be email addresses.
# allowed_subjects_list = ["subject1@example.com","subject2@example.com"]
# }
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion doc/plugin_agent_nodeattestor_k8s_sat.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The main configuration accepts the following values:
| `cluster` | Name of the cluster. It must correspond to a cluster configured in the server plugin. |
| `token_path` | Path to the service account token on disk | "/var/run/secrets/kubernetes.io/serviceaccount/token" |

The token path defaults to the default location Kubernetes uses to place the token and should not need to be overridden in most cases.
The token path defaults to the default location kubernetes uses to place the token and should not need to be overriden in most cases.

A sample configuration with the default token path:

Expand Down
34 changes: 34 additions & 0 deletions doc/plugin_agent_workloadattestor_k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,31 @@ 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. |

| 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. |
| `enable_allowed_subjects_list`| Enables a list of allowed subjects that are trusted and are allowed to sign container images artificats. Defaults to 'false'. If true and `allowed_subjects_list` is empty, no workload will pass signature validation. |
| `allowed_subjects_list`| The list of allowed subjects enabled by `enable_allowed_subjects_list` each entry represents subject e-mail. Defaults to empty list. |
| `rekor_url` | The URL for the rekor STL Server to use with cosign. Defaults to 'rekor.sigstore.dev', Rekor's public instance. |

**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 rekor.sigstore.dev, cosign defaults to using the public instance.

### Sigstore workload attestor for SPIRE

The k8s workload attestor plugin also has capabilities to validate 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 @@ -71,6 +96,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 | 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:spirex@example.com")|
| 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