Skip to content
This repository was archived by the owner on Oct 18, 2025. It is now read-only.

Commit 325a693

Browse files
committed
Lesson 7
1 parent f7eb7d6 commit 325a693

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- name: Ensure Cloudflare DNS is used
2+
query: SELECT 1 FROM dns_resolvers WHERE type='nameserver' AND address = '1.1.1.1'
3+
critical: false
4+
description: This device is not using Cloudflare DNS, which may lead to slower DNS resolution times and potential security risks.
5+
resolution: Change the DNS resolver to Cloudflare at 1.1.1.1
6+
platform: darwin
7+
run_script:
8+
path: ../scripts/set-dns-cloudflare.sh
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# Script to set DNS to 1.1.1.1 on macOS
4+
5+
# Function to set DNS for a network service
6+
set_dns() {
7+
local service=$1
8+
echo "Setting DNS for $service..."
9+
10+
# Set DNS servers to 1.1.1.1 and 1.0.0.1 (primary and secondary)
11+
sudo networksetup -setdnsservers "$service" 1.1.1.1 1.0.0.1
12+
13+
# Show the current DNS settings
14+
echo "DNS servers for $service:"
15+
networksetup -getdnsservers "$service"
16+
echo ""
17+
}
18+
19+
# Get all network services
20+
services=$(networksetup -listallnetworkservices | tail -n +2)
21+
22+
# Set DNS for each active network service
23+
while IFS= read -r service; do
24+
# Skip services with asterisk (disabled)
25+
if [[ $service != *"*"* ]]; then
26+
set_dns "$service"
27+
fi
28+
done <<< "$services"
29+
30+
echo "DNS configuration complete!"
31+
echo ""
32+
echo "To verify your DNS settings:"
33+
echo "1. System Preferences > Network > Advanced > DNS"
34+
echo "2. Or run: scutil --dns"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- name: Windows - All available updates installed
2+
query: SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM windows_updates);
3+
critical: true
4+
description: This Windows device may have outdated system software, which could lead to security vulnerabilities, performance issues, and incompatibility with other systems.
5+
resolution: Run all available Windows updates.
6+
platform: windows
7+

teams/engineering.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
name: Engingeering
1111
policies:
1212
- path: ../lib/macos/policies/macos-device-health.policies.yml
13+
- path: ../lib/windows/policies/all-windows-updates-installed.policies.yml
1314
queries:
1415
- path: ../lib/all/queries/collect-failed-login-attempts.queries.yml
1516
agent_options:
@@ -30,4 +31,12 @@ team_settings:
3031
features:
3132
enable_host_users: true
3233
enable_software_inventory: true
34+
webhook_settings:
35+
failing_policies_webhook:
36+
enable_failing_policies_webhook: true
37+
destination_url: https://webhook.site/a63689d4-1c00-4293-b502-37b9b471d56e
38+
host_batch_size: 0
39+
policy_ids:
40+
- 1
41+
- 2
3342
software:

teams/new-hires.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
name: New Hires
1111
policies:
1212
- path: ../lib/macos/policies/macos-device-health.policies.yml
13+
- path: ../lib/macos/policies/dns-resolvers.policies.yml
1314
queries:
1415
- path: ../lib/all/queries/collect-usb-devices.queries.yml
1516
- path: ../lib/all/queries/collect-failed-login-attempts.queries.yml

0 commit comments

Comments
 (0)