5

Chef Inspec Configuration Steps

 2 years ago
source link: https://blog.knoldus.com/chef-inspec-configuration-steps/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Reading Time: 2 minutes

Introduction:

Hello Readers. In this blog, we are going to see how to configure chef inspec in our local system to execute the tests.

Chef is an open-source testing framework. They are used to test or validate the configurations, security components as per the client’s requirements or organization’s requirements. It is mainly used to test infrastructure configurations. we can even test cloud services such as AWS, Google (GCP), Azure.

Steps to configure chef inspec in our local system

  • First we download visual studio code IDE.

a68gW06SdGWoZkA7qnzrx_nHPvjT0I7TJy8rlCQf61IZWRbLNYWy_vb5sm83sasMUJM4Zd8noyY1T-0MqU_isAGqJlz9u_p-1btuyw_M_sN5-WyL9LlWPlaZDVheHx6F1uGqgpYE

  • Then we download Chef workstation software from their official website and install it.

About Chef Workstation: 

Chef Workstation helps to get started with Chef Infra or Chef InSpec. Components like remote scanning and reusable copybook tools all are available in one package.

The URL for downloading the software: https://downloads.chef.io/tools/workstation#windows.

  • After that we cross-check CW PowerShell shortcut icon is created or not upon installing Chef Workstation. The PowerShell shortcut icon looks like this:

LxhSeeZpPXnbdC1WPNuZv0_ouXjU39Ve9L7ycwavrg5jOM62h98nTSWSD3NDQxi9vCb-WiO0DWBXXpf768pp4sU222XGYzO7x28ZMm0yL6PwEPDYvU_dB4FcwwH-bn0ubmWjRa6J

  • Then we download and install AWS CLI software.

AWS CLI: 

The AWS Command Line Interface (CLI) helps to manage our AWS services. With just one unified tool, you can control and automate multiple AWS services. 

It is a mandatory step to test AWS services from Chef Inspec scripts.

The URL to download the software: https://aws.amazon.com/cli/

i-Rwhy3r6CZH1_8DmLiEvNBFmt23Mr2cgm0wotHeDO49y-0BhGc2l5toKI7AL44tNJ3UbC1jAow0vPC-x2JNb3V-WZ2GYvo6_tGkalsPYw87lR68siAZB9hGwh1LDmhfgDWM7f4v

  • Then we double click on CW PowerShell shortcut icon. 
  • After that we type “AWS configure” to configure AWS credentials. ( AWS Access Key ID, AWS Secret Access Key, Default region name, and Default output format).

The following curl script will install Chef InSpec for Ubuntu and Red Hat Enterprise Linux:

curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -P inspec

For Ubuntu, use the following command to install:

sudo dpkg -i /path/to/inspec.deb

For Red Hat Enterprise Linux, use the following command to install:

sudo rpm -U /path-to/inspec.rpm

Conclusion

In short, it is an open-source framework for testing and auditing your applications and infrastructure. They work by comparing the actual state of your system with the desired state that you express in easy-to-read and easy-to-write Chef InSpec code. The minimum skills required to write the test scripts and test AWS services include basic knowledge of AWS, Ruby, and Chef Inspec framework.

Scala Future


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK