salt.modules.win_firewall

Module for configuring Windows Firewall

salt.modules.win_firewall.add_rule(name, localport, protocol='tcp', action='allow', dir='in', remoteip='any')

New in version 2015.5.0.

Add a new firewall rule

CLI Example:

salt '*' firewall.add_rule 'test' '8080' 'tcp'
salt '*' firewall.add_rule 'test' '1' 'icmpv4'
salt '*' firewall.add_rule 'test_remote_ip' '8000' 'tcp' 'allow' 'in' '192.168.0.1'
salt.modules.win_firewall.delete_rule(name, localport, protocol='tcp', dir='in', remoteip='any')

New in version 2015.8.0.

Delete an existing firewall rule

CLI Example:

salt '*' firewall.delete_rule 'test' '8080' 'tcp' 'in'
salt '*' firewall.delete_rule 'test_remote_ip' '8000' 'tcp' 'in' '192.168.0.1'
salt.modules.win_firewall.disable(profile='allprofiles')

Disable firewall profile :param profile: (default: allprofiles)

CLI Example:

salt '*' firewall.disable
salt.modules.win_firewall.enable(profile='allprofiles')

Enable firewall profile :param profile: (default: allprofiles)

New in version 2015.5.0.

CLI Example:

salt '*' firewall.enable
salt.modules.win_firewall.get_config()

Get the status of all the firewall profiles

CLI Example:

salt '*' firewall.get_config
salt.modules.win_firewall.get_rule(name='all')

New in version 2015.5.0.

Get firewall rule(s) info

CLI Example:

salt '*' firewall.get_rule 'MyAppPort'