Skip to content

fix(security): Go 1.26.11, Secret opt-in and tenancy hardening - #41

Merged
mmatloka merged 2 commits into
mainfrom
chore/deps-go-1.26.11-security-fixes
Nov 19, 2026
Merged

mmatloka merged 2 commits into
mainfrom
chore/deps-go-1.26.11-security-fixes

Conversation

@mmatloka

Copy link
Copy Markdown
Contributor

Summary

Bumps the Go minimum to 1.26.11 and updates all dependencies. Also fixes a batch of security-scanner findings in three areas: cross-tenant isolation, containers running as root, and access control.

Dependencies

  • go 1.26.11; all modules updated, including franz-go, grpc, otel and k8s.io v0.37.2.
  • k8s.io/kube-openapi is pinned to a revision that still supports Go 1.26. The latest revision requires Go 1.27.

Tenancy / isolation

  • An empty tenancy prefix now fails closed. Validation rejects "" prefixes because they match every name.
  • Schema Registry subjects are checked against tenancy prefixes. A foreign subject gives a terminal TenancyDenied and is never deleted.
  • Finalizers for topics, policies, quotas and users only clean up a spec the operator actually applied, in a namespace tenancy still allows. Otherwise they orphan the resource and emit a CleanupSkipped event. This stops spec edits made during deletion from triggering cleanup on behalf of another tenant.
  • Cluster ACL view: when Allow and Deny conflict, Deny wins, and the prune scope is built from every policy.

Secrets

  • BREAKING: the operator only uses a referenced Secret if it carries the label gitops.monedula.dev/credential-source=true. This covers KafkaCluster credentials and TLS, KafkaTopic schema bodies and KafkaUser passwords. You can opt out with --require-secret-label=false or chart requireSecretLabel: false. The CHANGELOG has an upgrade note.
  • New --secret-namespaces flag (chart: rbac.secretNamespaces). When set, the ClusterRole drops all Secret access and each listed namespace gets its own Role and RoleBinding. The Secret cache and reads are limited to those namespaces.

Non-root manifests

  • The quickstart and scenario Kafka and Schema Registry manifests, the manager, and the webhook patch now set runAsNonRoot and a fixed UID/GID. They also use seccomp RuntimeDefault, disallow privilege escalation and drop ALL capabilities.

Reviewer notes

  • The apiserver bumps metadata.generation by 1 when it sets deletionTimestamp. The "spec was applied" check therefore accepts observed+1.
  • The quickstart, scenario and e2e setup Secrets are now labelled.
  • Not addressed yet: tenancy changes don't revoke access that was already granted.

Checklist

  • go build ./..., go vet ./..., go test ./... pass. The envtest suites and the helm render tests and helm lint also pass, run in a Linux container. The kind e2e suite has not been run locally.
  • Updated CHANGELOG.md (Unreleased) if user-facing
  • Behavior or usage changes are noted in the summary, so the docs at https://monedula.dev/flock/docs/gitops/ can follow

- Bump the Go minimum to 1.26.11 and update all dependencies.
- Run the quickstart, scenario and webhook manifests as non-root with
  dropped capabilities.
- Tenancy: empty prefixes fail closed; Schema Registry subjects are
  checked against tenancy prefixes.
- Finalizers only clean up specs the operator applied and the namespace
  is still allowed to manage.
- Cluster ACL view: Allow/Deny conflicts resolve to Deny, and prune
  scope covers every policy.
- BREAKING: referenced Secrets must carry the label
  gitops.monedula.dev/credential-source=true (opt out with
  --require-secret-label=false / requireSecretLabel: false).
- Optional --secret-namespaces / rbac.secretNamespaces replaces
  cluster-wide Secret RBAC with per-namespace Roles.
@mmatloka
mmatloka merged commit be382b4 into main Nov 19, 2026
15 checks passed
@mmatloka
mmatloka deleted the chore/deps-go-1.26.11-security-fixes branch November 19, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants