Machine identity: OIDC discovery provider for OpenBao #360

Merged
raito merged 9 commits from oidc-discovery-provider into main 2025-09-25 23:22:34 +00:00
Owner

This finishes the base setup for machine identity.

The next PRs will work on providing policies and feeding OpenBao with secrets, eventually putting an OpenBao agent in every VMs.

This finishes the base setup for machine identity. The next PRs will work on providing policies and feeding OpenBao with secrets, eventually putting an OpenBao agent in every VMs.
We use this piece of software to let OpenBao register a new OIDC method
for login which will be used by machines.

Signed-off-by: Raito Bezarius <raito@afnix.fr>
Signed-off-by: Raito Bezarius <raito@afnix.fr>
Signed-off-by: Raito Bezarius <raito@afnix.fr>
Signed-off-by: Raito Bezarius <raito@afnix.fr>
Signed-off-by: Raito Bezarius <raito@afnix.fr>
raito changed title from Machine identity: OIDC discovery provider for OpenBao to WIP: Machine identity: OIDC discovery provider for OpenBao 2025-09-23 19:54:16 +00:00
@ -55,1 +55,3 @@
bagel.baremetal.hypervisor.enable = lib.mkEnableOption "hypervisor role";
bagel.baremetal.hypervisor = {
enable = lib.mkEnableOption "hypervisor role";
secondaryIPv6 = lib.mkOption {
Author
Owner

We could avoid this if:

  • We succeed into using a front NGINX on port 443 and perform SNI.
  • We succeed into moving SPIRE server and OIDC discovery provider inside a VM with 2 IPv6 or something.
We could avoid this if: - We succeed into using a front NGINX on port 443 and perform SNI. - We succeed into moving SPIRE server and OIDC discovery provider inside a VM with 2 IPv6 or something.
Author
Owner

SNI is done.

SNI is done.
raito marked this conversation as resolved
raito force-pushed oidc-discovery-provider from f090d2beb4 to cceaa1902e 2025-09-23 20:41:41 +00:00 Compare
raito force-pushed oidc-discovery-provider from cceaa1902e to b793d03ce5 2025-09-25 22:28:05 +00:00 Compare
raito changed title from WIP: Machine identity: OIDC discovery provider for OpenBao to Machine identity: OIDC discovery provider for OpenBao 2025-09-25 22:28:19 +00:00
@ -36,0 +27,4 @@
defaultPolicyFragment = {
"auth/token/*".capabilities = [ "create" "read" "update" "delete" "list" ];
};
# spiffe://$TD/tenants/$TENANT/svc/forgejo
Author
Owner

Expand these comments.

Expand these comments.
raito marked this conversation as resolved
@ -36,0 +22,4 @@
# Each region has its own OIDC discovery server and is expected to operate
# independently.
machine-identity = {
# audience = $tenant_id OR https://vault.afnix.fr
Author
Owner

Expand these comments.

Expand these comments.
raito marked this conversation as resolved
@ -83,2 +131,4 @@
"transit/decrypt/terraform-backend-states-key".capabilities = [ "create" "update" ];
};
machine_sts = {
Author
Owner

We can get rid of this test now.

We can get rid of this test now.
raito marked this conversation as resolved
@ -0,0 +7,4 @@
regionOpts = { config, ... }: {
options = {
trustDomain = mkOption {
type = types.str;
Author
Owner

Missing description and examples.

Missing description and examples.
raito marked this conversation as resolved
@ -0,0 +12,4 @@
discoveryUrl = mkOption {
type = types.str;
default = "https://sts-oidc.${config.trustDomain}";
Author
Owner

Missing description.

Missing description.
raito marked this conversation as resolved
delroth approved these changes 2025-09-25 23:11:07 +00:00
delroth left a comment
Owner

Modulo existing comments.

Modulo existing comments.
@ -0,0 +1,126 @@
# SPDX-FileCopyrightText: 2025 Tom Hubrecht <tom.hubrecht@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
Owner

Aren't we relicensing this to match the rest of the repo?

Aren't we relicensing this to match the rest of the repo?
Author
Owner

Yes, we did indeed.

Yes, we did indeed.
raito marked this conversation as resolved
@ -0,0 +89,4 @@
inherit (cfg.localTermination) port;
addr = "127.0.0.1";
ssl = true;
# proxyProtocol = true;
Owner

Why is this (and the later proxy_protocol line) commented out?

Why is this (and the later proxy_protocol line) commented out?
Author
Owner

It's because @thubrecht had in intent to support optional proxy protocol for downstreams that would support for it I imagine.
We should get rid of it, our downstreams do not support PROXY protocol v2 anyway and we don't need it, we can read the access logs on our NGINX.

It's because @thubrecht had in intent to support optional proxy protocol for downstreams that would support for it I imagine. We should get rid of it, our downstreams do not support PROXY protocol v2 anyway and we don't need it, we can read the access logs on our NGINX.
Author
Owner

This PROXY story will come back in n64gw01 once I add SNI proxies for IPv4.

This PROXY story will come back in n64gw01 once I add SNI proxies for IPv4.
raito marked this conversation as resolved
raito force-pushed oidc-discovery-provider from b793d03ce5 to aa00cd11cc 2025-09-25 23:22:14 +00:00 Compare
raito merged commit aa00cd11cc into main 2025-09-25 23:22:34 +00:00
raito deleted branch oidc-discovery-provider 2025-09-25 23:22:34 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
afnix/infra!360
No description provided.