Replies: 1 comment 1 reply
-
Another way would be to add another option: Variables specified in Could use some bike-shedding for the option name, but this is probably easiest to understand for the user (compared to adding more env variables, or turning their values into mini-languages). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I think I would like to have
--preserve-env
enabled by default, but have it block variables that commonly include credentials.More complex patterns
The first thing it would need is to extend the wildcard mechanism to allow a leading
*
as well, so we can write something likeI would probably add all of these patterns to my list:
Let me know if I missed anything commonly used!
Enabling
--preserve-env
by defaultFor now I can define
limactl-sh
with the new alias feature that would set my extended block list and then invokeslimactl shell --preserve-env "$@"
. That way I can uselimactl sh FOO printenv
and it would include most of my host environment.If we want to offer this as a built-in feature, then we would need a better mechanism to enable it (maybe with another env variable). Not sure this is needed, but this is why I made this a discussion and not an issue. 😄
Using the allow list to create exceptions for the block list
Right now if
LIMA_SHELLENV_ALLOW
is defined, the block list is ignored. Anything not defined in the allow list is blocked.But with my new more aggressive block list I may want to just allow a specific credential to pass though, e.g.
GITHUB_TOKEN
orOPENAI_API_KEY
, together with my regular env variables, but still block all other credentials.I haven't come up with a good mechanism to do this yet. Ideas so far:
Use yet another env variable:
LIMA_SHELLENV_BLOCK_NOT=GITHUB_TOKEN
Name needs bike shedding. Not happy about explosion of env variables.
Add a prefix to
LIMA_SHELLENV_ALLOW
similar how we have the+
prefix option onLIMA_SHELLENV_BLOCK
:LIMA_SHELLENV_ALLOW=+GITHUB_TOKEN
.It is breaking the concept that everything not explicitly allowed is blocked. The
+
has a different meaning here than on the block list, may need a different special character.Allow another prefix in the block list:
LIME_SHELLENV_BLOCK=-GITHUB_TOKEN,+*TOKEN*
All variables in the
-
list would not be blocked, even if they match a pattern in the+
list. Could be used to also remove single entries from the default block list.Turns the setting into a mini-language that might be hard to understand.
All options feel too complicated to me, but I haven't been able to come up with something simpler that is still flexible enough.
Beta Was this translation helpful? Give feedback.
All reactions