2IZI Guard · 0.4.10 · PRE-1.0

文件

目前核心面向 PHP 8.1+,安全邊界不綁定框架。每個 action 明確保護,並在業務操作前消耗 token。

保護應用操作

安全由伺服器決定,而不是小工具狀態。

2IZI Guard 透過本機風險評估、自適應摩擦與一次性伺服器授權權杖保護表單和公開操作。核心執行時不強制依賴外部 CAPTCHA。

PHP 8.1+Core runtime
MariaDB / MySQLBaseline storage
0必要的外部執行時請求
256-bitopaque token 熵
PRE-1.0目前分支採 security-first 架構並具備自動 regression/red-team 測試。建議先 Shadow Mode,再依真實流量調整 enforcement。
Quick start

整合面小,最終權限保留在伺服器端。

目前核心面向 PHP 8.1+,安全邊界不綁定框架。每個 action 明確保護,並在業務操作前消耗 token。

1. Frontend

前端HTML
<script src="/guard/public/assets/guard.js?v=0.4.10" defer></script>
<form data-guard-action="contact">
  …
</form>

2. Protected action

受保護 actionPHP
$result = Guard::verifyAndConsume(
    $_POST['guard_token'] ?? '',
    'contact'
);

if (!$result->allowed()) {
    http_response_code(403);
    exit;
}

典型 actions

loginregisterpassword_resetcontactcheckoutfile_upload
Server authorityJavaScript 成功不代表授權;伺服器驗證並消耗 Guard token。
運作方式

一個受保護 action,五個獨立檢查點。

瀏覽器可參與 challenge,但最終業務權限始終由伺服器簽發並消耗。

01

驗證上下文

先檢查 Origin、action、session 與基礎限流。

02

本機評分

伺服器與應用訊號產生可解釋的風險決策。

03

增加摩擦

策略可選 PASS、PoW、互動、節流或拒絕。

04

一次簽發

隨機 256-bit opaque token 綁定 session/action/origin 與短 TTL。

05

原子消耗

業務 endpoint 僅消耗一次;重放、失配與過期會被拒絕。

Policy modes

ShadowObserve and predict; no enforcement.
InvisibleNo visible challenge.
AdaptiveRisk-based PASS / PoW / interaction / deny.
Always challengeRequire step-up for every protected request.

可信流量可靜默通過,高風險可觸發 PoW、按住確認、節流或拒絕。

整合

Integration contract

目前核心面向 PHP 8.1+,安全邊界不綁定框架。每個 action 明確保護,並在業務操作前消耗 token。

Action registry

The server defines allowed action names. Never use a client-provided action as authorization context.

'contact' => [
  'mode' => 'adaptive',
  'fail_mode' => 'open_with_limit'
]

Origin / session binding

256-bit opaque token · 僅存 hash · 短 TTL · action/session/origin 綁定 · HMAC 完整性 · 一次性原子消耗 · server-only 業務訊號 · 關鍵 action fail-closed。

UI isolation

Shadow DOM isolates Guard visuals from host CSS. It is a UI reliability layer, not a security boundary.

Localization

UI locale is BCP-47-style, UTF-8, RTL-ready, touch/keyboard compatible, and extendable with locale packs.

威脅模型

假設攻擊者知道完整程式碼庫。

2IZI Guard 採 Kerckhoffs-style 假設:原始碼、JavaScript、API、資料庫結構、PoW 與門檻皆可能公開;秘密與授權仍留在伺服器。

假設攻擊者擁有

  • 完整原始碼
  • 現代 AI 模型
  • Playwright / Selenium / headless Chromium
  • 住宅代理
  • 自己的流量紀錄

安全不依賴隱藏

  • JavaScript
  • challenge 演算法
  • 欄位名稱
  • endpoint
  • risk threshold
核心不變條件256-bit opaque token · 僅存 hash · 短 TTL · action/session/origin 綁定 · HMAC 完整性 · 一次性原子消耗 · server-only 業務訊號 · 關鍵 action fail-closed。
誠實邊界瀏覽器 challenge 無法數學證明「生物學上的人」。關鍵操作仍需 passkey/WebAuthn、MFA、已驗證帳戶、交易授權與業務限額。
開源

公開程式碼應提升可審計性,而不是削弱安全模型。

閱讀實作不應產生授權繞過;公開審查仍需要嚴謹的發布、金鑰、倉庫權限與漏洞處理。

公開

  • 原始碼與變更歷史
  • SECURITY.md 與 responsible disclosure
  • 威脅模型與架構
  • 自動 security / red-team 測試
  • 發布 checksum 與 notes

保持私有

  • 正式環境 config/guard.php
  • APP_KEY 與 HMAC/privacy/rate-limit 金鑰
  • 資料庫 dump 與真實 security events
  • 真實 cookie/token/session
  • 部署秘密與私有基礎設施資訊
Operations

Diagnostics, tests and updates

Diagnostics

php bin/diagnose.php

Check database state, key material, Origin configuration and registered actions before enabling enforcement.

Regression / red-team

bash tests/run-all.sh

Release acceptance includes replay, proxy, risk, tampering, UI and integration checks. Run disposable MariaDB/MySQL concurrency tests where available.

Updates

Read release notes and migrations first. Do not overwrite production config/guard.php with a distribution template. Rotate keys only when a release explicitly requires it.

Rollout

Start with Shadow Mode, review predicted decisions and false positives, tune action policies, then enable calibrated enforcement.

目前狀態

0.4.10 · pre-1.0 · 持續開發

目前分支採 security-first 架構並具備自動 regression/red-team 測試。建議先 Shadow Mode,再依真實流量調整 enforcement。

PHP core可用
Webasyst / Shop-Script adapter核心穩定後
Verified agents / Privacy Pass未來 / 依標準而定
0.4.10The responsive-layout hotfix changes UI sizing and preview embedding only; database schema, token/challenge protocol, keys, risk engine and server authorization logic are unchanged.

語言

EnglishEnglishРусскийRussian简体中文Chinese (Simplified)繁體中文Chinese (Traditional)日本語Japanese한국어KoreanDeutschGermanFrançaisFrenchEspañolSpanishItalianoItalianPortuguês (Brasil)Portuguese (Brazil)العربيةArabicעבריתHebrewTürkçeTurkishPolskiPolishNederlandsDutchBahasa IndonesiaIndonesianTiếng ViệtVietnameseहिन्दीHindiPortuguês (Portugal)Portuguese (Portugal)ČeštinaCzechRomânăRomanianMagyarHungarianΕλληνικάGreekSvenskaSwedishNorskNorwegianDanskDanishSuomiFinnishไทยThai