-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CIS Benchmark 2.0.0 update #113
Merged
Merged
Changes from all commits
Commits
Show all changes
254 commits
Select commit
Hold shift + click to select a range
55642f6
add cis tags
ejaronne e5a3d05
Update aws-foundations-cis-1.1.rb
ejaronne 21914db
Update aws-foundations-cis-1.2.rb
ejaronne 881fbc9
Update aws-foundations-cis-1.3.rb
ejaronne 0d28100
Update aws-foundations-cis-1.4.rb
ejaronne 889d98d
Update aws-foundations-cis-1.1.rb
ejaronne 14bdd4d
Update aws-foundations-cis-1.2.rb
ejaronne 01285d0
Update aws-foundations-cis-1.3.rb
ejaronne 645dcb6
Update aws-foundations-cis-1.5.rb
ejaronne c852e74
Update aws-foundations-cis-1.8.rb
ejaronne e41b12b
Update aws-foundations-cis-1.9.rb
ejaronne 0f20542
Update aws-foundations-cis-1.10.rb
ejaronne a59a868
Update aws-foundations-cis-1.11.rb
ejaronne daaec89
Update aws-foundations-cis-1.12.rb
ejaronne 774c81b
Update aws-foundations-cis-1.14.rb
ejaronne a54f5c6
Update aws-foundations-cis-1.15.rb
ejaronne c516e04
Update aws-foundations-cis-1.16.rb
ejaronne c1f44c2
Update aws-foundations-cis-1.17.rb
ejaronne ac3d416
Update aws-foundations-cis-1.18.rb
ejaronne 80dd77e
Update aws-foundations-cis-3.1.rb
ejaronne 41b4a7b
Update aws-foundations-cis-3.2.rb
ejaronne ed7b83d
Update aws-foundations-cis-3.3.rb
ejaronne 59c0df9
Update aws-foundations-cis-3.4.rb
ejaronne 3abc253
Update aws-foundations-cis-3.5.rb
ejaronne a1e89c6
Update aws-foundations-cis-3.6.rb
ejaronne bffa059
Update aws-foundations-cis-3.7.rb
ejaronne 1c1663e
Update aws-foundations-cis-3.8.rb
ejaronne eabb77f
Update aws-foundations-cis-3.9.rb
ejaronne 5759c85
Update aws-foundations-cis-4.1.rb
ejaronne 229e5de
Update aws-foundations-cis-4.1.rb
ejaronne 7ce5591
Update aws-foundations-cis-4.2.rb
ejaronne f292afe
Update aws-foundations-cis-4.3.rb
ejaronne d271b78
Update aws-foundations-cis-4.4.rb
ejaronne 508a9fa
Update aws-foundations-cis-4.5.rb
ejaronne 9a8f724
Update aws-foundations-cis-4.6.rb
ejaronne f236bff
Update aws-foundations-cis-4.7.rb
ejaronne 12a2bee
Update aws-foundations-cis-4.8.rb
ejaronne ca1e757
Update aws-foundations-cis-4.9.rb
ejaronne a4c399d
Update aws-foundations-cis-4.10.rb
ejaronne 58d2d21
Update aws-foundations-cis-4.11.rb
ejaronne 9b2a07c
Update aws-foundations-cis-4.12.rb
ejaronne a579b0d
Update aws-foundations-cis-4.13.rb
ejaronne 94716fc
Update aws-foundations-cis-4.14.rb
ejaronne 3acac09
Update aws-foundations-cis-4.15.rb
ejaronne dfc5857
Update aws-foundations-cis-4.16.rb
ejaronne 8056d41
Update aws-foundations-cis-5.4.rb
ejaronne fa2f7ef
Update aws-foundations-cis-5.5.rb
ejaronne fb23d8e
Update aws-foundations-cis-1.6.rb
ejaronne f0dad0f
Update aws-foundations-cis-1.7.rb
ejaronne 10efeea
Update aws-foundations-cis-1.13.rb
ejaronne 343329b
Update aws-foundations-cis-1.19.rb
ejaronne eaf2bf3
Update aws-foundations-cis-1.20.rb
ejaronne 1e9a3e7
Update aws-foundations-cis-1.21.rb
ejaronne 0ad7386
Update aws-foundations-cis-1.22.rb
ejaronne d788acc
Update aws-foundations-cis-2.1.1.rb
ejaronne 94b142d
Update aws-foundations-cis-2.1.2.rb
ejaronne 7eb34dc
Update aws-foundations-cis-2.1.3.rb
ejaronne 9707ff0
Update aws-foundations-cis-2.1.4.rb
ejaronne d0b2212
Update aws-foundations-cis-2.2.1.rb
ejaronne c74a51f
Update aws-foundations-cis-2.3.1.rb
ejaronne cc61dc5
Update aws-foundations-cis-2.3.2.rb
ejaronne 69154b8
Update aws-foundations-cis-2.3.3.rb
ejaronne 4fbe0de
Update aws-foundations-cis-2.4.1.rb
ejaronne 8364485
Update aws-foundations-cis-3.10.rb
ejaronne 02f7fda
Update aws-foundations-cis-3.11.rb
ejaronne cfd26ad
Update aws-foundations-cis-5.1.rb
ejaronne e6b4337
Update aws-foundations-cis-5.1.rb
ejaronne e163d50
Update aws-foundations-cis-5.2.rb
ejaronne 09d247d
Update aws-foundations-cis-5.3.rb
ejaronne d7decfe
Update aws-foundations-cis-5.6.rb
ejaronne 18ac59c
initial 2.0 commit
ejaronne e74efba
delete old 1.2 controls
ejaronne 0cb53b3
Update inspec.yml
ejaronne 247c475
Update inspec.yml
ejaronne 08a1eb8
added a simple worklfow for testing the profile
aaronlippold f101eff
moved the Gemfile to the correct location
aaronlippold 1adbb39
fixed bug in Gemfile and .gemrc
aaronlippold f6c4dac
removed yq for now
aaronlippold 07c7824
added an inspec vendor prior to the check
aaronlippold 0bbc704
added a bit more debuging on our inspec env
aaronlippold df0f931
fixed inspec exec exit code, added quotes to display file names
aaronlippold cd12ff0
added a blank inputs and added it to the workflow
aaronlippold e942323
fixed inputs
aaronlippold 6e16db4
Update inspec.yml
ejaronne 6d1b02d
fixed tyop in the input variable
aaronlippold 6198f47
Update README.md
ejaronne 2a56937
ran cookstyle -a and added skip messages for controls without code yet
aaronlippold b1f521e
added enhanced-outcomes for easier review
aaronlippold 6b174e8
Fixes and Updates to Resources from the Resource Pack
aaronlippold 26197f1
fixed depends, linted with rufo
aaronlippold 1c693fe
Fixed profile error and typo
aaronlippold d31b355
updated the threshold while I am fixing a bug with a resource or two
aaronlippold 3148038
Removed Pipeline Steps while in development
aaronlippold 5e2f97b
fixed slow controls
aaronlippold 5ac3318
fixed branch name on worklfow
aaronlippold f1f246c
added chef lisense key for testing
aaronlippold 99c603e
updated controls for account given resource changes
aaronlippold db9dda0
added senstive to the first two controls
aaronlippold 49e9d45
marked MFA data sensitive
aaronlippold f0b5f7a
added tests for 5.6 and added aws docs reference
aaronlippold dd94025
Simplified controls, added tests, fixed inputs
aaronlippold e154996
clarifying manual check in 1.3
wdower 32dad63
creating .gitignore
wdower 95ee852
finishing 1.13
wdower a0a797b
1.7 -- expect syntax still has ugly fail messages
wdower 9f99e86
fixed inspec.yml, split out 1.7 into multiple 'it' blocks for clarity
wdower 21d83ac
updating 1.18
wdower f251c30
fixing 1.7 when no input is set
wdower 1d0f30c
adding 1.19
wdower d94f9c8
adding test to define what the aws_iam_access_analyzer should be able…
wdower 17a9cd8
commenting out control that doesnt have a resource yet to keep pipeli…
wdower 71252e2
adding 1.21 as manual review because it requires knowing if each IAM …
wdower 0640d4d
added 1.22
wdower 4a170b4
adding disable_slow_controls caveat to 1.7
wdower 3d06b04
adding 1.6 -- basically a repeat of 1.5 but with an added check on wh…
wdower 28ae11e
adding new input to catch the case of a third party data management tool
wdower b2fc743
psuedocode for 2.1.3
wdower cf359b3
updates for 1.20 and a few others
aaronlippold 156697c
psuedocode for 2.1.1
wdower a7a00d7
fixing missing block end
wdower dc78165
using existing aws_s3_bucket resource to do 2.1.1
wdower 2309be7
Mostly Done on 1.20 with some polish still needed
aaronlippold 419a01c
Linting with rubocop
aaronlippold f244135
Updates to Gemfile and Linting
aaronlippold 2801dc6
CIS 2.1.1
aaronlippold d5d54ac
added review question
aaronlippold 3964178
added exempt KMS key list and added to 3.8
aaronlippold ad515a1
added exempt KMS key list and added to 3.8
aaronlippold 302bdd2
clarifying the Not Applicable statement a bit
wdower 53ae46e
adding control for 2.1.2, borrowing pattern from 2.1.2
wdower 799d94d
rewriting 5.5 to use only_if instead of if/else
wdower 6a6874e
adding psuedocode for 2.1.4
wdower de5a022
first pass for 2.3.1
wdower b6a1261
removing redundant test step from 2.3.1, adding 2.3.2
wdower 0ff816f
commenting out 2.1.4 until it gets resource support so the pipeline w…
wdower acde81e
updating Gemfile to unpin InSpec and add aws-sdk-analyzer and train-k…
wdower 66a9c9d
adding 2.3.3
wdower ef0f732
adding 2.4.1, modeled after the s3 bucket control code
wdower a8697c2
adding exempt and single rds inputs, fixing some bad references in 2…
wdower 3b806e1
updated RDS controls to use the same robust pattern as EFS and S3 checks
wdower ad47859
fixing typos in RDS controls
wdower ae50bc5
putting a floor on InSpec version, fixing typo on 2.3.x
wdower beb3b96
ensuring exempt rds instances not included in list of fails
wdower f7b81bd
debugging
aaronlippold 041700c
- Worked around the broken plural resource until we fix
aaronlippold a77bc1e
added workaround for 2.3.2 and 2.3.2 for now
aaronlippold 0ac985e
moved to only_if with impact to get past strackstrace error
aaronlippold ce3fac2
Refactored 1.20
aaronlippold d7b803e
yamllint inspec.yml
aaronlippold 3e07417
adding 4.16
aaronlippold 3fbd1df
added 3.10
wdower 412fccd
adding 3.11, updating 3.10 to indicate that one is supposed to be tes…
wdower d8caebe
working on output to end-user
aaronlippold 555a418
updated feedback to end user to be a bit more clear
aaronlippold fb6484f
updated syntax of 4.16 to use the expect syntax
aaronlippold b07608f
updated syntax of 4.16 to use the expect syntax
aaronlippold 290d760
updated syntax of 4.16 to use the expect syntax
aaronlippold 3634dc0
fixed broken reference links
aaronlippold 2f530db
fixed broken reference links
aaronlippold 86226e3
should have a working 2.1.4 but could be improved by expect perhaps
aaronlippold 88c8f04
trying to see if a bundle install will help for a bit while we are us…
aaronlippold de4481c
adding missing bundle exec to the inspec exec
aaronlippold 02d3cfd
start of table to track progress
aaronlippold 28cb880
filled out status table
aaronlippold 2c4a4c8
moved status table
aaronlippold 1d4a7c5
fixed typo in authors
aaronlippold 8556e4f
Update README.md
wdower f0d76d7
refactoring 3.10 and 3.11 to use updated cloudtrail resource
wdower d11a521
Updated status table in readme
aaronlippold 7ca24b2
Update README.md
wdower 7a4c778
notes on possible organization of small macie resources vs a big comp…
aaronlippold e842e03
testing run fixes
aaronlippold 0d613f8
hard coding the inspec-results to see if that fixes the save issue
aaronlippold 827e9ac
one more time
aaronlippold f0e1c3e
tyring to see the path of the results file
aaronlippold 1976fa2
3.8 is throwing a deep stack trace and 3.1 has an uncaught aws servic…
aaronlippold 57a3d21
refactoring 5.6 to hopefully avoid stack overflow errors
wdower fe54d7a
adding missing 'do'
wdower ea00dfc
refactoring 3.8 to not use describe blocks in a loop
wdower 28e3fa3
fixing function call in 3.8
wdower 64e47d9
printing display_name instead of full ARN for 3.8
wdower 4746f42
filtering nils from 3.8 correctly, pretty printing output on fail
wdower c7931a9
testing even prettier printing
wdower b2f04bc
removing comments
wdower ed30927
updated controls for govcloud
aaronlippold 3c745c7
removing unecessary if statement from 1.7
wdower 4a09602
fixing where method to use a block in 1.6
wdower 1f0763e
typo in 1.2
wdower d15dbb5
adding correct only_if clause to 2.1.3
wdower 949f25f
added workflow
aaronlippold 9ff4e6b
updated inspec.yml
aaronlippold b9a632c
fixing creds
aaronlippold 3a23104
rubocop:lint and updated aws other workflow name
aaronlippold 375f1d3
trying again
aaronlippold 52107bd
adding AWSRB_DEBUG for review
aaronlippold afa7389
adding -l debug
aaronlippold 58f12dc
adding sts audiance to the aws config to see if that helps our run
aaronlippold 407ed6c
adding to the repo
aaronlippold d8efe39
updating 2.2.1 to use new aws_region matcher for ebs encryption
wdower 6f7c477
fixing 1.18
wdower 591de3b
fixing rspec matcher in 1.18
wdower 8aa6dc2
flipping logic for only_if on 1.18
wdower ccb9d74
making 1.18 fail output prettier
wdower 73c11e9
fixing 3.1 to support any region for its cloud trails
aaronlippold 1591d2f
adding if clause for no element found case
aaronlippold 3d57e26
3.9 moving conditional describe to a only_if statement
wdower be5b838
fixing 3.9 to use the aws_flow_log resource
wdower 0bbffe3
typo in 3.9
wdower e36b169
fixing error on 2.2.1
aaronlippold b83cda8
cleanup
aaronlippold f2b87bc
added tests for 5.3, fixed a few small things, linted'
aaronlippold 9bdae1d
added ignore_other_regions
aaronlippold 6ccd7bf
fixed input depth error in 5.4
aaronlippold a0727aa
mostly finished off the 5.x requirements, 5.1 needs to be worked, the…
aaronlippold 6affd72
updating testing to not disable slow controls
aaronlippold 82d1d08
renamed util script so it was clear what it does
aaronlippold 7ac5017
updated util script
aaronlippold 83f5bf3
adding the GITHUB_SHA that trigger the action to the workflow results…
aaronlippold 53c8a82
adding upload to heimdall-demo
aaronlippold de39ada
made curl a bit more quite
aaronlippold 7520133
wip 5.1
wdower 6dd6142
updating 5.1 to use new filtertable logic in resource
wdower 29b291c
fixing 5.1 to work with resource refactor
wdower 2c82dca
using local resource pack
aaronlippold 2c61c21
fixed rubocop issue
aaronlippold 1de13e3
fixed depends
aaronlippold 96126f3
removed pry from testing
aaronlippold a38df89
shorting sha, standarding naming and testing inputs.
aaronlippold 0b70cce
adding short sha, and naming artifacts
aaronlippold 12df115
moved the short sha calc to after repo checkout
aaronlippold e2b2bf9
removing duplicate input for remote management ports
wdower 0dd7803
adding in exemptions to 5.1
wdower de91b26
adding disable_slow_controls to 5.1
wdower 66e361f
typo
wdower d154316
typo, again
wdower 0974429
udating 5.2
wdower 5c11a35
adding only_if to control to bail if a non-AWS tool should be doing m…
wdower fff5482
adding test for 4.1.5, adding input for declaring a third-party monit…
wdower 9019882
update script to get the list of regions from the cli
aaronlippold ff11c78
fixing incorrect method in 1.17
wdower 16b50a6
fixed typo in 5.5 with inputs vs input...
aaronlippold 14c3982
updated thresholds to not allow profile errors and maintain a min 10%…
aaronlippold 7984d41
updating macie control
wdower 34299ee
mistaken sign on govcloud check for macie
wdower 0e350a7
updating README, removing obselete inputs
wdower 4b9983e
cleanup -removing comments
wdower 15e5868
updated benchmark status table
wdower babe92d
Minor Updates and Linting
aaronlippold d21a6b2
Moving Heimdall Upload in the workflow
aaronlippold b59f7c3
finished final readthroughs, reviewed latest test runs, removed unnee…
aaronlippold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
name: CIS AWS Foundations v2.0.0 - Other | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
my-job: | ||
name: Validate the CIS AWS Benchmark v2.0 | ||
runs-on: ubuntu-latest | ||
env: | ||
CHEF_LICENSE: accept-silent | ||
CHEF_LICENSE_KEY: ${{ secrets.SAF_CHEF_LICENSE_KEY }} | ||
RESULTS_FILE: other_inspec_results.json | ||
PROFILE_FILE: profile.json | ||
INPUT_FILE: other.inputs.yml | ||
THRESHOLD_FILE: other.threshold.yml | ||
AWS_REGION: ${{ secrets.OTHER_AWS_REGION }} | ||
HEIMDALL_URL: https://heimdall-demo.mitre.org | ||
steps: | ||
- name: add needed packages | ||
run: sudo apt-get install -y jq curl | ||
|
||
- name: Configure AWS credentials | ||
env: | ||
AWS_REGION: ${{ secrets.OTHER_AWS_REGION }} | ||
#AWS_SUBNET_ID: ${{ secrets.SAF_AWS_SUBNET_ID }} | ||
|
||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.OTHER_AWS_ACCESS_KEY }} | ||
aws-secret-access-key: ${{ secrets.OTHER_AWS_SECRET }} | ||
aws-region: ${{ secrets.OTHER_AWS_REGION }} | ||
audience: https://sts.${{ secrets.OTHER_AWS_REGION }}.amazonaws.com | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Clone full repository so we can push | ||
run: git fetch --prune --unshallow | ||
|
||
- name: Set short git commit SHA | ||
id: vars | ||
run: | | ||
calculatedSha=$(git rev-parse --short ${{ github.sha }}) | ||
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV | ||
|
||
- name: Confirm git commit SHA output | ||
run: echo ${{ env.COMMIT_SHORT_SHA }} | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.1" | ||
|
||
- name: Disable ri and rdoc | ||
run: 'echo "gem: --no-document" >> ~/.gemrc' | ||
|
||
- name: Bundle Install | ||
run: bundle install | ||
|
||
- name: Installed Inspec | ||
run: bundle exec inspec version | ||
|
||
- name: Vendor the InSpec Profile | ||
run: bundle exec inspec vendor --overwrite | ||
|
||
- name: Lint the Inspec profile | ||
run: bundle exec inspec check . | ||
|
||
- name: Run the Profile | ||
run: | | ||
bundle exec inspec exec . --target aws:// --input-file=${{ env.INPUT_FILE }} --reporter cli json:${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} --enhanced-outcomes --filter-empty-profiles || true | ||
|
||
- name: Save Test Result JSON | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.workflow }}-${{ env.COMMIT_SHORT_SHA }}-results | ||
path: | | ||
./${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} | ||
|
||
- name: Upload to Heimdall | ||
run: | | ||
curl -# -s -F data=@${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} -F "filename=${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE}}" -F "public=true" -F "evaluationTags=${{ env.COMMIT_SHORT_SHA }},${{ github.repository }},${{ github.workflow }}" -H "Authorization: Api-Key ${{ secrets.HEIMDALL_UPLOAD_KEY }}" "${{ env.HEIMDALL_URL }}/evaluations" | ||
|
||
- name: Display our ${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} results summary | ||
uses: mitre/saf_action@v1 | ||
with: | ||
command_string: "view summary -i ${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }}" | ||
|
||
- name: Ensure ${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} meets our results threshold | ||
uses: mitre/saf_action@v1 | ||
with: | ||
command_string: "validate threshold -i ${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} -F ${{ env.THRESHOLD_FILE }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
--- | ||
name: CIS AWS Foundations v2.0.0 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
my-job: | ||
name: Validate my profile | ||
runs-on: ubuntu-latest | ||
env: | ||
CHEF_LICENSE: accept-silent | ||
CHEF_LICENSE_KEY: ${{ secrets.SAF_CHEF_LICENSE_KEY }} | ||
RESULTS_FILE: inspec_results.json | ||
PROFILE_FILE: profile.json | ||
INPUT_FILE: default.inputs.yml | ||
THRESHOLD_FILE: default.threshold.yml | ||
HEIMDALL_URL: https://heimdall-demo.mitre.org | ||
steps: | ||
- name: add needed packages | ||
run: sudo apt-get install -y jq curl | ||
|
||
- name: Configure AWS credentials | ||
env: | ||
AWS_SG_ID: ${{ secrets.SAF_AWS_SG_ID }} | ||
AWS_SUBNET_ID: ${{ secrets.SAF_AWS_SUBNET_ID }} | ||
|
||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.SAF_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.SAF_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Clone full repository so we can push | ||
run: git fetch --prune --unshallow | ||
|
||
- name: Set short git commit SHA | ||
id: vars | ||
run: | | ||
calculatedSha=$(git rev-parse --short ${{ github.sha }}) | ||
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV | ||
|
||
- name: Confirm git commit SHA output | ||
run: echo ${{ env.COMMIT_SHORT_SHA }} | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.1" | ||
|
||
- name: Disable ri and rdoc | ||
run: 'echo "gem: --no-document" >> ~/.gemrc' | ||
|
||
- name: Bundle Install | ||
run: bundle install | ||
|
||
- name: Installed Inspec | ||
run: bundle exec inspec version | ||
|
||
- name: Vendor the InSpec Profile | ||
run: bundle exec inspec vendor --overwrite | ||
|
||
- name: Lint the Inspec profile | ||
run: bundle exec inspec check . | ||
|
||
- name: Run the Profile | ||
run: | | ||
bundle exec inspec exec . --target aws:// --input-file=${{ env.INPUT_FILE }} --reporter cli json:${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} --enhanced-outcomes --filter-empty-profiles || true | ||
|
||
- name: Save Test Result JSON | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.workflow }}-${{ env.COMMIT_SHORT_SHA }}-results | ||
path: | | ||
./${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} | ||
|
||
- name: Upload to Heimdall | ||
run: | | ||
curl -# -s -F data=@${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} -F "filename=${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE}}" -F "public=true" -F "evaluationTags=${{ env.COMMIT_SHORT_SHA }},${{ github.repository }},${{ github.workflow }}" -H "Authorization: Api-Key ${{ secrets.HEIMDALL_UPLOAD_KEY }}" "${{ env.HEIMDALL_URL }}/evaluations" | ||
|
||
- name: Display our ${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} results summary | ||
uses: mitre/saf_action@v1 | ||
with: | ||
command_string: "view summary -i ${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }}" | ||
|
||
- name: Ensure ${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} meets our results threshold | ||
uses: mitre/saf_action@v1 | ||
with: | ||
command_string: "validate threshold -i ${{ env.COMMIT_SHORT_SHA }}-${{ env.RESULTS_FILE }} -F ${{ env.THRESHOLD_FILE }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
aws* | ||
inspec-aws | ||
*.lock | ||
*.gem | ||
*.rbc | ||
|
||
*results.json | ||
inputs.yml | ||
|
||
/.config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,162 @@ | ||
Style/WordArray: | ||
Description: 'Use %w or %W for an array of words. (https://rubystyle.guide#percent-w)' | ||
Enabled : false | ||
--- | ||
AllCops: | ||
Exclude: | ||
- Gemfile | ||
- Rakefile | ||
- "test/**/*" | ||
- "examples/**/*" | ||
- "vendor/**/*" | ||
- "lib/bundles/inspec-init/templates/**/*" | ||
- .direnv/**/* | ||
TargetRubyVersion: 2.6.3 | ||
|
||
Style/RedundantPercentQ: | ||
Layout/EmptyLinesAroundBlockBody: | ||
Enabled: false | ||
Layout/HashAlignment: | ||
Enabled: false | ||
Layout/EmptyLineAfterGuardClause: | ||
Enabled: false | ||
Layout/MultilineBlockLayout: | ||
Enabled: false | ||
Layout/EmptyLinesAroundAttributeAccessor: | ||
Enabled: true | ||
|
||
Style/NestedParenthesizedCalls: | ||
Layout/SpaceAroundOperators: | ||
Enabled: false | ||
|
||
Style/TrailingCommaInHashLiteral: | ||
Description: 'https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainhashliteral' | ||
Layout/ParameterAlignment: | ||
Enabled: true | ||
Layout/LineLength: | ||
Enabled: false | ||
Layout/SpaceAroundMethodCallOperator: | ||
Enabled: true | ||
Lint/DeprecatedOpenSSLConstant: | ||
Enabled: true | ||
Lint/MixedRegexpCaptureTypes: | ||
Enabled: true | ||
Style/RedundantRegexpCharacterClass: | ||
Enabled: false | ||
Style/RedundantRegexpEscape: | ||
Enabled: false | ||
Lint/ParenthesesAsGroupedExpression: | ||
Enabled: false | ||
Lint/ReturnInVoidContext: | ||
Enabled: false | ||
Lint/AmbiguousBlockAssociation: | ||
Exclude: | ||
- "controls/*" | ||
Lint/RaiseException: | ||
Enabled: true | ||
Lint/StructNewOverride: | ||
Enabled: true | ||
EnforcedStyleForMultiline: no_comma | ||
|
||
Style/TrailingCommaInArrayLiteral: | ||
Lint/DuplicateBranch: # (new in 1.3) | ||
Enabled: true | ||
Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1) | ||
Enabled: true | ||
Lint/EmptyBlock: # (new in 1.1) | ||
Enabled: true | ||
Lint/EmptyClass: # (new in 1.3) | ||
Enabled: true | ||
Lint/NoReturnInBeginEndBlocks: # (new in 1.2) | ||
Enabled: true | ||
EnforcedStyleForMultiline: no_comma | ||
Lint/ToEnumArguments: # (new in 1.1) | ||
Enabled: true | ||
Lint/UnmodifiedReduceAccumulator: # (new in 1.1) | ||
Enabled: true | ||
|
||
Metrics/ClassLength: | ||
Max: 500 | ||
Exclude: | ||
- libraries/aws_ecs_task_definition.rb | ||
Metrics/MethodLength: | ||
Max: 100 | ||
Exclude: | ||
- libraries/aws_cloudfront_distribution.rb | ||
Metrics/BlockLength: | ||
Max: 300 | ||
Metrics/AbcSize: | ||
Max: 75 | ||
Metrics/BlockNesting: | ||
Enabled: false | ||
Metrics/CyclomaticComplexity: | ||
Max: 25 | ||
Metrics/PerceivedComplexity: | ||
Max: 25 | ||
|
||
Naming/AccessorMethodName: | ||
Enabled: false | ||
Naming/FileName: | ||
Enabled: false | ||
Naming/PredicateName: | ||
Enabled: false | ||
Naming/VariableNumber: | ||
Enabled: false | ||
|
||
Style/BlockDelimiters: | ||
Enabled: false | ||
Style/Documentation: | ||
Enabled: false | ||
Style/Encoding: | ||
Enabled: true | ||
Style/NumericLiterals: | ||
MinDigits: 10 | ||
Style/PercentLiteralDelimiters: | ||
PreferredDelimiters: | ||
"%": "{}" | ||
"%i": () | ||
"%q": "{}" | ||
"%Q": () | ||
"%r": "{}" | ||
"%s": () | ||
"%w": "{}" | ||
"%W": () | ||
"%x": () | ||
Style/ClassAndModuleChildren: | ||
Enabled: false | ||
Style/ConditionalAssignment: | ||
Enabled: false | ||
Style/AndOr: | ||
Enabled: false | ||
Style/Not: | ||
Enabled: false | ||
Style/TrailingCommaInArrayLiteral: | ||
EnforcedStyleForMultiline: comma | ||
Style/TrailingCommaInHashLiteral: | ||
EnforcedStyleForMultiline: comma | ||
Style/TrailingCommaInArguments: | ||
EnforcedStyleForMultiline: comma | ||
Style/NegatedIf: | ||
Enabled: false | ||
Style/UnlessElse: | ||
Enabled: false | ||
Style/RedundantBegin: | ||
Enabled: false | ||
Style/IfUnlessModifier: | ||
Enabled: false | ||
Style/RescueStandardError: | ||
Enabled: false | ||
Style/ExponentialNotation: | ||
Enabled: true | ||
Style/HashEachMethods: | ||
Enabled: true | ||
Style/HashTransformKeys: | ||
Enabled: false | ||
Style/HashTransformValues: | ||
Enabled: true | ||
Style/HashSyntax: | ||
Enabled: true | ||
Style/SlicingWithRange: | ||
Enabled: true | ||
Style/ArgumentsForwarding: # (new in 1.1) | ||
Enabled: true | ||
Style/CollectionCompact: # (new in 1.2) | ||
Enabled: true | ||
Style/DocumentDynamicEvalDefinition: # (new in 1.1) | ||
Enabled: true | ||
Style/NegatedIfElseCondition: # (new in 1.2) | ||
Enabled: true | ||
Style/NilLambda: # (new in 1.3) | ||
Enabled: true | ||
Style/SwapValues: # (new in 1.1) | ||
Enabled: true | ||
Style/FrozenStringLiteralComment: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'inspec', '>= 6.6.0' | ||
gem 'inspec-core' | ||
gem 'inspec-bin' | ||
gem 'kitchen-inspec' | ||
gem 'rake' | ||
gem 'rubocop' | ||
gem 'rubocop-rake' | ||
gem "train-aws", git: 'https://github.com/mitre/train-aws.git', branch: 'al/dep-updates' | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logs seems to indicate this may be unneeded given they seem to be pre installed on the runner