forbidden
forbidden Validator Documentation
Unconditional Denial of Access for FHIR Resources
Intent
The forbidden validator acts as a strict denial rule, rejecting all requests for a specified resource and operation. It enforces a "deny-by-default" security model to prevent accidental data exposure.
Key Use Cases:
- Blocking public access to sensitive resources (e.g., genetic data).
- Disabling unsafe operations (e.g.,
PatientdeletingMedicationRequestrecords). - Serving as a fallback rule when no other validators apply.
Key Features
- No Validation Logic: Always returns
is_valid = False. - Role Agnostic: Applies to all roles unless overridden by explicit
Allowedrules. - Performance: Zero computational overhead (instant denial).
Configuration Examples
1. Default Deny-All Strategy
{
"rbac": {
"default_access": "Forbidden",
"validation_rules": [
{
"client_role": "Practitioner",
"entity_name": "Patient",
"operation": "read",
"validator": "forbidden"
}
]
}
}
Explanation:
- All requests are denied by default.
- Explicitly allows
Practitionerusers to readPatientrecords.
2. Block Patient Access to MedicationRequests
{
"client_role": "Patient",
"entity_name": "MedicationRequest",
"operation": "read",
"validator": "forbidden"
}
Outcome: Patients receive 403 Forbidden when attempting to view medication orders.
Best Practices
- Default Security Posture:
Combine with granular
"default_access": "forbidden"allowedrules for least-privilege access. - Override Carefully: Use
allowedonly for verified safe operations. - Audit Logs: Monitor requests blocked by this validator to identify misuse.
FHIR Security Considerations
- Aligns with FHIR’s Security principles for access control.
- Use with Provenance resources to track access attempts.
Use Case: Research Database Lockdown
A genomics study uses forbidden to:
- Block all access to
MolecularSequenceresources by default. - Allow access only to researchers with explicit
allowedrules tied to IRB approval.
Configuration:
{
"client_role": "Researcher",
"entity_name": "MolecularSequence",
"operation": "read",
"validator": "allowed",
}