Replies: 3 comments
-
Hey, I think that makes sense to allow extending the supported backends. I do like your approach of creating a protocol/interface here. We could imagine having a "magic" function (like |
Beta Was this translation helpful? Give feedback.
-
by keeping it mostly generic the protocol method However lets keep this discussion going around requirements before we jump to solutioning. There are a couple of security concerns to consider here, since we would be allowing external packages to provide secret backends, we should look to pass only the configuration relevant to that secret backend. An example of that is if I happen to write a new aws secrets manager backend, When my backend is invoked I should not also receive the configuration for any other secrets backends like I shouldn't get the vault address, or any config that might allow access to another backend. I am also not sure about the discovery part, I would like to understand more about the idea, but my concern here is that through a supply chain attack some dependency pulls in another dependency which would be discovered as a secrets backend. This backend could be malicious and gather secrets even those not defined in the experiment by receiving the config and then communicating with the secret provider and harvesting secrets etc. I suspect we will need to start with an MVP approach to this. we are not going to get it all right in one go. but I think this is a solid feature improvement for the tool |
Beta Was this translation helpful? Give feedback.
-
The supply chain risk exists for sure. That said, it exists by the very nature of how we load extensions as well. I do care for security but I think we shouldn't mix topics. Supply chain, as a general threat, should deserve its own topic for a more holistic approach to it by the framework. We have a choice, either we let users implement their own secret backend, even if another exist. This could happen on AWS for instance if you have specific requirements on how you need to access secrets. Or we want the CTK implementation to be the sole authority. In that case, I'd rather we keep all the backend in chaostoolkit-lib. In that case, we can always delegate to installing the right dependencies via extras
That's a fair expectation. |
Beta Was this translation helpful? Give feedback.
-
Currently
secrets.py
is a python module in thechaostoolkit-lib
package. It holds all the code related to loading secrets. Currently this supports onlyenv
andvault
(hashicorp) secret types. However in todays tech stack there are many other places secrets may be stored. Examples are AWS SSM (secure strings), AWS Secrets Manager, Azure Key Vault, Kubernetes Secret. The code currently maintains two different concerns, ENV and VAULT. This means that there are multiple reasons to have to change the module which goes against the Single responsibility principle. It also means there is more to test and as new secret types are added we would need to update the code to define theseCurrent loop
This if statement could grown significantly and doesn't lend its self to scaling or being extendable. Refactoring the
secret
module could see a newsecret
package created and have two modules,env
andvault
. This allows us to separate out the functionality and tests for each secret type. The mainchaostoolkit-lib
would still have asecret
module that could define aProtocol
for what makes a secret. This will need some thought but based on the existing setup might have two methodsinitalise_secret_provider
andload_secret
. Thesecret
module could then have a map that maps secrettype
to a package name loaded at run time. This would also lend its self to allow in the future others to pass a secret map that would map their own secret types to their own packages outside of the core, allowing users to extend the functionality where the tookit community might not have the time or experience to implement a secret provider for their given platform.Beta Was this translation helpful? Give feedback.
All reactions