Security in Compute
Who may do what (IAM), what is audited, how volumes are encrypted, and how instances are exposed to the network.
IAM actions
Every operation is checked against your IAM policies. A resource name looks like
rn:ews:de1:<org>:ec2:instance/<instance id>; the resource types are instance, volume, vpc,
subnet, security-group, key-pair, image, elastic-ip, snapshot-policy, nat-gateway and
snapshot.
| Action | Access | What it allows |
|---|---|---|
ec2:DescribeInstances | Read | List and describe instances |
ec2:StartInstances | Write | Start stopped instances |
ec2:StopInstances | Write · destructive | Stop running instances |
ec2:RebootInstances | Write · destructive | Reboot instances |
ec2:TerminateInstances | Write · destructive | Terminate instances |
ec2:RunInstances | Write | Launch new instances |
ec2:ModifyInstanceAttribute | Write · destructive | Rename or resize an instance |
ec2:GetInstanceUserData | Read · sensitive | Read the cloud-init user data an instance booted with |
ec2:AssociateInstanceRole | Write | Give a running instance an IAM role it gets short-lived credentials for (also needs iam:PassRole on the role) |
ec2:DisassociateInstanceRole | Write · destructive | Take an instance’s IAM role away; it gets no new credentials |
ec2:RotateInstanceIdentity | Write | Replace an instance’s identity secret (the machine does this itself at boot and daily) |
ec2:GetInstanceIdentityToken | Read · sensitive | An instance gets a signed, five-minute identity token for one audience, to prove itself to a third party |
ec2:AddInstanceKey | Write | Add a key pair to a running instance’s authorized_keys (root and its default user), through Deutsche Cloud Connect, without a reboot |
ec2:RemoveInstanceKey | Write · destructive | Remove a key pair that Deutsche Cloud added from a running instance |
ec2:StartSession | Write | Open a terminal on an instance from the console or the CLI (Deutsche Cloud Connect, no inbound port) |
ec2:DescribeSessions | Read | List terminal sessions on instances: who, when, how long, how much |
ec2:TerminateSession | Write · destructive | End someone else’s terminal session (ending your own needs no permission) |
ec2:RegisterConnectKey | Write | An instance registers the key its Deutsche Cloud Connect tunnel logs in with (the machine does this itself) |
ec2:DescribeVolumes | Read | List EBS volumes |
ec2:CreateVolume | Write | Create EBS volumes |
ec2:DeleteVolume | Write · destructive | Delete EBS volumes |
ec2:AttachVolume | Write | Attach volume to instance |
ec2:ModifyVolume | Write | Rename a volume or grow its size |
ec2:RotateVolumeKey | Write | Replace an encrypted volume’s LUKS passphrase with a new key |
ec2:InstallVolumeHelper | Write | Get the install script (with a fresh instance credential) that lets an older instance open encrypted volumes |
ec2:DetachVolume | Write · destructive | Detach volume from instance |
ec2:DescribeSnapshots | Read | List volume snapshots and their progress |
ec2:CreateSnapshot | Write | Snapshot a volume to object storage (stops its instance when asked to) |
ec2:DeleteSnapshot | Write · destructive | Delete a volume snapshot and the stored data no other snapshot uses |
ec2:DescribeVpcs | Read | List VPCs |
ec2:DescribeNatGateways | Read | List NAT gateways and their public addresses |
ec2:CreateNatGateway | Write | Give a VPC a NAT gateway, so machines without a public IPv4 reach the internet |
ec2:DeleteNatGateway | Write · destructive | Delete a NAT gateway; private machines lose IPv4 internet access |
ec2:CreateVpc | Write | Create VPCs |
ec2:DeleteVpc | Write · destructive | Delete VPCs |
ec2:DescribeSecurityGroups | Read | List security groups |
ec2:CreateSecurityGroup | Write | Create security groups |
ec2:DeleteSecurityGroup | Write · destructive | Delete security groups |
ec2:AuthorizeSecurityGroupIngress | Write | Add inbound security group rules |
ec2:RevokeSecurityGroupIngress | Write · destructive | Remove inbound security group rules |
ec2:AuthorizeSecurityGroupEgress | Write | Add outbound security group rules |
ec2:RevokeSecurityGroupEgress | Write · destructive | Remove outbound security group rules |
ec2:DescribeSubnets | Read | List subnets |
ec2:DescribeAvailabilityZones | Read | List availability zones and the provider location behind each |
ec2:DescribeInstanceTypeOfferings | Read | List which instance types each availability zone sells right now (live provider stock) |
ec2:CreateSubnet | Write | Create a subnet in a VPC, in one availability zone |
ec2:DeleteSubnet | Write · destructive | Delete a subnet no instance holds an address in |
ec2:DescribeAddresses | Read | List Elastic IP addresses |
ec2:AllocateAddress | Write | Allocate a new Elastic IP |
ec2:ReleaseAddress | Write · destructive | Release an Elastic IP |
ec2:AssociateAddress | Write | Associate an Elastic IP with an instance |
ec2:DisassociateAddress | Write · destructive | Disassociate an Elastic IP from an instance |
ec2:DescribeImages | Read | List machine images |
ec2:CreateImage | Write | Create a machine image from an instance |
ec2:DeregisterImage | Write · destructive | Deregister a machine image and delete its provider snapshot |
ec2:DescribeSnapshotPolicies | Read | List snapshot policies and their schedules |
ec2:CreateSnapshotPolicy | Write | Create a policy that snapshots instances on a schedule |
ec2:UpdateSnapshotPolicy | Write | Change, pause or run a snapshot policy now |
ec2:DeleteSnapshotPolicy | Write · destructive | Delete a snapshot policy (the images it made are kept) |
ec2:DescribeKeyPairs | Read | List key pairs |
ec2:ImportKeyPair | Write | Import an SSH public key as a key pair |
ec2:DeleteKeyPair | Write · destructive | Delete a key pair |
Generated from the service’s IAM descriptor. Sensitive reads hand over secret material or source code and are recorded in the audit log like writes; destructive writes delete, overwrite or revoke.
- Start, stop and reboot are three actions:
ec2:StartInstances,ec2:StopInstances(stop and shutdown) andec2:RebootInstances. Renaming, resizing and changing security groups are allec2:ModifyInstanceAttribute. - Security group rules are checked by direction:
ec2:AuthorizeSecurityGroupIngress/…Egressto add,ec2:RevokeSecurityGroupIngress/…Egressto remove, read from the stored rule. - Launching with extra volumes also needs
ec2:CreateVolumeandec2:AttachVolume; with an instance role,iam:PassRoleon it; with a public hostname,dns:ChangeRecordson the zone. - Snapshotting an attached volume also needs
ec2:StopInstanceson its instance. - Choosing a KMS key for a volume needs
kms:Encrypton that key. ec2:GetInstanceUserDatais a sensitive read: not in the read-only presets, and recorded in the audit log whether allowed or refused.- The instance type catalog, image catalog and region list (
/ec2/api/catalog/…) need a signed-in caller and no action. - Key pairs in the console use the KMS SSH key pair actions (
kms:GenerateSshKeyPair,kms:ImportSshKeyPair,kms:DeleteSshKeyPair). The list needskms:ListSshKeyPairsorec2:DescribeKeyPairs.
Audit
Every write is recorded in the audit log with its outcome, as is every read of user data. A machine
receiving its role's credentials is recorded as iam:AssumeRoleForInstance, and every identity
token as ec2:GetInstanceIdentityToken.
Encryption
- Volumes are encrypted with LUKS2 by default, each with its own key, wrapped by the platform key or by one of your KMS keys. The key is released only to the instance the volume is attached to, from its own address. Deleting the volume deletes the key. See Use encrypted volumes.
- Volume snapshots of an encrypted volume are copied as ciphertext and keep their own copy of the key.
- Root disks are not encrypted.
Network exposure
- With no security group attached, every port of an instance is open to the internet. The launch
wizard proposes a new group that lets in SSH from your address only, and warns Every port of
this machine will be open to the internet. when you choose none. Through the API, CLI or
Terraform, an instance launched without
securityGroupIdshas no group. - Security groups filter the public side; traffic inside a private network is not filtered.
- An instance launched without a public IPv4 has a public IPv6 address and no inbound IPv4.
- No root password is set on a machine; logins use keys.
- Deutsche Cloud Connect is on unless you launch with
connect: false: the machine keeps one outbound SSH connection to Deutsche Cloud, through which the console terminal logs in and keys are added, with no inbound port open. See What runs on your machines.