agentleFS
Cogni-AI-OUCogni-AI-OU/cogni-ai-agent-skills/gh-aw-firewall-debug/SKILL.md

gh-aw-firewall-debug

Skill4 starsChanged 6 months agoMITView on GitHub

Debug the AWF firewall by inspecting Docker containers, analyzing Squid access logs, checking iptables rules, and troubleshooting network issues.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 1 is distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when you need to debug the awf firewall, inspect container state, analyze traffic, or troubleshoot network issues.

    line 11
  2. Very specific:

    When an agentic workflow run fails with a blocked egress error.

    line 15
  3. Very specific:

    When needing to view or analyze Squid access logs or iptables rules to troubleshoot network issues.

    line 17
  4. Very specific:

    When diagnosing missing MCP tools (use gh aw audit instead of checking the network firewall).

    line 22
  5. Very specific:

    Run with debug logging and keep containers: sudo awf --allow-domains github.com --log-level debug --keep-containers 'curl …

    line 75
  6. Very specific:

    Domain blocked unexpectedly: Look at the Host header (3rd column) in /var/log/squid/access.log - it may need a subdomain allowlisted.

    line 80
  7. Very specific:

    DNS resolution failing: Verify DNS allowed in iptables with sudo dmesg | grep "FW_DNS".

    line 82
  8. Very specific:

    Avoid leaving debug containers running indefinitely.

    line 86
  9. Very specific:

    Do not make persistent iptables changes outside of the FW_WRAPPER lifecycle.

    line 87

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AWF Firewall Debugging

<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->

Use this skill when you need to debug the awf firewall, inspect container state, analyze traffic, or troubleshoot network issues.

When to Use

  • When an agentic workflow run fails with a blocked egress error.
  • To inspect Docker container states (awf-squid, awf-agent) during local firewall debugging.
  • When needing to view or analyze Squid access logs or iptables rules to troubleshoot network issues.

When Not to Use

  • For debugging simple YAML schema errors in the workflow frontmatter (use gh aw compile --verbose).
  • When diagnosing missing MCP tools (use gh aw audit instead of checking the network firewall).
  • For standard GitHub Actions CI/CD network issues unrelated to the AWF infrastructure.

Common Pitfalls

  • Stray Containers: Starting a debug session but forgetting to run the manual cleanup commands, leaving awf-squid and awf-agent containers running and consuming resources.
  • Ignoring Subdomains: Assuming allowing github.com implicitly allows api.github.com, leading to confusing TCP_DENIED errors in the Squid log.
  • DNS Confusion: Failing to check dmesg for FW_DNS blocks when a domain simply won't resolve, assuming it's a HTTP layer issue.

Core Principles

  • Non-Interactive Debugging: Rely on docker exec and grep/awk pipelines to extract logs and states.
  • Identify Access Blocks: Quickly trace TCP_DENIED in Squid logs or FW_BLOCKED in dmesg.

Commands / Usage Patterns

Check Container Status

docker ps | grep awf
docker inspect awf-squid --format='{{.State.Running}}'
docker inspect awf-agent --format='{{.State.ExitCode}}'

View and Analyze Logs

Squid proxy container (IP: 172.30.0.10) & Agent execution container (IP: 172.30.0.20).

docker exec awf-squid cat /var/log/squid/access.log
docker exec awf-squid grep "TCP_DENIED" /var/log/squid/access.log | awk '{print $3}' | sort -u
docker exec awf-squid tail -f /var/log/squid/access.log | grep --line-buffered TCP_DENIED

Inspect iptables Rules

sudo iptables -t filter -L FW_WRAPPER -n -v
docker exec awf-agent iptables -t nat -L OUTPUT -n -v
sudo dmesg | grep "FW_BLOCKED"

Network Inspection

docker network inspect awf-net
docker exec awf-agent nc -zv 172.30.0.10 3128
docker exec awf-agent cat /etc/resolv.conf

Diagnostics and Troubleshooting

Debug Mode Workflow:

  1. Run with debug logging and keep containers: sudo awf --allow-domains github.com --log-level debug --keep-containers 'curl https://api.github.com'
  2. Inspect containers: docker ps | grep awf
  3. Check iptables: sudo iptables -t filter -L FW_WRAPPER -n
  4. Manual cleanup when done: docker rm -f awf-squid awf-agent && docker network rm awf-net

Domain blocked unexpectedly: Look at the Host header (3rd column) in /var/log/squid/access.log - it may need a subdomain allowlisted.

DNS resolution failing: Verify DNS allowed in iptables with sudo dmesg | grep "FW_DNS".

What to Avoid

  • Avoid leaving debug containers running indefinitely. Always run cleanup (docker rm -f awf-squid awf-agent && docker network rm awf-net).
  • Do not make persistent iptables changes outside of the FW_WRAPPER lifecycle.

Limitations

  • Logs inside normal executions are moved after cleanup and not accessible inside the container anymore. Access them via /tmp/squid-logs-*/access.log instead.

Related Skills

  • robust-commands: You MUST load this skill when executing commands requiring resilient error recovery or fallbacks.
  • shell: You MUST load this skill when handling shell commands with performance monitoring or timeouts.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.