Skip to content
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

Refactor network disruption code #7

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

IgorMilavec
Copy link
Collaborator

@drieseng here is my take on the subject. Trying to abort network connections using docker seemed trivial at first, but failed miserably in the end. I tried pausing the container, but Docker's network stack seems to function as a reverse proxy: even when the container is paused, it would still accept network connections and autonomously respond to TCP keepalives.
Stopping the container of course nicely closes network connections, which is not what we want in this case.

In the process I have refactored the code to have a clean separation of different methods we could use to disrupt network connectivity. I have also made tests inconclusive in case network disruption fails. I think this is worth including in the codebase. Please have a look and let me know.

Apart from moving VirtualBox support into separate class I have not touched it as I don't have any VirtualBox experience. I presume this is something you can have a look at later?

I merged, this will fix #4.

@IgorMilavec IgorMilavec marked this pull request as draft April 9, 2022 08:54
@drieseng
Copy link
Member

@IgorMilavec, I appear to have missed this one. Sorry about this.

I'll try to find time to review and test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DisableHostNetworkConnection requires UAC elevation
2 participants