The Industrial Evidence Chain enforces a multi-layered security architecture conforming to the Principle of Least Privilege (PoLP) and zero-trust verification. All protected endpoints mandate cryptographically signed JSON Web Tokens (JWT) and evaluate granular Role-Based Access Control (RBAC) claims before executing business logic.
Authentication is stateless, utilizing HMAC-SHA256 (HS256) signed tokens generated upon successful verification of BCrypt password hashes.
{
"sub": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"email": "tech@proofchain.local",
"name": "Alex Rivera",
"role": ["Technician"],
"jti": "8b9195b0-3ef0-482a-9e12-8e137b0ff462",
"iss": "Proofchain-AuthServer",
"aud": "Proofchain-EnterpriseAPI",
"exp": 1788523200,
"nbf": 1788436800,
"iat": 1788436800
}- Signature Algorithm: HMAC-SHA256 (
HS256) - Key Length: 256-bit symmetric secret key (configured via environment variable
JWT__KEYor secure key vault) - Token Expiration: 24 hours (86,400 seconds)
- Clock Skew Tolerance: Zero seconds
The system classifies organizational actors into four primary functional roles:
| API Action / Resource | Technician | Manager | Auditor | Admin |
|---|---|---|---|---|
| Authenticate / Login | Yes | Yes | Yes | Yes |
| View Dashboard Statistics | Yes | Yes | Yes | Yes |
| Scan / Search Assets | Yes | Yes | Yes | Yes |
| Register New Asset | No | Yes | No | Yes |
| Update Asset Details | No | Yes | No | Yes |
| Create Draft Evidence | Yes | No | No | Yes |
| Upload Media Attachments | Yes | No | No | Yes |
| Submit Evidence for Review | Yes | Yes | No | Yes |
| Anchor Evidence to Ledger | No | Yes | No | Yes |
| Verify Evidence Integrity | Yes | Yes | Yes | Yes |
| Inspect System Audit Logs | No | No | Yes | Yes |
| Execute Tamper Simulation (Demo) | No | No | No | Yes |
Requests flow through the ASP.NET Core pipeline in the following sequence:
[Incoming HTTP Request]
|
v
[1. Global Exception Handler Middleware]
-> Captures unhandled faults and returns standardized RFC-7807 problem details
|
v
[2. CORS Middleware]
-> Allows preflight and cross-origin requests from authorized front-end origins
|
v
[3. Authentication Middleware (`UseAuthentication`)]
-> Validates JWT signature, expiration, issuer, and audience
-> Populates `ClaimsPrincipal` onto `HttpContext.User`
|
v
[4. Authorization Middleware (`UseAuthorization`)]
-> Evaluates `[Authorize(Roles = "...")]` attributes on controllers and actions
-> Rejects unauthorized requests immediately with `401 Unauthorized` or `403 Forbidden`
|
v
[5. Controller Action Execution]
-> Business logic executes with authenticated user identity
|
v
[6. Audit Logging Interceptor]
-> Captures mutating actions and writes immutable record to `audit_logs`
The React 19 client application secures tokens via:
- In-Memory & Storage Encapsulation: Stored in
localStorageundertokenanduserkeys. - Axios Request Interceptor: Automatically attaches
Authorization: Bearer <token>to all outgoing API calls. - Axios Response Interceptor: Intercepts
401 Unauthorizedresponses, clears local session storage, and redirects the user to the/loginportal. - Role Guards: Front-end route guards (
ProtectedRoute.tsx) restrict unauthorized URL navigation and hide privileged UI elements based on the decoded token roles.