Skip to content

Commit

Permalink
Update bootstrap.sh with fleet fixes, remove duplicate registry key code
Browse files Browse the repository at this point in the history
  • Loading branch information
clong committed Nov 17, 2020
1 parent 71bb917 commit 1a47c92
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
2 changes: 0 additions & 2 deletions ESXi/ansible/roles/logger/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,6 @@
fleetctl get options > /tmp/options.yaml
/usr/bin/yq w -i /tmp/options.yaml 'spec.config.options.enroll_secret' 'enrollmentsecret'
/usr/bin/yq w -i /tmp/options.yaml 'spec.config.options.logger_snapshot_event_type' 'true'
# Fleet 3.0 requires the "kind" to be "options" instead of "option"
# sed -i 's/kind: option/kind: options/g' /tmp/options.yaml # Not needed with change to fleetdm/fleet
fleetctl apply -f /tmp/options.yaml
# Use fleetctl to import YAML files
Expand Down
6 changes: 2 additions & 4 deletions Vagrant/logger_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ install_fleet_import_osquery_config() {
fleetctl get options >/tmp/options.yaml
/usr/bin/yq w -i /tmp/options.yaml 'spec.config.options.enroll_secret' 'enrollmentsecret'
/usr/bin/yq w -i /tmp/options.yaml 'spec.config.options.logger_snapshot_event_type' 'true'
# Fleet 3.0 requires the "kind" to be "options" instead of "option"
sed -i 's/kind: option/kind: options/g' /tmp/options.yaml
fleetctl apply -f /tmp/options.yaml

# Use fleetctl to import YAML files
Expand All @@ -322,8 +320,8 @@ install_fleet_import_osquery_config() {
# Files must exist before splunk will add a monitor
touch /var/log/fleet/osquery_result
touch /var/log/fleet/osquery_status
/opt/splunk/bin/splunk add monitor "/var/log/fleet/osquery_result" -index osquery -sourcetype 'osquery:json' -auth 'admin:changeme'
/opt/splunk/bin/splunk add monitor "/var/log/fleet/osquery_status" -index osquery-status -sourcetype 'osquery:status' -auth 'admin:changeme'
/opt/splunk/bin/splunk add monitor "/var/log/fleet/osquery_result" -index osquery -sourcetype 'osquery:json' -auth 'admin:changeme' --accept-license --answer-yes --no-prompt
/opt/splunk/bin/splunk add monitor "/var/log/fleet/osquery_status" -index osquery-status -sourcetype 'osquery:status' -auth 'admin:changeme' --accept-license --answer-yes --no-prompt
fi
}

Expand Down
5 changes: 0 additions & 5 deletions Vagrant/scripts/configure-ou.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,3 @@ Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Creating Workstations OU..."
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Something went wrong attempting to reach AD or create the OU."
}
}

# Sysprep breaks auto-login. Let's restore it here:
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoAdminLogon -Value 1
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultUserName -Value "vagrant"
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultPassword -Value "vagrant"
5 changes: 0 additions & 5 deletions Vagrant/scripts/join-domain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ If ($hostname -eq "wef") {
Add-Computer -DomainName "windomain.local" -credential $DomainCred -PassThru
}

# Set auto login
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoAdminLogon -Value 1
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultUserName -Value "vagrant"
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultPassword -Value "vagrant"

# Stop Windows Update
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Disabling Windows Updates and Windows Module Services"
Set-Service wuauserv -StartupType Disabled
Expand Down
5 changes: 5 additions & 0 deletions Vagrant/scripts/provision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,10 @@ if ($env:COMPUTERNAME -imatch 'vagrant') {
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Installing bginfo..."
. c:\vagrant\scripts\install-bginfo.ps1
}

Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Setting the registry for auto-login..."
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoAdminLogon -Value 1 -Type String
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultUserName -Value "vagrant"
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultPassword -Value "vagrant"
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Provisioning after joining domain..."
}

0 comments on commit 1a47c92

Please sign in to comment.