workstation-security
Skill54 starsChanged 3 months agoMITView on GitHub
Sikkerhetssjekk for macOS-utviklermaskiner — brannmur, SSH, Git, hemmeligheter, nettverk og Nav-plattformverktøy
- Pipes a download into a shell
- Reads credentials
- Installs packages
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- ai-news-researchSkill
- aksel-builderSkill
- aksel-spacingSkill
- api-designSkill
- conventional-commitSkill
- deliberate-ai-useSkill
- flyway-migrationSkill
- jackson-3-migrationSkill
- java-to-kotlinSkill
- kafkaSkill
- klarsprakSkill
- kotlin-app-configSkill
- ktor-scaffoldSkill
- naisSkill
- nav-architecture-reviewSkill
- nav-authSkill
- nav-deep-interviewSkill
- nav-dekoratorenSkill
- nav-planSkill
- nav-troubleshootSkill
- observability-debuggingSkill
- observability-setupSkill
- playwright-testingSkill
- postgresql-reviewSkill
- readme-reviewSkill
- rust-developmentSkill
- security-owaspSkill
- security-reviewSkill
- spring-boot-scaffoldSkill
- terse-modeSkill
- threat-modelSkill
- tokenx-authSkill
- web-design-reviewerSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Run these checks with run_in_terminal or bash.
- Distinctive: line 48
If not immediate → MEDIUM.
- Distinctive: line 54
If "On" → MEDIUM. Fix: System Settings → General → Sharing → disable Remote Login.
- Very specific: line 73
Not installed → HIGH. Fix: brew install --cask nais/tap/naisdevice.
- Distinctive: line 80
Not running → HIGH. Fix: Enroll at https://auth.kolide.com/device/registrations/new.
- Very specific: line 86
Not logged in or expired → MEDIUM.
- Very specific: line 106
Check ~/.ssh/ directory permissions — must be 700:
- Very specific: line 110
Check private key permissions — must be 600:
- Distinctive: line 114
Check SSH key algorithm strength — weak keys are HIGH:
- Very specific: line 130
Check for ForwardAgent yes — HIGH if enabled for untrusted hosts:
- Very specific: line 135
Check for StrictHostKeyChecking no — HIGH if set globally:
- Distinctive: line 150
Commit signing — recommended (INFO if missing):
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Workstation Security Audit
Run these checks with run_in_terminal or bash. Report every finding with a severity (CRITICAL / HIGH / MEDIUM / INFO / PASS) and a concrete fix. Summarize results in a table at the end.
1. macOS System Security
/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate 2>/dev/null
/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode 2>/dev/null
fdesetup status 2>/dev/null
csrutil status 2>/dev/null
spctl --status 2>/dev/null| Check | Expected | If failing | Severity |
| Firewall | enabled | System Settings → Network → Firewall | HIGH |
| Stealth mode | on | sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on | MEDIUM |
| FileVault | On | System Settings → Privacy & Security → FileVault | CRITICAL |
| SIP | enabled | Boot Recovery → csrutil enable | CRITICAL |
| Gatekeeper | assessments enabled | System Settings → Privacy & Security → Allow apps from App Store and identified developers | HIGH |
Additional OS Hardening
- Automatic security updates — must be enabled:
softwareupdate --schedule 2>/dev/null defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates 2>/dev/null defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall 2>/dev/null defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload 2>/dev/nullCriticalUpdateInstallandAutomaticDownloadshould return1. If not → MEDIUM. Fix: System Settings → General → Software Update → Automatic Updates. - Screen lock — must require password immediately:
If not immediate → MEDIUM. Fix: System Settings → Lock Screen → Require password immediately.sysadminctl -screenLock status 2>/dev/null - Remote Login (SSH server) — should be off unless needed (requires admin):
If "On" → MEDIUM. Fix: System Settings → General → Sharing → disable Remote Login.sudo systemsetup -getremotelogin 2>/dev/null || echo "Requires admin — check System Settings → General → Sharing → Remote Login" - Login items and LaunchAgents — review for unexpected persistence:
Flag unknown or suspicious entries → MEDIUM.ls ~/Library/LaunchAgents/ 2>/dev/null ls /Library/LaunchAgents/ 2>/dev/null
2. Nav Platform Security
These checks are specific to Nav developer machines connected to the NAIS platform.
Note: Only check the tools listed below. Missing optional developer tools (Copilot CLI, nav-pilot, etc.) are not security findings and should not be reported.
- naisdevice — must be installed and healthy:
Not installed → HIGH. Fix:ls /Applications/naisdevice.app 2>/dev/null && echo "INSTALLED" || echo "NOT INSTALLED"brew install --cask nais/tap/naisdevice. - Kolide agent — must be enrolled and running:
Not running → HIGH. Fix: Enroll at https://auth.kolide.com/device/registrations/new. Resolve any Kolide issues flagged in Slack.ps aux | grep -i kolide | grep -v grep | head -3 ls /private/var/kolide-k2/ 2>/dev/null - GitHub CLI — check auth state:
Not logged in or expired → MEDIUM. Fix: rungh auth status 2>/dev/nullgh auth loginoutside the cplt sandbox. Inside a sandbox the gh guard blocksgh auth loginas credential modification, and it is on by default (thestandardpreset, cplt#335), so the command will fail there no matter how many times it is retried.gh auth statusitself is allowed; only the token-revealing form (--show-token/-t) is blocked. - Security scanning tools — should be installed:
Missing tools → INFO. Fix:which trivy gitleaks zizmor 2>/dev/nullbrew install trivy gitleaks zizmor. - gcloud authentication — check for active credentials:
Review active accounts — ensure only your Nav identity is active.gcloud auth list 2>/dev/null | head -5
3. SSH Configuration
- Check
~/.ssh/directory permissions — must be700:stat -f "%Sp %p" ~/.ssh 2>/dev/null - Check private key permissions — must be
600:find ~/.ssh -type f -name "id_*" ! -name "*.pub" -exec stat -f "%Sp %p %N" {} \; - Check SSH key algorithm strength — weak keys are HIGH:
RSA < 3072 bits → HIGH. DSA → CRITICAL (deprecated). Ed25519 or ECDSA → PASS.for key in ~/.ssh/id_*; do [ -f "$key" ] && [[ "$key" != *.pub ]] && ssh-keygen -l -f "$key" 2>/dev/null done - SSH private keys should be encrypted — unencrypted keys are HIGH:
Any reported key is not encrypted. Fix: set a passphrase on the key(s), manage them in your password manager, or use a tool like Secretive.for key in ~/.ssh/id_*; do if [ -f "$key" ] && [[ "$key" != *.pub ]]; then ssh-keygen -y -P "" -f "$key" &>/dev/null && echo "Unencrypted key: $key" fi done - Check for
ForwardAgent yes— HIGH if enabled for untrusted hosts:
Fix: removegrep -n "ForwardAgent" ~/.ssh/config 2>/dev/nullForwardAgent yes; usessh -A <host>only when needed. - Check for
StrictHostKeyChecking no— HIGH if set globally:grep -n "StrictHostKeyChecking" ~/.ssh/config 2>/dev/null
4. Git Configuration
- Credential helper —
osxkeychainormanageris secure;storeis HIGH (plaintext);cacheis MEDIUM:git config --global credential.helper - Plaintext credentials — must not exist (CRITICAL):
ls -la ~/.git-credentials ~/.netrc 2>/dev/null - Commit signing — recommended (INFO if missing):
git config --global commit.gpgsign - TLS verification — must not be
false(CRITICAL):git config --global http.sslVerify - Pre-commit hooks — check for secret scanners (gitleaks, detect-secrets):
git config --global core.hooksPath
5. Credential Files
- Sensitive files must be
600(owner-only). Check each that exists:
Any file with group/other read → HIGH. Fix:for f in ~/.npmrc ~/.yarnrc.yml ~/.kube/config ~/.docker/config.json \ ~/.pulumi/credentials.json ~/.terraform.d/credentials.tfrc.json \ ~/.config/gh/hosts.yml ~/.aws/credentials ~/.azure/accessTokens.json \ ~/.netrc; do [ -f "$f" ] && stat -f "%Sp %N" "$f" donechmod 600 <file>. - Scan for plaintext tokens (CRITICAL if found):
Fix: remove hardcoded tokens; use environment variables or credential helpers.grep -l "authToken=ghp_\|authToken=npm_\|authToken=glpat-\|_password=" ~/.npmrc 2>/dev/null grep -l "npmAuthToken:" ~/.yarnrc.yml 2>/dev/null grep -l "password" ~/.pypirc ~/.netrc 2>/dev/null - Cloud provider credentials — JSON files in
~/.config/gcloud/,~/.aws/,~/.azure/should be600:find ~/.config/gcloud ~/.aws ~/.azure -name "*.json" -o -name "credentials" 2>/dev/null | \ xargs -I{} stat -f "%Sp %N" {} 2>/dev/null
6. Shell Configuration
- History files must be
600:stat -f "%Sp %p" ~/.zsh_history ~/.bash_history 2>/dev/null - History privacy — sensitive commands should be excludable (INFO if not set):
- zsh:
grep HIST_IGNORE_SPACE ~/.zshrc - bash:
grep HISTCONTROL ~/.bashrc
- zsh:
- Secrets in shell profiles — scan for hardcoded API keys, tokens, passwords (HIGH if found):
grep -nE '^\s*export\s+\w*(API_KEY|SECRET|_TOKEN|PASSWORD|AWS_SECRET|GITHUB_TOKEN|NPM_TOKEN|PRIVATE_KEY)\s*=' \ ~/.zshrc ~/.zprofile ~/.zshenv ~/.bashrc ~/.bash_profile ~/.profile 2>/dev/null - Remote code execution patterns —
curl | bashin profiles (MEDIUM):
Note:grep -nE 'curl\s.*\|\s*(ba)?sh|wget\s.*\|\s*(ba)?sh' \ ~/.zshrc ~/.zprofile ~/.bashrc ~/.bash_profile 2>/dev/nulleval "$(brew shellenv)"andeval "$(mise activate)"are standard and safe.
7. Network Exposure
- Services listening on all interfaces (0.0.0.0) — flag anything unexpected (MEDIUM):
Known safe: rapportd (Apple Handoff), Tailscale/IPNExtension (VPN), ControlCenter (AirPlay — disable if unused). Dev servers (node, python) on 0.0.0.0 should bind to 127.0.0.1 instead.lsof -i -P -n 2>/dev/null | grep LISTEN | grep -v '127.0.0.1\|::1' | awk '{print $1, $9}' | sort -u - Firewall exceptions — review for stale entries:
Flag if >30 exceptions (INFO). Remove stale entries in System Settings → Firewall → Options./usr/libexec/ApplicationFirewall/socketfilterfw --listapps 2>/dev/null | head -1
8. Package Managers & Developer Tools
- npm — check TLS and script settings:
npm config get strict-ssl 2>/dev/null npm config get ignore-scripts 2>/dev/nullstrict-ssl=false→ HIGH (TLS disabled).ignore-scriptsabsent → INFO. - pip — check for TLS bypass:
python3 -m pip config list 2>/dev/null | grep -E 'trusted-host|index-url'trusted-hostset → HIGH (TLS bypassed). Customindex-urlnot pointing to pypi.org → MEDIUM. - Go — check checksum verification:
Non-empty GONOSUMCHECK → MEDIUM (checksum verification bypassed).go env GONOSUMCHECK GONOSUMDB GOFLAGS 2>/dev/null - Docker — check for plaintext credentials:
Plaintextcat ~/.docker/config.json 2>/dev/null | python3 -c "import sys,json; d=json.load(sys.stdin); print('credHelpers:', d.get('credHelpers',{})); print('credsStore:', d.get('credsStore','')); print('auths:', list(d.get('auths',{}).keys()))" 2>/dev/nullauthorpasswordinauths→ HIGH. UsingcredHelpersorcredsStore→ PASS. - Homebrew — list third-party taps for awareness:
Review for unexpected taps → INFO.brew tap 2>/dev/null | grep -v '^homebrew/' - VS Code — list extensions for review:
Review for extensions from unknown publishers → INFO.code --list-extensions 2>/dev/null | wc -l
9. Outdated Software
Outdated tools can contain known vulnerabilities. Check each package manager for pending updates.
- Homebrew formulae — check for outdated packages:
Security-critical tools outdated (trivy, gitleaks, zizmor, git) → MEDIUM. Others → INFO. Fix:brew outdated 2>/dev/nullbrew upgrade. - Homebrew casks — check for outdated applications:
Outdated browsers or naisdevice → MEDIUM. Others → INFO. Fix:brew outdated --cask 2>/dev/nullbrew upgrade --cask. - npm global packages:
Outdated → INFO. Fix:npm outdated -g 2>/dev/nullnpm update -g. - pip packages:
Outdated → INFO. Fix:pip3 list --outdated 2>/dev/nullpip3 install --upgrade <package>. - mise/asdf runtimes:
Outdated → INFO. Fix:mise outdated 2>/dev/nullmise upgrade. - macOS system updates:
Pending security updates → MEDIUM. Other updates → INFO. Fix:softwareupdate -l 2>/dev/nullsoftwareupdate -ia.
Report Format
Summarize all findings in a table:
| Severity | Category | Finding | Remediation |
|----------|-------------|--------------------------------------|-----------------------|
| CRITICAL | Credentials | Plaintext token in ~/.npmrc | Remove token, use env |
| HIGH | SSH | ForwardAgent enabled for 'myhost' | Remove from config |
| PASS | FileVault | Disk encryption enabled | |End with an overall verdict: CRITICAL / HIGH / MEDIUM / GOOD based on the worst finding, and a count summary (e.g., "0 critical, 1 high, 2 medium, 18 passed").
Related
| Resource | Use For |
@security-champion | Trusselmodellering, compliance, Navs sikkerhetsarkitektur |
@security-review | Sikkerhetssjekk av kodeendringer før commit/push |
$nav-auth | JWT-validering, TokenX, ID-porten, Maskinporten |
$nais | Nais-manifest, accessPolicy, hemmeligheter |
| sikkerhet.nav.no | Navs Golden Path og autoritative sikkerhetsretningslinjer |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

