From 107c4ce5ee21134298f9eae4cc58deaf6fd972dc Mon Sep 17 00:00:00 2001 From: Adam Siwiec <73085927+adamsiwiec1@users.noreply.github.com> Date: Tue, 20 Oct 2026 04:41:20 -0400 Subject: [PATCH] feat(packaging): split Homebrew into phishkit cask (desktop) and phishkit-cli formula phishkit is now a cask for the full Tauri desktop app (.dmg on macOS, AppImage on Linux), and phishkit-cli is a formula that builds the CLI only (phishkit + phishkit_ctl). The desktop .dmg/AppImage are not built yet, so the cask carries placeholder shas until a desktop build/sign job ships them. The CLI formula uses the real v0.1.1-alpha.1 source tarball sha. README and release.yml updated to match. --- .github/workflows/release.yml | 17 +++---- README.md | 23 ++++++--- packaging/README.md | 3 +- packaging/homebrew/phishkit-cli.rb | 37 +++++++++++++++ packaging/homebrew/phishkit.rb | 76 ++++++++++++++++++++++++------ 5 files changed, 126 insertions(+), 30 deletions(-) create mode 100644 packaging/homebrew/phishkit-cli.rb diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e324792..1575d69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,13 +77,14 @@ jobs: SHA=$(sha256sum "$TGZ" | awk '{print $1}') URL="https://github.com/${REPO}/releases/download/${GITHUB_REF_NAME}/$(basename "$TGZ")" - # Homebrew formula (source tarball of the tag — SHA filled when published from archive URL) + # Homebrew formula for the CLI only (source tarball of the tag; SHA filled when the archive is public). + # The desktop app ships as a cask (packaging/homebrew/phishkit.rb); it needs built/signed .dmg/.AppImage artifacts. SRC_URL="https://github.com/${REPO}/archive/refs/tags/${GITHUB_REF_NAME}.tar.gz" - cat > packaging/homebrew/phishkit.rb < packaging/homebrew/phishkit-cli.rb < :build depends_on "go" => :build def install - system "cargo", "install", "--locked", "--path", "apps/cli", "--root", prefix, "--bin", "phishkit" + system "cargo", "install", "--locked", "--path", "apps/cli", "--root", prefix, "--bin", "phishkit", "--bin", "phishkit_ctl" end test do assert_match "phishkit", shell_output("#{bin}/phishkit --help 2>&1") @@ -100,7 +101,7 @@ jobs: end EOF # strip leading spaces from heredoc indent - sed -i 's/^ //' packaging/homebrew/phishkit.rb + sed -i 's/^ //' packaging/homebrew/phishkit-cli.rb cat > packaging/aur/PKGBUILD < @@ -136,7 +137,7 @@ jobs: mv packaging/debian/changelog.new packaging/debian/changelog mkdir -p dist-packaging - cp packaging/homebrew/phishkit.rb dist-packaging/ + cp packaging/homebrew/phishkit-cli.rb dist-packaging/ cp packaging/aur/PKGBUILD dist-packaging/ cp -r packaging/debian dist-packaging/ echo "${URL}" > dist-packaging/linux-asset.url @@ -175,7 +176,7 @@ jobs: files: | release-assets/*.tar.gz release-assets/*.tar.gz.sha256 - release-assets/phishkit.rb + release-assets/phishkit-cli.rb release-assets/PKGBUILD env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index c571746..3aaf823 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,9 @@ session**. An expert operator keeps full control; a non-technical user can run a click-through campaign from the guided wizard. The supported product is the Tauri desktop app, with a headless CLI for scripting. -> **Alpha — `v0.1.1-alpha.1`.** This is an early, in-progress release. Expect breaking changes, -> and prefer building from source. The macOS and Linux Homebrew cask is the easiest way to try it. +> **Alpha, `v0.1.1-alpha.1`.** This is an early, in-progress release. Expect breaking changes. +> The CLI installs from Homebrew today. The desktop app builds from source for now, while the +> signed `.dmg` and AppImage installers are still being set up. > **Authorized assessments only.** phishkit drives an AiTM proxy, sends email, and handles > captured credentials and live session tokens. Run it only with explicit written authorization @@ -40,13 +41,18 @@ Install, then try the whole AiTM flow against a local mock app that ships with t target, no email, no privileges beyond a loopback host entry. ```bash -# 1) Install (macOS / Linux — Homebrew; other options below) -brew install --cask openhat-security/tap/phishkit +# 1) Install. Two packages: the desktop app (cask) and the headless CLI (formula). +brew install --cask openhat-security/tap/phishkit # desktop UI (see note below) +brew install openhat-security/tap/phishkit-cli # CLI: installs `phishkit` and `phishkit_ctl` -# 2) Start the guided desktop console -phishkit # or: make start (from a source checkout) +# 2) Launch the desktop console, or run the CLI +open -a phishkit # desktop app +phishkit --help # CLI (or: make start, from a source checkout) ``` +The CLI formula works today. The desktop cask points at the signed `.dmg` and AppImage, which +are still being built, so for now install the desktop app from source (see [Install](#install)). + Dry-run the capture surface from a source checkout, which stands up an HTTPS upstream and drives the cookie demo login through evilginx: @@ -84,9 +90,12 @@ pick a phishlet, configure your own SMTP or ESP sender, and run a campaign from ## Install ```bash -# macOS / Linux — Homebrew +# Desktop app (macOS / Linux) via Homebrew cask brew install --cask openhat-security/tap/phishkit +# Headless CLI only (macOS / Linux) via Homebrew formula +brew install openhat-security/tap/phishkit-cli + # from source (recommended for alpha) git clone --recurse-submodules https://github.com/openhat-security/phishkit.git cd phishkit diff --git a/packaging/README.md b/packaging/README.md index 8c82f36..887d24c 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -9,7 +9,8 @@ files to the GitHub Release. | Channel | Path | Alpha behavior | |---------|------|--------------------| | GitHub Releases | workflow artifacts | Primary — CLI `.tar.gz` + sha256 | -| Homebrew | [`homebrew/phishkit.rb`](homebrew/phishkit.rb) | Formula attached; fill `sha256` after tag archive exists; push to your tap when ready | +| Homebrew (CLI) | [`homebrew/phishkit-cli.rb`](homebrew/phishkit-cli.rb) | Formula; builds the CLI from the tag source. `sha256` is set for v0.1.1-alpha.1; push to the tap as `phishkit-cli` | +| Homebrew (desktop) | [`homebrew/phishkit.rb`](homebrew/phishkit.rb) | Cask for the Tauri desktop app. Needs built/signed `.dmg`/`.AppImage` artifacts on the release before the `sha256` placeholders can be filled | | AUR | [`aur/PKGBUILD`](aur/PKGBUILD) | PKGBUILD attached with asset URL/sha; publish manually or with `AUR_SSH_PRIVATE_KEY` later | | Debian / Launchpad | [`debian/`](debian/) | Changelog bumped; `dput` remains operator-driven (`REPLACE_ME` identities) | diff --git a/packaging/homebrew/phishkit-cli.rb b/packaging/homebrew/phishkit-cli.rb new file mode 100644 index 0000000..d26eda4 --- /dev/null +++ b/packaging/homebrew/phishkit-cli.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# phishkit-cli: headless CLI only, built from the tagged source. +# Publish to the tap as `openhat-security/tap/phishkit-cli`. +# Update `url`/`sha256`/`version` for each tag (the release workflow prints both). +class PhishkitCli < Formula + desc "Authorized AiTM + awareness assessment CLI (alpha, CLI only)" + homepage "https://github.com/openhat-security/phishkit" + url "https://github.com/openhat-security/phishkit/archive/refs/tags/v0.1.1-alpha.1.tar.gz" + sha256 "02d932e97cdba099c9f2640f83041241b793e8d0f298be748224b9888c1418a9" + version "0.1.1-alpha.1" + license "GPL-3.0-only" + + depends_on "rust" => :build + depends_on "go" => :build + + def install + system "cargo", "install", "--locked", "--path", "apps/cli", "--root", prefix, + "--bin", "phishkit", "--bin", "phishkit_ctl" + (share/"phishkit").install Dir["kit/evilginx/phishlets"] + end + + def caveats + <<~EOS + phishkit-cli is the headless CLI only. For the desktop app, install the cask: + brew install --cask openhat-security/tap/phishkit + + Alpha build for authorized security assessments only. Read the authorized-use + policy before running it: #{opt_share}/phishkit or the repo docs. + EOS + end + + test do + assert_match "phishkit", shell_output("#{bin}/phishkit --help 2>&1") + assert_match "phishkit_ctl", shell_output("#{bin}/phishkit_ctl --help 2>&1") + end +end diff --git a/packaging/homebrew/phishkit.rb b/packaging/homebrew/phishkit.rb index b12d28e..7888c19 100644 --- a/packaging/homebrew/phishkit.rb +++ b/packaging/homebrew/phishkit.rb @@ -1,22 +1,70 @@ # frozen_string_literal: true -# Placeholder Homebrew formula — publish to your tap after filling URLs/SHA. -class Phishkit < Formula - desc "Authorized AiTM + awareness assessment CLI" - homepage "https://github.com/openhat-security/phishkit" - url "https://github.com/openhat-security/phishkit/archive/refs/tags/v0.1.0.tar.gz" - sha256 "REPLACE_ME" - license "GPL-3.0-only" +# phishkit: the full Tauri desktop app. +# Publish to the tap as `openhat-security/tap/phishkit` (cask). +# +# PENDING: the desktop release artifacts (.dmg for macOS, .AppImage for Linux) are +# not built or signed yet. The current release workflow (.github/workflows/release.yml) +# only builds the CLI. A desktop build+sign job is still needed (the signed-updater +# build job tracked in the follow-ups) before this cask can resolve. +# +# Once the desktop artifacts are attached to the latest tag, replace each +# REPLACE_ME_DESKTOP_* sha256 with the real checksum and bump `version`. +# Expected Tauri bundle names for v#{version}: +# macOS arm64: phishkit_#{version}_aarch64.dmg +# macOS x86_64: phishkit_#{version}_x64.dmg +# Linux x86_64: phishkit_#{version}_amd64.AppImage +cask "phishkit" do + version "0.1.1-alpha.1" - depends_on "rust" => :build - depends_on "go" => :build + on_macos do + on_arm do + sha256 "REPLACE_ME_DESKTOP_DMG_ARM64_NOT_BUILT_YET" + url "https://github.com/openhat-security/phishkit/releases/download/v#{version}/phishkit_#{version}_aarch64.dmg" + end + on_intel do + sha256 "REPLACE_ME_DESKTOP_DMG_X64_NOT_BUILT_YET" + url "https://github.com/openhat-security/phishkit/releases/download/v#{version}/phishkit_#{version}_x64.dmg" + end + end + on_linux do + on_intel do + sha256 "REPLACE_ME_DESKTOP_APPIMAGE_X64_NOT_BUILT_YET" + url "https://github.com/openhat-security/phishkit/releases/download/v#{version}/phishkit_#{version}_amd64.AppImage" + end + end + + name "phishkit" + desc "Authorized AiTM + awareness assessment kit (full desktop app, alpha)" + homepage "https://github.com/openhat-security/phishkit" - def install - system "cargo", "install", "--locked", "--path", "apps/cli", "--root", prefix, "--bin", "phishkit" - (share/"phishkit").install Dir["kit/evilginx/phishlets"] + livecheck do + skip "Auto-generated on release." end - test do - assert_match "phishkit", shell_output("#{bin}/phishkit --help 2>&1") + depends_on macos: :big_sur + + app "phishkit.app" + + postflight do + # Alpha builds are not notarized yet, so clear the quarantine bit to let + # Gatekeeper open the app on first launch. + if OS.mac? + system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}"] + end end + + caveats <<~EOS + phishkit is an alpha build for authorized security assessments only. + Read the authorized-use policy before running it. + + For the headless CLI only, install the formula instead: + brew install openhat-security/tap/phishkit-cli + EOS + + zap trash: [ + "~/Library/Application Support/com.phishkit.app", + "~/Library/Preferences/com.phishkit.app.plist", + "~/Library/Saved Application State/com.phishkit.app.savedState", + ] end