core

Security & PDPA

มาตรฐานความปลอดภัย — encryption at rest, HMAC webhook, การจัดการ key, สิทธิ์ตาม PDPA

⏱ PDPA

SlipBolt จัดการ "ข้อมูลการเงิน" จึงออกแบบความปลอดภัยตั้งแต่ชั้น credential ถึงการลบข้อมูลตาม PDPA

Authentication

Credentialใช้กับรายละเอียด
JWT (HS256)Dashboard / LIFFaccess token 15 นาที + refresh 7 วัน (rotated) · cookie httpOnly + Secure + SameSite=Lax + path /api
API keyServer-to-serversk_live_… / sk_test_… · เก็บเป็น argon2 hash (โชว์เต็มครั้งเดียว) · revoke/rotate ได้เอง
  • Refresh token เก็บเป็น sha256 hash (Session.tokenHash) — DB dump ที่หลุดไป replay ไม่ได้
  • Refresh-reuse detection — token เก่าถูกใช้ซ้ำ → revoke ทั้ง chain ทันที
  • New-device detection — login จากอุปกรณ์ใหม่ → แจ้งเตือนทางอีเมล

Encryption

  • In transit: TLS 1.2+ ทุก endpoint
  • At rest: LINE channel secret/token เข้ารหัส AES-256-GCM (key ENCRYPTION_KEY · 32-byte hex) — ถอดเฉพาะตอนเรียก LINE API, ไม่เคย cache plaintext ลง Redis
  • รหัสผ่านผู้ใช้: argon2id

Webhook integrity

  • ขาเข้า (LINE): ตรวจ HMAC-SHA256 ของ raw body ทุก request ก่อนรับ
  • ขาออก (ของคุณ): ทุก delivery เซ็น X-Slipbolt-Signature: t=<ts>,v1=<hmac>verify ทุกครั้ง ด้วย webhook secret ของ endpoint (ดู Webhooks)

Rate limit & abuse

  • Global throttle 120 req/min · login 5 req/min
  • API key มี rate limit ต่อ key ที่ 120 req/min (เท่ากันทุกแพ็ก · ไม่ได้ผูกกับราคา)
    • เพดานรวมของ POST /api/v1/verify ที่ 240 req/min — ดู Authentication
  • Input: รับเฉพาะ application/octet-stream (raw bytes) · จำกัดขนาดรูป

Audit log

ทุก security event (login/logout · password · session · link/unlink · API key · plan · admin action) เก็บใน audit_logs แบบ append-only · ผู้ใช้ดูของตัวเองได้ที่ Settings → Audit Log · prune อัตโนมัติหลัง 90 วัน

Log ระบบ redact ค่าอ่อนไหวอัตโนมัติ (password, *token*, *secret*, Authorization)

PDPA — สิทธิ์เจ้าของข้อมูล

สิทธิ์ทำได้ที่
เข้าถึง / พกพา (Access · Portability)GET /auth/me/export → JSON ทั้งหมด (ไม่มี secret) · Settings → Security
ลบ (Erasure)DELETE /auth/me → soft-delete + ยกเลิก subscription + revoke ทุก session · cron ลบจริงหลัง 24 ชม.
ความเป็นส่วนตัวของสลิปรูปสลิป ลบทันทีหลังตรวจเสร็จ (ไม่ persist) · เก็บเฉพาะ text (ref/ยอด/วันที่/ชื่อ)
Retentionข้อมูลธุรกรรม anonymize อัตโนมัติตาม pdpaRetentionMonths (default 12 เดือน) เมื่อร้านเปิด auto-delete

ข้อมูลทุกชิ้น isolated ต่อร้าน (shopId) — ไม่มีการรั่วข้าม tenant

รายงานช่องโหว่

พบปัญหาความปลอดภัย ติดต่อทีมงานก่อนเปิดเผยสาธารณะ — เราจะตอบกลับและแก้ไขโดยเร็ว