Skip to content

fjimenez77/MacDNA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧬 MacDNA v3

Capture Β· Deploy Β· Clone Your Mac

v3.0  ━━  cyberspartan77  ━━  2026

Capture your Mac's complete configuration DNA and deploy it to any new machine.

MacDNA scans your current Mac β€” preferences, apps, dock layout, dotfiles, security settings, keyboard, fonts, network β€” and saves everything into a portable profile. Take that profile to a brand new Mac, deploy it, and your setup is restored.

No dependencies. Pure Python. Runs from a USB stick.


Quick Start

# Clone the repo
git clone https://github.com/fjimenez77/MacDNA.git
cd MacDNA

# Run it
python3 macdna.py

That's it. You get an interactive menu:

╔══════════════════════════════════════════════╗
β•‘        🧬  M a c D N A   v 3                β•‘
β•‘   Capture  -  Deploy  -  Clone Your Mac      β•‘
╠══════════════════════════════════════════════╣
β•‘  Author: cyberspartan77  |  v3.0  |  2026    β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

─── MAIN MENU ────────────────────────────────

  1  Capture This Mac
  2  Deploy to This Mac
  3  View Profile
  4  Compare Profiles
  5  Delete Profile
  6  Security & Asset Audit
  7  Settings
  8  Exit MacDNA

What It Captures

Category What's Grabbed
Machine Identity Hostname, macOS version, chip type, serial
System Preferences Dark mode, Finder settings, trackpad, mouse, screenshots
Dock All dock apps, position, size, autohide, magnification
Applications Homebrew formulae & casks, Mac App Store apps, all /Applications
Keyboard & Input Key repeat, hot corners, auto-correct, smart quotes
Security FileVault, firewall, Gatekeeper, SIP, screen lock
Shell & Dotfiles .zshrc, .bashrc, .gitconfig, .vimrc, PATH, oh-my-zsh detection
Login Items Login apps + LaunchAgents
Fonts User-installed fonts in ~/Library/Fonts
Network DNS servers, custom /etc/hosts entries

Output

Each capture creates a folder with two files:

profiles/
  CyberSpartan77s_MacBook_Pro_2026-03-17/
    profile.json    ← machine-readable, used for deploy
    profile.html    ← interactive browser viewer

HTML Viewer

The HTML report is a dark-themed, searchable, expandable viewer you can open in any browser β€” no server needed. It shows:

  • Stats dashboard (app count, formulae, casks, dock apps, dotfiles, fonts)
  • Collapsible sections for every category
  • Color-coded tags for apps, casks, dock items
  • Syntax-highlighted dotfile contents
  • Full raw JSON toggle
  • Search bar to find any setting

Security & Asset Audit

Run with sudo for full results: sudo python3 macdna.py β†’ option 6.

sudo vs Non-sudo

Feature Without sudo With sudo
Capture settings βœ… Full βœ… Full
Deploy settings βœ… Full βœ… Full
Security audit β€” asset intel βœ… Full βœ… Full
Security audit β€” compliance ⚠️ Partial (firewall, remote login limited) βœ… Full
Security audit β€” event logs ⚠️ Limited (sudo history, failed logins) βœ… Full
Security audit β€” threats βœ… Full βœ… Full
Security audit β€” certificates βœ… Full βœ… Full

A comprehensive security assessment covering 8 audit domains with 60+ checks:

Section What's Scanned
Asset Intelligence CPU, RAM, GPU, storage volumes, battery health, USB/Thunderbolt/Bluetooth devices, serial, board ID
User Accounts & Access Local users, admin status, hidden accounts, sudoers, SSH config, authorized_keys
Certificates System keychain certs, expiry dates, self-signed detection, 30/60/90-day expiry warnings
Network & Connections Listening ports, established connections, UDP, interfaces, VPN tunnels, routing table, sharing services
Domain & Management Active Directory, LDAP, MDM enrollment, configuration profiles, managed preferences
Threat Detection & IOCs Reverse shells, suspicious processes, unsigned binaries, crypto miners, malware names, cron jobs, browser extensions, env variable anomalies, recently modified system files
Compliance Posture FileVault, SIP, Gatekeeper, firewall, stealth mode, auto-updates, screen lock, remote login, guest account, AirDrop, Time Machine, secure boot
Logs & Forensics Failed logins, sudo history, SSH history, kernel panics, app crashes, quarantine events, mounted volumes

Guidance & Remediation Engine

Every failed check or threat finding includes actionable remediation:

  • What β€” plain English description of the issue
  • Risk β€” why it matters to your security posture
  • Fix β€” the exact terminal command to remediate
  • Settings Path β€” where to fix it in System Settings UI
  • CIS Reference β€” CIS Benchmark ID where applicable

Findings are color-coded: πŸ”΄ Critical | 🟑 Warning | 🟒 Pass

Audit Output

profiles/
  CyberSpartan77s_MacBook_Pro_2026-03-17/
    profile.json    ← system capture
    profile.html    ← system capture viewer
    audit.json      ← security audit data
    audit.html      ← security audit viewer with guidance

Deploy

Pick a saved profile β†’ select which categories to apply β†’ dry-run or live.

  • Dry Run β€” previews every change, touches nothing
  • Apply β€” writes settings via defaults write, installs apps via brew/mas, restores dotfiles
  • Auto-backup β€” existing dotfiles are backed up to ~/.macdna_backup/ before overwrite
  • Idempotent β€” skips already-installed apps
  • Confirmation β€” requires typing YES before any changes

Settings

Configurable via the in-app Settings menu (option 6):

Setting Default
Profile save location ./profiles/
Backup directory ~/.macdna_backup/
Auto-backup before deploy ON
Dry-run by default OFF
Confirm before apply ON
Exclude sensitive dotfiles (.netrc, .npmrc) ON
Auto-name profiles OFF
Compact JSON OFF
Color output ON
Default capture categories All
Security audit with capture OFF
Threat alert level medium

Settings persist in settings.json.

Security

  • Never captures passwords, tokens, SSH keys, keychains, or credentials
  • Sensitive dotfiles (.netrc, .npmrc, .pypirc) excluded by default
  • Profiles stay local β€” .gitignore excludes them from version control
  • Capture is read-only β€” safe to run anytime
  • Deploy is cautious β€” confirmation required, dry-run available

Requirements

  • macOS 12+ (Monterey through Sequoia)
  • Python 3 (pre-installed on macOS)
  • Apple Silicon or Intel
  • Optional: Homebrew (for app install/restore)
  • Optional: mas (for App Store app capture)

Project Structure

MacDNA/
β”œβ”€β”€ macdna.py           # Main app β€” capture, deploy, menus, HTML reports
β”œβ”€β”€ securityaudit.py    # Security & Asset Audit engine + guidance
β”œβ”€β”€ profiles/           # Saved captures and audits
β”œβ”€β”€ LICENSE
└── README.md

Related Projects

  • WinDNA β€” Windows counterpart (Python + PowerShell, x64/x86/ARM)

Keywords

macOS system backup, Mac settings capture, Mac migration tool, deploy Mac preferences, clone Mac setup, macOS configuration DNA, system preferences backup, Mac dotfile backup, FileVault audit, SIP compliance check, macOS security audit, CIS benchmark Mac, Mac forensic snapshot, Homebrew backup restore, Mac App Store backup, dark mode capture, dock layout backup, Python macOS tool, Mac IT admin tool, macOS compliance checker

Contributing

Pull requests, bug reports, and feature suggestions are welcome.

Quick version:

# 1. Fork the repo on GitHub
# 2. Clone your fork
git clone https://github.com/YOUR_USERNAME/MacDNA.git
cd MacDNA

# 3. Create a feature branch
git checkout -b feature/your-idea

# 4. Make changes, test locally
python3 macdna.py
python3 -m py_compile macdna.py

# 5. Commit + push + open a PR
git commit -m "Add: your change"
git push origin feature/your-idea

Before opening a PR:

  • Open an issue first for non-trivial changes
  • Keep PRs focused (one logical change per PR)
  • Test the affected functionality manually
  • No new external dependencies without discussion
  • No real credentials, SSH keys, or PII in commits

Reporting bugs? Include macOS version, Python version, and reproduction steps.

Found a security issue? Don't open a public issue β€” use GitHub Security Advisories instead.

Contributors

License

Apache License 2.0 β€” see LICENSE for full text.

Copyright 2026 Felix J. (@fjimenez77) and contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

About

🧬 Capture your Mac's complete configuration DNA β€” preferences, apps, dock, dotfiles, security β€” and deploy it to any new Mac. Interactive menu-driven Python tool. No dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages