Questions tagged [inspec]

Questions related to the InSpec testing framework by Chef.

InSpec is an -based audit testing framework. Based on the specification described in its , the state of a system (mostly a server or container) can be verified, very similar to .

Links:

119 questions
0
votes
0 answers

Inspec 4.16.0 Issue with uploading inspec profile to Chef Automate

After upgrading Inspec from version 3.5.0 to 4.16.0, I've faced next issue: # inspec compliance upload linux-profile --overwrite [2019-09-13T12:05:10+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' -…
0
votes
3 answers

Coerce command('stdout') to integer for math comparison

Given a checker script deployed to my server at path /tmp/foo with the following content... #!/bin/bash a=`cat /tmp/a` b=`cat /tmp/b` echo -n $( expr $a - $b ) ...I have an InSpec test to evaluate if the difference between a and b are within an…
Peter Vandivier
  • 606
  • 1
  • 9
  • 31
0
votes
1 answer

Error: Connection refused connecting to locahost - Berkshelf - Test Kitchen

I having an issue when running kitchen converge on Test Kitchen with Dokken driver and Inspec as verifier. The error occurred when the starting to resolving the cookbook dependencies 7.0.6 Resolving cookbook dependencies with Berkshelf…
Edmhar
  • 642
  • 1
  • 7
  • 24
0
votes
1 answer

Chef Inspec Test JSON output from an HTTP API

I am trying to create a inspec control where i need to check the status in a json file which gets downloaded when hitting a http url. When i hit http://localhost:5000/aaa/bbb/ccc/v1/healthCheck url a file gets downloaded(healthCheck.json). I am…
avk
  • 61
  • 5
0
votes
1 answer

Using Ansible Variables in InSpec test

I'm currently building reusable Playbooks which is fine for InSpec testing post deployment as I know exactly how it will always look. I'm moving onto configuration items that change build on build with the use of variables in ansible. Is there way…
Spike
  • 130
  • 2
  • 12
0
votes
1 answer

Why does Inspec return "expected [] to include" when checking for aws_elbs ports?

This is an Inspec control that checks for the VPC-Id, Ports, Subnets and AZs for a specific Network Loadbalancer: control 'Loadbalancer Config' do title 'Checks for correct configuration of LBs' describe aws_elbs.where(arn:…
uwieuwe4
  • 143
  • 1
  • 2
  • 18
0
votes
1 answer

Ho to use string concatenation in an http-block in Inspec?

I've got an Inspec-control containing a http-block. The URL is saved in a variable called DNScloudui['value'] - I want to add https:// to the beginning of the URL. DNScloudui = attribute('DNS_name_cloudui') control 'Website reachability' do …
uwieuwe4
  • 143
  • 1
  • 2
  • 18
0
votes
1 answer

How to use attributes in an Inspec command?

I defined some basic Inspec tests to check if a loadbalancer is active: proxy = attribute('proxy_netlb_arn') control 'Checks if all the ECE Load balancers are active ' do impact 1.0 title 'Checks if all the ECE Load balancers are active' describe…
uwieuwe4
  • 143
  • 1
  • 2
  • 18
0
votes
1 answer

Not able to validate package installation on windows using inspec

I want to know how to validate the installation of a package/application ( ON WINDOWS machine ) through inspec. I tried using package command to test but it didn't work. Control : describe package ('java') do it { should be_installed…
vini
  • 87
  • 12
0
votes
1 answer

How to get image from a docker repo for test kitchen

I need to test my application with Docker Image httpd and when i add it to the current .kitchen.yaml file it fails with the error: root@ip-172-31-1-22:~/test1# kitchen test -----> Starting Kitchen (v1.23.2) -----> Cleaning up any prior instances of…
anish anil
  • 2,299
  • 7
  • 21
  • 41
0
votes
1 answer

Chef - creating a cronjob and testing it with Inspec

I'm trying to set up a cronjob to run a command (in this example ls) once every day. For this I am using the cron resource. The problem is that I don't know how to test it with Inspect. I tried using crontab but it's not working. Here's the code: //…
Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206
0
votes
1 answer

Common approach to verifying if something is empty

I'm quite new to InSpec and would like to learn from your experience. There are some approaches to verifying if a file or its property is empty. Approach 1 - using file resource to and read its content. Use eq matcher to check the output '' describe…
EagleDev
  • 1,754
  • 2
  • 11
  • 31
0
votes
1 answer

Inspec test cases for windows authentication

I am trying to validate (mssql) Sql authentication mode "Integrated" using inspec. I was not able find any reference. How to pass sql query using ruby as i am having sql query which displays the current sql authentication mode.
titanjoy
  • 9
  • 2
0
votes
1 answer

Chef - Assert registry key exists

After Chef spins up my Windows box, I use the following Inspec test to assert a registry key exists: describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client') do it { should…
FBryant87
  • 4,273
  • 2
  • 44
  • 72
0
votes
1 answer

How to write test for chef make install

I am trying to write some tests for a chef Nginx cookbook. I have come to a block. I need to write a test for the code below. I can test for the core_lock released. I am unsure how to test for the make install as well as ./autogen.sh and ./configure…
user9753902