Bảo mật là quyết định của máy chủ, không phải trạng thái widget.
2IZI Guard bảo vệ biểu mẫu và hành động công khai bằng đánh giá rủi ro cục bộ, friction thích ứng và token ủy quyền máy chủ dùng một lần. Không bắt buộc CAPTCHA bên ngoài.
Bề mặt tích hợp nhỏ. Quyền cuối cùng nằm ở máy chủ.
Core hiện tại nhắm PHP 8.1+ và framework-independent tại security boundary. Bảo vệ từng action rõ ràng và tiêu thụ token trước business operation.
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;
}Action thường dùng
loginregisterpassword_resetcontactcheckoutfile_uploadMột action được bảo vệ. Năm checkpoint độc lập.
Browser có thể tham gia challenge nhưng business permission luôn do máy chủ phát hành và tiêu thụ.
Xác minh ngữ cảnh
Kiểm tra Origin, action, session và limit cơ bản trước công việc tốn kém.
Đánh giá cục bộ
Tín hiệu server và ứng dụng tạo quyết định rủi ro có thể giải thích.
Thêm friction
Policy chọn PASS, PoW, interaction, throttle hoặc deny.
Phát hành một lần
Token opaque ngẫu nhiên 256-bit gắn với session/action/origin và TTL ngắn.
Tiêu thụ nguyên tử
Business endpoint tiêu thụ một lần; replay, mismatch và expiry bị từ chối.
Policy modes
Traffic tin cậy có thể đi qua im lặng; rủi ro cao có thể kích hoạt PoW, hold, throttle hoặc deny.
Integration contract
Core hiện tại nhắm PHP 8.1+ và framework-independent tại security boundary. Bảo vệ từng action rõ ràng và tiêu thụ token trước business operation.
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 · chỉ lưu hash · TTL ngắn · binding action/session/origin · HMAC integrity · one-time atomic consume · server-only business signals · fail-closed cho action quan trọng.
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.
Giả định kẻ tấn công biết toàn bộ mã nguồn.
Mã nguồn, JavaScript, API, schema DB, PoW và threshold có thể bị biết; secret và ủy quyền vẫn ở máy chủ.
Giả định kẻ tấn công có
- toàn bộ source code
- mô hình AI hiện đại
- Playwright / Selenium / headless Chromium
- residential proxy
- bản ghi traffic của chính họ
Security không dựa vào việc giấu
- JavaScript
- thuật toán challenge
- tên field
- endpoint
- risk threshold
Mã công khai phải tăng khả năng kiểm tra, không làm yếu mô hình.
Đọc implementation không được tạo authorization bypass. Public review cần release, key, repository permission và vulnerability handling có kỷ luật.
Công khai
- source và lịch sử thay đổi
- SECURITY.md và responsible disclosure
- threat model và kiến trúc
- test security / red-team tự động
- release checksum và notes
Giữ riêng
- production config/guard.php
- APP_KEY và HMAC/privacy/rate-limit keys
- DB dump và security events thật
- cookie/token/session thật
- deployment secret và 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 · đang phát triển
Branch hiện tại có security-first architecture và regression/red-team coverage tự động. Bắt đầu với Shadow Mode rồi calibrate enforcement trên traffic thật.