セキュリティ判断はウィジェットではなくサーバーが行う。
2IZI Guard はローカルなリスク評価、適応型フリクション、1回限りのサーバー認可トークンでフォームと公開アクションを保護します。外部 CAPTCHA の必須依存はありません。
小さな integration surface。最終 permission は server-side。
現在の core は PHP 8.1+ 向けで security boundary は framework 非依存。各 action を明示的に保護し、business operation 前に token を consume します。
1. Frontend
<script src="/guard/public/assets/guard.js?v=0.4.10" defer></script> <form data-guard-action="contact"> … </form>
2. Protected action
$result = Guard::verifyAndConsume(
$_POST['guard_token'] ?? '',
'contact'
);
if (!$result->allowed()) {
http_response_code(403);
exit;
}代表的な actions
loginregisterpassword_resetcontactcheckoutfile_upload1つの保護 action、5つの独立チェックポイント。
ブラウザは challenge に参加できますが、業務権限の発行と消費は常にサーバーです。
文脈を検証
高コスト処理の前に Origin、action、session、基本 limit を確認。
ローカル評価
server/application signals から説明可能なリスク判断を作成。
フリクション追加
PASS、PoW、interaction、throttle、deny を policy が選択。
1回だけ発行
ランダム 256-bit opaque token を session/action/origin/短い TTL に binding。
原子的に consume
business endpoint が1回だけ消費し、replay・mismatch・expiry を拒否。
Policy modes
信頼できる traffic は静かに通し、高リスクには PoW、長押し、throttle、deny を適用できます。
Integration contract
現在の core は PHP 8.1+ 向けで security boundary は framework 非依存。各 action を明示的に保護し、business operation 前に token を consume します。
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 binding · HMAC integrity · one-time atomic consume · server-only business signals · critical 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 の前提で設計されています。source、JavaScript、API、DB schema、PoW、threshold が知られていても、秘密と認可は server-side に残ります。
攻撃者が持つと仮定
- 完全な source code
- 最新 AI model
- Playwright / Selenium / headless Chromium
- residential proxy
- 自身の traffic capture
隠蔽に依存しない
- JavaScript
- challenge algorithm
- field name
- endpoint
- risk threshold
公開コードは監査性を高めるべきで、モデルを弱めるべきではない。
実装を読むだけで authorization bypass が生じてはいけません。公開 review には厳格な release、key、repository permission、vulnerability handling が必要です。
公開する
- source と change history
- SECURITY.md / responsible disclosure
- threat model / architecture
- 自動 security / red-team tests
- release checksum / notes
非公開にする
- production config/guard.php
- APP_KEY / HMAC/privacy/rate-limit key
- DB dump / real security events
- real cookie/token/session
- deployment secret / private infrastructure
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 · 開発中
現行 branch は security-first architecture と automated regression/red-team coverage を備えます。まず Shadow Mode、その後 real traffic で enforcement を調整してください。