fix(security): restrict !exec YAML function with command allowlist and env sanitization#2276
Draft
fix(security): restrict !exec YAML function with command allowlist and env sanitization#2276
Conversation
…nitization - Add ExecConfig struct to AtmosConfiguration with AllowedCommands allowlist - Strip credential-bearing env vars (tokens, secrets, passwords, API keys) from !exec environment - Validate all shell command names against allowlist when exec.allowed_commands is configured - Thread AtmosConfiguration into ProcessTagExec; config-load path passes nil (no allowlist) - Stack-processing path (yaml_func_utils.go) passes full atmosConfig for enforcement - Add tests for allowlist enforcement, pipe blocking, env sanitization Agent-Logs-Url: https://github.com/cloudposse/atmos/sessions/4b8b3a24-2205-4fcf-9cf5-a281dfbe5523 Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
…nsitiveEnvVar Agent-Logs-Url: https://github.com/cloudposse/atmos/sessions/4b8b3a24-2205-4fcf-9cf5-a281dfbe5523 Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Agent-Logs-Url: https://github.com/cloudposse/atmos/sessions/4a45f41f-d4a8-418a-89a6-54f80ec76981 Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Agent-Logs-Url: https://github.com/cloudposse/atmos/sessions/1725e0a1-9539-4c55-ae01-d28f5efd8c23 Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
nitrocode
April 1, 2026 15:48
View session
Dependency Review✅ No vulnerabilities or license issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
…r exec field Agent-Logs-Url: https://github.com/cloudposse/atmos/sessions/ac5477dd-98e8-428e-9818-be96ba3affcf Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2276 +/- ##
==========================================
+ Coverage 77.16% 77.18% +0.02%
==========================================
Files 1034 1034
Lines 97576 97623 +47
==========================================
+ Hits 75296 75355 +59
+ Misses 18073 18061 -12
Partials 4207 4207
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nil, //→nil, //)"exec": {}field"exec": {}field