Skip to content

Instantly share code, notes, and snippets.

View adamleff's full-sized avatar

Adam Leff adamleff

  • Salesforce
View GitHub Profile
@adamleff
adamleff / blog.md
Created July 3, 2017 18:51
Inheritance Blog Post

Understanding InSpec Profile Inheritance

Engineers sometimes use the phrase DRY - Don't Repeat Yourself. It's commonly used when writing or reviewing code that is repetitive. The usual solution is to take the repetitious code and turn it into something that can be reused.

It's really easy to fall into the "repeat yourself" trap, even with a tool like InSpec. InSpec Profiles contain some number of controls and tests that describe the compliance status of a host or system. It's likely that all hosts in a fleet need to be tested against the same compliance rules. But what if one host has a legitmate reason to fail a particular test? Or what if a test for a group of hosts is considered a lower severity failure than a different group of hosts? Don't fork/copy that profile just yet!

Using Profile Inheritance

In addition to its own controls, an InSpec profile can bring in the controls from another InSpec profile. Additionally, when inheriting

@adamleff
adamleff / output.json
Created May 12, 2017 13:30
Inherited profile duplicated controls in output
{
"version": "1.24.0",
"controls": [
{
"status": "passed",
"code_desc": "File /tmp should exist",
"run_time": 0.005593,
"start_time": "2017-05-12 09:30:22 -0400"
},
{
pkg_name=mapcrafter
pkg_description="High Performance Minecraft Map Renderer."
pkg_version=2.3.1
pkg_maintainer="Robb Kidd <robb@thekidds.org>"
pkg_license=('GPL-3.0')
pkg_description="Mapcrafter is a high performance Minecraft map renderer written in C++. It renders Minecraft worlds to a bunch of images which are viewable in any webbrowser using Leaflet.js."
pkg_upstream_url="https://github.com/mapcrafter/mapcrafter"
pkg_source=https://github.com/mapcrafter/mapcrafter/archive/v.${pkg_version}.tar.gz
pkg_shasum=b88e53ccffc00f83717f2e686dbed047b95f011187af2b7a23ba7f5cd3537679
pkg_dirname=mapcrafter-v.2.3.1
Verifying that +adamleff is my blockchain ID. https://onename.com/adamleff
@adamleff
adamleff / gist:28f7ab85892871ab5ce0
Created October 4, 2014 19:02
Supermarket omnibus build stack trace
[Builder: supermarket] I | bundle `exec rake assets:precompile': 1.1343s
[Builder: supermarket] I | Build supermarket: 106.0193s
The following shell command exited with status 1:
$ CFLAGS=-I/opt/supermarket/embedded/include LC_ALL=C LDFLAGS=-Wl,-rpath,/opt/supermarket/embedded/lib -L/opt/supermarket/embedded/lib LD_RUN_PATH=/opt/supermarket/embedded/lib PATH=/opt/supermarket/bin:/opt/supermarket/embedded/bin:/home/vagrant/.gem/ruby/2.1.2/bin:/usr/local/bin:/opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/bin:/opt/rubies/ruby-2.1.2/bin:/usr/kerberos/bin:/bin:/usr/bin PKG_CONFIG_PATH=/opt/supermarket/embedded/lib/pkgconfig /opt/supermarket/embedded/bin/bundle exec rake assets:precompile
Output:
(nothing)
@adamleff
adamleff / Stacktrace
Last active August 29, 2015 14:07
pg_ext -- where are you?
[Builder: supermarket] I | bundle `install --jobs 4 --path=/opt/supermarket/embedded/service/gem --without development': 104.8834s
[Builder: supermarket] I | Environment:
[Builder: supermarket] I | CFLAGS="-I/opt/supermarket/embedded/include"
[Builder: supermarket] I | LDFLAGS="-Wl,-rpath,/opt/supermarket/embedded/lib -L/opt/supermarket/embedded/lib"
[Builder: supermarket] I | LD_RUN_PATH="/opt/supermarket/embedded/lib"
[Builder: supermarket] I | PATH="/opt/supermarket/bin:/opt/supermarket/embedded/bin:/home/vagrant/.gem/ruby/2.1.2/bin:/usr/local/bin:/opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/bin:/opt/rubies/ruby-2.1.2/bin:/usr/kerberos/bin:/bin:/usr/bin"
[Builder: supermarket] I | PKG_CONFIG_PATH="/opt/supermarket/embedded/lib/pkgconfig"
[Builder: supermarket] I | $ /opt/supermarket/embedded/bin/bundle exec rake assets:precompile
[Builder: supermarket] I | bundle `exec rake assets:pr
### Keybase proof
I hereby claim:
* I am adamleff on github.
* I am adamleff (https://keybase.io/adamleff) on keybase.
* I have a public key whose fingerprint is A100 1AEC 36E1 639E 28D5 66A7 AC5A C649 02CB A1CD
To claim this, I am signing this object: