Security एक server decision है, widget state नहीं।
2IZI Guard स्थानीय risk evaluation, adaptive friction और single-use server authorization tokens से forms और public actions की सुरक्षा करता है। External CAPTCHA runtime अनिवार्य नहीं है।
छोटी integration surface. अंतिम permission server पर रहती है।
Current core PHP 8.1+ को target करता है और security boundary पर framework-independent है। हर action को explicit protect करें और 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;
}Typical actions
loginregisterpassword_resetcontactcheckoutfile_uploadएक protected action. पाँच independent checkpoints.
Browser challenge में भाग ले सकता है, लेकिन business permission हमेशा server जारी और consume करता है।
Context validate
महंगे काम से पहले Origin, action, session और basic limits जाँचें।
Local score
Server और application signals explainable risk decision बनाते हैं।
Friction जोड़ें
Policy PASS, PoW, interaction, throttle या deny चुनती है।
एक बार issue
Random 256-bit opaque token को session/action/origin और short TTL से bind करें।
Atomic consume
Business endpoint token को एक बार consume करता है; replay, mismatch और expiry reject होते हैं।
Policy modes
Trusted traffic चुपचाप गुजर सकता है; अधिक risk पर PoW, hold, throttle या deny लागू हो सकता है।
Integration contract
Current core PHP 8.1+ को target करता है और security boundary पर framework-independent है। हर action को explicit protect करें और 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 tokens · hash-only storage · short TTL · action/session/origin binding · HMAC integrity · one-time atomic consume · server-only business signals · critical actions 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.
मानते हैं कि attacker पूरे codebase को जानता है।
Source, JavaScript, API, DB schema, PoW और thresholds ज्ञात हो सकते हैं; secrets और authorization server-side रहते हैं।
मानते हैं attacker के पास है
- पूरा source code
- modern AI models
- Playwright / Selenium / headless Chromium
- residential proxies
- अपने traffic captures
Security इन चीज़ों को छुपाने पर निर्भर नहीं
- JavaScript
- challenge algorithms
- field names
- endpoints
- risk thresholds
Public code auditability बढ़ाए, model को कमजोर न करे।
Implementation पढ़ना authorization bypass नहीं बनाना चाहिए। Public review के लिए disciplined releases, keys, repository permissions और vulnerability handling जरूरी हैं।
Publish करें
- source और change history
- SECURITY.md और responsible disclosure
- threat model और architecture
- automated security / red-team tests
- release checksums और notes
Private रखें
- production config/guard.php
- APP_KEY और HMAC/privacy/rate-limit keys
- DB dumps और real security events
- real cookies/tokens/sessions
- deployment secrets और 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 · active development
Current branch में security-first architecture और automated regression/red-team coverage है। पहले Shadow Mode, फिर real traffic पर enforcement tune करें।