tun_bypass_windows.go 794 B

1234567891011121314151617181920212223242526
  1. //go:build (amd64 || arm64) && !e2e_testing
  2. // +build amd64 arm64
  3. // +build !e2e_testing
  4. package overlay
  5. import (
  6. "log/slog"
  7. "github.com/slackhq/nebula/wfp"
  8. )
  9. // interfaceBypassKeys are only read when the interface bypass is installed
  10. var interfaceBypassKeys = []string{"tun.windows_bypass_wdf"}
  11. // installInterfaceBypass installs a WFP PERMIT filter scoped to the wintun interface LUID so inbound traffic on the
  12. // nebula adapter bypasses Windows Defender Firewall.
  13. func installInterfaceBypass(l *slog.Logger, luid uint64) closer {
  14. s, err := wfp.PermitInterface(luid)
  15. if err != nil {
  16. l.Warn("Failed to install WFP bypass filters on nebula interface", "error", err)
  17. return nil
  18. }
  19. l.Info("Installed WFP filters bypassing Windows Defender Firewall on nebula interface")
  20. return s
  21. }