Skip to content

Instantly share code, notes, and snippets.

@diogoaurelio
diogoaurelio / terratest_base_example.go
Created March 22, 2021 16:42
terratest test example environment
package tests
import (
"fmt"
"github.com/gruntwork-io/terratest/modules/random"
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
"strings"
"testing"
)
@diogoaurelio
diogoaurelio / terraform_compliance_bucket_example.compliance
Created March 26, 2021 09:39
Terraform-compliance example bucket policy
Feature: Buckets config
Scenario: encryption at rest
Given I have AWS S3 Bucket defined
Then encryption at rest must be enabled
Scenario: resources are tagged
Given I have AWS S3 Bucket defined
Then it must contain tags
And its value must not be null
# encoding: utf-8
# copyright: 2021, mk::labs
title 'general AWS IAM account best practices'
control 'All human users should have MFA enabled' do
impact 0.7
title 'Ensure there all human users have MFA enabled'
desc 'Ensure there all human users have MFA enabled'
@diogoaurelio
diogoaurelio / aws_network_inspec.rb
Created April 13, 2021 16:46
InSpec example controls related to AWS Network
# encoding: utf-8
# copyright: 2021, mk::labs
title 'Network related resources compliance checks'
control 'Security groups hardening default - port 22' do
impact 0.7
title 'Ensure default security groups do not allow port 22'
desc 'Ensure default security groups do not allow port 22'