Skip to content

Instantly share code, notes, and snippets.

View mattray's full-sized avatar
🇦🇺
in Sydney

Matt Ray mattray

🇦🇺
in Sydney
View GitHub Profile
$ ./bin/build_demo.sh aws a2 'Tuesday' mattray-apac 12 'mray' 'Sales' 'APAC'
Creating aws a2 demo...
{
"StackId": "arn:aws:cloudformation:us-west-2:496323866215:stack/mray-Tuesday-Chef-Demo-20180626T052147Z/d373c260-7900-11e8-8f50-02fa8eda759c"
}
$ cd -
/Users/mray/ws/inspec-iggy
$ inspec cloudformation generate -t test/bjc-demo-aws-a2.json -s mray-Tuesday-Chef-Demo-20180626T052147Z

$ ./bin/build_demo.sh aws a2 'Tuesday' mattray-apac 12 'mray' 'Sales' 'APAC' Creating aws a2 demo... { "StackId": "arn:aws:cloudformation:us-west-2:496323866215:stack/mray-Tuesday-Chef-Demo-20180626T052147Z/d373c260-7900-11e8-8f50-02fa8eda759c" }

$ cd - /Users/mray/ws/inspec-iggy

$ inspec cloudformation generate -t test/bjc-demo-aws-a2.json -s mray-Tuesday-Chef-Demo-20180626T052147Z

---
driver:
name: ec2
instance_type: m3.medium
aws_ssh_key_id: mattray-apac
region: ap-southeast-1
associate_public_ip: true
interface: public
tags:
Name: inspec-aws-exceptions-cis
$ bundle exec bin/iggy cfn generate -t test/bjc-demo-aws-4.5.4.json
# encoding: utf-8
#
title '/Users/mray/ws/iggy/test/bjc-demo-aws-4.5.4.json controls generated by Iggy v0.1.0'
control 'aws_vpc::VPC' do
title 'Iggy bjc-demo-aws-4.5.4.json aws_vpc::VPC'
desc 'aws_vpc::VPC from the source file /Users/mray/ws/iggy/test/bjc-demo-aws-4.5.4.json
Generated by Iggy v0.1.0'
---
driver:
name: ec2
instance_type: m3.medium
security_group_ids: ["sg-e6b61680"] # open up rdp, winrm-http, winrm-https
associate_public_ip: true
interface: dns
aws_ssh_key_id: <%= ENV['AWS_SSH_KEY_ID'] %>
tags:
Name: inspec-aws-exceptions-cis
mray@farnsworth[08:53]2.4.4(master)~/ws/iggy
$ bundle exec bin/iggy terraform -f ../inspec-verify-provision/terraform/terraform.tfstate
# encoding: utf-8
#
title '/Users/mray/ws/inspec-verify-provision/terraform/terraform.tfstate controls generated by Iggy v0.1.0'
control 'aws_security_group::sg-d48b85ad' do
title 'Iggy terraform.tfstate aws_security_group::sg-d48b85ad'
desc 'aws_security_group::sg-d48b85ad from the source file /Users/mray/ws/inspec-verify-provision/terraform/terraform.tfstate
# encoding: utf-8
#
title '/Users/mray/ws/inspec-verify-provision/terraform/terraform.tfstate controls generated by Iggy v0.1.0'
control 'aws_security_group::sg-d48b85ad' do
title 'Iggy terraform.tfstate aws_security_group::sg-d48b85ad'
desc 'aws_security_group::sg-d48b85ad from the source file /Users/mray/ws/inspec-verify-provision/terraform/terraform.tfstate
Generated by Iggy v0.1.0'
impact 1.0
mray@farnsworth[00:02]2.4.4(generating_demo*)~/ws/inspec-verify-provision/terraform
$ terraform apply -var 'key_name=mattray-tf' -var 'private_key_path=/Users/mray/.ssh/mattray-apac' -var 'public_key_path=/Users/mray/.ssh/mattray-apac.pub'
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_elb.web
mray@farnsworth[00:02]2.4.4(generating_demo*)~/ws/inspec-verify-provision/terraform
$ terraform apply -var 'key_name=mattray-tf' -var 'private_key_path=/Users/mray/.ssh/mattray-apac' -var 'public_key_path=/Users/mray/.ssh/mattray-apac.pub'
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_elb.web
$ /opt/inspec/bin/inspec exec aws-demo
Profile: InSpec Profile (aws-demo)
Version: 0.2.0
Target: local://
↺ bjcpublic-check: Check My public S3 bucket
↺ Resource Aws_s3_bucket is not supported on platform mac_os_x/17.4.0.
↺ bjcadmins-check: Check My private S3 bucket
↺ Resource Aws_s3_bucket is not supported on platform mac_os_x/17.4.0.