aws_recon 0.5.30 → 0.5.31
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/aws_recon/collectors/ecrpublic.rb +58 -0
- data/lib/aws_recon/services.yaml +27 -0
- data/lib/aws_recon/version.rb +1 -1
- data/readme.md +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5d30a79acd6256deaea52f09600427740cd821ae4f5d65daf6012dc95cb44e4
|
4
|
+
data.tar.gz: cc51789bcae95c1339af7edc86417de46fd92f089bf1d01e9d296d314a9342ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a7bb7de812452842f330625c714cdb6028b80af72f6034e762057a905c445c943d96a3849e7dea992db8fb76151139ebb5a5338665b836800228ef0a284f1b
|
7
|
+
data.tar.gz: 2079f1d21b47dffd3b8923e1e7ab093c363932aaa5028d3bfce15acbf9e185be9e93dbdfb33d024555675ffb91d33074b60a85bf55a18fefe29292c2f6592064
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Collect ECRPublic resources
|
5
|
+
#
|
6
|
+
class ECRPublic < Mapper
|
7
|
+
#
|
8
|
+
# Returns an array of resources.
|
9
|
+
#
|
10
|
+
def collect
|
11
|
+
resources = []
|
12
|
+
|
13
|
+
#
|
14
|
+
# describe_repositories
|
15
|
+
#
|
16
|
+
|
17
|
+
puts(@client.describe_repositories)
|
18
|
+
@client.describe_repositories.each_with_index do |response, page|
|
19
|
+
log(response.context.operation_name, page)
|
20
|
+
|
21
|
+
response.repositories.each do |repo|
|
22
|
+
struct = OpenStruct.new(repo.to_h)
|
23
|
+
struct.type = "repository"
|
24
|
+
struct.arn = repo.repository_arn
|
25
|
+
struct.policy = @client
|
26
|
+
.get_repository_policy({ repository_name: repo.repository_name }).policy_text.parse_policy
|
27
|
+
|
28
|
+
struct.images = []
|
29
|
+
#
|
30
|
+
# describe images
|
31
|
+
#
|
32
|
+
@client.describe_images({ repository_name: repo.repository_name }).image_details.each_with_index do |image, page|
|
33
|
+
log(response.context.operation_name, "describe_images", page)
|
34
|
+
image_hash = image.to_h
|
35
|
+
struct.images << image_hash
|
36
|
+
end
|
37
|
+
rescue Aws::ECR::Errors::ServiceError => e
|
38
|
+
log_error(e.code)
|
39
|
+
|
40
|
+
raise e unless suppressed_errors.include?(e.code) && !@options.quit_on_exception
|
41
|
+
ensure
|
42
|
+
resources.push(struct.to_h)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
resources
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
# not an error
|
52
|
+
def suppressed_errors
|
53
|
+
%w[
|
54
|
+
RepositoryPolicyNotFoundException,
|
55
|
+
ScanNotFoundException
|
56
|
+
]
|
57
|
+
end
|
58
|
+
end
|
data/lib/aws_recon/services.yaml
CHANGED
@@ -55,6 +55,33 @@
|
|
55
55
|
alias: rds
|
56
56
|
- name: ECR
|
57
57
|
alias: ecr
|
58
|
+
- name: ECRPublic
|
59
|
+
alias: ecrpublic
|
60
|
+
excluded_regions:
|
61
|
+
- af-south-1
|
62
|
+
- ap-east-1
|
63
|
+
- ap-northeast-1
|
64
|
+
- ap-northeast-2
|
65
|
+
- ap-northeast-3
|
66
|
+
- ap-south-1
|
67
|
+
- ap-southeast-1
|
68
|
+
- ap-southeast-2
|
69
|
+
- ca-central-1
|
70
|
+
- eu-central-1
|
71
|
+
- eu-north-1
|
72
|
+
- eu-south-1
|
73
|
+
- eu-west-1
|
74
|
+
- eu-west-2
|
75
|
+
- eu-west-3
|
76
|
+
- me-south-1
|
77
|
+
- sa-east-1
|
78
|
+
- us-east-2
|
79
|
+
- us-west-1
|
80
|
+
- us-west-2
|
81
|
+
- af-south-1
|
82
|
+
- ap-east-1
|
83
|
+
- eu-south-1
|
84
|
+
- me-south-1
|
58
85
|
- name: DynamoDB
|
59
86
|
alias: dynamodb
|
60
87
|
- name: KMS
|
data/lib/aws_recon/version.rb
CHANGED
data/readme.md
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws_recon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Larsen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-04-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- lib/aws_recon/collectors/dynamodb.rb
|
204
204
|
- lib/aws_recon/collectors/ec2.rb
|
205
205
|
- lib/aws_recon/collectors/ecr.rb
|
206
|
+
- lib/aws_recon/collectors/ecrpublic.rb
|
206
207
|
- lib/aws_recon/collectors/ecs.rb
|
207
208
|
- lib/aws_recon/collectors/efs.rb
|
208
209
|
- lib/aws_recon/collectors/eks.rb
|