Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 2.54 KB

README.md

File metadata and controls

70 lines (46 loc) · 2.54 KB

InSpec for Pwsh

  • Project State: Maintained

For more information on project states and SLAs, see this documentation.

This InSpec resource pack uses the ruby-pwsh provides the required resources to write tests for profiles using Pwsh.

Prerequisites

This resource pack requires the use of train-pwsh, which is a transport that is used to connect to a persistent powershell session. Please refer to the documentation of train-pwsh to ensure the environment variables have been set there for this work.

More documentation about each resource in this resource pack can be accessed through the docs folder of the repo. Here is the link to it: Docs.

Use the Resources

Since this is an InSpec resource pack, it only defines InSpec resources. To use these resources in your controls, create your profile:

Create a profile

inspec init profile my-profile

The above command generates a sample inspec.yml that depends on master. We recommend this is pinned to a release of the resource pack as follows.

Example inspec.yml:

name: my-profile
title: My own Pwsh profile
version: 0.1.0
inspec_version: '>= 4.6.9'
depends:
 - name: inspec-pwsh
   url: https://github.com/mitre/inspec-pwsh

(For available inspec-pwsh versions, see this list of inspec-pwsh versions.)

If a resource is in local, change the url to path.

name: my-profile
title: My own Pwsh profile
version: 0.1.0
inspec_version: '>= 4.6.9'
depends:
 - name: inspec-pwsh
   path: ../my-profile

(For available inspec-pwsh versions, see this list of inspec-pwsh versions.)

Add some tests and run the profile via:

inspec exec my-profile -t pwsh://pwsh-options

Resource documentation

This resource pack allows the testing of the following Pwsh resources. If a resource you wish to test is not listed, please feel free to open an Issue. As an open-source project, we also welcome public contributions via Pull Request.

InSpec Supported Resources https://docs.chef.io/inspec/resources/

Examples

Support

The InSpec Pwsh resources are community-supported. For bugs and features, please open a GitHub issue and label it appropriately.