Skip to content

Three Officers Model

Doggy implements the three-officer security model compliant with Chinese information security standards (等保), using ThreeOfficersVoter for fine-grained permission control.

Overview

The three-officer model separates system management into three independent roles, enforced by App\Security\Voter\ThreeOfficersVoter:

RoleScope
ROLE_SYS_ADMINSystem configuration, user management
ROLE_SEC_ADMINSecurity policy configuration
ROLE_AUDITORAudit log review

The three roles are mutually independent and check each other — no single role can fully control the system.

Voter Permissions

php
// src/Security/Voter/ThreeOfficersVoter.php
class ThreeOfficersVoter extends Voter
{
    public const SYSTEM_CONFIG = 'SYSTEM_CONFIG';  // System admin
    public const USER_MANAGE   = 'USER_MANAGE';     // Security officer
    public const AUDIT_VIEW    = 'AUDIT_VIEW';       // Auditor
    public const BUSINESS_DATA = 'BUSINESS_DATA';   // Regular user data access
}

Role Responsibilities

System Admin (ROLE_SYS_ADMIN)

  • User account management
  • System configuration (SYSTEM_CONFIG)
  • Cannot view audit logs
  • Cannot modify security policies

Security Officer (ROLE_SEC_ADMIN)

  • Password policy configuration
  • Permission policy management (USER_MANAGE)
  • Security incident handling
  • Cannot manage user accounts
  • Cannot view audit logs

Auditor (ROLE_AUDITOR)

  • View all operation logs (AUDIT_VIEW)
  • Generate audit reports
  • Detect anomalous behavior
  • Cannot modify any system configuration
  • Cannot manage users

Initialization

Use the InitOfficersCommand to initialize the three admin accounts:

bash
php bin/console app:init-officers

Default Accounts

RoleUsernameInitial Password
System Adminadminadmin123
Security Officersecuritysecurity123
Auditorauditorauditor123

⚠️ Change all default passwords in production.

Business Data Access

Regular authenticated users (ROLE_USER) access business data via BUSINESS_DATA permission but cannot perform administrative operations.

Open Source under MIT | Copyright © 2026 Doggy