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/RSpec output HTML format

How can rspec_html_formatter gem be used with InSpec to generate output in html format? Also, is it possible to edit the output shown when we use html format in inspec? inspec exec spec.rb --format html Can we just show whatever is in control…
saurg
  • 327
  • 1
  • 3
  • 17
0
votes
1 answer

Ruby Loop to Get All Files in All Home Directories on a Linux Machine (Inspec/Chef Work)

I'm trying to check file ownership of every file in every home directory on a Linux machine as an Inspec test written in ruby, utilizing Linux commands. I have an array of home directory owners called ownerArray (containing users like bin, root,…
jstremme
  • 1
  • 3
0
votes
1 answer

Chef Inspec throws Rspec deprecation errors

I'm running a Chef Inspec exec profile in a Jenkins job and it returns Rspec deprecation warnings. The problem is that these warnings are included in the json output that inspec exec command creates and I've tried sed/awk to remove all characters…
hedda
  • 51
  • 1
  • 8
0
votes
0 answers

Is there any way to run PowerShell scripts in Serverspec?

There are lots of build-in resources in Serverspec, but I want to extend it to my own needs. In InSpec it support script resource which will run the PowerShell script and get the result it seems. But InSpec is too slow. Is there any equivalent to…
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230
0
votes
1 answer

InSpec commands are too slow in Windows. Am I missing any steps?

I am checking both Serverspec and InSpec for validating my infrastructure. While I was executing Serverspec in my Windows 2012 R2 server, it was working without any visible performance problem. But when I was executing InSpec, I saw no result for…
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230
-1
votes
1 answer

Suitable Regex for finding value to a key in yaml file

I want to make sure that I am using aescbc as provider. kind: EncryptionConfig apiVersion: v1 resources: - resources: - secrets providers: - aescbc: keys: - name: key1
Betsy Stones
  • 81
  • 2
  • 3
  • 6
-1
votes
1 answer

Ruby, parsing YAML and outputting value

I'm pretty new to ruby and all the documentation on this subject has confused me a bit. So here goes. I'm using inspec to test my infrastructure, but I want it to consume some variables from the YAML file used by ansible. This effectively means I…
ticktockhouse
  • 589
  • 3
  • 9
  • 21
-1
votes
1 answer

How to get a simple JSON data file from a complex JSON file using jq

I have a complex json file, nested to 4th and 5th levels and I am trying to get the below result using jq. Any help would be appreciated: { "Name": "unix-global", "Title": "AWS cli should be installed", "desc": "System Package aws-cli should…
-2
votes
1 answer

Inspec command not printing the memory of a server

By executing from inspec.backend.run_command. It's only printing CPU and not memory if i use awk in $memory. Here is my code: control 'nodes_certs' do impact 0.7 title 'nodes_certs' desc 'An optional…
-2
votes
1 answer

Chef / InSpec documentation

Good morning, I have just installed inspec on an UBUNTU server I tried to follow this tutorial : https://learn.chef.io/modules/try-inspec#/ But nothing worked as it was supposed to work I tend to think that I didn't quite understand how this…
Aicha KERMICHE
  • 37
  • 1
  • 10
-2
votes
2 answers

Use a regex to check cron entry '0 5 * * * /usr/bin/aide --check'

How do I check the cron entry 0 5 * * * /usr/bin/aide --check with a regex? I would like to check this in Chef InSpec like its('content') { should match // }
user3121011
  • 449
  • 3
  • 12
-4
votes
2 answers

inspec resources not identified

i am using inspec test framework with ruby for infrastructure testing. I have written a test in the controls Here is my test: require 'aws-sdk' credentials = Aws::AssumeRoleCredentials.new( role_arn: 'some_value', role_session_name:…
rinkoo s
  • 11
  • 2
-4
votes
1 answer

Use of InSpec with Puppet

I had been using ServerSpec for my integration testing with Chef. Since ServerSpec is "deprecated" and InSpec is supported by Chef, I've change to use only InSpec, which is also supported in Puppet. However I'm not 100% sure is InSpec is the best…
Koe
  • 1,238
  • 1
  • 11
  • 18
-4
votes
5 answers

How do you check if an array element is empty or not in Ruby?

How do you check if an array element is empty or not in Ruby? passwd.where { user =~ /.*/ }.uids => ["0", "108", "109", "110", "111", "112", "994", "995", "1001", "1002", "", "65534"]
1 2 3 4 5 6 7
8