edk12564 opened a new pull request, #78:
URL: https://github.com/apache/fineract-consumer-facing/pull/78

   Issues: https://github.com/apache/fineract-consumer-facing/issues/65, 
https://github.com/apache/fineract-consumer-facing/issues/58
   
   # Summary
   
   Audit
   
   With the new BFF and frontend layers, we have added new API surfaces that 
require auditing for better observability and compliance.  For deployers in 
various countries, auditing configurations are set to a configurable amount in 
application.properties.
   
   Architecturally, client-side auditing was left synchronous. This is in line 
with Fineract's existing auditing infrastructure. However, server-side 
(BFF-side) auditing was implemented using Spring EventBus to be handled 
asynchronously. This was done to improve performance on the frontend.
   
   Additionally, for audit events that are required to be transactional, we 
used Spring Modulith's existing implementation that holds events in a 
transactional outbox so events are not lost. This ensures that the callsite and 
event live or die together. For nontransactional events, we simply add to an 
EventBus to be handled in memory. 
   
   Frontend audit requests are handled in batches with a time limit and 
batchsize limit.
   
   Rate limiting is bundled with this change because audit allows a surface 
that attackers can exploit repeatedly, since an attack that creates many audit 
events can overload the database and event queue. Therefore, we have added rate 
limiting in the application layer that limits by user to a configurable amount 
in application.properties. 
   
   While this prevents authenticated users from overloading the database, 
unauthenticated endpoints like login and registration can still be overwhelmed. 
It is highly recommended that production environments use cloud deployment 
practices to take advantage of firewalls, DDoS protection, and network rate 
limiting to protect these endpoints.
   
   Finally, existing features in both the frontend and backend were modified to 
call these auditing endpoints/publishers. 
   
   ## More Details
   
   - implemented audit feature
   - added event driven architecture with EventBus for server side audits
   - utilized Spring Modulith to handle transactional events
   - added liquibase migration for nontransactional audit events
   - added liquibase migration for Spring Modulith's transactional events
   - added PIIScreen for information in the audit table to protect user data
   - implemented @TransactionalAuditListener and @NonTransactionalAuditListener 
aspects to handle different types of audits
   - separated serverside and clientside audit entries in table
   - added configurable audit table TTL for serverside vs clientside entries
   - called clientside audit events in batches on the frontend
   - implemented rate limiting per user
   - added Redis rate limit cache to handle rate limiting between server 
instances
   - added cucumber and unit tests to confirm rate limiting functionality


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to