File: windows_firewall.rb

package info (click to toggle)
ruby-serverspec 2.42.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 980 kB
  • sloc: ruby: 4,835; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 547 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module Serverspec::Type
  class WindowsFirewall < Base
    def exists?
      @runner.check_firewall_exists(@name)
    end

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

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

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

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

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

  end
end