# Security in Managed Kubernetes

Who may do what (IAM), what is recorded, how secrets are encrypted, and who can reach a cluster.

## IAM actions

Every operation is checked against your IAM policies. A cluster's resource name is
`rn:ews:<region>:<org>:eks:cluster/<cluster id>`; permission checks always use the id, also when you
address the cluster by name. Node groups, access entries, add-ons and pod identity associations
have resource names of their own under the cluster.

(The table of IAM actions is generated on the web page.)
- `eks:AccessKubernetesApi` issues a token, so it is a write. It is only half of getting in: the
  caller also needs an access entry (see [Cluster access](cluster-access.md)).
- Handing a role to a node group or a pod identity association also needs `iam:PassRole` on that
  role.
- Installing `external-dns`, or `cert-manager` with zones, also needs `dns:ChangeRecords` on every
  zone listed.
- The cluster's own components (load balancers, volumes, DNS add-ons) are not IAM principals;
  Deutsche Cloud acts for them only on resources that belong to the cluster, or on the zones an add-on
  lists. Image pulls from your registry are the exception: they use the node group's IAM role.

## Audit

Every write that reaches its permission check is recorded in the audit log, allowed or refused. A
read is recorded only when it is refused. A request refused before its permission check, for
example for an unknown cluster (`404`), records nothing. Changes to a cluster are also
written to its **Activity**, with who made them: creation, settings, node groups, access entries
and policies, pod identity associations, add-ons, upgrades, snapshots and restores, and every
issuance of break-glass credentials.

Inside the cluster, the Kubernetes audit log is collected by default (see
[Read control-plane logs](read-control-plane-logs.md)).

## Encryption

- Kubernetes Secrets are encrypted in etcd with KMS v2; the key-encryption key stays with
  Deutsche Cloud.
- etcd snapshots are sealed with a key per snapshot under Deutsche Cloud's master key, and cannot be
  downloaded.
- Volumes of the default StorageClass `ews-volume-encrypted` are opened with LUKS on the node; the
  key is released only to the node the volume is attached to.

## Network exposure

- The API endpoint answers on its public address to the networks you allow, inside the network, or
  both; see [Set API endpoint access](set-endpoint-access.md). Every request authenticates.
- Nodes accept no inbound traffic from the internet until you add rules to the cluster's node
  security group; see [What runs on your machines](what-runs-on-your-machines.md).
- The control plane reaches kubelets through a tunnel the nodes open (Konnectivity).

## Related

- [Cluster access](cluster-access.md)
- [Monitoring](monitoring.md)
