Skip to content
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

TrustStore CRD #557

Open
wants to merge 85 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
f44e0f1
first commit
Apr 11, 2020
9ab36c8
first commit
Apr 11, 2020
157460f
allow parse not support type
Apr 14, 2020
ed6fdd0
allow parse not support type
Apr 14, 2020
8762bd0
allow parse not support type
Apr 14, 2020
3585bc3
allow parse not support type
Apr 14, 2020
4be4e3c
0.1.2
Apr 14, 2020
55f4ead
update pbepkcs12
Apr 15, 2020
810faa0
update pbepkcs12
Apr 15, 2020
49c79c1
sdsi cert
Apr 15, 2020
88a4226
0.1.3
Apr 16, 2020
e2a7503
fix
hjiayz Apr 24, 2020
d750eae
switch to RustCrypto HmacSha1
Keruspe Jun 9, 2020
5ef132e
switch to getrandom
Keruspe Jun 9, 2020
464e982
update RustCrypto deps
Keruspe Jun 11, 2020
de4272f
drop unused block-cipher-trait
Keruspe Jun 16, 2020
b5e2e50
block-modes: update to 0.5.0
Keruspe Jul 10, 2020
2e8a35a
rustfmt
Keruspe Jul 10, 2020
017b50e
update rustcrypto
Keruspe Sep 28, 2020
6ad0857
Merge pull request #1 from Keruspe/master
Oct 14, 2020
f48e223
version 0.2.0
hjiayz Oct 14, 2020
02c5c97
update crypto dependencies
Keruspe Mar 20, 2021
e372089
update crypto dependencies
Keruspe Sep 14, 2021
f30063c
update yasna
Keruspe Sep 14, 2021
1c6f637
rename to pkcs-12
Keruspe Oct 20, 2021
1d3fbd9
version 0.3.0
Keruspe Oct 20, 2021
5c0018e
require yasna with std feature
Keruspe Oct 20, 2021
885484a
version 0.3.1
Keruspe Oct 20, 2021
dc0fad4
add CI
Keruspe Oct 21, 2021
5e3179a
Merge pull request #2 from Keruspe/crypto
hjiayz Oct 24, 2021
e11d003
Update Cargo.toml
hjiayz Oct 24, 2021
dd06c31
Merge git://github.com/hjiayz/p12
Keruspe Oct 26, 2021
9b6e213
v0.3.2
Keruspe Oct 26, 2021
0888af5
fix fork merge
Keruspe Oct 26, 2021
c9d7a8e
version 0.3.3
Keruspe Oct 26, 2021
46812d6
update dependencies
Keruspe Dec 15, 2021
c05cf02
v0.4.0
Keruspe Dec 15, 2021
27f3b2e
switch to sha1
Keruspe Jan 31, 2022
c8eb0b6
v0.4.1
Keruspe Jan 31, 2022
35102a6
update yasna
Keruspe Feb 2, 2022
e5a6535
v0.5.0
Keruspe Feb 2, 2022
f83f8bd
apply clippy suggestions
Keruspe Feb 2, 2022
f671118
port to cipher 0.4
Keruspe Feb 10, 2022
c8e573a
Merge pull request #6 from hjiayz/cipher04
Keruspe Feb 11, 2022
22270e2
edition 2021
Keruspe Feb 11, 2022
e5c1353
fix clippy lint
Keruspe Feb 11, 2022
df7e97a
v0.6.0
Keruspe Feb 11, 2022
88f34d1
ensure we have at least BS data (empty passwords)
ubamrein Feb 15, 2022
58ff78f
Merge pull request #7 from ubamrein/master
Keruspe Feb 15, 2022
8113ee5
v0.6.1
Keruspe Feb 15, 2022
ac90e05
update to cipher 0.4.1
Keruspe Feb 16, 2022
202f08d
v0.6.2
Keruspe Feb 16, 2022
45615bc
update to cipher 0.4.2
jcaesar Feb 17, 2022
0f96bbc
Merge pull request #8 from jcaesar/master
Keruspe Feb 17, 2022
9983420
v0.6.3
Keruspe Feb 18, 2022
d6ad9a5
Add TrustStore CRD and controller
nightkr Jan 28, 2025
4c0c1d4
Support custom TrustStore formats
nightkr Jan 29, 2025
03ef7b2
Fix clippy warnings
nightkr Jan 29, 2025
a9085d7
Explicitly disallow TrustStore for kerberos backend
nightkr Feb 20, 2025
c4e1707
Start sketching out k8s-search support
nightkr Feb 20, 2025
9791bee
Configure watches for the truststore controller
nightkr Mar 10, 2025
26b54eb
Optimistically try to encode truststore data as string
nightkr Mar 10, 2025
b3656dd
Clean up error handling
nightkr Mar 12, 2025
b569b05
Start factoring out truststore reference watch logic
nightkr Mar 12, 2025
d43274f
Factor out TrustStore dependency resolution logic
nightkr Mar 12, 2025
57e3727
Log reconciliation results properly
nightkr Mar 13, 2025
85b3bfc
TrustStore smoke test
nightkr Mar 13, 2025
21fe8ed
Stub out pkcs12 salt for determinism
nightkr Mar 13, 2025
fff63d1
Add 'rust/p12/' from commit '9983420fd81ba123ee2c284c8e564734de8b5f00'
nightkr Mar 13, 2025
75bb19f
Move p12 into subtree folder
nightkr Mar 13, 2025
5326498
Factor out the RNG provider from p12 instead of always just stubbing …
nightkr Mar 13, 2025
f284c9b
Handle CSI startup errors (again)
nightkr Mar 14, 2025
5092971
Docs
nightkr Mar 14, 2025
eac6338
Changelog
nightkr Mar 14, 2025
055c732
Minor cleanup
nightkr Mar 17, 2025
8cd87e4
Use ProductOperatorRun
nightkr Mar 17, 2025
2674b67
Merge branch 'main' into feature/truststore-crd
nightkr Mar 17, 2025
26a60f4
Fixed an import that got missing in the merge conflict
nightkr Mar 18, 2025
1181174
Add CRD docs for TrustStore
nightkr Mar 18, 2025
ecd2fd1
Fix pre-commit errors
nightkr Mar 18, 2025
fd3ab95
Drop unused hex dependency
nightkr Mar 18, 2025
42d423a
Update Ring for rustsec advisory
nightkr Mar 18, 2025
70a809c
Ignore RUSTSEC-2025-0012 for now
nightkr Mar 18, 2025
0762b44
Fix broken doclinks
nightkr Mar 18, 2025
cb9873a
Switch p12 to use the workspace version (to unbreak our PR build script)
nightkr Mar 18, 2025
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- Made RSA key length configurable for certificates issued by cert-manager ([#528]).
- Kerberos principal backends now also provision principals for IP address, not just DNS hostnames ([#552]).
- OLM deployment helper ([#546]).
- Added TrustStore CRD for requesting CA certificate information ([#557]).

### Changed

Expand All @@ -33,6 +34,7 @@ All notable changes to this project will be documented in this file.
[#546]: https://github.com/stackabletech/secret-operator/pull/546
[#548]: https://github.com/stackabletech/secret-operator/pull/548
[#552]: https://github.com/stackabletech/secret-operator/pull/552
[#557]: https://github.com/stackabletech/secret-operator/pull/557
[#563]: https://github.com/stackabletech/secret-operator/pull/563
[#564]: https://github.com/stackabletech/secret-operator/pull/564
[#566]: https://github.com/stackabletech/secret-operator/pull/566
Expand Down
16 changes: 11 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 39 additions & 5 deletions Cargo.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ byteorder = "1.5"
clap = "4.5"
futures = { version = "0.3", features = ["compat"] }
h2 = "0.4"
kube-runtime = { version = "0.98", features = ["unstable-runtime-stream-control"] }
ldap3 = { version = "0.11", default-features = false, features = [
"gssapi",
"tls",
] }
libc = "0.2"
native-tls = "0.2"
openssl = "0.10"
p12 = "0.6"
pin-project = "1.1"
pkg-config = "0.3"
prost = "0.13"
Expand Down
9 changes: 9 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ ignore = [
#
# TODO: Remove after https://github.com/kube-rs/kube/pull/1652 is merged
"RUSTSEC-2024-0384",

# https://rustsec.org/advisories/RUSTSEC-2025-0012
# "backoff" is unmainted.
#
# Upstream (kube) has switched to backon in 0.99.0, and an upgrade is scheduled on our end. In the meantime,
# this is a very low-severity problem.
#
# TODO: Remove after upgrading to kube 0.99.
"RUSTSEC-2025-0012",
]

[bans]
Expand Down
59 changes: 59 additions & 0 deletions deploy/helm/secret-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ spec:
description: The Secret objects are located in the same namespace as the Pod object. Should be used for Secrets that are provisioned by the application administrator.
type: object
type: object
trustStoreConfigMapName:
description: |-
Name of a ConfigMap that contains the information required to validate against this SecretClass.

Resolved relative to `search_namespace`.

Required to request a TrustStore for this SecretClass.
nullable: true
type: string
required:
- searchNamespace
type: object
Expand Down Expand Up @@ -308,3 +317,53 @@ spec:
served: true
storage: true
subresources: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: truststores.secrets.stackable.tech
annotations:
helm.sh/resource-policy: keep
spec:
group: secrets.stackable.tech
names:
categories: []
kind: TrustStore
plural: truststores
shortNames: []
singular: truststore
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1alpha1
schema:
openAPIV3Schema:
description: Auto-generated derived type for TrustStoreSpec via `CustomResource`
properties:
spec:
description: |-
A [TrustStore](https://docs.stackable.tech/home/nightly/secret-operator/truststore) requests information about how to validate secrets issued by a [SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass).

The requested information is written to a ConfigMap with the same name as the TrustStore.
properties:
format:
description: The [format](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#format) that the data should be converted into.
enum:
- tls-pem
- tls-pkcs12
- kerberos
nullable: true
type: string
secretClassName:
description: The name of the SecretClass that the request concerns.
type: string
required:
- secretClassName
type: object
required:
- spec
title: TrustStore
type: object
served: true
storage: true
subresources: {}
20 changes: 20 additions & 0 deletions deploy/helm/secret-operator/templates/roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ rules:
- create
- patch
- update
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- patch
- get
- watch
- list
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -95,8 +105,11 @@ rules:
- secrets.stackable.tech
resources:
- secretclasses
- truststores
verbs:
- get
- watch
- list
- apiGroups:
- listeners.stackable.tech
resources:
Expand All @@ -113,6 +126,13 @@ rules:
- get
- patch
- create
- apiGroups:
- events.k8s.io
resources:
- events
verbs:
- create
- patch
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
- apiGroups:
- security.openshift.io
Expand Down
1 change: 1 addition & 0 deletions docs/modules/secret-operator/examples/secretclass-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ spec:
pod: {}
# or...
name: my-namespace
trustStoreConfigMapName: tls-ca # <4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is used as introduction to SecretClasses, so I would not show special cases. Using k8sSearch for trust stores is not the main use case. I would leave it out. If not, then I would at least mention that this property is optional.

8 changes: 8 additions & 0 deletions docs/modules/secret-operator/examples/truststore-tls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: secrets.stackable.tech/v1alpha1
kind: TrustStore
metadata:
name: truststore-pem # <1>
spec:
secretClassName: tls # <2>
format: tls-pem # <3>
17 changes: 14 additions & 3 deletions docs/modules/secret-operator/pages/secretclass.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include::example$secretclass-tls.yaml[]
<1> Backends are mutually exclusive, only one may be used by each SecretClass
<2> Configures and selects the xref:#backend-autotls[] backend
<3> Configures and selects the xref:#backend-k8ssearch[] backend
<4> Provides a trust root to be requested by xref:truststore.adoc[]

[#backend]
== Backend
Expand All @@ -28,6 +29,8 @@ Each SecretClass is a associated with a single backend, which dictates the mecha

*Format*: xref:#format-tls-pem[]

*TrustStore*: Yes

Issues a TLS certificate signed by the Secret Operator.
The certificate authority can be provided by the administrator, or managed automatically by the Secret Operator.

Expand Down Expand Up @@ -132,6 +135,8 @@ spec:

*Format*: xref:#format-tls-pem[]

*TrustStore*: No

Injects a TLS certificate issued by {cert-manager}[Cert-Manager].

WARNING: This backend is experimental, and subject to change.
Expand Down Expand Up @@ -195,6 +200,8 @@ spec:

*Format*: xref:#format-kerberos[]

*TrustStore*: No

Creates a Kerberos keytab file for a selected realm. The Kerberos KDC and administrator credentials must be provided by the administrator.

IMPORTANT: Only MIT Kerberos (krb5) and Active Directory are currently supported.
Expand Down Expand Up @@ -350,6 +357,8 @@ spec:

*Format*: Free-form

*TrustStore*: If configured

This backend can be used to mount `Secret` across namespaces into pods. The `Secret` object is selected based on two things:

1. The xref:scope.adoc[scopes] specified on the `Volume` using the attribute `secrets.stackable.tech/scope`.
Expand Down Expand Up @@ -426,14 +435,16 @@ spec:
pod: {}
# or...
name: my-namespace
trustStoreConfigMapName: tls-ca # <4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
trustStoreConfigMapName: tls-ca # <4>
trustStoreConfigMapName: tls-ca

----

`k8sSearch`:: Declares that the `k8sSearch` backend is used.
`k8sSearch.searchNamespace`:: Configures the namespace searched for `Secret` objects.
`k8sSearch.searchNamespace.pod`:: The `Secret` objects are located in the same namespace as the `Pod` object. Should be used
`k8sSearch.searchNamespace`:: Configures the namespace searched for Secrets.
`k8sSearch.searchNamespace.pod`:: The Secret objects are located in the same namespace as the Pod. Should be used
for secrets that are provisioned by the application administrator.
`k8sSearch.searchNamespace.name`:: The `Secret` objects are located in a single global namespace. Should be used for secrets
`k8sSearch.searchNamespace.name`:: The Secrets are located in a single global namespace. Should be used for secrets
that are provisioned by the cluster administrator.
`k8sSearch.trustStoreConfigMapName`:: ConfigMap used to provision xref:truststore.adoc[].

==== Format

Expand Down
Loading