inspec/test/fixtures/profiles/cloud/test-azure/README.md
Clinton Wolfe 2d9c443a04 Add functional tests that try each of the cloud resource packs with bad creds
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-02-26 14:41:38 -05:00

56 lines
No EOL
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Example InSpec Profile For Azure
This example shows the implementation of an InSpec profile for Azure. See [https://github.com/inspec/inspec-azure](https://github.com/inspec/inspec-azure) for details on how to configure credentials for your subscription.
## Create a profile
```
$ inspec init profile --platform azure my-profile
─────────────────────────── InSpec Code Generator ───────────────────────────
Creating new profile at /Users/spaterson/my-profile
• Creating directory libraries
• Creating file README.md
• Creating directory controls
• Creating file controls/example.rb
• Creating file inspec.yml
• Creating file libraries/.gitkeep
```
## Run the tests
```
$ cd my-profile/
$ inspec exec . -t azure://
Profile: Azure InSpec Profile (my-profile)
Version: 0.1.0
Target: azure://12345abc-987d-654e-fg21-abcdef23324r
× azure-virtual-machines-exist-check: Check resource groups to see if any VMs exist. (4 failed)
× Azure Virtual Machines should exist
expected Azure Virtual Machines to exist
× Azure Virtual Machines should exist
expected Azure Virtual Machines to exist
× Azure Virtual Machines should exist
expected Azure Virtual Machines to exist
× Azure Virtual Machines should exist
expected Azure Virtual Machines to exist
✔ Azure Virtual Machines should exist
✔ Azure Virtual Machines should exist
✔ Azure Virtual Machines should exist
Profile: Azure Resource Pack (inspec-azure)
Version: 1.2.0
Target: azure://12345abc-987d-654e-fg21-abcdef23324r
No tests executed.
Profile Summary: 0 successful controls, 1 control failure, 0 controls skipped
Test Summary: 3 successful, 4 failures, 0 skipped
```