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
1
vote
1 answer

Using Chef Inspec is it possible to verify the strength of SSH keys?

On executing the command ssh-keygen -lf /etc/ssh/ssh_host_dsa_key.pub I am getting a output where the first few digits represent the key strength. Is there a possible way to validate the key strength using Chef inspec? Suppose I get 1024...... as…
blueeel
  • 13
  • 3
1
vote
1 answer

How can i pass the '-t azure://' target into a ruby inspec script?

If in my script I want to test azure resources using a ruby library (not inspec binary) running in a container: def my_resource_groups rg = Inspec::Runner.new(conf={:vendor_cache=>'/app'}) rg.add_target('/app/profiles/azure') …
soapdish
  • 55
  • 7
1
vote
2 answers

Parsing Casandra.yaml in Ruby/Inspec to get seeds value

How do I parse the following yaml from Cassandra.yaml in Ruby (InSpec) profile to get the seeds value. I would to get all the 3 Ipaddress in one sting or the 3 IP addresses in 3 strings. seed_provider: - class_name:…
zxcvb
  • 11
  • 1
1
vote
1 answer

How do I include a custom inspec resource in multiple profiles?

I have written a custom chef inspec resource to work with a proprietary configuration format that the company I work for uses. I have put the resource in the .\myprofile\libraries folder as the documentation dictates that I should[1]. However, I…
Jason Thompson
  • 4,643
  • 5
  • 50
  • 74
1
vote
0 answers

How to setup Chef InSpec on AWS by providing 'ARN' instead of Secret Access Key and Access Key Id?

Is there a way to provide ARN instead of setting up credentials. or How to run chef InSpec profiles on different AWS users/accounts by providing only ARN?. I know using Secret Access Key and Access Key Id we can run checks is there any other way?
1
vote
1 answer

Inspec - Control Source Code Error - 503 "Service Unavailable"

We have written inspec control using aws-sdk and ruby to validate the S3 bucket. We are running the inspec against us-east-1 region. But getting Control source code error - 503 service not available. Tried running the same code manually after the s3…
1
vote
2 answers

Why can't we use Ansible only instead of Chef inspect?

Referring to : http://scienceofficersblog.blogspot.com/2016/02/testing-ansible-with-inspec.html There are so many posts mentioning use of Chef inspec for Ansible testing. But they usually give example like: Ansible: - hosts: all user: root …
ZIA UR REHMAN
  • 119
  • 12
1
vote
0 answers

Infrastructure Compliance via Inspec

I am describing in brief the CHEF usage in our env and what we wish to accomplish from Inspec. • We have two generic cookbooks available for Windows and Unix • These generic cookbooks have individual recipes, each of which has the logic defining…
maverick
  • 266
  • 4
  • 18
1
vote
0 answers

Installing chef-dk & Inspec on Solaris

How do I install Chef-DK and Inspec on Solaris? I have Chef-Client (Version 14.5.33) installed on my Solaris machine. I tried executing: curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -P inspec and curl…
Larry
  • 71
  • 5
1
vote
1 answer

Linux download wildcard URL

Using my script I'd like to be able to go to Chef Inspec and download the latest version. However the URL they use has versions. The versions will change and eventually, if I hard code the URL, I won't be getting the latest. How do I use the wget…
1
vote
1 answer

How to make a program that can open mysql

I'm developing an InSpec control that runs CIS compliance commands. While working on MySQL, I'm stuck here: Execute the following SQL statement to determine the value of datadir: show variables where variable_name = 'datadir'; I need to extract the…
Aicha KERMICHE
  • 37
  • 1
  • 10
1
vote
1 answer

Inspec (Kitchen) Multiple Control / Target Types

It doesn't seem as if I am able to run Inspec against multiple targets using different controls. For instance I have the following: control "aws" do describe aws_ec2_instance(name: 'Terraform Test Instance') do it { should exist } …
Brian Carpio
  • 493
  • 3
  • 9
  • 15
1
vote
2 answers

Handling attributes in InSpec

I was trying to create some basic inspec tests to validate a set of HTTP URLs. The way I started is like this - control 'http-url-checks' do impact 1.0 title 'http-url-checks' desc ' Specify the URLs which need to be up and working. ' …
mmukhe
  • 668
  • 9
  • 22
1
vote
1 answer

Chef Inspec on 32 bit Windows 2008 servers

We want to Scan our 32 bit Windows 2008 servers using Inspec. But Chef doesn't have a Inspec Client for this version of Windows. Is there a way we can use Inspec in our environment? Cheers
IT-Sheriff
  • 154
  • 1
  • 2
  • 19
1
vote
2 answers

Chef / InSpec powershell command result within Test

Background I wrote a cookbook that installs Windows Features. Some of the features have dependencies on parent features. The parent features may not have the source files required to install the feature. Within my recipe, I use only_if to call a…