specinfra 2.71.3 → 2.72.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/command/windows/base/firewall.rb +33 -0
- data/lib/specinfra/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f533368006b4d3ad7a874e0d34f112d78b6f07db
|
4
|
+
data.tar.gz: 695093bad03312f2ab92b4c4ce877378e8863e56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23ac28e62753099bf41ed396ec43450e0fba05cac9b9f3ec3fd57b2a7351df5a99b4f8de6052a41fc7c790516ff459ed4e48e0e7c4a3c866ae638be02172b7a5
|
7
|
+
data.tar.gz: ec969e86f08e1bfa984b15df356655ced79ac576c7c09adc8e1be5a258cd9ad1690a1edce923f4a68a6ae819f1f5c1f7c80f78db35bb00c3584f409ecba32365
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class Specinfra::Command::Windows::Base::Firewall < Specinfra::Command::Windows::Base
|
2
|
+
class << self
|
3
|
+
def check_exists(displayName)
|
4
|
+
cmd = "(Get-NetFirewallRule -DisplayName '#{displayName}') -ne $null"
|
5
|
+
create_command cmd
|
6
|
+
end
|
7
|
+
|
8
|
+
def check_is_enabled(displayName)
|
9
|
+
cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | where {$_.Enabled -eq 'True'}) -ne $null"
|
10
|
+
create_command cmd
|
11
|
+
end
|
12
|
+
|
13
|
+
def check_has_action(displayName, action)
|
14
|
+
cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | where {$_.Action -eq '#{action}'}) -ne $null"
|
15
|
+
create_command cmd
|
16
|
+
end
|
17
|
+
|
18
|
+
def check_has_protocol(displayName, protocol)
|
19
|
+
cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | Get-NetFirewallPortFilter | where {$_.Protocol -eq '#{protocol}'}) -ne $null"
|
20
|
+
create_command cmd
|
21
|
+
end
|
22
|
+
|
23
|
+
def check_has_localport(displayName, localport)
|
24
|
+
cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | Get-NetFirewallPortFilter | where {$_.LocalPort -eq '#{localport}'}) -ne $null"
|
25
|
+
create_command cmd
|
26
|
+
end
|
27
|
+
|
28
|
+
def check_has_direction(displayName, direction)
|
29
|
+
cmd = "((Get-NetFirewallRule -DisplayName '#{displayName}') | where {$_.Direction -eq '#{direction}'}) -ne $null"
|
30
|
+
create_command cmd
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/specinfra/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.72.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|
@@ -453,6 +453,7 @@ files:
|
|
453
453
|
- lib/specinfra/command/windows/base.rb
|
454
454
|
- lib/specinfra/command/windows/base/feature.rb
|
455
455
|
- lib/specinfra/command/windows/base/file.rb
|
456
|
+
- lib/specinfra/command/windows/base/firewall.rb
|
456
457
|
- lib/specinfra/command/windows/base/group.rb
|
457
458
|
- lib/specinfra/command/windows/base/host.rb
|
458
459
|
- lib/specinfra/command/windows/base/hot_fix.rb
|