Inspec components

Targets

Targets are the place where we can execute our scripts

Inspec supports the below Targets

  • local - The Inspec Script can be run against the local machine
  • Remote - The Inspec Script can be run against the remote machine using ssh and WinRm for windows
  • Docker - The Inspec script can be run against the docker container

-t - used to specify the target If we don't specify the target by default it executes on the local machine

Example of running the script against the docker container

inspec - t docker://<docker-id> test.rb

Inspec Controls Sources

We can execute the controls from the different sources

  • local - we can execute the scripts presents in the local-machine
  • profile - we can execute the scripts presents in the profile
  • Remote url - we cam execute the scripts present in the remote url
  • Supermarket - we can execute the scripts present in the Chef supermarket
  • Compliance - we can execute the scripts present in the compliance Server

Executing the Controls from the Supermarket

Type the below command in the terminal to list profiles present in the Chef-Supermarket

$ inspec supermarket profiles

We can get more info about the profile by typing the below command in the terminal

$ inspec supermarket info <profile-name>

To run the profile from the supermarket type the below-command

$ inspec supermarket exec <profile-name>

results matching ""

    No results matching ""