nixpkgs/nixos
Graham Christensen 83ea88e03f
nixos: ec2 ami: support IMDSv2
AWS's metadata service has two versions. Version 1 allowed plain HTTP
requests to get metadata. However, this was frequently abused when a
user could trick an AWS-hosted server in to proxying requests to the
metadata service. Since the metadata service is frequently used to
generate AWS access keys, this is pretty gnarly. Version two is
identical except it requires the caller to request a token and provide
it on each request.

Today, starting a NixOS AMI in EC2 where the metadata service is
configured to only allow v2 requests fails: the user's SSH key is not
placed, and configuration provided by the user-data is not applied.
The server is useless. This patch addresses that.

Note the dependency on curl is not a joyful one, and it expand the
initrd by 30M. However, see the added comment for more information
about why this is needed. Note the idea of using `echo` and `nc` are
laughable. Don't do that.
2020-11-19 13:00:56 -05:00
..
doc Merge master into staging-next 2020-11-13 20:58:35 +01:00
lib nixos: use nativeBuildInputs in make- iso9660-image and system-tarball 2020-11-18 14:05:30 +01:00
maintainers Merge pull request #102174 from grahamc/ami-root-use-gpt 2020-10-30 16:14:37 -04:00
modules nixos: ec2 ami: support IMDSv2 2020-11-19 13:00:56 -05:00
tests Merge pull request #104018 from NeQuissimus/xterm_update 2020-11-17 12:15:19 -05:00
COPYING
default.nix
README treewide: use https for nixos.org and hydra.nixos.org 2020-05-03 22:14:21 -07:00
release-combined.nix nano: Add test 2020-11-16 14:00:34 -05:00
release-small.nix nixos/release-small: drop latestKernel.login 2020-04-19 22:20:07 +03:00
release.nix nixos/release: add pantheon closure 2020-07-26 15:30:08 -04:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
https://nixos.org/nixos and in the manual in doc/manual.