Skip to content

Fully-asynchronous programmable dynamic firewall API for Windows platform written in C#.

License

Notifications You must be signed in to change notification settings

GarthJL1965/Nautilus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nautilus

Fully-asynchronous programmable dynamic firewall API for Windows platform written in C#.

Usage

Dynamic firewall API examples.

// required COM+ component 'NetFwTypeLib' and admin permission.
using Nautilus.Windows.Firewall; 

// gets firewall controller. (singleton)
var controller = Firewall.Controller;

// creates a new firewall rule.
IFirewallRule newRule = await controller.Create();
// updates firewall properties.
newRule.Enabled = true;
newRule.Direction = Directions.Incoming;
newRule.Protocol = ProtocolType.TCP;
newRule.LocalPorts.Add(8000..8008);
newRule.LocalPorts.Add(8009);
newRule.RemoteAddresses.Add(IPAddressRange.Parse("173.245.48.0/20"));
newRule.RemoteAddresses.Add(IPAddress.Parse("1.1.1.1"));

// gets the firewall rules.
IEnumerable<IFirewallRule> rules = controller.Rules;

// deletes a firewall rule.
await controller.Delete(rule.Id);

// removes all firewall rules.
await controller.Clear();

License

Mozilla Public License 2.0

About

Fully-asynchronous programmable dynamic firewall API for Windows platform written in C#.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%