This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Set host file so the instance knows where to find chef-server | |
$hosts = "1.2.3.4 hello.example.com" | |
$file = "C:\Windows\System32\drivers\etc\hosts" | |
$hosts | Add-Content $file | |
## Download the Chef client | |
$clientURL = "https://packages.chef.io/files/stable/chef/12.19.36/windows/2012/chef-client-12.19.36-1-x64.msi" | |
$clientDestination = "C:\chef-client.msi" | |
Invoke-WebRequest $clientURL -OutFile $clientDestination |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: ruby | |
git: | |
submodules: false | |
before_install: | |
- echo "Installing test gems" | |
- gem install yaml-lint | |
# skip install step |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"prefix": { | |
// Prefix to be assigned to all machines | |
"value": "test" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On node 1 you will need something like this: | |
# package installation and configuration | |
# set an attribute key as the last action | |
node.set['master']['key'] = 6B0FEJFM | |
Then on node 2 you are looking for the key that you set during node 1’s run: | |
# all the node configuration up to master node requirement / dependency |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
driver: | |
name: ec2 | |
aws_ssh_key_id: your_key | |
region: eu-west-1 | |
availability_zone: b | |
require_chef_omnibus: true | |
instance_type: m1.small | |
associate_public_ip: true | |
interface: dns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
driver: | |
name: ec2 | |
aws_ssh_key_id: my_key | |
region: eu-west-1 | |
availability_zone: b | |
require_chef_omnibus: true | |
instance_type: m1.small | |
associate_public_ip: true | |
interface: dns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reboot '.Net Install' do | |
reason 'Need to reboot after .NET installation' | |
action :nothing | |
end | |
if version_arr[6][:data] != 394_271 | |
package '.NET 4.6.1' do | |
source 'https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe' | |
installer_type :custom | |
action :install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reboot '.Net Install' do | |
reason 'Need to reboot after .NET installation' | |
action :nothing | |
end | |
version_arr = registry_get_values('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', :x86_64) | |
if version_arr[6][:data] != 394_271 | |
package '.NET 4.6.1' do | |
source 'https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource_name :security_policy | |
default_action :configure | |
property :policy_template, String, required: false, default: 'C:\Windows\security\templates\chefNewPolicy.inf' | |
property :database, String, required: false, default: 'C:\Windows\security\database\chef.sdb' | |
property :log_location, String, default: 'C:\Windows\security\logs\chef-secedit.log' | |
action :configure do | |
if node['platform'] == 'windows' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name 'windows-hardening' | |
maintainer 'Joe Gardiner' | |
maintainer_email '[email protected]' | |
license 'Apache 2.0' | |
description 'Hardening cookbook for Windows 2012 R2' | |
long_description 'Remediates critical issues identified by the DevSec Windows baseline' | |
version '0.9.0' | |
supports 'windows' | |
depends 'windows-security-policy' |
OlderNewer