awful 0.0.35 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/awful/security_group.rb +19 -0
- data/lib/awful/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e4aa9e317381692d25c4f59ed46074cda3d16f5
|
4
|
+
data.tar.gz: a39626808424accf9a7b7415f2f202cd4500474c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa0648dfd5b6cceb238e3d4c6d8f2ef6ec18a1ef050680faa9a9681447fd07b0ffd8059d7a502aae1be2a9e59a83b02b6dfc37c8da39a59603184c8529eeaa22
|
7
|
+
data.tar.gz: 547ba3ea49d5568c650abf36007de21b67f9875441c4c4e0df979fa949a2426a4862aabff5b61000d7592308ca9c6cf074337625d64edf1fa5ab12095e466dfe
|
data/lib/awful/security_group.rb
CHANGED
@@ -27,6 +27,25 @@ module Awful
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
desc 'inbound NAME', 'show inbound rules for named security group'
|
31
|
+
method_option :long, aliases: '-l', default: false, desc: 'Long listing'
|
32
|
+
def inbound(name)
|
33
|
+
ec2.describe_security_groups.map(&:security_groups).flatten.find do |sg|
|
34
|
+
sg.group_name == name
|
35
|
+
end.ip_permissions.tap do |perms|
|
36
|
+
sources = ->(perm) { perm.ip_ranges.map(&:cidr_ip) + perm.user_id_group_pairs.map(&:group_id) }
|
37
|
+
if options[:long]
|
38
|
+
perms.map do |p|
|
39
|
+
sources.call(p).map do |s|
|
40
|
+
[p.ip_protocol, p.from_port, p.to_port, s]
|
41
|
+
end
|
42
|
+
end.flatten(1).tap { |list| print_table list }
|
43
|
+
else
|
44
|
+
puts perms.map { |p| sources.call(p) }.flatten
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
30
49
|
end
|
31
50
|
|
32
51
|
end
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|