Metadata-Version: 2.1
Name: ardvane
Version: 0.15.0
Summary: Protects developers from malware that spreads through code: scan, block, fix and check daily. Runs only on your computer.
Home-page: https://github.com/Abdul-Moiz31/ardvane
Author: Abdul Moiz
License: MIT
Project-URL: Source, https://github.com/Abdul-Moiz31/ardvane
Project-URL: Changelog, https://github.com/Abdul-Moiz31/ardvane/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/Abdul-Moiz31/ardvane/issues
Keywords: security,malware,git,supply-chain,developer-tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Security
Classifier: Environment :: Console
Requires-Python: >=3.8
Description-Content-Type: text/markdown

<div align="center">

<img src="app/ui/icon.png" alt="" width="96" height="96">

# Ardvane

**Free, open-source protection for developers against malware that spreads through code:
fake job interviews, malicious packages and the PolinRider worm.**

Find it · block it · fix it · and stay on top of it every day. Everything runs on your own computer.

[![Tests](https://github.com/Abdul-Moiz31/ardvane/actions/workflows/tests.yml/badge.svg)](https://github.com/Abdul-Moiz31/ardvane/actions/workflows/tests.yml)
[![Version](https://img.shields.io/github/v/release/Abdul-Moiz31/ardvane?color=blue)](https://github.com/Abdul-Moiz31/ardvane/releases)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
![Platforms](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows%20(beta)-blue)
![Dependencies](https://img.shields.io/badge/dependencies-none-brightgreen)

[Website](https://ardvane-site.vercel.app) ·
[Get started](#get-started) ·
[What it does](#what-it-does) ·
[How it protects you](#how-it-protects-you) ·
[Accuracy](#accuracy) ·
[I think I'm infected](docs/after-a-scan/if-danger-found.md) ·
[Contributing](CONTRIBUTING.md)

</div>

---

## Why Ardvane exists

Developers are being targeted by state-sponsored malware (North Korea's *Contagious Interview* campaign) that spreads
**through code**: fake recruiters with "take-home tests", fake npm packages and malicious editor extensions. Once inside,
a worm uses your stolen GitHub access to **force-push itself into every repository you can reach**, including your
teammates' and your company's.

I was hit **three times in five weeks**. A clean reinstall lasted three days. Deleting files, rewriting history and
revoking tokens didn't stop it, because it kept coming back through infected repositories and collaborators. Ardvane is
everything that finally worked, packaged so you don't lose the weeks I did. → [Read the story](docs/story)

> **Think you're infected right now?** Go to [`docs/after-a-scan/if-danger-found.md`](docs/after-a-scan/if-danger-found.md). The order of the steps matters.

<a id="get-started"></a>

## Get started

**1. Install** with one command:

| | |
|---|---|
| **macOS** (Homebrew) | `brew install abdul-moiz31/ardvane/ardvane` |
| **macOS, Linux, Windows** (Python 3.8+) | `pipx install ardvane` |

What each system gets (Linux has no daily check, Windows is beta): [docs/platforms.md](docs/platforms.md).

No pipx yet? `brew install pipx` on a Mac, `py -m pip install --user pipx` on Windows, or use
`python3 -m pip install --user ardvane` instead.

**2. Open Ardvane:**

```bash
ardvane
```

The dashboard opens in your browser and runs **only on your computer**. Press **Scan now**, then:

- **Protection → Turn on protection**: you see every change before it's made
- **Overview → Daily check**: choose your time (9:00 by default)
- **Protection → Add app icon**: adds Ardvane to your Applications folder (Start menu on Windows), so from now on you
  open it from Launchpad, Spotlight or the Dock, with no terminal

→ [Dashboard guide](docs/dashboard.md)

**Prefer the terminal?**

| Command | What it does |
|---|---|
| `ardvane scan` | Read-only scan of this computer and your projects (`--quick` for machine checks only) |
| `ardvane check <folder>` | Scan one folder before you open it: a download, a coding test, a colleague's repo |
| `ardvane check-github <owner/repo>` | Scan every branch of GitHub repositories without cloning them |
| `ardvane surface <folder>` | List everything in a folder that can run code by itself (install scripts, editor tasks, git hooks, AI-tool hooks and MCP servers); `--user` does the same for your own AI-tool settings |
| `ardvane baseline save` / `diff` | Remember the start-up items, shell files, git settings and AI-tool settings on this computer, then see what changed since |
| `ardvane update-detections` | Download the latest signed detection list now (scans and the daily check do this anyway) |
| `ardvane protect` | Turn on protection (`--dry-run` shows every change first) |
| `ardvane unprotect` | Remove protection and restore your previous settings |
| `ardvane fixes` | What Ardvane can fix for you, with undo |
| `ardvane branches protect --all` | Block force pushes to your repositories with a GitHub ruleset (`--tags` also protects release tags; `list`, `check`, `undo` too) |
| `ardvane report-owner <owner/repo>` | Scan a repository shared with you and write the report its owner needs |
| `ardvane sandbox <owner/repo or folder>` | Open a coding test in a throwaway container, after scanning it |
| `ardvane secrets` | Find credentials in plain text files and see how to move off them |
| `ardvane doctor` | Print versions and what is switched on, safe to paste into a bug report |
| `ardvane log` | What Ardvane has changed: fixes, protection and settings, GitHub rulesets and issues, updates, sandboxes opened |
| `ardvane --help` | Everything else |

The scan ends with **CLEAN**, **worth a look** or **INFECTED**, says exactly what to do next, and saves a report.
When a new version is out the dashboard says so and updates in one click; or run `brew upgrade ardvane` / `pipx upgrade ardvane`.

<details>
<summary>Run from source instead (contributors, or no Homebrew / pipx)</summary>

```bash
git clone https://github.com/Abdul-Moiz31/ardvane.git
cd ardvane
python3 app/dashboard.py            # = `ardvane`; add a command, e.g. python3 app/dashboard.py scan
```

The scripts also work on their own: `bash scan-my-machine.sh`, `bash mac/install.sh`, `bash mac/install-routine.sh 9:00`,
and on Windows (beta) the matching `.ps1` files in `windows/`.

</details>

<a id="what-it-does"></a>

## What Ardvane does

| | |
|---|---|
| **Scans your computer** | Malware locations, running malware, startup items, attacker connections, editor settings, every git project and every installed package |
| **Checks git history** | Every version of every file on every branch, tag and commit, and says whether malware is in a branch's current files or only in older commits. A GitHub repository is read in a temporary folder and deleted again |
| **Cleans history** | For repositories you administer: a full backup first, then every commit, branch and tag rewritten, verified, shown to you, and pushed only after you type the repository's name |
| **Blocks infected code** | `git clone` typed in a terminal checks a repository *before* its files are written; `git pull` / `checkout` warn you; `git push` scans every commit being pushed and is blocked if one contains malware, or if the scan cannot finish |
| **Hardens your tools** | VS Code / Cursor can't auto-run code when you open a folder; npm packages can't run install scripts |
| **Fixes, with undo** | Fixes what's safe to fix (editor and npm settings, switched-off protection, malware in known locations), **ask first** by default or **automatic** if you choose. Malware files are moved to quarantine, not deleted; undo puts them back, and refuses if you have edited the file since. A stopped process cannot be restarted |
| **What changed** | Saves a baseline of everything that starts by itself (start-up items, shell start-up files, git settings that run programs, AI-tool settings), then lists what was added, removed or changed since, with a plain explanation of each. It is trusted as of the day you save it, not proven clean, and a list of changes never says the computer is safe ([what it watches on each system](docs/baseline.md)) |
| **Auto-run report** | Lists every place a folder, or your own AI-tool settings, can run code without you typing a command: install scripts, editor tasks, dev containers, git hooks, AI-agent hooks and MCP servers, instruction files, with when each runs, why it matters and the scanner's verdict ([auto-run](docs/auto-run.md)) |
| **To-do list** | Every finding becomes a short checklist; a real infection opens the recovery checklist; a later scan checks that your fix worked |
| **Safe install** | `npm`, `npx`, `pnpm`, `yarn`, `bun` and `pip` check every package an install would add against known malware (Ardvane's list plus OSV.dev's malicious-package database), and ask first about a package created this week, a release by a first-time publisher, or a name one typo from a popular package |
| **GitHub check** | Audits up to 100 of the repositories you administer, at most once every 20 hours (self-hosted runners, risky workflows, new deploy keys and SSH keys, suspicious webhooks, pending invitations, repositories a stolen token could force-push; anything it could not read is shown as "not checked"), warns about many repos pushed at once and scans recently pushed repos, plus every branch of any repos you choose. Shown live while a scan runs. The dashboard offers to turn it on when the GitHub CLI is signed in; your token stays in the GitHub CLI |
| **Block force pushes** | One click adds a GitHub ruleset to each of your repositories a stolen token could force-push: no force pushes, no deleting the default branch, undo any time |
| **Tell the owner** | For a repository shared with you that carries malware: scans every branch and writes the report its owner needs, to copy, save or open as an issue |
| **Open safely** | Scans a coding test, then opens it in a throwaway container that shares none of your files or keys, and deletes it when you leave. Starts Docker for you if it isn't running (Docker or Podman needed) |
| **Secrets** | Finds AWS, npm, GitHub CLI, Docker, git and other credentials in plain text files and walks you off them, step by step. Never shows or edits a secret |
| **Daily check** | macOS and Windows only (Linux has no scheduled check). Runs at the time you choose, notices if malware switched your protection off, and shows a notification. The dashboard warns you if it has stopped running. On macOS it runs through the Ardvane app so you can allow Documents, Desktop and Downloads once |
| **GitHub Action** | The same scanner on every push and pull request, and every branch every night, for teammates and branches nobody opens locally: pinned to a full commit hash, with SARIF output for GitHub code scanning ([how](docs/github-action.md)) |
| **Guides** | Every attack explained, and step-by-step recovery: cut off access, clean repositories, rotate secrets, harden |

<a id="how-it-protects-you"></a>

## How it protects you

| You do | Ardvane does |
|---|---|
| `git clone …` in a terminal | Downloads without writing project files → scans → **blocks** the clone if infected |
| `git pull`, `git checkout` | Scans and warns you before you open anything |
| `git push` | Scans every commit in the push and **blocks** it if one contains malware, or if the scan cannot run (Python missing, scanner broken). You can override once with `git push --no-verify` |
| Open a folder in VS Code / Cursor | Nothing runs on its own (automatic tasks off, Workspace Trust on) |
| `npm install` | Packages can't run install scripts |
| Every day at your time (macOS, Windows) | Checks your machine, projects, protections and (optionally) GitHub, then adds anything it finds to your to-do list |
| `checkrepo <folder>` | Scan anything before you open it: a download, a coding test, a colleague's repo. Files it could not read are listed as "Not scanned"; a folder that is a git repository with a `.gitignore` is scanned without the files git ignores |

A scan takes about **0.1–0.7 seconds per repository**. When everything is clean you won't notice it.

## Safe by design

- **Runs on your computer.** No account, no telemetry, no cloud, and nothing about your computer is uploaded. The
  dashboard listens on `127.0.0.1`, needs a per-session key, and refuses requests from other websites. Some features do
  contact a service, only when you use them, and send only the names of the repositories or packages you ask about:
  GitHub (the detection list, the GitHub check, update checks), OSV.dev, npm and PyPI (safe install lookups), and Docker
  Hub (the sandbox image). Each can be switched off; the full list is under **Settings → Privacy**.
- **Detections that keep up, signed.** Before each scan and daily check, Ardvane downloads a list of new detections
  from GitHub. It is used only if it carries Ardvane's signature and is newer than the copy you have, and it can only
  add detections, never remove one, and it expires: Ardvane warns you when the copy on your computer is old. Nothing
  about your computer is sent. See [feed/README.md](feed/README.md).
- **Reads, doesn't run.** The scanner only reads files and runs git with hooks and `core.fsmonitor` disabled, so even a
  booby-trapped repository can't make it execute anything.
- **Careful fixes, with undo.** You see every change before it's made. Malware files are moved to quarantine as
  evidence, not deleted, and fixes can be undone (undo refuses if you have edited the file since). Stopping a malware
  process cannot be undone, and in the default mode it only happens after you confirm.
- **No dependencies.** Python's standard library and plain JavaScript. No npm, no build step, no CDN: what you read
  here is exactly what runs.
- **No real malware in this repository.** Tests build synthetic samples at runtime.

<a id="accuracy"></a>

## Accuracy

The scanner was built from **real malware files** taken from an actual infection, then tuned against clean code:

| Test | Result |
|---|---|
| Real malware files (both payload variants, fake fonts, auto-run tasks, droppers) | **71 / 71 detected** |
| Same files with every known marker switched off (behaviour rules only) | **71 / 71 detected** |
| 18 popular open-source projects, 106,225 files (Font-Awesome, Babel, Webpack, Prettier, javascript-obfuscator…) | **0 false alarms** |
| A developer's 14 real projects + all installed packages, ~240,000 files | **0 false alarms** · 1 real infection leftover found |
| Ardvane scanned by itself: its source, the pip-installed copy and its own records | **0 alarms**, checked on every change |
| Automated tests: scanner, fixer (incl. attempts to trick it), history clean-up, dashboard security, GitHub check | **over 450 unit tests and over 150 detection checks**, run on every change (the unit tests on macOS, Linux and Windows, except a few that need a Unix shell), plus a build-and-install test of the package |

**Honest limits:** Ardvane targets this family of attacks, so a completely new technique may not be detected. That's
why it also hardens your editor, npm, git and GitHub and (on macOS and Windows) checks every day. Windows support is beta: on every change an automatic test parses the Windows scripts, dry-runs the installer, runs the quick scan and runs the dashboard's backend tests on Windows, but the scripts have had far less real-world use than macOS and check less (see [what each system gets](docs/platforms.md)). Reports are very welcome. A folder that is a git repository is scanned without the files its `.gitignore` hides, and a file Ardvane cannot read or is too large (over 5 MB) is reported as "Not scanned" rather than counted as clean. A scan can't
prove a machine is clean after a backdoor has run; see the [recovery guide](docs/after-a-scan/if-danger-found.md).

## What's in the repository

```
ardvane/
├── app/                        the Ardvane dashboard and `ardvane` command (Python standard library + plain JavaScript)
├── packaging/                  builds the PyPI package (standard library only)
├── scan-my-machine.sh / .ps1   one-command, read-only machine scan
├── scanner/                    detection and fixes: checkrepo, autofix, GitHub check, package lists, git hooks, safe clone, tests
├── mac/                        install / uninstall / daily check for macOS (the installer also works on Linux, which has no daily check)
├── windows/                    the same for Windows (beta)
└── docs/                       guides: the attacks, recovery, hardening, the story
```

## Learn more

- [The attacks](docs/attacks): PolinRider worm, fake job interviews, BeaverTail / InvisibleFerret stealers, the
  MicrosoftSystem64 backdoor, VS Code auto-run tasks, GlassWorm extensions, malicious npm packages, AI coding-agent
  attacks, ClickFix, EtherHiding
- [If you're infected](docs/after-a-scan/if-danger-found.md) · [Cleaning GitHub repositories](docs/after-a-scan/clean-github-repos.md) ·
  [Secrets rotation](docs/after-a-scan/secrets-rotation-checklist.md) · [Hardening checklist](docs/after-a-scan/hardening-checklist.md)
- Reference: [What each system gets](docs/platforms.md) · [What changed](docs/baseline.md) · [Auto-run](docs/auto-run.md) · [Workflow audit](docs/github-workflows.md) · [Dashboard](docs/dashboard.md) · [checkrepo](docs/checkrepo.md) · [Daily check](docs/daily-routine.md) · [Infected packages](docs/infected-packages.md)

## Contributing

Contributions are very welcome, especially **Windows test reports**, **new malicious packages or indicators** (with a
link to the public report) and **false-alarm reports**. Read [CONTRIBUTING.md](CONTRIBUTING.md), fork, branch, and open a
pull request; every change needs a test. Run every test with `python run_all.py`.

Found a security problem in Ardvane itself? Please report it privately; see [SECURITY.md](SECURITY.md).

## Credits

Ardvane stands on the work of researchers and other victims who published their findings:
[OpenSourceMalware](https://github.com/OpenSourceMalware/PolinRider) ·
[polinrider-cleaner](https://github.com/meSingh/polinrider-cleaner) (MIT, indicator lists) ·
[Bedri-B/polinrider](https://github.com/Bedri-B/polinrider) (MIT) ·
[pushwarden](https://github.com/FaheemRafiq/pushwarden) · [gitshield](https://github.com/mirzasaikatahmmed/gitshield) ·
Palo Alto Networks Unit 42 · Google Threat Intelligence Group · JFrog Security Research · Socket · Elastic Security Labs ·
Checkmarx · Cloud Security Alliance. Full source lists are at the end of every page in [`docs/attacks`](docs/attacks).

## License and disclaimer

[MIT](LICENSE): use it, share it, adapt it.
Ardvane reduces risk; it cannot guarantee that a machine is clean or will stay clean. It is provided as-is, without warranty.
