salt.modules.win_firewall

Module for configuring Windows Firewall

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

2015.5.0 新版功能.

Add a new firewall rule

CLI 范例:

salt '*' firewall.add_rule 'test' '8080' 'tcp'
salt '*' firewall.add_rule 'test' '1' 'icmpv4'
salt.modules.win_firewall.delete_rule(name, localport, protocol='tcp', dir='in')

2015.8.0 新版功能.

Delete an existing firewall rule

CLI 范例:

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

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

CLI 范例:

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

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

2015.5.0 新版功能.

CLI 范例:

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

Get the status of all the firewall profiles

CLI 范例:

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

2015.5.0 新版功能.

Get firewall rule(s) info

CLI 范例:

salt '*' firewall.get_rule 'MyAppPort'