inspec/lib/plugins/inspec-init/templates/profiles/gcp
Collin McNeese fa327ab55c
updates readme for profile inits to reference inputs instead of attributes
Signed-off-by: Collin McNeese <cmcneese@chef.io>
2021-03-17 11:28:20 -05:00
..
controls Updates GCP profile init to use inputs instead of attributes 2021-03-17 09:15:10 -05:00
libraries Move templates dir outside of lib 2019-02-06 11:58:10 -05:00
inputs.yml updates readme for profile inits to reference inputs instead of attributes 2021-03-17 11:28:20 -05:00
inspec.yml Updates GCP profile init to use inputs instead of attributes 2021-03-17 09:15:10 -05:00
README.md updates readme for profile inits to reference inputs instead of attributes 2021-03-17 11:28:20 -05:00

Example InSpec Profile For GCP

This example shows the implementation of an InSpec profile for GCP that depends on the InSpec GCP Resource Pack. See the README for instructions on setting up appropriate GCP credentials.

Create a profile

$ inspec init profile --platform gcp my-profile
Create new profile at /Users/spaterson/my-profile
 * Create directory libraries
 * Create file README.md
 * Create directory controls
 * Create file controls/example.rb
 * Create file inspec.yml
 * Create file inputs.yml
 * Create file libraries/.gitkeep

Update inputs.yml to point to your project

gcp_project_id: 'my-gcp-project'

Run the tests

$ cd gcp-profile/
$ inspec exec . -t gcp:// --input-file=inputs.yml

Profile: GCP InSpec Profile (my-profile)
Version: 0.1.0
Target:  gcp://local-service-account@my-gcp-project.iam.gserviceaccount.com

  ✔  gcp-single-region-1.0: Ensure single region has the correct properties.
     ✔  Region europe-west2 zone_names should include "europe-west2-a"
  ✔  gcp-regions-loop-1.0: Ensure regions have the correct properties in bulk.
     ✔  Region asia-east1 should be up
     ✔  Region asia-northeast1 should be up
     ✔  Region asia-south1 should be up
     ✔  Region asia-southeast1 should be up
     ✔  Region australia-southeast1 should be up
     ✔  Region europe-north1 should be up
     ✔  Region europe-west1 should be up
     ✔  Region europe-west2 should be up
     ✔  Region europe-west3 should be up
     ✔  Region europe-west4 should be up
     ✔  Region northamerica-northeast1 should be up
     ✔  Region southamerica-east1 should be up
     ✔  Region us-central1 should be up
     ✔  Region us-east1 should be up
     ✔  Region us-east4 should be up
     ✔  Region us-west1 should be up
     ✔  Region us-west2 should be up


Profile: Google Cloud Platform Resource Pack (inspec-gcp)
Version: 0.5.0
Target:  gcp://local-service-account@my-gcp-project.iam.gserviceaccount.com

     No tests executed.

Profile Summary: 2 successful controls, 0 control failures, 0 controls skipped
Test Summary: 18 successful, 0 failures, 0 skipped