You need to enable JavaScript to run this app.

Ana içeriğe geç

MyBB User Privacy Engineering: GDPR/KVKK Compliance & Data Anonymization

MyBB User Privacy Engineering: GDPR/KVKK Compliance & Data Anonymization

Administrator
MyBB User Privacy Engineering: GDPR/KVKK Compliance & Data Anonymization
MyBB User Privacy Engineering: GDPR/KVKK Compliance & Data Anonymization

By default, MyBB was engineered in an era when bulletin boards logged every user's raw IPv4/IPv6 binary address across registration records, individual forum posts, private messages, poll votes, reputation logs, and session tables indefinitely. Under modern data-protection frameworks—specifically the European Union’s General Data Protection Regulation (GDPR) and Türkiye’s Personal Data Protection Law (KVKK)—storing indefinite IP telemetry, lacking self-service JSON/CSV data portability exports, or deleting an account without breaking thread coherence creates serious legal and architectural liability. By implementing subnet IP truncation, cryptographic log rotation, self-service "Right to Access" export endpoints, and referential-integrity-preserving account anonymization, administrators can operate compliant MyBB communities without sacrificing moderation security.



Mapping Personal Data Footprint Across Core MyBB Tables

Achieving true GDPR/KVKK compliance starts with an exact inventory of where Personally Identifiable Information (PII) resides inside MyBB’s relational schema. Unlike flat blog platforms, MyBB scatters network identifiers and user metadata across more than a dozen tables:

[table]
[tr]
[td]Database Table[/td]
[td]Stored PII Columns[/td]
[td]Default Retention Behavior[/td]
[td]Compliant Engineering Action[/td]
[/tr]
[tr]
[td]mybb_users[/td]
[td]email, regip, lastip, birthday, icq/skype/fields[/td]
[td]Retained permanently until manual admin deletion[/td]
[td]Truncate IP subnets after 30 days; scrub on erasure[/td]
[/tr]
[tr]
[td]mybb_posts[/td]
[td]ipaddress (packed VARBINARY(16)), username, message[/td]
[td]Permanent binary IP attached to every single post[/td]
[td]Zero out ipaddress after 90 days; preserve post body[/td]
[/tr]
[tr]
[td]mybb_privatemessages[/td]
[td]fromid, toid, subject, message, ipaddress[/td]
[td]Stored until both sender and recipient delete copy[/td]
[td]Purge IP column; hard-delete orphaned deleted PMs[/td]
[/tr]
[tr]
[td]mybb_sessions[/td]
[td]ip, useragent, location, uid[/td]
[td]Cleared periodically via dailycleanup.php[/td]
[td]Enforce strict 24-hour session expiration cron[/td]
[/tr]
[tr]
[td]mybb_moderatorlog / adminlog[/td]
[td]ipaddress, uid, data (serialized action payload)[/td]
[td]Retained indefinitely unless pruned manually[/td]
[td]Rotate security audit logs after 180–365 days[/td]
[/tr]
[tr]
[td]mybb_pollvotes / threadratings[/td]
[td]uid, ipaddress[/td]
[td]Permanent vote/rating audit trail[/td]
[td]Nullify ipaddress after poll closure window[/td]
[/tr]
[/table]

Automated IP Subnet Truncation & Time-Bound Retention Tasks

Under both GDPR Article 5(1)(e) (*storage limitation*) and KVKK Article 4 (*data minimization and retention limits*), storing full raw IP addresses permanently for every five-year-old forum post fails proportionality tests. At the same time, security teams still need recent IP telemetry (e.g., 30 to 90 days) to investigate spam waves, ban evasion, or account takeovers.

The optimal architectural compromise is a scheduled MyBB background task (/inc/tasks/privacy_ip_prune.php) that zeroes out packed binary VARBINARY(16) IP fields once posts and registrations age past your documented security retention window:

Kod:
<?php
// /inc/tasks/privacy_ip_prune.php — Scheduled IP Address Anonymization Task
function task_privacy_ip_prune(array $task): void
{
    global $db, $lang;

    $postRetentionCutoff = TIME_NOW - (90 * 86400); // 90 days for post anti-abuse logs
    $userRetentionCutoff = TIME_NOW - (30 * 86400); // 30 days for inactive user lastip

    // 1. Scrub binary ipaddress on posts older than 90 days while keeping post content intact
    $db->write_query("
        UPDATE " . TABLE_PREFIX . "posts
        SET ipaddress = X'00000000'
        WHERE dateline < {$postRetentionCutoff}
          AND ipaddress != X'00000000'
          AND ipaddress != ''
    ");

    // 2. Scrub legacy registration and last-visit IPs on inactive accounts
    $db->write_query("
        UPDATE " . TABLE_PREFIX . "users
        SET regip = X'00000000', lastip = X'00000000'
        WHERE lastactive < {$userRetentionCutoff}
          AND (regip != X'00000000' OR lastip != X'00000000')
    ");

    // 3. Purge historical search logs and mail logs older than 14 days
    $logCutoff = TIME_NOW - (14 * 86400);
    $db->delete_query('searchlog', "dateline < {$logCutoff}");
    $db->delete_query('maillogs', "dateline < {$logCutoff}");

    add_task_log($task, 'Completed scheduled GDPR/KVKK IP address and telemetry pruning.');
}
Alıntı:Never delete a departing user’s valuable technical posts when fulfilling an erasure request; anonymize their account into a pseudonymous "Deleted Member #UID" placeholder so thread continuity and community knowledge remain intact.

Implementing "Right to Be Forgotten" Without Destroying Forum Threads

When a member invokes their Right to Erasure under GDPR Article 17 or KVKK Article 11, using MyBB Admin CP’s default *Delete User* button without preparation either leaves orphaned `uid = 0` guest posts carrying their old username in plaintext or wipes out hundreds of helpful replies that anchor active discussions.

Instead, engineer an atomic account-anonymization workflow triggered from User CP (after password + 2FA confirmation and a 7-day cooling-off grace period):

Kod:
<?php
// Atomic User Account Anonymization Preserving Thread & Post Referential Integrity
function mybb_anonymize_user_account(int $uid): void
{
    global $db;

    $anonUsername = 'Deleted Member #' . $uid;
    $anonEmail = 'deleted_' . $uid . '@anonymized.invalid';
    $randomPass = bin2hex(random_bytes(32));

    // 1. Scrub personal profile attributes, credentials, and network identifiers
    $db->update_query('users', [
        'username' => $db->escape_string($anonUsername),
        'password' => $db->escape_string($randomPass),
        'salt' => '',
        'loginkey' => $db->escape_string(bin2hex(random_bytes(25))),
        'email' => $db->escape_string($anonEmail),
        'avatar' => '',
        'avatartype' => '',
        'usertitle' => 'Former Member',
        'website' => '',
        'icq' => '',
        'skype' => '',
        'google' => '',
        'birthday' => '',
        'signature' => '',
        'regip' => '',
        'lastip' => '',
        'allownotices' => 0,
        'receivepms' => 0,
        'usergroup' => 7 // Banned / Retired locked group preventing login
    ], "uid = {$uid}");

    // 2. Clear custom user profile fields (location, bio, social handles)
    $db->delete_query('userfields', "ufid = {$uid}");

    // 3. Re-label historical authorship on threads & posts while scrubbing post IPs
    $db->update_query('threads', ['username' => $db->escape_string($anonUsername)], "uid = {$uid}");
    $db->update_query('threads', ['lastposter' => $db->escape_string($anonUsername)], "lastposteruid = {$uid}");
    $db->update_query('posts', [
        'username' => $db->escape_string($anonUsername),
        'ipaddress' => ''
    ], "uid = {$uid}");

    // 4. Purge user's private message inbox/sent folders & active sessions
    $db->delete_query('privatemessages', "uid = {$uid}");
    $db->delete_query('sessions', "uid = {$uid}");
    $db->delete_query('threadsubscriptions', "uid = {$uid}");
    $db->delete_query('forumsubscriptions', "uid = {$uid}");
}
Notice how updating username across mybb_threads and mybb_posts removes the member’s chosen handle from public postbit headers while keeping their foreign key uid valid—preventing broken profile links or orphaned thread metadata. (If a user’s post body itself contains self-doxxing phone numbers or real names, provide a dedicated post-redaction report queue for staff review.)

Self-Service Data Portability Export (JSON / HTML Archive)

GDPR Article 20 and KVKK Article 11 grant users the right to receive a structured, machine-readable export of all personal data they provided to your platform. Adding a lightweight Download My Personal Data endpoint inside usercp.php?action=export_data eliminates manual staff workload completely:

  1. Rate-Limit Export Generation: Allow one archive generation per 24 hours per account (verified via my_post_key) so bots cannot abuse the endpoint to trigger expensive database queries.
  2. Bundle Structured JSON Payloads Inside a Temporary ZIP: Export profile.json (account metadata, custom profile fields, registration timestamp), posts.json (every forum reply with thread ID and timestamp), private_messages.json, and reputation_given.json—streaming the archive directly to the browser without leaving unencrypted exports sitting on disk.

Zero-Tracker Cookie Consent & Third-Party Embed Gatekeeping

Strictly necessary functional cookies—specifically MyBB’s session cookie (sid) and login persistence token (mybbuser)—are exempt from prior consent banners under both ePrivacy/GDPR and KVKK guidelines because the forum cannot operate without them. However, three common MyBB theme additions do require explicit opt-in consent before loading:
  • External Analytics & Ad Scripts: Never fire Google Analytics, Meta Pixels, or programmatic ad tags until a visitor clicks *Accept* in a lightweight first-party consent manager storing preferences in localStorage (or switch to privacy-first, cookieless analytics such as Plausible or Umami that require zero tracking cookies).
  • Third-Party Fonts and Gravatar IP Leaks: Loading Google Fonts from fonts.googleapis.com or fetching user avatars directly from gravatar.com transmits every visitor’s IP address to external US servers on every page load—a violation flagged repeatedly by European data protection authorities. Self-host all WOFF2 fonts locally and proxy/cache Gravatar images on your own server or disable external Gravatars by default.

By combining scheduled binary IP pruning, referential-integrity-preserving account anonymization, self-service JSON data exports, and zero-leak local font/avatar hosting, MyBB communities achieve full GDPR and KVKK compliance while earning deep member trust.
İşin Doğrusu Youtube Kanalı

MyBB User Privacy Engineering: GDPR/KVKK Compliance & Data Anonymization