feat(trust): wire per-tier egress NetworkPolicy + live telemetry ingestion#55
Draft
gnanirahulnutakki wants to merge 1 commit into
Draft
feat(trust): wire per-tier egress NetworkPolicy + live telemetry ingestion#55gnanirahulnutakki wants to merge 1 commit into
gnanirahulnutakki wants to merge 1 commit into
Conversation
…stion (a) NetworkPolicy generation: pkg/trust/network_policy.go generates K8s NetworkPolicy objects per trust tier (full=allow-all, limited=cluster- internal only, quarantine=Prometheus-only on TCP 9090). The reconciler calls applyNetworkPolicyForTier after every credential issuance so tier changes take immediate effect. (b) Telemetry ingestor: cmd/operator/telemetry_handler.go exposes POST /telemetry/signal (default :8082) accepting TelemetrySignal JSON from Tetragon, Kubescape, and credential verifiers. On tier change the handler fires applyPolicy so egress is re-enforced without waiting for the next reconcile. Locally testable: manifest generation (9 tests) and ingestor (9 tests) run without a cluster. NetworkPolicy.Create/Update calls in applyNetworkPolicy and the acceptance criterion (tier change measurably changes egress) require a K8s cluster. Fixes #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41
What
(a) Per-tier NetworkPolicy egress enforcement
go/pkg/trust/network_policy.go— pure Go generator, no cluster needed:full(≥70)vibap-egress-fulllimited(≥40)vibap-egress-limitedquarantine(<40)vibap-egress-quarantineThe reconciler (
issueCredential) callsapplyNetworkPolicyForTierafter every credential issuance, so a tier change takes effect on the next reconcile without waiting.(b) Live telemetry ingestion
go/cmd/operator/telemetry_handler.go— HTTP handler:POST /telemetry/signal(default:8082, flag--telemetry-bind-address)TelemetrySignalwire format)TrustScoreJSON (includingauthorization_tier)applyPolicycallback to immediately re-enforce egressTests
go/pkg/trustgo/cmd/operatorNeeds a cluster
The following require a K8s cluster with a CNI that supports NetworkPolicy:
applyNetworkPolicy(Get + Create/Update K8s API calls in reconciler)Without a cluster,
applyNetworkPolicyForTierlogs a warning and continues — the trust score update still persists and the NetworkPolicy object is generated correctly (verified by 9 unit tests).