Bird
Raised Fist0
HLDsystem_design~12 mins

Why security must be designed in in HLD - Architecture Impact

Choose your learning style10 modes available
System Overview - Why security must be designed in

This system explains why security must be built into software and systems from the start. It shows how security components protect data and services against attacks and failures. The goal is to ensure safe, reliable, and trusted system operation.

Architecture Diagram
User
  |
  v
Firewall
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
Authentication Service <-> Authorization Service
  |
  v
Application Service
  |
  v
Database
  |
  v
Audit Logs

Cache <-> Application Service
Components
User
actor
End user who accesses the system
Firewall
security_gateway
Blocks unauthorized network traffic before it reaches the system
Load Balancer
load_balancer
Distributes incoming requests evenly to prevent overload
API Gateway
api_gateway
Central entry point that enforces security policies and routes requests
Authentication Service
security_service
Verifies user identity before allowing access
Authorization Service
security_service
Checks user permissions to control access to resources
Application Service
service
Handles business logic and processes user requests
Database
database
Stores application data securely
Audit Logs
logging_service
Records security events and user actions for monitoring and compliance
Cache
cache
Speeds up data access while respecting security controls
Request Flow - 14 Hops
User → Firewall
Firewall → Load Balancer
Load Balancer → API Gateway
API Gateway → Authentication Service
Authentication Service → Authorization Service
Authorization Service → Application Service
Application Service → Cache
Cache → Application Service
Application Service → Database
Database → Application Service
Application Service → Audit Logs
Application Service → API Gateway
API Gateway → Load Balancer
Load Balancer → User
Failure Scenario
Component Fails:Authentication Service
Impact:Users cannot verify identity, so no access is granted, blocking all requests.
Mitigation:Use redundant authentication servers and fallback mechanisms to maintain availability.
Architecture Quiz - 3 Questions
Test your understanding
Which component first blocks unauthorized network traffic?
AFirewall
BAPI Gateway
CLoad Balancer
DAuthentication Service
Design Principle
Security must be designed in from the start to protect the system at multiple layers. Components like firewalls, authentication, and authorization work together to prevent unauthorized access. Logging and redundancy ensure monitoring and availability. This layered approach reduces risks and builds trust.

Practice

(1/5)
1. Why is it important to include security in the system design from the beginning?
easy
A. Because security slows down the system and should be avoided
B. Because security can be added easily after development
C. Because users do not care about security
D. Because fixing security issues later is more expensive and risky

Solution

  1. Step 1: Understand the cost of late security fixes

    Fixing security problems after the system is built often requires rework, causing delays and higher costs.
  2. Step 2: Recognize the risk of ignoring early security

    Ignoring security early can lead to data breaches and loss of user trust, which are costly and damaging.
  3. Final Answer:

    Because fixing security issues later is more expensive and risky -> Option D
  4. Quick Check:

    Early security design = Cost saving and risk reduction [OK]
Hint: Security early saves cost and risk later [OK]
Common Mistakes:
  • Thinking security can be added easily after development
  • Assuming users don't care about security
  • Believing security always slows down systems
2. Which of the following is a correct security design practice to include from the start?
easy
A. Encrypting sensitive data during storage and transmission
B. Ignoring authentication to speed up development
C. Using default passwords for all users
D. Allowing open access to all system components

Solution

  1. Step 1: Identify secure data handling methods

    Encrypting data protects it from unauthorized access both when stored and during communication.
  2. Step 2: Eliminate insecure options

    Ignoring authentication, using default passwords, or open access are insecure and expose the system to attacks.
  3. Final Answer:

    Encrypting sensitive data during storage and transmission -> Option A
  4. Quick Check:

    Encryption = Secure data handling [OK]
Hint: Encrypt data to protect it always [OK]
Common Mistakes:
  • Skipping authentication for speed
  • Using default or weak passwords
  • Allowing unrestricted access
3. Consider a system designed without early security measures. What is the likely outcome when a data breach occurs?
medium
A. The breach causes loss of user trust and costly fixes
B. The breach improves system performance
C. The breach has no effect if data is public
D. The system can quickly fix the breach without impact

Solution

  1. Step 1: Understand consequences of data breaches

    A data breach exposes sensitive information, damaging user trust and requiring expensive fixes.
  2. Step 2: Reject incorrect outcomes

    Quick fixes without impact are unrealistic; breaches never improve performance; public data assumption is unsafe.
  3. Final Answer:

    The breach causes loss of user trust and costly fixes -> Option A
  4. Quick Check:

    Data breach = Trust loss + Costly fixes [OK]
Hint: Breaches cost trust and money [OK]
Common Mistakes:
  • Assuming breaches have no impact
  • Thinking breaches improve performance
  • Believing fixes are always quick and cheap
4. A system was built without authentication and encryption. What is the main security flaw to fix?
medium
A. Disable logging to improve speed
B. Add authentication and encrypt data communication
C. Remove all user access controls
D. Use default passwords for all users

Solution

  1. Step 1: Identify missing security features

    Authentication verifies users; encryption protects data in transit. Both are essential for security.
  2. Step 2: Exclude harmful fixes

    Removing access controls, disabling logging, or using default passwords worsen security risks.
  3. Final Answer:

    Add authentication and encrypt data communication -> Option B
  4. Quick Check:

    Authentication + Encryption = Secure system [OK]
Hint: Add auth and encryption to fix security [OK]
Common Mistakes:
  • Removing access controls
  • Disabling logs to speed up
  • Using default passwords
5. You are designing a new online service. Which approach best ensures security is built in from the start?
hard
A. Focus on features first; security can be patched later
B. Add security features only after the system is fully developed
C. Plan authentication, encryption, and secure communication before coding
D. Use default settings and rely on network firewalls only

Solution

  1. Step 1: Recognize best security design practice

    Planning authentication, encryption, and secure communication early integrates security deeply and reduces risks.
  2. Step 2: Understand risks of delayed security

    Adding security late or relying only on firewalls leaves many vulnerabilities and increases costs.
  3. Final Answer:

    Plan authentication, encryption, and secure communication before coding -> Option C
  4. Quick Check:

    Early security planning = Strong protection [OK]
Hint: Design security features before coding [OK]
Common Mistakes:
  • Delaying security until after development
  • Relying only on network firewalls
  • Ignoring security to speed up features
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard