Skip to content

Roles & Permissions ​

TestNet uses an RBAC permission model for fine-grained access control, with business data scoped by project context.


User & permission management

1. User Account & Session Security ​

Navigate to "System" -> "Users" to manage accounts:

  • Authentication & Brute-Force Rate Limiting: Login issues a 24-hour JWT token. To defend against credential brute-forcing, an internal limiter tracks consecutive failures per username + client IP (resolving X-Forwarded-For), locking the target account for 15 minutes after 5 consecutive failures (automatically cleared via Redis TTL);
  • Revocation on Logout (Token Blacklist): When a user logs out, the server writes the token MD5 into a Redis revocation blacklist with a TTL matching its remaining validity. Blacklisted tokens are rejected by the authentication filter even if the signature and expiry timestamp are valid;
  • Password Policy & Self-Service Changes: Passwords must be at least 6 characters and are hashed with BCrypt. Standard users can change their password under "Profile" (requires verifying the current password; the new password is sent in a POST JSON body to prevent plaintext logging in proxy/access logs); administrators can reset passwords under "Users";
  • Account Disabling: Set abnormal or departed accounts to DISABLED to immediately revoke all access.

2. Role Configuration ​

Under "System" -> "Roles", create roles for different teams (e.g., Security Ops, Penetration Tester, Auditor):

1. Permission Codes ​

The system controls operations via permission codes in the format resource:entity:action:

  • View: asset:domain:view, workflow:config:view, client:list:view
  • Modify: asset:domain:edit, asset:domain:import, workflow:tool:edit
  • Execute & Export: workflow:config:execute, task:list:execute, asset:domain:export

2. Menu Control & Ancestor Inheritance ​

  • Button & Menu Visibility: Upon login, unauthorized menu items and dangerous action buttons (e.g., "Delete All Assets", "Run Command") are automatically hidden or disabled;
  • Ancestor Chain Authorization: Checking a parent menu group in the role permission tree automatically permits its nested leaf routes (hasMenuPermission walks the ancestor chain), enabling clean group-level authorization;
  • Fallback for Restricted Users: Users without dashboard access are automatically directed to their first permitted operational menu upon login (e.g., "Root Domains"), avoiding dead-end 403 pages.

3. Department Tree & Project Data Isolation ​

1. Organizational Tree ​

Navigate to "System" -> "Departments" to build multi-level structures (e.g., Headquarters -> Security Center -> Red Team Lab). Each department has a unique code. Department info serves as an organizational record and project annotation.

2. Project-Scoped Data Isolation ​

Business data isolation is scoped by project: assets, tasks, and workflow runs all belong to a project. After switching the project context in the top bar, lists and graphs only show data within the current project. All API permissions are governed by the global RBAC model; the platform does not provide department-level data access isolation.


最近更新

Released under the MIT License