Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Implement sys.getEnv() function to return local environment variables #259

Closed
Milkshak3s opened this issue Jul 31, 2023 · 1 comment · Fixed by #274
Closed
Labels
feature New feature or request

Comments

@Milkshak3s
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Production systems often expose secrets, or the location of secrets as environment variables. Viewing these variables is useful for identifying the system we're executing on, or for locating secrets for priv esc.

Describe the solution you'd like
A functions like sys.getEnv() that returns a dict of keys -> values of env vars:

{
  "SOME_VARIABLE": "SOME VALUE"
}

Describe alternatives you've considered
We could rely on sys.exec executing env or similar, though this would make our actions more visible in a process tree.
(Right? Plz correct me here if wrong)

Additional context
Add any other context or screenshots about the feature request here.

@Milkshak3s Milkshak3s added the feature New feature or request label Jul 31, 2023
@hulto
Copy link
Collaborator

hulto commented Jul 31, 2023

Good idea!
Maybe sys.get_env() for naming consistency.
Would be nice to have an optional parameter "key: string" to get just one env var if it exists (empty if it doesn't)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants