Skip to content

Instantly share code, notes, and snippets.

@NAshwini
NAshwini / mac1015.rb
Created July 10, 2020 10:00
mac_1015_traslatedcontrol
#encoding: UTF-8
# control "xccdf_org.cisecurity.benchmarks_rule_1.1_Verify_all_Apple_provided_software_is_current" do
# title "Verify all Apple provided software is current"
# desc "
# Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update.
# [https://support.apple.com/en-us/HT201541](https://support.apple.com/en-us/HT201541)
# Rationale: It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities.
$ git diff
diff --git a/attributes/default.rb b/attributes/default.rb
index 031205e..865ccef 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -46,3 +46,6 @@ default['chef_client_updater']['product_name'] = nil
# download URL for Sysinternals handle.zip (Windows only)
default['chef_client_updater']['handle_zip_download_url'] = nil
+
@NAshwini
NAshwini / azure_deploy.json
Last active May 10, 2018 06:33
chef windows template files
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "string",
"metadata": {
"description": "Username for the Virtual Machine."
}
},
@NAshwini
NAshwini / http_proxy.diff
Created December 7, 2017 14:25
Gist for http_proxy of card [MSYS-721]
diff --git a/lib/kitchen/transport/ssh.rb b/lib/kitchen/transport/ssh.rb
index bc836e1..b315b61 100644
--- a/lib/kitchen/transport/ssh.rb
+++ b/lib/kitchen/transport/ssh.rb
@@ -21,6 +21,7 @@ require "kitchen"
require "fileutils"
require "net/ssh"
require "net/ssh/gateway"
+require "net/ssh/proxy/http"
require "net/scp"
@NAshwini
NAshwini / C:\Users\MSys\Desktop\user_data_ash.ps1
Last active November 17, 2017 10:22
Creating aws vm with driver ec2
<powershell>
$user="ashwini"
$password="ec2user@123"
net user /add $user $password;
net localgroup Administrators /add $user;
winrm quickconfig -q
winrm create winrm/config/Listener?Address=*+Transport=HTTP
diff --git a/lib/chef/provider/aws_key_pair.rb b/lib/chef/provider/aws_key_pair.rb
index 4af8637..015b667 100644
--- a/lib/chef/provider/aws_key_pair.rb
+++ b/lib/chef/provider/aws_key_pair.rb
@@ -12,8 +12,8 @@ class Chef::Provider::AwsKeyPair < Chef::Provisioning::AWSDriver::AWSProvider
action :destroy do
if current_resource_exists?
- converge_by "delete AWS key pair #{new_resource.name} on region #{region}" do
- driver.ec2.key_pairs[new_resource.name].delete