# Chef InSpec

**URL:** https://discourse.chef.io/c/inspec/10.md?page=1

[Latest](https://discourse.chef.io/latest.md) · [Categories](https://discourse.chef.io/categories.md)

**Page:** 2

---

## [How to solve the error "undefined method \`docker\_image' for cookbook" in chefspec unit test](https://discourse.chef.io/t/how-to-solve-the-error-undefined-method-docker-image-for-cookbook-in-chefspec-unit-test/20290)

<div class="topic-metadata">

**Author:** [@Keemtaker](https://discourse.chef.io/u/Keemtaker)\
**Replies:** 0\
**Last updated:** [September 16, 2021, 3:44pm UTC](https://discourse.chef.io/t/how-to-solve-the-error-undefined-method-docker-image-for-cookbook-in-chefspec-unit-test/20290 "2021-09-16T15:44:45Z")

</div>

I am trying to setup unit tests for a chef cookbook using chefspec. I have a docker resource in my recipe that utilises the docker cookbook. I get this error when I run chef exec rspec undefined method \`docker\_image' for…

---

## [Azure DevOps Inspec Setup](https://discourse.chef.io/t/azure-devops-inspec-setup/19961)

<div class="topic-metadata">

**Author:** [@Suresh1256644](https://discourse.chef.io/u/Suresh1256644)\
**Replies:** 0\
**Last updated:** [June 9, 2021, 1:00pm UTC](https://discourse.chef.io/t/azure-devops-inspec-setup/19961 "2021-06-09T13:00:33Z")

</div>

Hi, I am trying to use InSpec infrastructure validation tool. I have some queries. Can anyone help me to achieve my setup. My Team is using Azure + Azure DevOps + Terraform. All the infra provisioning we are using terra…

---

## [Recipe attributes with Inspec](https://discourse.chef.io/t/recipe-attributes-with-inspec/13776)

<div class="topic-metadata">

**Author:** [@rmnobarra](https://discourse.chef.io/u/rmnobarra)\
**Replies:** 2\
**Last updated:** [May 18, 2021, 10:38am UTC](https://discourse.chef.io/t/recipe-attributes-with-inspec/13776 "2021-05-18T10:38:37Z")

</div>

Hello all, I wrote some control test for Mysql cookbook and i'd like to run some queries using mysql cli, but, for that, i need to insert root password first. I have this pass stored in a attribute but and don't know ho…

---

## [Inspec exec winrm doesn't work from RHEL 7 machine to windows machine](https://discourse.chef.io/t/inspec-exec-winrm-doesnt-work-from-rhel-7-machine-to-windows-machine/19846)

<div class="topic-metadata">

**Author:** [@orabudi](https://discourse.chef.io/u/orabudi)\
**Replies:** 0\
**Last updated:** [May 5, 2021, 4:32pm UTC](https://discourse.chef.io/t/inspec-exec-winrm-doesnt-work-from-rhel-7-machine-to-windows-machine/19846 "2021-05-05T16:32:45Z")

</div>

I am trying to run inspec winrm from a RHEL 7 server to try and connect to windows server with the following CLI command: inspec exec SOME\_BASELINE --host==WINDOWS\_HOSTNAME --user=DOMAIN\_USER --password=USER\_PASSWORD --…

---

## [Running into a rspec error with homebrew\_package](https://discourse.chef.io/t/running-into-a-rspec-error-with-homebrew-package/19695)

<div class="topic-metadata">

**Author:** [@meooow](https://discourse.chef.io/u/meooow)\
**Replies:** 1\
**Last updated:** [March 25, 2021, 5:03pm UTC](https://discourse.chef.io/t/running-into-a-rspec-error-with-homebrew-package/19695 "2021-03-25T17:03:38Z")

</div>

In my custom resource, I have homebrew\_package 'amazon-ecs-cli' In spec Test I have it { is\_expected.to install\_homebrew\_package('amazon-ecs-cli') } The error I got was: Failure/Error: it { is\_expected.to install\_ho…

---

## [Example of using inspec as a library?](https://discourse.chef.io/t/example-of-using-inspec-as-a-library/19651)

<div class="topic-metadata">

**Author:** [@kohanyi.robert](https://discourse.chef.io/u/kohanyi.robert)\
**Replies:** 2\
**Last updated:** [March 10, 2021, 10:15pm UTC](https://discourse.chef.io/t/example-of-using-inspec-as-a-library/19651 "2021-03-10T22:15:49Z")

</div>

I'd like to use inspec as a library in my rspec tests (reason: I'd like to use 3rd party gems which don't ship with inspec), but I've no idea how to do so. I got inspec installed via gem install inspec, and require 'ins…

---

## [Chef Inspec control status capture](https://discourse.chef.io/t/chef-inspec-control-status-capture/19578)

<div class="topic-metadata">

**Author:** [@vinod\_0006](https://discourse.chef.io/u/vinod_0006)\
**Replies:** 4\
**Last updated:** [March 3, 2021, 7:47am UTC](https://discourse.chef.io/t/chef-inspec-control-status-capture/19578 "2021-03-03T07:47:59Z")

</div>

I want to perform some action if my control fails, example, I may want to send an email or execute some ruby code, how can I capture the control execution result, I tried ruby begin rescue block but it did not work, how …

---

## [Chef inspec inheritance not working locally](https://discourse.chef.io/t/chef-inspec-inheritance-not-working-locally/19556)

<div class="topic-metadata">

**Author:** [@ShwetabhSuman](https://discourse.chef.io/u/ShwetabhSuman)\
**Replies:** 1\
**Last updated:** [February 15, 2021, 11:59pm UTC](https://discourse.chef.io/t/chef-inspec-inheritance-not-working-locally/19556 "2021-02-15T23:59:36Z")

</div>

Hi , I have inspec version : 4.24.32 installed on my local ubuntu machine. I am trying to see the inheritance feature of inspec but it is erroring out. What i did: in one directory ../src i have kept two profile wher…

---

## [MSSQL Output to Chef inspec](https://discourse.chef.io/t/mssql-output-to-chef-inspec/17975)

<div class="topic-metadata">

**Author:** [@DevopsDeveloper](https://discourse.chef.io/u/DevopsDeveloper)\
**Replies:** 0\
**Last updated:** [November 22, 2020, 2:59pm UTC](https://discourse.chef.io/t/mssql-output-to-chef-inspec/17975 "2020-11-22T14:59:45Z")

</div>

The MSSQL print messages are not taken into chef inspec for validation. Do we have an option to validate. Below chef inspec sample code donot take the MSSQL print message. sql = mssql\_session(user: 'sa', password: 'Tes…

---

## [Resource to check if a file share exists](https://discourse.chef.io/t/resource-to-check-if-a-file-share-exists/17960)

<div class="topic-metadata">

**Author:** [@StavvyB](https://discourse.chef.io/u/StavvyB)\
**Replies:** 0\
**Last updated:** [November 17, 2020, 5:53pm UTC](https://discourse.chef.io/t/resource-to-check-if-a-file-share-exists/17960 "2020-11-17T17:53:46Z")

</div>

Hello, I am trying to check if a file share exists and also test to ensure the appropriate people have access to it. I was wondering if a resource already existed that can do this? Thanks!

---

## [Inspec with winrm on remote windows server](https://discourse.chef.io/t/inspec-with-winrm-on-remote-windows-server/12834)

<div class="topic-metadata">

**Author:** [@bkeshark](https://discourse.chef.io/u/bkeshark)\
**Replies:** 15\
**Last updated:** [November 11, 2020, 1:27pm UTC](https://discourse.chef.io/t/inspec-with-winrm-on-remote-windows-server/12834 "2020-11-11T13:27:11Z")

</div>

Hi All, i have enabled winrm on my both windows servers and trying to run inspec test remotely. but its failing with below error. can you please help me? PS E:\> inspec exec .\\example.rb -t winrm://TestUser@domain --pa…

---

## [Testing custom os\_env values with inspec](https://discourse.chef.io/t/testing-custom-os-env-values-with-inspec/17917)

<div class="topic-metadata">

**Author:** [@StavvyB](https://discourse.chef.io/u/StavvyB)\
**Replies:** 0\
**Last updated:** [November 6, 2020, 11:29pm UTC](https://discourse.chef.io/t/testing-custom-os-env-values-with-inspec/17917 "2020-11-06T23:29:13Z")

</div>

Hello, I am trying to take advantage of the os\_env resource, but my issue is the environment variables I am trying to test are set with a PowerShell script. I was wondering if its possible to run the script from within …

---

## [Is there a way to check node tags as an inspec guard?](https://discourse.chef.io/t/is-there-a-way-to-check-node-tags-as-an-inspec-guard/17855)

<div class="topic-metadata">

**Author:** [@mcascone](https://discourse.chef.io/u/mcascone)\
**Replies:** 3\
**Last updated:** [November 6, 2020, 3:58am UTC](https://discourse.chef.io/t/is-there-a-way-to-check-node-tags-as-an-inspec-guard/17855 "2020-11-06T03:58:22Z")

</div>

I want to use guards in my inspec controls so they only run on nodes with the appropriate tags. In the recipe DSL, we can use tagged?('my\_tag'). This method doesn't seem to be available in InSpec. Is there a similar wa…

---

## [Licensing and Reselling InSpec scripts](https://discourse.chef.io/t/licensing-and-reselling-inspec-scripts/17890)

<div class="topic-metadata">

**Author:** [@revl-ca](https://discourse.chef.io/u/revl-ca)\
**Replies:** 4\
**Last updated:** [November 5, 2020, 7:36pm UTC](https://discourse.chef.io/t/licensing-and-reselling-inspec-scripts/17890 "2020-11-05T19:36:10Z")

</div>

I would like to know if the license allows me to make, maintain and sell baselines scripts and custom InSpec resources module for very particular products. Thank you

---

## [mssql\_session - "its" not working for more than one column](https://discourse.chef.io/t/mssql-session-its-not-working-for-more-than-one-column/17308)

<div class="topic-metadata">

**Author:** [@jeyoung](https://discourse.chef.io/u/jeyoung)\
**Replies:** 5\
**Last updated:** [October 26, 2020, 2:44pm UTC](https://discourse.chef.io/t/mssql-session-its-not-working-for-more-than-one-column/17308 "2020-10-26T14:44:47Z")

</div>

What I'm trying to do is get two columns back from a SQL Server database so that I can check versioning. We have different versions and levels of SQL Server in our organization, and I want to be able to check the year a…

---

## [Skip the controls not required](https://discourse.chef.io/t/skip-the-controls-not-required/17808)

<div class="topic-metadata">

**Author:** [@Ashima](https://discourse.chef.io/u/Ashima)\
**Replies:** 3\
**Last updated:** [October 16, 2020, 9:26am UTC](https://discourse.chef.io/t/skip-the-controls-not-required/17808 "2020-10-16T09:26:31Z")

</div>

I have created an inspec profile containing all the test cases I might need for my AWS account. However there is a chance that I do not have certain resources. So I want to skip the respective controls. For example: My p…

---

## [Inspec::Plugin::V2::InstallError Errors with Version Mismatch and Plugin Install](https://discourse.chef.io/t/inspec-installerror-errors-with-version-mismatch-and-plugin-install/17757)

<div class="topic-metadata">

**Author:** [@eicai5](https://discourse.chef.io/u/eicai5)\
**Replies:** 4\
**Last updated:** [October 1, 2020, 5:09am UTC](https://discourse.chef.io/t/inspec-installerror-errors-with-version-mismatch-and-plugin-install/17757 "2020-10-01T05:09:13Z")

</div>

I am starting to doubt this is a problem with this plugin. What can I be doing wrong? $ which inspec /Users/myuser/.rvm/gems/ruby-2.7.1/bin/inspec $ inspec version 4.23.11 $ inspec plugin list ┌────────────────────────…

---

## [Chef Inspec vs AWS Config](https://discourse.chef.io/t/chef-inspec-vs-aws-config/17651)

<div class="topic-metadata">

**Author:** [@Ashima](https://discourse.chef.io/u/Ashima)\
**Replies:** 5\
**Last updated:** [September 30, 2020, 3:50am UTC](https://discourse.chef.io/t/chef-inspec-vs-aws-config/17651 "2020-09-30T03:50:03Z")

</div>

Hi, I have to include compliance in my AWS devops environment. I have come across a service named AWS Config apart from Inspec. AWS config provides compliance check and remediation of AWS resources, predefined templates…

---

## [Aws\_ec2\_instance resource property not working as per the documentation](https://discourse.chef.io/t/aws-ec2-instance-resource-property-not-working-as-per-the-documentation/17524)

<div class="topic-metadata">

**Author:** [@sudhakar](https://discourse.chef.io/u/sudhakar)\
**Replies:** 2\
**Last updated:** [August 13, 2020, 6:15am UTC](https://discourse.chef.io/t/aws-ec2-instance-resource-property-not-working-as-per-the-documentation/17524 "2020-08-13T06:15:04Z")

</div>

Hello As per the link for additional properties for resource "aws\_ec2\_instance" in the docs give the attribute name for checking the monitoring status of instance but on using it it throws error as undefined method. p…

---

## [Ec2 instance attributes check for the ones not mentioned in the docs](https://discourse.chef.io/t/ec2-instance-attributes-check-for-the-ones-not-mentioned-in-the-docs/17522)

<div class="topic-metadata">

**Author:** [@sudhakar](https://discourse.chef.io/u/sudhakar)\
**Replies:** 3\
**Last updated:** [August 11, 2020, 5:40pm UTC](https://discourse.chef.io/t/ec2-instance-attributes-check-for-the-ones-not-mentioned-in-the-docs/17522 "2020-08-11T17:40:34Z")

</div>

Hello, I am trying to perform a check/test using chef inspec on resources in aws for the below attributes: EC2: 1 : ec2-instance-detailed-monitoring-enabled (part of aws\_launch\_confiuration but not aws\_ec2\_instance) …

---

## [AWS security group](https://discourse.chef.io/t/aws-security-group/17276)

<div class="topic-metadata">

**Author:** [@pdipud](https://discourse.chef.io/u/pdipud)\
**Replies:** 3\
**Last updated:** [June 28, 2020, 2:09pm UTC](https://discourse.chef.io/t/aws-security-group/17276 "2020-06-28T14:09:27Z")

</div>

Hello guys, I’m new to InSpec and while I read the documentation I’d like to know if someone can help to understand a few things. I’m focused on controls in AWS, more precisely controls for security group. I have been w…

---

## [Inspec with a different username and password (windows)](https://discourse.chef.io/t/inspec-with-a-different-username-and-password-windows/17303)

<div class="topic-metadata">

**Author:** [@mhincapie](https://discourse.chef.io/u/mhincapie)\
**Replies:** 2\
**Last updated:** [July 22, 2020, 10:30pm UTC](https://discourse.chef.io/t/inspec-with-a-different-username-and-password-windows/17303 "2020-07-22T22:30:29Z")

</div>

Hello Chef Community, I had a question that you might be able to help me. I have been running chef for some time and I understand why when the client runs it does it with the root\\system account. I came across a scenari…

---

## [Evaluate all but one file in a directory - InSpec](https://discourse.chef.io/t/evaluate-all-but-one-file-in-a-directory-inspec/17335)

<div class="topic-metadata">

**Author:** [@w\_coff](https://discourse.chef.io/u/w_coff)\
**Replies:** 3\
**Last updated:** [July 2, 2020, 1:17pm UTC](https://discourse.chef.io/t/evaluate-all-but-one-file-in-a-directory-inspec/17335 "2020-07-02T13:17:19Z")

</div>

Hello, Hoping someone might be able to help me out with a specific issue here. I would imagine this is a very common case but I can find no explicit answers... I want to run a control where I evaluate file properties …

---

## [Kitchen testing](https://discourse.chef.io/t/kitchen-testing/17278)

<div class="topic-metadata">

**Author:** [@Chiango2](https://discourse.chef.io/u/Chiango2)\
**Replies:** 1\
**Last updated:** [June 17, 2020, 8:32am UTC](https://discourse.chef.io/t/kitchen-testing/17278 "2020-06-17T08:32:19Z")

</div>

================================================================================ Recipe Compile Error in /tmp/kitchen/cache/cookbooks/csl\_configure\_machine\_image/recipes/default.rb =====================================…

---

## [Packer InSpec provisioner fails with "Error opening/processing"](https://discourse.chef.io/t/packer-inspec-provisioner-fails-with-error-opening-processing/17104)

<div class="topic-metadata">

**Author:** [@icarson](https://discourse.chef.io/u/icarson)\
**Replies:** 4\
**Last updated:** [May 18, 2020, 8:07am UTC](https://discourse.chef.io/t/packer-inspec-provisioner-fails-with-error-opening-processing/17104 "2020-05-18T08:07:06Z")

</div>

Hi Guys I am using the Hashicorp Packer InSpec provisioner to run a hardening profile against AWS EC2 images which Packer is building. I am storing the hardening profile in a self-hosted Gitlab instance but am having d…

---

## [Gem conflicts between chef client 14.15.6 and audit cookbook 9.2.1](https://discourse.chef.io/t/gem-conflicts-between-chef-client-14-15-6-and-audit-cookbook-9-2-1/17108)

<div class="topic-metadata">

**Author:** [@tsin](https://discourse.chef.io/u/tsin)\
**Replies:** 1\
**Last updated:** [May 14, 2020, 8:46am UTC](https://discourse.chef.io/t/gem-conflicts-between-chef-client-14-15-6-and-audit-cookbook-9-2-1/17108 "2020-05-14T08:46:06Z")

</div>

We have some tests that make use of the audit cookbook (version 9.2.1) to do some validations on Windows Server 2016 DataCenter machines. Previously we were using chef client 14.14.29 and the tests run fine. However with…

---

## [Is there a way to list all of the controls in an inspec profile?](https://discourse.chef.io/t/is-there-a-way-to-list-all-of-the-controls-in-an-inspec-profile/16953)

<div class="topic-metadata">

**Author:** [@brucellino](https://discourse.chef.io/u/brucellino)\
**Replies:** 2\
**Last updated:** [April 16, 2020, 11:31am UTC](https://discourse.chef.io/t/is-there-a-way-to-list-all-of-the-controls-in-an-inspec-profile/16953 "2020-04-16T11:31:47Z")

</div>

Hi there, My question is just what it says on the box : Is there a way to list all of the controls in a profile? Preferably, in some human-readable or document-friendly way (ie, markdown). I would like to have a READM…

---

## [Inspec Reporter | HTML Format](https://discourse.chef.io/t/inspec-reporter-html-format/16901)

<div class="topic-metadata">

**Author:** [@achettri](https://discourse.chef.io/u/achettri)\
**Replies:** 5\
**Last updated:** [April 14, 2020, 12:37pm UTC](https://discourse.chef.io/t/inspec-reporter-html-format/16901 "2020-04-14T12:37:19Z")

</div>

Hello, I am using inspec reporter to generate the patch scan report in HTML format but in the report I am getting error message as show in the snapshot. can anyone help me to understand what its all about and how to ge…

---

## [InSpec html report title and heading change](https://discourse.chef.io/t/inspec-html-report-title-and-heading-change/16898)

<div class="topic-metadata">

**Author:** [@achettri](https://discourse.chef.io/u/achettri)\
**Replies:** 0\
**Last updated:** [April 7, 2020, 4:03pm UTC](https://discourse.chef.io/t/inspec-html-report-title-and-heading-change/16898 "2020-04-07T16:03:22Z")

</div>

Hello, I am using inspec for the patch scanning using community profile "dev-sec/linux-patch-baseline" and saving the report of the outcome in html format. Problem which i want to address is that i want a way to change…

---

## [Change the Report title for inspec Report](https://discourse.chef.io/t/change-the-report-title-for-inspec-report/16719)

<div class="topic-metadata">

**Author:** [@avc](https://discourse.chef.io/u/avc)\
**Replies:** 0\
**Last updated:** [February 24, 2020, 5:17pm UTC](https://discourse.chef.io/t/change-the-report-title-for-inspec-report/16719 "2020-02-24T17:17:38Z")

</div>

Hi, I have a scenario, where I am running inspec on multiple systems using SSH. is there a way i can get the test reports with the server name? the title I get is default, i.e. "Rspec Code examples" As of now I am d…

[Previous page](https://discourse.chef.io/c/inspec/10.md)

[Next page](https://discourse.chef.io/c/inspec/10.md?page=2)
