Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Domain Driven Design and Security

This is linked to this question which seems to have asked a while back. Security implementation in a project that is adhering to basic principles of Domain driven design. let me give an example

Banking System:
Use Case: A new bank deposit is being made and requires approval as it is first deposit

a. Clerk can auto authorize if the deposit amount is <5000
b. Manager can be of two types - Bank manager / Account Manager. ONLY Account manager can authorize any accounts that have deposit >5000

My concerns are as follows (Pls correct if the concern itself is correct)

  1. Not sure where should i build this following logic - takes care of checking whether the logged on user has authorization to do certain things taking in to account his title - (this case Account manager). Authorizing is a use case, but the security layer seems to have intimate knowledge on the domain object
  2. In general Authorization (not authentication). I know that Role Based authentication would help, but the question is "where" - in which layer and the call flow. Should the UI layer call on some security layer or would the domain layer validate itself for all possible combinations ?

Please help. Its very confusing.

Bump to see if this gets experts notice

Cheers

like image 701
VJVRR Avatar asked Mar 30 '11 18:03

VJVRR


People also ask

What is DDD in security?

Amongst the techniques introduced to manage the complexity of the application development process is Domain-driven design (DDD). DDD prescribes a specific application of separation of concerns to the application model into a domain model and DDD-services.

What is Domain-Driven Design used for?

Domain-Driven Development allows us to plan a microservice architecture by decomposing the larger system into self-contained units, understanding the responsibilities of each, and identifying their relationships. In this article, we'll learn the basics of Domain-Driven Design and how to apply it to microservices.

Is Domain-Driven Design still relevant?

Domain-driven design (DDD) is a useful approach that provides excellent guidelines for modeling and building systems, but it is a means to an end, not an end in itself. While the concepts are valid, you lose a lot if you limit yourself to using them only: There actually is a life beyond DDD.

What is Domain-Driven Design example?

An aggregate is a domain-driven design pattern. It's a cluster of domain objects (e.g. entity, value object), treated as one single unit. A car is a good example. It consists of wheels, lights and an engine.


1 Answers

Security is a cross-cutting design feature which can affect all classes, methods and properties.

From a DDD perspective you would go with specifications and roles.

Where and how those specifications get implemented comes down to your architecture. You could go with aspects, you could go with in-line calls, events, etc.

Here are some links I would check out regarding security and roles:

  • Security
  • Roles
  • RBAC
like image 117
Todd Smith Avatar answered Oct 03 '22 19:10

Todd Smith