-
Notifications
You must be signed in to change notification settings - Fork 373
Fix network/firewall schema description and engine support inconsistencies #17909
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
Changes from 2 commits
37dec68
db25fc3
a981e31
34c70b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -699,6 +699,8 @@ func (c *Compiler) computeAllowedDomainsForSanitization(data *WorkflowData) stri | |
| return GetCodexAllowedDomains(data.NetworkPermissions) | ||
| case "claude": | ||
| return GetClaudeAllowedDomains(data.NetworkPermissions) | ||
| case "gemini": | ||
| return GetGeminiAllowedDomainsWithToolsAndRuntimes(data.NetworkPermissions, data.Tools, data.Runtimes) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot review why Gemini uses runtime and the other no...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch — Gemini only had the The actual engine execution code ( Fixed in a981e31 — all four engine cases now call
Comment on lines
689
to
+697
|
||
| default: | ||
| // For other engines, use network permissions only | ||
| domains := GetAllowedDomains(data.NetworkPermissions) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -216,8 +216,8 @@ func (c *Compiler) ExtractEngineConfig(frontmatter map[string]any) (string, *Eng | |
| } | ||
| } | ||
|
|
||
| // Extract log_level field (default: "debug") | ||
| if logLevel, hasLogLevel := firewallObj["log_level"]; hasLogLevel { | ||
| // Extract log-level field (default: "debug") | ||
| if logLevel, hasLogLevel := firewallObj["log-level"]; hasLogLevel { | ||
| if logLevelStr, ok := logLevel.(string); ok { | ||
| firewallConfig.LogLevel = logLevelStr | ||
| } | ||
|
Comment on lines
+219
to
223
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ var engineFirewallSupportLog = logger.New("workflow:engine_firewall_support") | |
| // hasNetworkRestrictions checks if the workflow has network restrictions defined | ||
| // Network restrictions exist if: | ||
| // - network.allowed has domains specified (non-empty list) AND it's not just "defaults" | ||
| // - network.blocked has domains specified (non-empty list) | ||
| func hasNetworkRestrictions(networkPermissions *NetworkPermissions) bool { | ||
| if networkPermissions == nil { | ||
| return false | ||
|
|
@@ -33,6 +34,11 @@ func hasNetworkRestrictions(networkPermissions *NetworkPermissions) bool { | |
| return true | ||
| } | ||
|
|
||
| // If blocked domains are specified, we have restrictions | ||
| if len(networkPermissions.Blocked) > 0 { | ||
| return true | ||
| } | ||
|
Comment on lines
+37
to
+40
|
||
|
|
||
| return false | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schema now documents
network.firewall.cleanup-script, but the compiler’sextractFirewallConfigpath (used fornetwork.firewall) doesn’t parse this field, andCleanupScriptis not used anywhere when building AWF commands. As-is, users can setcleanup-scriptand it will be silently ignored. Please wire this through end-to-end: parse the field fromnetwork.firewall(ideally accepting bothcleanup-scriptand the legacy underscore form for compatibility) and ensure it is actually applied during/after AWF shutdown (or remove it from the schema if it’s not supported).