ความปลอดภัยคือการตัดสินใจของเซิร์ฟเวอร์ ไม่ใช่สถานะของ widget
2IZI Guard ปกป้องฟอร์มและการกระทำสาธารณะด้วยการประเมินความเสี่ยงภายในระบบ friction แบบปรับตัว และ token อนุญาตจากเซิร์ฟเวอร์แบบใช้ครั้งเดียว โดยไม่บังคับใช้ CAPTCHA ภายนอก
พื้นผิว integration เล็ก สิทธิ์สุดท้ายอยู่บนเซิร์ฟเวอร์
Core ปัจจุบันมุ่ง PHP 8.1+ และ framework-independent ที่ security boundary ปกป้องแต่ละ action อย่างชัดเจนและ consume token ก่อน 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;
}Actions ทั่วไป
loginregisterpassword_resetcontactcheckoutfile_uploadหนึ่ง action ที่ป้องกัน ห้าจุดตรวจอิสระ
Browser อาจมีส่วนใน challenge แต่ business permission ออกและ consume โดยเซิร์ฟเวอร์เสมอ
ตรวจ context
ตรวจ Origin, action, session และ limits พื้นฐานก่อนงานที่มีต้นทุนสูง
ประเมินภายใน
สัญญาณจาก server และ application สร้าง risk decision ที่อธิบายได้
เพิ่ม friction
Policy เลือก PASS, PoW, interaction, throttle หรือ deny
ออก token ครั้งเดียว
สุ่ม 256-bit opaque token ผูกกับ session/action/origin และ TTL สั้น
Consume แบบ atomic
Business endpoint consume ครั้งเดียว และปฏิเสธ replay, mismatch, expiry
Policy modes
traffic ที่เชื่อถือได้ผ่านได้เงียบ ๆ ส่วนความเสี่ยงสูงอาจใช้ PoW, hold, throttle หรือ deny
Integration contract
Core ปัจจุบันมุ่ง PHP 8.1+ และ framework-independent ที่ security boundary ปกป้องแต่ละ action อย่างชัดเจนและ consume token ก่อน 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 tokens · hash-only storage · TTL สั้น · binding action/session/origin · HMAC integrity · one-time atomic consume · server-only business signals · fail-closed สำหรับ critical actions
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.
สมมติว่าผู้โจมตีรู้โค้ดทั้งหมด
Source, JavaScript, API, DB schema, PoW และ threshold อาจเป็นที่รู้ได้ แต่ secret และ authorization ต้องอยู่บนเซิร์ฟเวอร์
สมมติว่าผู้โจมตีมี
- source code ทั้งหมด
- AI models สมัยใหม่
- Playwright / Selenium / headless Chromium
- residential proxies
- captures ของ traffic ตัวเอง
Security ไม่พึ่งการซ่อน
- JavaScript
- challenge algorithms
- field names
- endpoints
- risk thresholds
โค้ดสาธารณะควรเพิ่มความสามารถในการตรวจสอบ ไม่ใช่ทำให้โมเดลอ่อนแอ
การอ่าน implementation ต้องไม่สร้าง authorization bypass Public review ต้องมี releases, keys, repository permissions และ vulnerability handling ที่มีวินัย
ควรเปิดเผย
- source และ change history
- SECURITY.md และ responsible disclosure
- threat model และ architecture
- automated security / red-team tests
- release checksums และ notes
ควรเก็บเป็นความลับ
- production config/guard.php
- APP_KEY และ HMAC/privacy/rate-limit keys
- DB dumps และ security events จริง
- 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 · กำลังพัฒนา
Branch ปัจจุบันเป็น security-first architecture พร้อม automated regression/red-team coverage เริ่มด้วย Shadow Mode แล้ว calibrate enforcement บน traffic จริง