Skip to content
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

Exclude read access of Disease- and FeatureConfigurationFacade and the Infrastructure facades from the audit log [3] #9882

Closed
7 tasks done
Tracked by #7904
MartinWahnschaffe opened this issue Jul 18, 2022 · 2 comments · Fixed by #10894
Assignees
Labels
audit backend Affects the web backend change A change of an existing feature (ticket type) data-protection

Comments

@MartinWahnschaffe
Copy link
Contributor

MartinWahnschaffe commented Jul 18, 2022

Problem Description

Read access to those facades is not relevant for the audit log and leads to a lot of unnecessary entries.

Proposed Change

  • Find a generic way to ignore all read calls to those facades in AuditLoggerInterceptor. The logic in AudiLoggerEjb.inferBackendAction may be of help.
  • Also take care of ExternalSurveillanceToolGatewayFacadeEjb.isFeatureEnabled() and SormasToSormasFacadeEjb.isAnyFeatureConfigured
  • UserRoleFacadeEjb.getAllActiveAsReference() should be removed
  • DistrictFacadeEjb.getAllActiveByRegion(java.lang.String)
  • CommunityFacadeEjb.getAllActiveByRegion(java.lang.String)
  • PointOfEntryFacadeEjb.getAllActiveByRegion(java.lang.String)
  • DiseaseConfigurationFacadeEjb.getAllDiseases

Acceptance Criteria

  • Call to FeatureConfigurationFacade.isFeatureEnabled is no longer logged
  • Call to FeatureConfigurationFacade.saveFeatureConfiguration is still logged. Can be tested using LineListingResource.postFeatureConfigurations (lineListing/push)

Implementation Details

Additional Information

@MartinWahnschaffe MartinWahnschaffe added backend Affects the web backend change A change of an existing feature (ticket type) data-protection labels Jul 18, 2022
@StefanKock StefanKock changed the title Exclude read access of Disease- and FeatureConfigurationFacade from the audit log Exclude read access of Disease- and FeatureConfigurationFacade from the audit log [3] Aug 3, 2022
@JonasCir JonasCir self-assigned this Aug 31, 2022
@JonasCir JonasCir added the audit label Sep 12, 2022
@markusmann-vg markusmann-vg added this to the Sprint 120 - 1.77.0 milestone Sep 29, 2022
@JonasCir JonasCir changed the title Exclude read access of Disease- and FeatureConfigurationFacade from the audit log [3] Exclude read access of Disease- and FeatureConfigurationFacade and the Infrastructure facadesfrom the audit log [3] Oct 18, 2022
@JonasCir JonasCir changed the title Exclude read access of Disease- and FeatureConfigurationFacade and the Infrastructure facadesfrom the audit log [3] Exclude read access of Disease- and FeatureConfigurationFacade and the Infrastructure facades from the audit log [3] Oct 18, 2022
@JonasCir
Copy link
Contributor

Hey @MartinWahnschaffe I see the following ways:

  1. exclude the methods of FeatureConfigurationFacade by manually adding them to the deny-list
  2. special case FeatureConfigurationFacade and re-use inferBackendAction somehow
  3. do not special case and introduce an annotation à la @FacadeMethodInclude which we put on saveFeatureConfiguration etc to include them. We could get rid of ignoreAuditMethods by introducing a @FacadeMethodIgnore. We use the reflections library to scan for the methods in the static initializer.

@MartinWahnschaffe
Copy link
Contributor Author

As discussed let's use the following approach:

  1. Introduce an annotation that allows to ignore whole methods and classes. I'm not sure what's the best way to differentiate this from the existing AuditInclude/Excluse annotation used for dtos. To me those names would be a better fit to what we need here so maybe the existing annotation should be renamed to AuditPropertyInclude/Exclude
  2. Introduce a class annotation that allows to exclude read-only methods from auditing. Can re-use the inferBackendAction logic to build a cache of methods to be ignored.

JonasCir added a commit that referenced this issue Nov 10, 2022
JonasCir added a commit that referenced this issue Nov 10, 2022
JonasCir added a commit that referenced this issue Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit backend Affects the web backend change A change of an existing feature (ticket type) data-protection
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants