Skip to content

feat: add --enable-host-access flag and fix CONNECT to port 80#190

Merged
Mossaka merged 1 commit intomainfrom
feat/enable-host-access-189
Jan 6, 2026
Merged

feat: add --enable-host-access flag and fix CONNECT to port 80#190
Mossaka merged 1 commit intomainfrom
feat/enable-host-access-189

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Jan 6, 2026

Summary

This PR addresses issue #189 by:

  • Making host.docker.internal opt-in via --enable-host-access flag

    • By default, containers cannot resolve host.docker.internal
    • When enabled, adds extra_hosts to both Squid and agent containers
    • Shows security warning when combined with host.docker.internal domain
  • Allowing CONNECT method to Safe_ports (80 and 443)

    • Changes http_access deny CONNECT !SSL_ports to !Safe_ports
    • Required because Node.js fetch uses CONNECT for HTTP through proxy
    • Domain ACLs remain the primary security control

Security Considerations

  1. Host access is opt-in - Prevents accidental exposure of host services
  2. Warning displayed when host.docker.internal is in allowed domains
  3. Safe_ports change has minimal security impact - Domain filtering remains the primary control

Usage

# Enable access to services running on the host via host.docker.internal
sudo awf \
  --enable-host-access \
  --allow-domains host.docker.internal \
  -- curl http://host.docker.internal:8080

Test Plan

  • Unit tests for --enable-host-access flag behavior
  • Unit tests for Safe_ports CONNECT rule
  • Documentation updated in docs/usage.md
  • Manual testing with MCP gateway on host

Closes #189

🤖 Generated with Claude Code

This PR addresses issue #189 by:

1. Making host.docker.internal opt-in via --enable-host-access flag
   - By default, containers cannot resolve host.docker.internal
   - When enabled, adds extra_hosts to both Squid and agent containers
   - Shows security warning when combined with host.docker.internal domain

2. Allowing CONNECT method to Safe_ports (80 and 443)
   - Changes `http_access deny CONNECT !SSL_ports` to `!Safe_ports`
   - Required because Node.js fetch uses CONNECT for HTTP through proxy
   - Domain ACLs remain the primary security control

Security considerations:
- Host access is opt-in to prevent accidental exposure of host services
- Warning displayed when host.docker.internal is in allowed domains
- Safe_ports change has minimal security impact as domain filtering is primary control

Closes #189

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

💥 WHOOSH! Smoke Claude springs into action on this pull request! [Panel 1 begins...]

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Test Coverage Report

Metric Coverage Covered/Total
Lines 80.71% 1235/1530
Statements 80.68% 1266/1569
Functions 77.71% 136/175
Branches 72.15% 412/571
Coverage Thresholds

The project has the following coverage thresholds configured:

  • Lines: 38%
  • Statements: 38%
  • Functions: 35%
  • Branches: 30%

Coverage report generated by `npm run test:coverage`

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Smoke Test Results (Run #20760004554)

✅ GitHub MCP: Reviewed PRs #186, #185
✅ File Writing: Created /tmp/gh-aw/agent/smoke-test-copilot-20760004554.txt
✅ Bash Tool: File verified successfully

Status: PASS

📰 BREAKING: Report filed by Smoke Copilot fer issue #190 🗺️

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Smoke Test Results:

Status: FAIL

💥 [THE END] — Illustrated by Smoke Claude fer issue #190 🗺️

@Mossaka Mossaka merged commit 5d61af1 into main Jan 6, 2026
38 checks passed
@Mossaka Mossaka deleted the feat/enable-host-access-189 branch January 6, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CONNECT requests to port 80 blocked by Squid ACL rules

1 participant