-
Notifications
You must be signed in to change notification settings - Fork 487
Description
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- I am running the latest version
- I did read the README!
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
- I'm reporting the issue to the correct repository (for multi-repository projects)
- I have read and checked all configs (with all optional parts)
Expected Behavior
When using per-analysis routing, using "drop" configuration should block internet for the guest/analysis VM. This implies blocking FORWARD/routing for the guest/analysis VM IP.
Current Behavior
When using the "drop" configuration, only OUTPUT blocking rules are created. Since no FORWARD rules are generated, the communication between CAPE (acting as the router) and the guest/analysis VM is restricted, but not for internet access.
The fix is quite easy, I could create a PR. However, am I correct here? Should another system/way handle that part of blocking internet access?
Failure Information (for bugs)
Steps to Reproduce
- Use a "drop" route type for an analysis.
- Internet is still accessible since no FORWARD rules are blocking the communication.
Context
- "Drop" route configuration :
CAPEv2/lib/cuckoo/core/analysis_manager.py
Lines 594 to 595 in 563fd24
elif self.route in ("none", "None", "drop"): self.rooter_response = rooter("drop_enable", self.machine.ip, str(self.cfg.resultserver.port)) - Router "drop_enable" rules creation :
Lines 871 to 880 in 563fd24
def drop_enable(ipaddr, resultserver_port): run_iptables( "-t", "nat", "-I", "PREROUTING", "--source", ipaddr, "-p", "tcp", "--syn", "--dport", resultserver_port, "-j", "ACCEPT" ) run_iptables("-A", "INPUT", "--destination", ipaddr, "-p", "tcp", "--dport", "8000", "-j", "ACCEPT") run_iptables("-A", "INPUT", "--destination", ipaddr, "-p", "tcp", "--sport", resultserver_port, "-j", "ACCEPT") run_iptables("-A", "OUTPUT", "--destination", ipaddr, "-p", "tcp", "--dport", "8000", "-j", "ACCEPT") run_iptables("-A", "OUTPUT", "--destination", ipaddr, "-p", "tcp", "--sport", resultserver_port, "-j", "ACCEPT") # run_iptables("-A", "OUTPUT", "--destination", ipaddr, "-j", "LOG") run_iptables("-A", "OUTPUT", "--destination", ipaddr, "-j", "DROP")
Failure Logs
N.A.