tailscale/tailcfg
Irbe Krumina c3e2b7347b
tailcfg,cmd/k8s-operator,kube: move Kubernetes cap to a location that can be shared with control (#12236)
This PR is in prep of adding logic to control to be able to parse
tailscale.com/cap/kubernetes grants in control:
- moves the type definition of PeerCapabilityKubernetes cap to a location
shared with control.
- update the Kubernetes cap rule definition with fields for granting
kubectl exec session recording capabilities.
- adds a convenience function to produce tailcfg.RawMessage from an
arbitrary cap rule and a test for it.

An example grant defined via ACLs:
"grants": [{
      "src": ["tag:eng"],
      "dst": ["tag:k8s-operator"],
      "app": {
        "tailscale.com/cap/kubernetes": [{
            "recorder": ["tag:my-recorder"]
	    “enforceRecorder”: true
        }],
      },
    }
]
This grant enforces `kubectl exec` sessions from tailnet clients,
matching `tag:eng` via API server proxy matching `tag:k8s-operator`
to be recorded and recording to be sent to a tsrecorder instance,
matching `tag:my-recorder`.

The type needs to be shared with control because we want
control to parse this cap and resolve tags to peer IPs.

Updates tailscale/corp#19821

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2024-06-10 16:36:22 +01:00
..
c2ntypes.go ipn/ipnlocal: add c2n method to check on TLS cert fetch status 2023-11-16 14:08:38 -08:00
derpmap.go all: make more tests pass/skip in airplane mode 2024-05-06 09:19:53 -07:00
proto_port_range_test.go tailcfg: implement text encoding for ProtoPortRange 2023-10-11 23:59:42 -07:00
proto_port_range.go tailcfg: implement text encoding for ProtoPortRange 2023-10-11 23:59:42 -07:00
tailcfg_clone.go tailcfg,all: add/plumb Node.IsJailed 2024-05-06 15:32:22 -07:00
tailcfg_test.go tailcfg,cmd/k8s-operator,kube: move Kubernetes cap to a location that can be shared with control (#12236) 2024-06-10 16:36:22 +01:00
tailcfg_view.go tailcfg,all: add/plumb Node.IsJailed 2024-05-06 15:32:22 -07:00
tailcfg.go tailcfg,cmd/k8s-operator,kube: move Kubernetes cap to a location that can be shared with control (#12236) 2024-06-10 16:36:22 +01:00
tka.go tailcfg: add RPC structs for /tka/affected-sigs 2023-02-21 21:58:38 +00:00