Skip to content

Instantly share code, notes, and snippets.

View chris-rock's full-sized avatar

Christoph Hartmann chris-rock

View GitHub Profile
### Keybase proof
I hereby claim:
* I am chris-rock on github.
* I am chrisrock (https://keybase.io/chrisrock) on keybase.
* I have a public key ASDSA6iCyxpkFFeafVC-2zzyOKB4MGBVqbGlYB6Aa1QezAo
To claim this, I am signing this object:
@chris-rock
chris-rock / index.html
Last active November 14, 2018 11:40
hello inspec landing page with crown
<html>
<head>
<title>InSpec landing</title>
</head>
<body style="margin: 0;">
<div class="container" style="background: linear-gradient(135deg, #5bc8a9 0%, #47b7d1 50%, #6063ef 100%);height: 100%;width: 100%;margin: 0;padding: 0;color: white;font-family: Muli, HelveticaNeue, Helvetica Neue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size: 6.25em;font-style: normal;font-weight: 200;">
<div style="text-align: center;height: 280px;margin: 0 auto;width: 400px;position: relative;top: 150px;">Hello</div>
<a href="https://www.inspec.io/" style="text-decoration: none;">
@chris-rock
chris-rock / index.html
Last active November 14, 2018 11:41
hello inspec landing page
<html>
<head>
<title>InSpec landing</title>
</head>
<body style="margin: 0;">
<div class="container" style="background: linear-gradient(135deg, #5bc8a9 0%, #47b7d1 50%, #6063ef 100%);height: 100%;width: 100%;margin: 0;padding: 0;color: white;font-family: Muli, HelveticaNeue, Helvetica Neue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size: 6.25em;font-style: normal;font-weight: 200;">
<div style="text-align: center;height: 280px;margin: 0 auto;width: 400px;position: relative;top: 150px;">Hello</div>
<a href="https://www.inspec.io/" style="text-decoration: none;">
@chris-rock
chris-rock / main.go
Created August 13, 2018 15:12
Run process as nobody from Go
// Author Christoph Hartmann
// This is a simple test that tries to execute a simple binary that prints its uid:
// package main
//
// import (
// "fmt"
// "os/user"
// )
//
@chris-rock
chris-rock / os.rb
Created April 9, 2017 19:59
Windows Operating System Checks
# Author: Christoph Hartmann
# Target OS: Windows 2012+
describe file('C:/Windows/explorer.exe') do
it { should exist }
it { should be_file }
end
describe user('Administrator') do
it { should exist }
@chris-rock
chris-rock / sec-tests.rb
Last active April 9, 2017 19:59
Security checks for Windows
# Author: Christoph Hartmann
# Target OS: Windows 2012+
# verify registry key entries
describe registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging') do
it { should exist }
its('EnableScriptBlockLogging') { should eq 0 }
end
# verify security policy configuration
@chris-rock
chris-rock / iis-test.rb
Created April 9, 2017 18:28
Verify Windows IIS with InSpec
# Author: Christoph Hartmann
# Target OS: Windows 2012 R2
# Check that IIS is installed via Windows Features
describe windows_feature('Webserver') do
it { should be_installed }
end
# Ensure IIS Service is running
describe service('W3SVC') do
@chris-rock
chris-rock / convert.sh
Created March 6, 2017 12:36
Convert .cab to .zip
#!/bin/bash
# this tool converts a .cab file to a zip file
# check that we have an input parameter
test -z "${1:-}" &&\
echo "[ERROR] You need to pass a .cab file" &&\
exit 1
CURRENT_DIR=$(pwd)
TMP=$(mktemp -d -t cab)
@chris-rock
chris-rock / convert.sh
Created March 6, 2017 12:36
Convert .cab to .zip
#!/bin/bash
# this tool converts a .cab file to a zip file
# check that we have an input parameter
test -z "${1:-}" &&\
echo "[ERROR] You need to pass a .cab file" &&\
exit 1
CURRENT_DIR=$(pwd)
TMP=$(mktemp -d -t cab)
➜ inspec git:(oracle-linux-service-resource) ✗ git checkout master
Switched to branch 'master'
➜ inspec git:(master) git remote add inspec https://github.com/chef/inspec.git
➜ inspec git:(master) ✗ git pull inspec master
From https://github.com/chef/inspec
* branch master -> FETCH_HEAD
* [new branch] master -> inspec/master
Already up-to-date.
➜ inspec git:(master) ✗ git checkout oracle-linux-service-resource
Switched to branch 'oracle-linux-service-resource'