-
Notifications
You must be signed in to change notification settings - Fork 30
fix(firewall): add api-proxy to allowed domains when enabled #804
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 all commits
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 | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1112,8 +1112,13 @@ export async function writeConfigs(config: WrapperConfig): Promise<void> { | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Write Squid config | ||||||||||||||||||||||||
| // Note: Use container path for SSL database since it's mounted at /var/spool/squid_ssl_db | ||||||||||||||||||||||||
| // When API proxy is enabled, add api-proxy to allowed domains so agent can communicate with it | ||||||||||||||||||||||||
| const domainsForSquid = config.enableApiProxy && networkConfig.proxyIp | ||||||||||||||||||||||||
| ? [...config.allowedDomains, 'api-proxy'] | ||||||||||||||||||||||||
|
Comment on lines
+1115
to
+1117
|
||||||||||||||||||||||||
| // When API proxy is enabled, add api-proxy to allowed domains so agent can communicate with it | |
| const domainsForSquid = config.enableApiProxy && networkConfig.proxyIp | |
| ? [...config.allowedDomains, 'api-proxy'] | |
| // Note: Use container path for SSL database since it's mounted at /var/spool/squid_ssl_db | |
| // When API proxy is enabled, add api-proxy to allowed domains so agent can communicate with it, | |
| // but avoid duplicating entries if the user already specified api-proxy (or .api-proxy). | |
| const hasApiProxyDomain = | |
| config.allowedDomains.includes('api-proxy') || | |
| config.allowedDomains.includes('.api-proxy'); | |
| const domainsForSquid = config.enableApiProxy && networkConfig.proxyIp | |
| ? (hasApiProxyDomain ? config.allowedDomains : [...config.allowedDomains, 'api-proxy']) |
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.
This test can pass without actually asserting anything: it swallows
writeConfigserrors and then only checks the file contents ifsquid.confexists. IfwriteConfigsfails before writing the config (e.g., missing seccomp profile), theif (fs.existsSync(...))block is skipped and the test still passes. To make the coverage meaningful, ensuresquid.confis created (or mock the seccomp-profile copy) and assertexistsSyncis true, or spy ongenerateSquidConfigto verify thedomainsargument includesapi-proxy.This issue also appears on line 1894 of the same file.