-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
544 lines (507 loc) · 18 KB
/
index.html
File metadata and controls
544 lines (507 loc) · 18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>mac-security — macOS Security Hardening</title>
<meta name="description" content="macOS workstation deployment, dev environment standardization, shell symmetry, and security auditing across lab machines. Scripts, configs, and hardening guides." />
<meta name="robots" content="index, follow" />
<meta property="og:type" content="website" />
<meta property="og:title" content="mac-security — macOS Security Hardening" />
<meta property="og:description" content="macOS workstation deployment, dev environment standardization, shell symmetry, and security auditing across lab machines." />
<meta property="og:url" content="https://davidwhittington.github.io/mac-security/" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="mac-security — macOS Security Hardening" />
<meta name="twitter:description" content="macOS workstation deployment, dev environment standardization, shell symmetry, and security auditing across lab machines." />
<style>
:root {
--bg: #0d1117;
--surface: #161b22;
--border: #30363d;
--text: #e6edf3;
--muted: #8b949e;
--accent: #58a6ff;
--green: #3fb950;
--orange: #d29922;
--red: #f85149;
--code-bg: #1f2937;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Nav */
nav {
border-bottom: 1px solid var(--border);
padding: 1rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.nav-brand {
font-weight: 700;
font-size: 1.1rem;
color: var(--text);
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
/* Hero */
.hero {
max-width: 860px;
margin: 5rem auto 3rem;
padding: 0 2rem;
text-align: center;
}
.hero-badge {
display: inline-block;
background: rgba(88, 166, 255, 0.1);
border: 1px solid rgba(88, 166, 255, 0.3);
color: var(--accent);
padding: 0.25rem 0.75rem;
border-radius: 2rem;
font-size: 0.8rem;
letter-spacing: 0.05em;
text-transform: uppercase;
margin-bottom: 1.5rem;
}
h1 {
font-size: clamp(2rem, 5vw, 3.2rem);
font-weight: 800;
line-height: 1.15;
letter-spacing: -0.02em;
margin-bottom: 1.25rem;
}
h1 span { color: var(--accent); }
.hero-sub {
font-size: 1.15rem;
color: var(--muted);
max-width: 600px;
margin: 0 auto 2.5rem;
}
/* Quick install */
.install-block {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.75rem;
padding: 1.5rem 2rem;
max-width: 540px;
margin: 0 auto 3.5rem;
text-align: left;
position: relative;
}
.install-label {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--muted);
margin-bottom: 0.75rem;
}
.install-block pre {
font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
font-size: 0.9rem;
color: var(--green);
white-space: pre;
}
.install-note {
font-size: 0.8rem;
color: var(--muted);
margin-top: 0.75rem;
}
/* Section */
section {
max-width: 860px;
margin: 0 auto;
padding: 3rem 2rem;
border-top: 1px solid var(--border);
}
h2 {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 1rem;
}
h3 {
font-size: 1.05rem;
font-weight: 600;
margin-bottom: 0.5rem;
}
p { color: var(--muted); margin-bottom: 1rem; }
/* What it checks grid */
.checks-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 1rem;
margin-top: 1.5rem;
}
.check-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.6rem;
padding: 1rem 1.2rem;
}
.check-icon { font-size: 1.25rem; margin-bottom: 0.4rem; }
.check-card h3 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.check-card p { font-size: 0.82rem; margin: 0; }
/* Commands */
.cmd-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.25rem; }
.cmd-row {
display: flex;
align-items: baseline;
gap: 1rem;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.5rem;
padding: 0.75rem 1rem;
}
.cmd-name {
font-family: "SF Mono", "Fira Code", monospace;
font-size: 0.85rem;
color: var(--green);
white-space: nowrap;
min-width: 210px;
}
.cmd-desc { font-size: 0.85rem; color: var(--muted); }
/* Code block */
.code-block {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 0.6rem;
padding: 1.25rem 1.5rem;
margin: 1.25rem 0;
overflow-x: auto;
position: relative;
}
.code-block pre {
font-family: "SF Mono", "Fira Code", monospace;
font-size: 0.85rem;
line-height: 1.7;
color: var(--text);
}
.code-block pre .comment { color: var(--muted); }
.code-block pre .cmd { color: var(--green); }
.code-block pre .flag { color: var(--accent); }
/* Copy button */
.copy-btn {
position: absolute;
top: 0.6rem;
right: 0.75rem;
background: var(--surface);
border: 1px solid var(--border);
color: var(--muted);
font-family: "SF Mono", "Fira Code", monospace;
font-size: 0.7rem;
padding: 0.2rem 0.55rem;
border-radius: 4px;
cursor: pointer;
transition: color 0.15s, border-color 0.15s, background 0.15s;
user-select: none;
line-height: 1.6;
}
.copy-btn:hover {
color: var(--text);
border-color: var(--muted);
background: var(--border);
}
.copy-btn.copied {
color: var(--green);
border-color: var(--green);
}
/* Warning banner */
.warning-banner {
max-width: 540px;
margin: 0 auto 2rem;
background: rgba(210, 153, 34, 0.08);
border: 1px solid rgba(210, 153, 34, 0.4);
border-radius: 0.6rem;
padding: 1rem 1.25rem;
display: flex;
gap: 0.75rem;
align-items: flex-start;
text-align: left;
}
.warning-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.05rem; }
.warning-text { font-size: 0.85rem; color: var(--muted); line-height: 1.55; }
.warning-text strong { color: #d29922; }
/* Guides */
.guides-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 1rem;
margin-top: 1.25rem;
}
.guide-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 0.6rem;
padding: 1rem 1.2rem;
transition: border-color 0.15s;
}
.guide-card:hover { border-color: var(--accent); }
.guide-card h3 { font-size: 0.9rem; margin-bottom: 0.3rem; }
.guide-card p { font-size: 0.82rem; margin: 0; }
/* Footer */
footer {
border-top: 1px solid var(--border);
text-align: center;
padding: 2rem;
color: var(--muted);
font-size: 0.82rem;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }
/* Responsive */
@media (max-width: 600px) {
.cmd-row { flex-direction: column; gap: 0.3rem; }
.cmd-name { min-width: unset; }
nav { flex-direction: column; gap: 1rem; }
}
</style>
</head>
<body>
<nav>
<span class="nav-brand">mac-security</span>
<div class="nav-links">
<a href="https://github.com/davidwhittington/mac-security">GitHub</a>
<a href="https://github.com/davidwhittington/mac-security/tree/main/docs/guides">Guides</a>
<a href="https://github.com/davidwhittington/mac-security/blob/main/CHANGELOG.md">Changelog</a>
</div>
</nav>
<div class="hero">
<div class="hero-badge">macOS Security Tooling</div>
<h1>Harden your Mac.<br><span>In minutes, not hours.</span></h1>
<p class="hero-sub">
mac-security is an open-source toolkit for auditing and hardening macOS workstations.
One command gives you a full security report. Another locks down your SSH, firewall,
and sharing services to a defensible baseline.
</p>
<div class="warning-banner">
<span class="warning-icon">⚠️</span>
<span class="warning-text">
<strong>Test before you deploy.</strong>
These scripts modify SSH configuration, firewall rules, and system security settings.
Always validate in a non-production or development environment before applying to
production machines. Review each script and understand what it does before running it
with elevated privileges.
</span>
</div>
<div class="install-block">
<div class="install-label">Install via Homebrew</div>
<pre>brew tap davidwhittington/mac-security
brew install davidwhittington/mac-security/mac-security</pre>
<div class="install-note">
Or clone the repo for the full audit + documentation workflow.<br>
macOS Ventura / Sonoma / Sequoia / Tahoe · Apple Silicon and Intel
</div>
</div>
</div>
<section>
<h2>What it audits</h2>
<p>Run <code style="color:var(--green);font-family:monospace">mac-security-audit</code> and get a structured Markdown report covering every major security control on your machine.</p>
<div class="checks-grid">
<div class="check-card">
<div class="check-icon">🔐</div>
<h3>FileVault</h3>
<p>Confirms disk encryption is on. Flags unencrypted machines as critical.</p>
</div>
<div class="check-card">
<div class="check-icon">🛡️</div>
<h3>SIP & Gatekeeper</h3>
<p>System Integrity Protection and app signing enforcement status.</p>
</div>
<div class="check-card">
<div class="check-icon">🔥</div>
<h3>Application Firewall</h3>
<p>Firewall state, stealth mode, and block-all setting.</p>
</div>
<div class="check-card">
<div class="check-icon">🔑</div>
<h3>SSH Configuration</h3>
<p>Reads sshd_config.d drop-ins. Reports password auth, root login, key auth.</p>
</div>
<div class="check-card">
<div class="check-icon">📡</div>
<h3>Sharing Services</h3>
<p>Remote Login, ARD, Screen Sharing, File Sharing, Internet Sharing.</p>
</div>
<div class="check-card">
<div class="check-icon">🌐</div>
<h3>Open Ports</h3>
<p>All TCP listeners. Spot unexpected services before attackers do.</p>
</div>
<div class="check-card">
<div class="check-icon">👤</div>
<h3>User Accounts</h3>
<p>Local users and admin group membership.</p>
</div>
<div class="check-card">
<div class="check-icon">🔄</div>
<h3>macOS Updates</h3>
<p>Auto-check, auto-download, and security data install policy.</p>
</div>
</div>
</section>
<section>
<h2>Commands</h2>
<p>Three tools ship with the Homebrew formula.</p>
<div class="cmd-list">
<div class="cmd-row">
<span class="cmd-name">mac-security-audit</span>
<span class="cmd-desc">Full security posture audit — outputs a structured Markdown report to stdout</span>
</div>
<div class="cmd-row">
<span class="cmd-name">mac-security-audit --brief</span>
<span class="cmd-desc">Audit without package lists — faster, good for scheduled runs</span>
</div>
<div class="cmd-row">
<span class="cmd-name">mac-security-audit --save</span>
<span class="cmd-desc">Write the report to <code>private/workstations/</code> for audit history tracking</span>
</div>
<div class="cmd-row">
<span class="cmd-name">mac-security-capture</span>
<span class="cmd-desc">Snapshot Homebrew packages, shell config, and git config from the current machine</span>
</div>
<div class="cmd-row">
<span class="cmd-name">mac-security-deploy</span>
<span class="cmd-desc">Restore a saved machine profile to a new or rebuilt Mac</span>
</div>
</div>
</section>
<section>
<h2>Quick start</h2>
<p>From zero to a hardened baseline in under five minutes.</p>
<div class="code-block"><pre><span class="comment"># 1. Install the tools</span>
<span class="cmd">brew tap</span> davidwhittington/mac-security
<span class="cmd">brew install</span> davidwhittington/mac-security/mac-security
<span class="comment"># 2. Run your first audit</span>
<span class="cmd">mac-security-audit</span> <span class="flag">--brief</span>
<span class="comment"># 3. Review the Findings Summary at the bottom of the report</span>
<span class="comment"># Each finding includes a severity and a recommended fix.</span>
<span class="comment"># 4. Harden SSH (see the SSH guide for the full walkthrough)</span>
printf <span class="flag">'%s\n'</span> \
<span class="flag">'PasswordAuthentication no'</span> \
<span class="flag">'PermitRootLogin no'</span> \
<span class="flag">'PubkeyAuthentication yes'</span> \
<span class="flag">'MaxAuthTries 3'</span> \
| sudo tee /etc/ssh/sshd_config.d/099-hardening.conf
<span class="comment"># 5. Re-run the audit to confirm findings are resolved</span>
<span class="cmd">mac-security-audit</span> <span class="flag">--brief</span></pre>
</div>
</section>
<section>
<h2>Guides</h2>
<p>Step-by-step documentation for every part of the hardening process.</p>
<div class="guides-list">
<a href="https://github.com/davidwhittington/mac-security/blob/main/docs/guides/ssh-pubkey-auth.md" class="guide-card">
<h3>SSH Public Key Authentication</h3>
<p>Key generation, authorized_keys setup, sshd hardening, multi-machine deployment.</p>
</a>
<a href="https://github.com/davidwhittington/mac-security/blob/main/docs/guides/firewall-pf-vs-application-firewall.md" class="guide-card">
<h3>Firewall: Application Firewall vs pf</h3>
<p>When block-all breaks SSH, and how pf gives you both.</p>
</a>
<a href="https://github.com/davidwhittington/mac-security/blob/main/docs/guides/ssh-fleet-key-management.md" class="guide-card">
<h3>SSH Fleet Key Management</h3>
<p>Per-client key strategy, ~/.ssh/config host blocks, key rotation across a lab.</p>
</a>
<a href="https://github.com/davidwhittington/mac-security/blob/main/docs/guides/automated-security-drift-detection.md" class="guide-card">
<h3>Automated Drift Detection</h3>
<p>launchd-scheduled audits that diff against the last report and alert on change.</p>
</a>
<a href="https://github.com/davidwhittington/mac-security/blob/main/docs/guides/removing-insecure-services.md" class="guide-card">
<h3>Removing Insecure Services</h3>
<p>Disable ARD, Screen Sharing, File Sharing, Internet Sharing, AirDrop step by step.</p>
</a>
</div>
</section>
<section>
<h2>Private data, public tools</h2>
<p>
Audit reports, machine profiles, and network diagrams contain sensitive data that
shouldn't live in a public repo. mac-security uses a git submodule pattern to keep
the tooling public and the data private:
</p>
<div class="code-block"><pre><span class="comment"># Public repo — scripts, guides, config templates</span>
mac-security/
scripts/audit/security-audit.sh
docs/guides/
config/launchagents/
config/launchdaemons/
<span class="comment"># Private submodule — per-machine data (separate private repo)</span>
mac-security/private/
workstations/macbook-pro-2026-03-08.md
machines/macbook-pro/Brewfile</pre>
</div>
<p>
Clone the repo, initialize the private submodule pointing at your own private repo,
and your audit history stays yours.
</p>
</section>
<footer>
<p>
<a href="https://github.com/davidwhittington/mac-security">mac-security</a> ·
<a href="https://github.com/davidwhittington/mac-tools">mac-tools</a> ·
MIT License ·
<a href="https://github.com/davidwhittington/mac-security/blob/main/CHANGELOG.md">Changelog</a> ·
<a href="https://github.com/davidwhittington/mac-security/issues">Issues</a>
</p>
</footer>
<script>
function addCopyButton(container, getTextFn) {
var btn = document.createElement('button');
btn.className = 'copy-btn';
btn.textContent = 'copy';
container.appendChild(btn);
btn.addEventListener('click', function () {
var text = getTextFn();
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(function () {
showCopied(btn);
}).catch(function () {
fallbackCopy(text, btn);
});
} else {
fallbackCopy(text, btn);
}
});
}
function showCopied(btn) {
btn.textContent = 'copied!';
btn.classList.add('copied');
setTimeout(function () {
btn.textContent = 'copy';
btn.classList.remove('copied');
}, 2000);
}
function fallbackCopy(text, btn) {
var ta = document.createElement('textarea');
ta.value = text;
ta.style.cssText = 'position:fixed;top:0;left:0;opacity:0;';
document.body.appendChild(ta);
ta.focus();
ta.select();
try { document.execCommand('copy'); showCopied(btn); } catch (e) {}
document.body.removeChild(ta);
}
// Attach to all .code-block elements
document.querySelectorAll('.code-block').forEach(function (block) {
var pre = block.querySelector('pre');
addCopyButton(block, function () {
return (pre.innerText || pre.textContent).trim();
});
});
// Attach to the hero install block
var installBlock = document.querySelector('.install-block');
if (installBlock) {
var pre = installBlock.querySelector('pre');
addCopyButton(installBlock, function () {
return (pre.innerText || pre.textContent).trim();
});
}
</script>
</body>
</html>