พรบ คอมพิวเตอร์ 2560 —
พรบ คอมพิวเตอร์ 2560
พรบ คอมพิวเตอร์ 2560 พระราชบัญญัติ ความผิด คอมพิวเตอร์ Hacking Fake News DDoS Spam Log 90 วัน ผู้ให้บริการ โทษ จำคุก ปรับ
| มาตรา | ความผิด | โทษจำคุก | โทษปรับ |
|---|---|---|---|
| 5 | เข้าระบบโดยมิชอบ | ≤ 6 เดือน | ≤ 10,000 |
| 7 | เข้าถึงข้อมูลโดยมิชอบ | ≤ 2 ปี | ≤ 40,000 |
| 8 | ดักรับข้อมูล | ≤ 3 ปี | ≤ 60,000 |
| 9 | ทำลาย/แก้ไขข้อมูล | ≤ 5 ปี | ≤ 100,000 |
| 10 | รบกวนระบบ (DDoS) | ≤ 5 ปี | ≤ 100,000 |
| 14 | ข้อมูลเท็จ (Fake News) | ≤ 5 ปี | ≤ 100,000 |
| 16 | ภาพตัดต่อ | ≤ 3 ปี | ≤ 200,000 |
ความผิดที่กำหนด
# === พรบ คอมพิวเตอร์ 2560 Offenses ===
from dataclasses import dataclass
@dataclass
class Offense:
section: str
offense: str
description: str
imprisonment: str
fine: str
example: str
offenses = [
Offense("มาตรา 5",
"เข้าระบบโดยมิชอบ (Unauthorized Access)",
"เข้าถึงระบบคอมพิวเตอร์ที่มีมาตรการป้องกัน โดยไม่มีสิทธิ์",
"จำคุกไม่เกิน 6 เดือน",
"ปรับไม่เกิน 10,000 บาท",
"Hack เข้า WiFi ผู้อื่น Login บัญชีผู้อื่น Bypass Password"),
Offense("มาตรา 7",
"เข้าถึงข้อมูลโดยมิชอบ (Unauthorized Data Access)",
"เข้าถึงข้อมูลคอมพิวเตอร์ที่มีมาตรการป้องกัน โดยไม่มีสิทธิ์",
"จำคุกไม่เกิน 2 ปี",
"ปรับไม่เกิน 40,000 บาท",
"ดู Database ลูกค้าโดยไม่ได้รับอนุญาต อ่านอีเมลผู้อื่น"),
Offense("มาตรา 9",
"ทำลาย/แก้ไขข้อมูล (Data Damage)",
"ทำให้เสียหาย ทำลาย แก้ไข เปลี่ยนแปลง เพิ่มเติมข้อมูล",
"จำคุกไม่เกิน 5 ปี",
"ปรับไม่เกิน 100,000 บาท",
"Deface เว็บไซต์ ลบข้อมูล Database Ransomware เข้ารหัสข้อมูล"),
Offense("มาตรา 10",
"รบกวนระบบ (System Interference)",
"รบกวนระบบคอมพิวเตอร์ผู้อื่นให้ทำงานไม่ได้ตามปกติ",
"จำคุกไม่เกิน 5 ปี",
"ปรับไม่เกิน 100,000 บาท",
"DDoS Attack ทำ Server ล่ม Flood Request"),
Offense("มาตรา 14",
"ข้อมูลเท็จ (False Information)",
"นำเข้าข้อมูลปลอม/บิดเบือน ที่น่าจะเกิดความเสียหาย",
"จำคุกไม่เกิน 5 ปี",
"ปรับไม่เกิน 100,000 บาท",
"แชร์ Fake News ข่าวปลอม โพสต์หมิ่นประมาท"),
Offense("มาตรา 16",
"ภาพตัดต่อ (Manipulated Image)",
"ตัดต่อภาพผู้อื่นที่น่าจะเกิดความเสียหาย",
"จำคุกไม่เกิน 3 ปี",
"ปรับไม่เกิน 200,000 บาท",
"ตัดต่อหน้าคนอื่นลง Deepfake Photoshop ภาพหมิ่น"),
]
print("=== Offenses ===")
for o in offenses:
print(f"\n [{o.section}] {o.offense}")
print(f" Desc: {o.description}")
print(f" Imprisonment: {o.imprisonment}")
print(f" Fine: {o.fine}")
print(f" Example: {o.example}")
หน้าที่ผู้ให้บริการ
# === Service Provider Obligations ===
# Log Data ที่ต้องเก็บ (มาตรา 26)
# Retention: 90 วัน (เจ้าหน้าที่สั่งได้ถึง 2 ปี)
#
# Web Server (Apache/Nginx):
# - Client IP Address
# - Request Date/Time
# - HTTP Method + URL
# - HTTP Status Code
# - User-Agent
# - Referer
#
# Email Server:
# - Sender/Recipient Address
# - Date/Time
# - Subject
# - Message-ID
# - Client IP
#
# Network (Firewall/Router):
# - Source/Destination IP
# - Source/Destination Port
# - Protocol
# - Date/Time
# - Bytes Transferred
#
# Authentication:
# - Username
# - Login/Logout Time
# - Source IP
# - Success/Failure
@dataclass
class ProviderDuty:
provider_type: str
duty: str
log_data: str
penalty: str
duties = [
ProviderDuty("ISP (ผู้ให้บริการอินเทอร์เน็ต)",
"เก็บ Traffic Data 90 วัน ร่วมมือกับเจ้าหน้าที่",
"Source/Dest IP Port Protocol Date/Time Login/Logout",
"ปรับ ≤ 500,000 บาท (ไม่เก็บ Log)"),
ProviderDuty("Web Hosting Provider",
"เก็บ Access Log 90 วัน ลบเนื้อหาตามคำสั่งศาล",
"Client IP URL Date/Time HTTP Method Status",
"ปรับ ≤ 500,000 บาท + โทษตาม ม.15"),
ProviderDuty("เจ้าของ Wi-Fi สาธารณะ",
"เก็บ Log ผู้ใช้ WiFi 90 วัน (MAC IP Date/Time)",
"MAC Address IP Date/Time Login/Logout Duration",
"ปรับ ≤ 500,000 บาท"),
ProviderDuty("เจ้าของเว็บไซต์/แอป",
"เก็บ User Log 90 วัน มี Terms of Service",
"Username IP Login/Logout Actions Date/Time",
"ปรับ ≤ 500,000 บาท + โทษตาม ม.15"),
ProviderDuty("Social Media Platform",
"เก็บ User Data ลบเนื้อหาตามคำสั่งศาล",
"User ID IP Content Upload Date/Time",
"ปรับ ≤ 500,000 บาท + Block URL"),
]
print("=== Provider Duties ===")
for d in duties:
print(f" [{d.provider_type}]")
print(f" Duty: {d.duty}")
print(f" Log: {d.log_data}")
print(f" Penalty: {d.penalty}")
IT Admin Compliance
# === IT Admin Compliance Checklist ===
# Logging Setup (Nginx example)
# access_log /var/log/nginx/access.log combined;
# error_log /var/log/nginx/error.log;
#
# Log Rotation (keep 90+ days)
# /var/log/nginx/*.log {
# daily
# rotate 90
# compress
# delaycompress
# notifempty
# create 640 nginx adm
# sharedscripts
# postrotate
# [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
# endscript
# }
#
# NTP Time Sync (CRITICAL for legal evidence)
# timedatectl set-ntp true
# ntpdate pool.ntp.org
@dataclass
class ComplianceItem:
category: str
action: str
priority: str
legal_basis: str
checklist = [
ComplianceItem("Logging",
"ตั้งค่า Access Log ทุก Server (Web DB Email Network)",
"Critical",
"มาตรา 26: เก็บ Traffic Data 90 วัน"),
ComplianceItem("Log Retention",
"เก็บ Log ≥ 90 วัน ตั้ง Rotation อย่าลบก่อน",
"Critical",
"มาตรา 26: Retention 90 วัน (สั่งได้ถึง 2 ปี)"),
ComplianceItem("Time Sync (NTP)",
"ตั้ง NTP Server ทุกเครื่อง เวลาต้องตรง",
"Critical",
"Log ที่เวลาไม่ตรง ใช้เป็นหลักฐานไม่ได้"),
ComplianceItem("Authentication Log",
"บันทึก Login/Logout ทุกระบบ + Source IP",
"High",
"มาตรา 26: Login/Logout ข้อมูลจราจร"),
ComplianceItem("Incident Response",
"มีแผนรับมือเมื่อเจ้าหน้าที่ขอ Log หรือมีคำสั่งศาล",
"High",
"มาตรา 18-19: อำนาจพนักงานเจ้าหน้าที่"),
ComplianceItem("Terms of Service",
"มี ToS และ Privacy Policy บนเว็บไซต์",
"Medium",
"มาตรา 15: ความรับผิดผู้ให้บริการ"),
ComplianceItem("Content Moderation",
"ลบเนื้อหาผิดกฎหมายเมื่อได้รับแจ้ง/คำสั่งศาล",
"High",
"มาตรา 15 + 20: ระงับการเผยแพร่"),
]
print("=== Compliance Checklist ===")
for c in checklist:
print(f" [{c.priority}] {c.category}: {c.action}")
print(f" Legal: {c.legal_basis}")
เคล็ดลับ
- Log 90 วัน: เก็บ Log ทุก Server อย่างน้อย 90 วัน Critical ที่สุด
- NTP: ตั้ง NTP Sync ทุกเครื่อง เวลาใน Log ต้องถูกต้อง
- Fake News: ตรวจสอบก่อนแชร์ ผู้แชร์อาจโดนร่วมด้วย มาตรา 14
- ToS: มี Terms of Service + Privacy Policy ทุกเว็บที่ให้บริการ
- WiFi: ร้านกาแฟ โรงแรม ที่ให้ WiFi ฟรี ต้องเก็บ Log ด้วย
พรบ คอมพิวเตอร์ 2560 คืออะไร
พระราชบัญญัติ ความผิดคอมพิวเตอร์ ฉบับ 2 แก้ไข 2550 MDES NCSA บก. ปอท. ป้องกัน อาชญากรรมไซเบอร์ ผู้ให้บริการ ISP