kinds of things are often secrets: – Passwords, Application Tokens, Secret keys, AWS keys, etc. • You’re storing them so machines (and humans) have access to them • It might be something small and internal • It might be something a bit more important • It might be the “Keys To The Kingdom”
a secret mean? mean? • Don’t store them in plain text on disk • Don’t pass them as command line parameters, or environment variables • Don’t store them in GitHub... • This is harder than it sounds...
• Microservices are by definition network-facing • If you cannot protect your Vault key, then your secrets are at risk • If an attacker compromises your application, they probably have access to your vault key... • If you could protect your Vault key, you could probably protect your secrets • Vault software helps but is not enough • We need to be able to protect our vault keys!
the rescue! • UNIX domain sockets allow authentication of the application that’s connecting – User ID – Group ID – Process ID – Security Context (SE Linux)
information comes from the process that initially connected • There is an attack based on this “freezing” • It involves forking lots of processes and wrapping around pids • It will likely fail many, many times before succeeding • It’s much harder to carry out in a container environment • The shorter the interval between connection and authentication, the harder this is to carry out • In the worst case, it’s still much harder to subvert than an environment variable or a file • It cannot subvert the security context information
you get even more information from information from • /proc • Docker inspect This gives you something similar to the DNA of the caller – the cyber analog of biometrics Authenticate your caller with just this information
– identifies the container • /proc/<pid>/exe - full pathname client binary • /proc/<pid>/uid_map (and gid_map) • /proc/<pid>/status – uid/gid info, ppid • /proc/<pid>/cmdline - client command line – can be modified by the application
• Name - the name of the image • Path - full pathname of the container's "init" process • Args - the arguments given to the init process in the container • State.Pid - the process id of the container's "init" process • Config.Hostname - hostname of this container • Config.Image - the image name that client is running in • Image - the SHA256 sum of "Config.Image"
• Custodia: – Proxies the entire secret management infrastructure – Duplicate configuration with Vault – Larger attack surface (even though it’s good code) • What if you just provided vault keys? – Each client just gets a vault key when authenticated – Clients use key to connect directly to vault
its work immediately – short interval – makes the attack harder • AuthProxy doesn’t read any data from client – This eliminates several classes of attacks • Total AuthProxy code is small ~ 300 lines • Much harder to subvert than environment variables or files to store keys in