Class: Serverspec::Type::WindowsFirewall

Inherits:
Base
  • Object
show all
Defined in:
lib/serverspec/type/windows_firewall.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect, #to_ary, #to_s

Constructor Details

This class inherits a constructor from Serverspec::Type::Base

Instance Method Details

#allowed?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/serverspec/type/windows_firewall.rb', line 23

def allowed?
  @runner.check_firewall_has_action(@name, 'Allow')
end

#enabled?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/serverspec/type/windows_firewall.rb', line 19

def enabled?
  @runner.check_firewall_is_enabled(@name)
end

#exists?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/serverspec/type/windows_firewall.rb', line 3

def exists?
  @runner.check_firewall_exists(@name)
end

#has_localport?(port) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/serverspec/type/windows_firewall.rb', line 11

def has_localport?(port)
  @runner.check_firewall_has_localport(@name, port)
end

#inbound?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/serverspec/type/windows_firewall.rb', line 15

def inbound?
  @runner.check_firewall_has_direction(@name, 'Inbound')
end

#tcp?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/serverspec/type/windows_firewall.rb', line 7

def tcp?
  @runner.check_firewall_has_protocol(@name, 'TCP')
end