Introduction To Secure Desgin Flashcards
(7 cards)
What is modularity
Breaking a program into single modules, makes code easier to manage, test, and update
It also limit impact of bugs or security flaws
Example when using Django for Modularity
In app like user, payment, and order are separated in Django module, for example vulnerability in payment dosent affect user or orders
What is Encapsulation?
Encapsulation is the practice of hiding internal data and logic, exposing only what’s necessary.
✅ Prevents direct access to sensitive parts of the code
✅ Protects from accidental misuse or malicious exploitation
Encapsulation when using Django
Using private functions or internal classes in views/models
Only exposing APIs or URLs needed by the frontend, keeping others inaccessible
Modularity for Security in Django
Encourages separation of concerns
You can apply security controls per module (e.g. only authenticated users access the admin app)
Easier to test and patch vulnerabilities without breaking the whole project
Encapsulation for Security in Django
Sensitive logic (e.g. password hashing) is hidden in secure modules
Form validation and CSRF tokens are encapsulated in Django’s forms system
Prevents frontend users from seeing or manipulating backend logic
Why use both of modularity and encapsulation
Reduce the chance of accidental security breaches
Limit the scope of an attack if a vulnerability is found
Help maintain clean, secure, and scalable code