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:
| Role | Scope |
|---|---|
ROLE_SYS_ADMIN | System configuration, user management |
ROLE_SEC_ADMIN | Security policy configuration |
ROLE_AUDITOR | Audit 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-officersDefault Accounts
| Role | Username | Initial Password |
|---|---|---|
| System Admin | admin | admin123 |
| Security Officer | security | security123 |
| Auditor | auditor | auditor123 |
⚠️ 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.