Skip to content

Commit

Permalink
Add EBS default encryption check and AccessAnalyzer check (#28)
Browse files Browse the repository at this point in the history
* build status

* check default EBS encryption setting in each region

* only build on new gem version

* AccessAnalyzer: list_analyzers - fixes #27

* Bump aws_recon to 0.2.12

* use GitHub badge

* Bump aws_recon to 0.2.13

* typo

* Bump aws_recon to 0.2.14
  • Loading branch information
joshlarsen committed Nov 18, 2020
1 parent 740d063 commit a555bb8
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: docker-build
on:
push:
branches: build
paths:
- 'lib/aws_recon/version.rb'

jobs:
docker-build:
Expand Down
24 changes: 24 additions & 0 deletions lib/aws_recon/collectors/accessanalyzer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class AccessAnalyzer < Mapper
#
# Returns an array of resources.
#
def collect
resources = []

#
# list_analyzers
#
@client.list_analyzers.each_with_index do |response, page|
log(response.context.operation_name, page)

# analyzers
response.analyzers.each do |analyzer|
struct = OpenStruct.new(analyzer.to_h)
struct.type = 'analyzer'
resources.push(struct.to_h)
end
end

resources
end
end
12 changes: 12 additions & 0 deletions lib/aws_recon/collectors/ec2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ def collect

# regional calls
if @region != 'global'
#
# get_ebs_encryption_by_default
#
@client.get_ebs_encryption_by_default.each do |response|
log(response.context.operation_name)

struct = OpenStruct.new(response.to_h)
struct.type = 'ebs_encryption_settings'

resources.push(struct.to_h)
end

#
# describe_instances
#
Expand Down
2 changes: 2 additions & 0 deletions lib/aws_recon/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
- name: Organizations
global: true
alias: organizations
- name: AccessAnalyzer
alias: aa
- name: ConfigService
alias: config
- name: CodeBuild
Expand Down
2 changes: 1 addition & 1 deletion lib/aws_recon/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module AwsRecon
VERSION = "0.2.11"
VERSION = "0.2.14"
end
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
![smoke-test](https://github.com/darkbitio/aws-recon/workflows/smoke-test/badge.svg)
[![Gem Version](https://badge.fury.io/rb/aws_recon.svg)](https://badge.fury.io/rb/aws_recon)

# AWS Recon
Expand Down

0 comments on commit a555bb8

Please sign in to comment.