About signatures for individual tokens #4
Replies: 3 comments 5 replies
-
yes
yes. With
The exact same thing could be said with non encrypted code. A rogue employee can change the code to make the application do something to its own benefit Other tools are subject to the same problem: SOPS is able to detect some partial changes with its MAC, but it won't see anything if someone encrypts a new file with the same keys. The new file will contain a valid MAC, but with tempered values. Fortunately we have procedures to reduce this kind of risk — code reviews being one of them. The encrypted secrets could be treated in the exact same way. |
Beta Was this translation helpful? Give feedback.
-
In addition to my initial comment (and the other thread above that focuses on authentication or signing) there is another factor that should be handled: binding an encrypted token to a particular key in your YAML. Take for example the following context:
Even if you implement signing and/or authentication, because we didn't also tie that signature / MAC to the "context" (i.e. "this is the encrypted SMTP SaaS secret key for the production instance"), one can transplant tokens from one place to another. Thus, when you implement the signing / authentication I would also include as "additional data" (assuming you are using an AEAD algorithm) the following information:
The building blocks that |
Beta Was this translation helpful? Give feedback.
-
You propose that someone that change an encrypted values also signs it, so I guess the signature must be verified during the deployment against a set of allowed identities that are actually allowed to change these values? |
Beta Was this translation helpful? Give feedback.
-
First of all I must make the distinction between MAC (checking that something hasn't tampered with the encrypted content) and "signatures" (checking the identity of the sender / encrypter). By my understanding of
age
, it doesn't support "signatures", it supports only MACs.The readme mentions that the tool doesn't support MACs at the file level. I do assume that it does support MACs at the token (i.e. YAML value) level.
However, the issue with MACs, as implemented by
age
, is that they are useful only to detect if something non-malicious has happened in transit (or at rest), because anyone (without access to the private key) can replace an entireage
encrypted file (YAML value in our case) with a completely different one, and nobody would observe it. (The MAC protects the original value from tampering by example swapping bytes, extending / truncating, etc. It doesn't protect against complete replacement.)Why do I care about "signatures" for values? Because not having them allows an attacker (say a rogue employee that doesn't have the private key, but does have write access to the repository) to start replacing "sensitive" tokens with ones he controls, thus introducing security breaches.
For example, say one has an application that delivers sensitive information via email to people (or replace email with SMS, etc.). A rogue employee might want to have access to those emails, but he doesn't have access to the production instance or the sending infrastructure (say we are using a cloud provider to send those messages). Say that the credentials of the email cloud service are stored in a YAML file (read at production run-time) and protected by
yage
. Then, the rogue employee could create a different account (that he controls) on the same cloud provider, and swap the "real" credentials (say secret / access key) with his own. Thus he could convince the production server to route the client emails through a system he controls, thus allowing him to intercept the client messages.(The same scenario can be applied to all kind of SaaS services, and to other internal resources / URLs / IPs that are used on critical paths.)
Beta Was this translation helpful? Give feedback.
All reactions