!atvIbxHoEqNcAIxYpN:nixos.org

NixOS AWS

64 Members
15 Servers

Load older messages


SenderMessageTime
15 Oct 2024
@commiterate:matrix.orgcommiterateI wouldn't be surprised if it were on the backlog or if they view the EIC certs from IMDS also providing proof that the EC2 Key Pair is also probably safe06:34:32
@commiterate:matrix.orgcommiteratethough they don't encrypt the SSH keys and require you to use the certs to decrypt the ciphertext, so...06:35:10
@commiterate:matrix.orgcommiterateat least that's my understanding, but the existing EIC AuthorizedKeysCommand Bash scripts aren't the easiest to read06:35:41
@commiterate:matrix.orgcommiterateMight be interesting for people who use Nix on non-NixOS EC2 instances (e.g. macOS): https://github.com/DeterminateSystems/nix-installer/issues/123506:37:05
@commiterate:matrix.orgcommiterate * I wouldn't be surprised if it were on the backlog or if they view the EIC certs from IMDS also providing proof that the EC2 Key Pair from IMDS also hasn't been tampered with 06:39:01
@commiterate:matrix.orgcommiterate * at least that's my understanding and what that security finding points out, but the existing EIC AuthorizedKeysCommand Bash scripts aren't the easiest to read 06:45:23
@commiterate:matrix.orgcommiterate * at least that's my understanding and what that security finding outlines, but the existing EIC AuthorizedKeysCommand Bash scripts aren't the easiest to read 06:45:31
@commiterate:matrix.orgcommiterateeven if they did encrypt the keys with the cert, it would still be vulnerable to MITM since it can just replace all IMDS responses06:46:28
@arianvp:matrix.orgArianI think the trick here is maybe to point to flakehub?09:53:30
@arianvp:matrix.orgArianNote there's a determinate systems discord. I'd suggest discussing a bit there09:53:50
@arianvp:matrix.orgArianP.S. MacOS is such a pain on EC2 holy moly09:54:18
@arianvp:matrix.orgArianYou have to install NixOS on the (unsupported) instance store09:54:43
@arianvp:matrix.orgArian * You have to install Nix on the (unsupported) instance store 09:54:51
@arianvp:matrix.orgArianand I have had several occasions where the instance store is just... broken09:55:02
@arianvp:matrix.orgArianInstalling nix on the EBS volume isn't possible automatically. You need to do a GUI step09:55:20
@arianvp:matrix.orgArianI've wasted days and hours of my life on this at work09:55:37
@arianvp:matrix.orgArianand any time you make a mistake; AWS will take around 3-8 hours to reboot the machine09:55:49
@arianvp:matrix.orgArianit's the most frustrating, painful product I have ever used09:56:03
@arianvp:matrix.orgArianno you're not as you dont have control over amazon's certificates10:07:56
@arianvp:matrix.orgArianthat's why you cant spoof EIC keys (after they fixed the vuln in the post)10:08:09
@arianvp:matrix.orgArianbut the root key is just plopped on disk by cloud-init without any checks10:08:22
@arianvp:matrix.orgArianI guess you're "protected" because cloud-init does this on first boot and then leaves it alone10:08:41
@arianvp:matrix.orgArian But my problem is you want to replace with with a ProxyCommand which makes it a continuous risk. EIC has hardening agaisnt this by signing the payloads with an AWS Cert. but the main SSH key doesnt have this protection 10:09:18
@arianvp:matrix.orgArianThe fact that the key is written to disk only once at bootup is kind of a security feature in this way10:09:40
@arianvp:matrix.orgArianas later IMDS spoofing doesn't lead people to be able to change the key10:09:53
@arianvp:matrix.orgArianEIC doesn't have this issue due to the Certificate being in play and not being able to spoof the IMDS payload10:10:15
@arianvp:matrix.orgArian * that's why you cant spoof EIC keys (after they fixed the vuln of incorrect cert validation in the post. which they seem they have) 10:10:37
@arianvp:matrix.orgArian I mean AuthorizedKeysCommand when I wrote ProxyCommand 10:11:58
@commiterate:matrix.orgcommiteratehmm assuming the trusted root CAs are baked onto the host and the attacker can only spoof off-instance stuff (e.g. IMDS), the attacker can just only inject responses in the get SSH keys endpoint. Basically, as long as the certs from the cert endpoint are valid, it just blindly trusts the SSH keys endpoint response.17:24:34
@commiterate:matrix.orgcommiterateUnless this line is actually doing some kind of validation my thing is missing: https://github.com/aws/aws-ec2-instance-connect-config/blob/551c73e8ec1f5ade4c8b1f52cf616e75b47879b4/src/bin/eic_parse_authorized_keys#L30717:25:09

Show newer messages


Back to Room ListRoom Version: 10