Skip to content

Instantly share code, notes, and snippets.

View anthonygrees's full-sized avatar
🏠
Working from home

Anthony Rees anthonygrees

🏠
Working from home
View GitHub Profile
@anthonygrees
anthonygrees / client.rb
Created December 14, 2017 00:18
Sample Files for Chef Server and Chef Client Install
log_level :info
log_location STDOUT
ssl_verify_mode :verify_none
verify_api_cert false
chef_server_url "https://123.123.0.4/organizations/org_name"
validation_client_name "org_name-validator"
validation_key "/etc/chef/org_name-validator.pem"
node_name "TestNode1"
@anthonygrees
anthonygrees / client.rb
Created December 14, 2017 00:18
Sample Files for Chef Server and Chef Client Install
log_level :info
log_location STDOUT
ssl_verify_mode :verify_none
verify_api_cert false
chef_server_url "https://123.123.0.4/organizations/org_name"
validation_client_name "org_name-validator"
validation_key "/etc/chef/org_name-validator.pem"
node_name "TestNode1"
#
# Added to allow WinRM access to scan
default['security_policy']['rights']['SeRemoteInteractiveLogonRight'] = '*S-1-1-0, *S-1-5-32-544, *S-1-5-32-545, *S-1-5-32-551'
default['security_policy']['rights']['SeNetworkLogonRight'] = '*S-1-1-0, *S-1-5-32-544, *S-1-5-32-545, *S-1-5-32-551'
@anthonygrees
anthonygrees / default_inspec_test.rb
Created February 12, 2018 02:33
Windows InSpec Default Tests
# # encoding: utf-8
# Inspec test for recipe windows_kitchen::default
# The Inspec reference, with examples and extensive documentation, can be
# found at http://inspec.io/docs/reference/resources/
## service example
describe service('DHCP Client') do
it { should be_installed }
# # encoding: utf-8
# Inspec test for recipe windows_kitchen::default
# The Inspec reference, with examples and extensive documentation, can be
# found at http://inspec.io/docs/reference/resources/
####
# 1.Check whether certain application is able to launched (e.g. Acrobat Reader is able to be launched
# without errors)
@anthonygrees
anthonygrees / VMware_vCenter_kitchen.yml
Last active May 13, 2019 02:55
Kitchen vCentre and vRA
---
driver:
name: vcenter
vcenter_username: <%= ENV['VCENTER_USER'] || "[email protected]" %>
vcenter_password: <%= ENV['VCENTER_PASSWORD'] || "Good4bye!" %>
vcenter_host: "172.16.20.2"
vcenter_disable_ssl_verify: true
provisioner:
name: chef_zero
## Looping example WannaCry Vulnerability Check
control 'WINDOWS HOTFIX - LOOP' do
impact 0.8
title 'This test checks that a numberof Windows Hotfixs are installed - Looping Example'
hotfixes = %w{ KB4012598 KB4042895 KB4041693 KB4041691 KB4041690 KB4041689 KB4041681 KB4039396 KB4038803 KB4038801 KB4038799 KB4038797 KB4038792 KB4038783 KB4038782 KB4038781 KB4038777 KB4038774 KB4038220 KB4034681 KB4034670 KB4034668 KB4034665 KB4034664 KB4034663 KB4034661 KB4034660 KB4034659 KB4034658 KB4032695 KB4032693 KB4025344 KB4025341 KB4025340 KB4025339 KB4025338 KB4025336 KB4025335 KB4025334 KB4025332 KB4025331 KB4022724 KB4022723 KB4022722 KB4022721 KB4022720 KB4022719 KB4022718 KB4022717 KB4022168 KB4019474 KB4019473 KB4019472 KB4019265 KB4019264 KB4019263 KB4019218 KB4019217 KB4019216 KB4019215 KB4019214 KB4019213 KB4016637 KB4016636 KB4016635 KB4015554 KB4015553 KB4015552 KB4015551 KB4015550 KB4015549 KB4015221 KB4015219 KB4015217 KB4013429 KB4013198 KB4012606 KB4012220 KB4012219 KB4012218 KB4012217 KB4012216

A1 -> A2 - Configure Data Collection

Description

If you’d like to install Automate 2.0 alongside an Automate 1.x deployment, you can relay the data from Automate 1.x using a logstash forwarding filter. Be sure to set

  • the automate_url to point at the Automate 2 instance
  • the automate_token must be set to an api token created in Automate 2.

Step 1 - Create A2 Token

To create your token, login to Automate 2.0 and click Admin, API Keys, Generate API Key.

require 'sinatra'
require 'pry'
require 'mixlib/shellout'
require 'aws-sdk-ec2'
configure do
enable :logging, :dump_errors, :raise_errors
end
get '/' do
@anthonygrees
anthonygrees / 01. NP plan.sh v1
Last active June 12, 2019 03:54
Habitat Jumpstart - National Parks
pkg_name=national-parks
pkg_description="A sample JavaEE Web app deployed in the Tomcat8 package"
pkg_origin=agr
pkg_version=1.0.0
pkg_maintainer="Bill Meyer <[email protected]>"
pkg_license=('Apache-2.0')
pkg_deps=(core/tomcat8 core/corretto)
pkg_build_deps=(core/corretto core/maven)
pkg_svc_user="root"
#pkg_binds=(