Commit Graph

86 Commits

Author SHA1 Message Date
Julian Sommer 97b2956186 release: update go.mod for v1.7.0 2026-06-09 12:50:53 +10:00
dependabot[bot] a985dc34f2 chore: bump github.com/nats-io/nats-server/v2 (#316) 2026-06-09 08:53:46 +10:00
Julian Sommer 2dada2cf9d release: update go.mod for v1.6.0 2026-06-03 09:15:38 +10:00
Josh Siviour 785a5655e4 feat(sts): EKS Q4 — AssumeRoleWithWebIdentity + presigned GetCallerIdentity verify (#272)
* feat(sts): EKS Q4 STS extensions — interface + JWKS reader + stubs

Lays the structural slice of AssumeRoleWithWebIdentity + presigned-URL
GetCallerIdentity verify for IRSA. The verify-path bodies (JWT signature
check against fetched JWKS, claims validation, Federated-principal trust
policy evaluation, SigV4 presigned-URL canonical-request reconstruction)
land in follow-up commits on this branch.

Adds:
- handlers/sts/oidc_jwks.go — JWK/JWKS types, ParseEKSIssuerURL (defensive
  iss parsing), FetchClusterJWKS (KV-backed read from
  eks-account-{accountID}/clusters/{name}/oidc-jwks.json via the EKS store
  helpers).
- handlers/sts/oidc_jwks_test.go — unit tests over a real JetStream
  test fixture.
- handlers/sts/assume_role_with_web_identity.go — interface entry, stub
  returns ErrorNotImplemented.
- handlers/sts/presigned_url_verify.go — PresignedCallerIdentity type +
  VerifyPresignedGetCallerIdentity stub.
- gateway/sts/AssumeRoleWithWebIdentity.go — dispatch shell.

Modifies:
- handlers/sts/service.go — STSService interface gains
  AssumeRoleWithWebIdentity + VerifyPresignedGetCallerIdentity.
- gateway/sts.go — registers AssumeRoleWithWebIdentity in stsActions +
  stsSkipPolicyCheck (anonymous; trust-policy-gated in handler).
- gateway/sts_request_test.go, gateway/sts/handler_test.go,
  gateway/auth_test.go — stub implementations updated to satisfy
  extended STSService interface.

Anonymous routing for AssumeRoleWithWebIdentity (eks-v1.md Q5 mux rework)
lands in Sprint 6e — for now the action is registered on the standard STS
gateway and rejects non-SigV4 requests upstream.

Refs: cs-eks-sts-q4 (mulga monorepo bead)

* feat(sts): AssumeRoleWithWebIdentity + presigned GetCallerIdentity verify

Implements EKS Q4 STS extensions for IRSA + EKS token-webhook flows.

AssumeRoleWithWebIdentity:
- ES256 JWT verification against per-cluster JWKS (eks-account-{accountID}
  KV bucket), keyed by issuer host-path.
- Federated trust-policy evaluator (explicit-deny-wins, exact-match
  Principal.Federated, fail-closed on Principal: "*").
- Condition support scoped to StringEquals on {iss}:sub (exact) and
  {iss}:aud (set-membership). All other operators rejected at validator.
- OIDC provider registry check against iam-account-{roleAccountID}; v1
  does not support cross-account registration.
- New awserrors: InvalidIdentityToken, IDPRejectedClaim,
  IDPCommunicationError.

VerifyPresignedGetCallerIdentity:
- Hand-rolled SigV4 canonical-request reconstruction (no sdk dep).
- Mandatory X-K8s-Aws-Id in SignedHeaders + value pinned to
  expectedClusterName during canonicalisation — cross-cluster replay
  surfaces as a signature mismatch.
- AKID-prefix dispatch (ASIA → session credential, AKIA → IAM user).
- Strict envelope checks: algorithm, credential scope service/terminator,
  X-Amz-Date / credential-scope date agreement, expiry within
  X-Amz-Expires, 5-minute wire skew.

Tests:
- 14 web-identity scenarios (happy paths, tampering, expiry, wrong aud,
  unknown kid, HS256 rejection, federated-wildcard fail-closed,
  explicit-deny-wins, provider-not-registered).
- 12 presigned-URL scenarios including cross-cluster replay defence,
  missing-x-k8s-aws-id, tampered query, bad service in credential, AKIA
  + ASIA happy paths.
- Cross-cluster anti-replay invariant test (rejects matrix of variant
  cluster names — case-different, prefix, suffix).
- AWS SigV4 known-vector test for deriveSigningKey.

Gateway:
- TODO documents that AssumeRoleWithWebIdentity is currently dispatched
  on the SigV4-gated path; a pre-auth route is needed so a projected
  ServiceAccount token alone can authenticate the caller.

IAM:
- Relaxes trust-policy Condition validator: now permitted only when
  Action is exactly [sts:AssumeRoleWithWebIdentity] and operator is
  StringEquals. Preserves loud failure for sts:AssumeRole.
2026-06-01 14:29:35 +10:00
Julian Sommer a7f7610176 release: update go.mod for v1.5.0 2026-05-26 10:04:09 +10:00
dependabot[bot] e34b536b97 chore: bump the go-dependencies group across 1 directory with 3 updates (#252) 2026-05-26 09:10:38 +10:00
Julian Sommer 3b5e3e21c0 chore: tidy 2026-05-26 09:04:46 +10:00
Julian Sommer 71350033f7 chore: bump golang.org/x/net 2026-05-26 09:02:55 +10:00
Julian Sommer 6d650f6c3a fix: actually fix predastore integration test 2026-05-21 15:13:14 +10:00
Julian Sommer 0ff911fdbc fix: change predastore node ips to 127.0.0.1 (#244) 2026-05-21 13:46:02 +10:00
Julian Sommer 739cf082a9 feat: rocky images + RHEL support (#238) 2026-05-20 14:36:41 +10:00
Julian Sommer 762381adfd chore: add BootMode field 2026-05-20 10:07:12 +10:00
Julian Sommer 495587304b release: update go.mod for v1.4.0 2026-05-19 09:37:54 +10:00
Julian Sommer fe59017cbb release: update go.mod for v1.3.0 2026-05-12 16:12:38 +10:00
dependabot[bot] dbb153bd42 chore: bump the go-dependencies group across 1 directory with 2 updates (#206) 2026-05-12 08:58:12 +10:00
Josh Siviour 48d7ce8a45 feat(viperblockd): retry LoadState on transient backend errors (siv-25 medium-term) (#210)
* feat(viperblockd): retry LoadState on transient backend errors

ebs.mount used to call vb.LoadState once and treat any failure as fatal.
When predastore was still warming up after a coordinated daemon restart,
the backend Read came back with a network/timeout error, viperblock
folded it into "block size is 0 in both local and backend state", and
the daemon's recovery path then ran the cleanup branch — destroying
DeleteOnTermination=true volumes (mulga-siv-25).

Wrap LoadState in retryLoadState: 5 attempts, 200ms * 1.5^n backoff
(total worst-case ~3.7s, well inside the 30s ebs.mount NATS deadline).
Retry only on viperblock.ErrStateBackendUnavailable; ErrStateNotFound
and any unclassified error fail fast so genuine problems are still
visible.

Retry loop is parameterised over sleep and loadFn so the retry policy
itself is unit-tested without spinning up a real VB.

* chore: bump viperblock to v1.2.2-0.20260511064619-1aa54f0dc1f6

Pulls in the ErrStateNotFound / ErrStateBackendUnavailable sentinels
introduced by mulgadc/viperblock#11 (merged on dev). Required for the
retry wrapper added in the previous commit to compile against the
public viperblock module.
2026-05-11 17:10:48 +10:00
Julian Sommer 9640cca480 chore: bump predastore version 2026-05-07 14:29:57 +10:00
dependabot[bot] 78c3cce183 chore: bump the go-dependencies group with 3 updates (#183) 2026-05-05 09:38:50 +10:00
Bryn Mailer 3c2f57101f refactor: lock free write path (#179)
* fix: remove predastore filesystem backend references

* fix: remove unused import

* chore: bump predastore version

* fix: create test buckets explicitly
2026-05-01 11:46:33 +10:00
Julian Sommer 6538a6cb69 feat: DescribeVolumeModifications (#174) 2026-04-29 15:54:43 +10:00
dependabot[bot] b2921dbad6 chore: bump golang.org/x/crypto (#162) 2026-04-28 09:11:29 +10:00
Ben Duncan f73e151c77 feat: in-process DHCP client and Manager in vpcd (mulga-990)
Introduces the spinifex/services/vpcd/dhcp package with a Client
interface, typed Lease struct, nclient4-backed implementation, and a
Fake for unit tests. Adds DHCPManager in the vpcd package: subscribes
to vpc.dhcp.acquire / vpc.dhcp.release NATS requests, runs a renewal
goroutine per lease with ±10% jitter on T1/T2, persists leases in the
new spinifex-dhcp-leases KV bucket, and fans out vpc.dhcp.lease-expired
when a lease permanently fails to renew. Wires the Manager into
launchService so it starts on vpcd boot and rehydrates persisted leases
via Bootstrap.

Handler-side wiring (ExternalIPAM → NATS) and the systemd capability
move land separately in mulga-991.

See docs/development/bugs/dhcp-allocate-error.md.
2026-04-22 16:45:30 +10:00
Ben Duncan 93a6704944 Merge remote-tracking branch 'origin/main' into feat/iso-installer 2026-04-21 14:29:16 +10:00
dependabot[bot] 869184efb5 chore: bump the go-dependencies group with 2 updates (#153) 2026-04-21 09:01:49 +10:00
Julian Sommer 32effaa16e Merge branch 'main' into feat/iso-installer 2026-04-15 15:50:37 +10:00
Julian Sommer 7d6e0780b5 feat: action rate limiting (#140) 2026-04-15 12:19:30 +10:00
tomnewton-mulga 01cd3b9ab1 Merge commit 'b7b639084b3c2a40b97c2f543b88ad498901b77d' into feat/iso-installer
# Conflicts:
#	Makefile
#	cmd/spinifex/cmd/admin.go
#	go.sum
2026-04-14 16:11:49 +10:00
Julian Sommer 56cdc158a6 chore: bump viperblock 2026-04-14 11:17:48 +10:00
Ben Duncan ebd0a64fe5 chore: bump predastore to v1.1.5 (#135)
Picks up multipart upload wedge fixes from predastore v1.1.5:
- 76fdbf1 fix: pool cleanup must not reap connections with in-flight streams (Bug A)
- 7df9645 fix: add mutex to bufferedWALFile to prevent bufio race (Bug B)
- 9dcd3dd fix: drain shard body before taking wal.mu in handlePUTShard (Bug C)
- 43e20f6 fix: widen QUIC flow-control windows to mitigate multipart upload deadlock

plus regression tests for all three bugs (predastore PR #8).
2026-04-13 13:00:25 +10:00
tomnewton-mulga 7c007ea6b5 feat: replace huh TUI with bubbletea + add branding package (mulga-859)
Replaces charmbracelet/huh with a custom bubbletea wizard for the
installer TUI. This gives full control over terminal I/O so the
installer attaches directly to the correct console device (ttyS0 for
serial, tty1 for VGA) as directed by the new spinifex-init boot script.

- branding/branding.go: centralised logo (ASCII placeholder), color
  constants, and publisher string ready for Mulga asset swap
- ui/ui.go: multi-screen bubbletea model (welcome → disk → network →
  identity → join → CA cert → confirm) styled with lipgloss
- main.go: reads SPINIFEX_CONSOLE from /proc/cmdline to open the right
  tty before launching tea.Program
- go.mod: bubbletea/lipgloss/bubbles promoted to direct deps; huh removed
2026-04-08 10:49:57 +10:00
tomnewton-mulga 1b39439cb8 feat: scaffold ISO installer TUI and install pipeline (mulga-859)
Adds cmd/installer with three packages:
- ui: huh-based TUI collecting disk, network, node, and cluster config
- install: sequential install steps (partition, debootstrap, chroot, bootloader)
- firstboot: oneshot systemd service that runs setup-ovn and spx admin init/join on first real boot

Supports both single-node init and multi-node join flows.
2026-04-07 15:50:40 +10:00
Julian Sommer 92e25a9653 chore: bump predastore 2026-03-31 14:11:47 +10:00
dependabot[bot] 9e3076727e chore: bump github.com/nats-io/nats.go in the go-dependencies group (#99) 2026-03-31 09:03:19 +11:00
Julian Sommer 71e82b22a7 chore: bump deps 2026-03-25 15:24:21 +10:00
Julian Sommer 73e5905092 chore: bump viperblock version 2026-03-25 14:17:15 +10:00
Julian Sommer a66b1a3d48 fix: remove InsecureSkipVerify (#87) 2026-03-25 12:51:34 +11:00
Julian Sommer 8c4adf08a3 chore: bump predastore to v1.1.2 2026-03-25 10:52:08 +10:00
dependabot[bot] e347f0a75e chore: bump github.com/nats-io/nats-server/v2 (#86) 2026-03-25 08:14:15 +10:00
Julian Sommer 0fbf4537c0 chore: bump viperblock 2026-03-24 11:24:40 +10:00
Julian Sommer 02931567ac release: update go.mod for v0.4.2 2026-03-20 13:09:48 +10:00
Julian Sommer d2d3e52522 feat: migrate to golangci-lint (#82) 2026-03-20 12:14:42 +11:00
dependabot[bot] efa6257850 build(deps): bump google.golang.org/grpc from 1.79.1 to 1.79.3 (#79) 2026-03-19 11:35:06 +11:00
Julian Sommer 71ec2b7ee5 release: update go.mod for v0.4.0 2026-03-19 08:28:16 +10:00
Julian Sommer 404b3d6246 release: update go.mod for v0.2.3 2026-03-10 09:36:58 +10:00
Julian Sommer 1c6950b89e release: update go.mod for v0.2.2 2026-03-06 09:45:34 +10:00
Julian Sommer 2d304528b8 chore: bump deps 2026-03-06 08:15:48 +10:00
Julian Sommer 77c6d05042 refactor: replace NYTimes/gziphandler with stdlib compress/gzip
Drop the external gziphandler dependency in hiveui. The replacement
uses a simple http.ResponseWriter wrapper that checks Content-Type
against an allowlist before enabling gzip compression. Same behavior,
zero external deps.
2026-03-05 12:53:46 +10:00
Julian Sommer 8af3d2e5fa feat: migrate off fiber (#62) 2026-03-05 12:53:46 +10:00
dependabot[bot] e08b8140a6 chore: bump github.com/gofiber/fiber/v2 from 2.52.11 to 2.52.12 (#51) 2026-02-25 10:36:09 +11:00
dependabot[bot] a7e0cb6972 chore: bump github.com/nats-io/nats-server/v2 (#50) 2026-02-25 10:35:49 +11:00