-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AuthzPolicyEnforcement should prevent access to the whole-system history api #2300
Comments
the whole-system history endpoint impl should call the beforeHistory and afterHistory hooks in the interceptor with a resource type of "Resource" |
two separate tasks:
|
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Issue #2300 - Add calls to beforeHistory and afterHistory
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
Issue #2300 - Fix buildPersistenceEventProperties
Confirmed behavior is as expected. Below is a sample of the OperationOutcome received when attempting without the appropriate scope: 403 Forbidden |
Is your feature request related to a problem? Please describe.
The
fhir-smart
AuthzPolicyEnforcementPersistenceInterceptor can be used to provide user-scoped authorization to the the FHIR Server's APIs.For example, it scopes all searches to the patient compartment that matches the patient context for a given session.
However, one thing it doesn't prevent access to is the whole-system history endpoint.
This endpoint provides an overview of all the create/update/delete interactions serviced on the server.
Therefor, a use with access to the api would be able to determine all of the resource ids on the server.
Describe the solution you'd like
Currently the whole-system-history implementation doesn't execute any beforeX or afterX hooks in our PersistenceInterceptor framework. Since this is the mechanism used by AuthzPolicyEnforcementPersistenceInterceptor to restrict access, we should first add these hooks (or use the existing beforeHistory and afterHistory ones).
Next, we should either filter the list of results somehow or, more likely, just prohibit this interaction altogether.
Describe alternatives you've considered
We already have support for restricting access to the whole-system history endpoint and that is to filter the "history" interaction on the "Resource" resource in the fhir-server-config.json (as described at https://ibm.github.io/FHIR/guides/FHIRServerUsersGuide#412-fhir-rest-api ).
This might be sufficient, but it requires the operator to override this setting on each configured resource type.
Example:
Acceptance Criteria
1.
GIVEN a deployment with fhir-smart installed
AND a request scoped to a particular patient
WHEN they invoke the whole-system history endpoint
THEN they should not see the resource ids for any resources to which they do not have access
Additional context
Relates to #2026 which rounds out our support for proper "whole-system history" behavior.
QA suggestions
user/*.read
orsystem/*.read
authorityExample: https://localhost:9443/fhir-server/api/v4/_history
_type
parameter): Requiresuser/<resource_type>.read
orsystem/<resource_type>.read
authority to each resource type in the_type
parameter.Example: https://localhost:9443/fhir-server/api/v4/_history?_type=Patient,Observation
user/<resource_type>.read
orsystem/<resource_type>.read
authority to the resource type.Example: https://localhost:9443/fhir-server/api/v4/Patient/_history
The text was updated successfully, but these errors were encountered: