0% found this document useful (0 votes)
4 views42 pages

Unit 3 Answer

The document discusses API security mechanisms, focusing on Session Cookies and Token-Based Authentication (JWT), detailing their definitions, workings, security mechanisms, vulnerabilities, and best practices. It emphasizes the importance of API security in protecting sensitive data, regulatory compliance, and mitigating financial and reputational risks. Additionally, it covers OAuth2 as a standard framework for securing service-to-service APIs, outlining its workflow and security considerations.

Uploaded by

sujithkasan67
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views42 pages

Unit 3 Answer

The document discusses API security mechanisms, focusing on Session Cookies and Token-Based Authentication (JWT), detailing their definitions, workings, security mechanisms, vulnerabilities, and best practices. It emphasizes the importance of API security in protecting sensitive data, regulatory compliance, and mitigating financial and reputational risks. Additionally, it covers OAuth2 as a standard framework for securing service-to-service APIs, outlining its workflow and security considerations.

Uploaded by

sujithkasan67
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ANNA UNIVERSITY

Department of Computer Science & Engineering

PART – B : Comprehensive Answers


Subject: API Security & Web Application Security

CO3 – Course Outcome 3: API Security Mechanisms

Prepared as per Anna University Examination Pattern


All 13 Questions Answered | Each answer: 4–5 pages equivalent
Q1. Explain Session Cookies and Token-Based Authentication, comparing their
security mechanisms.

1. Introduction
Authentication is the process of verifying the identity of a user or system. Two widely used
approaches are Session Cookie-Based Authentication and Token-Based Authentication (JWT). Both
have distinct architectural designs, security properties, and use cases. Understanding their
differences is essential for designing secure web applications and APIs.

2. Session Cookie-Based Authentication


2.1 Definition
Session-based authentication is a stateful mechanism where the server stores session data (user
state) and issues a session ID to the client via a cookie after successful login.

2.2 How It Works – Step by Step


• Step 1: The user sends credentials (username & password) to the server.
• Step 2: The server verifies credentials, creates a session object, and stores it in the server-side
session store (e.g., Redis, database, memory).
• Step 3: The server generates a unique Session ID and sends it to the client inside a Set-Cookie
HTTP header.
• Step 4: For every subsequent request, the browser automatically attaches the session cookie.
• Step 5: The server looks up the Session ID in the session store to retrieve user data.
• Step 6: On logout, the server destroys the session from the store.

2.3 Security Mechanisms in Session Cookies


Attribute Purpose Security Benefit

HttpOnly Prevents JS access Blocks XSS cookie theft

Secure HTTPS only Prevents MITM sniffing

SameSite=Strict No cross-site send Prevents CSRF attacks

Expiry/Max-Age Session timeout Reduces exposure window

Domain/Path Scope restriction Limits cookie exposure

2.4 Vulnerabilities
• Session Hijacking: Attacker steals session ID via XSS or network sniffing.
• CSRF (Cross-Site Request Forgery): Malicious site sends forged requests using stored cookies.
• Session Fixation: Attacker forces a known session ID before authentication.
• Server-side storage overhead: Large-scale systems face scalability issues.

3. Token-Based Authentication (JWT)


3.1 Definition
Token-based authentication is a stateless mechanism. After login, the server issues a digitally signed
token (commonly a JSON Web Token – JWT) to the client. The client stores it and sends it with every
request. The server validates the token without any server-side state lookup.

3.2 JWT Structure


A JWT consists of three Base64URL-encoded parts separated by dots:
• Header: Algorithm & token type. Example: { 'alg': 'HS256', 'typ': 'JWT' }
• Payload: Claims (user data, expiry). Example: { 'sub': 'user123', 'role': 'admin', 'exp':
1700000000 }
• Signature: HMACSHA256(base64(header) + '.' + base64(payload), secret_key)

3.3 How Token-Based Auth Works


• Step 1: Client sends credentials to the authentication server.
• Step 2: Server validates credentials and generates a signed JWT.
• Step 3: JWT is returned to the client (stored in localStorage or memory).
• Step 4: Client includes JWT in the Authorization header: Authorization: Bearer .
• Step 5: Server validates JWT signature and reads claims — no session store needed.
• Step 6: On expiry, a Refresh Token is used to obtain a new Access Token.

3.4 Security Mechanisms in Token-Based Auth


• Digital Signature (RS256/HS256): Ensures token integrity — any tampering invalidates the
signature.
• Expiry (exp claim): Short-lived tokens (15 min) limit the window of misuse.
• Audience (aud) & Issuer (iss) Claims: Prevent token misuse across services.
• Refresh Token Rotation: Old refresh tokens are invalidated on use.
• Token Blacklisting: Revoked tokens are added to a deny-list (partially stateful).

4. Detailed Comparison Table


Feature Session Cookies Token-Based (JWT)

State Stateful (server stores session) Stateless (self-contained token)

Storage Server memory/DB/Redis Client (localStorage / memory)

Scalability Harder (shared session store) Easier (no server state)

CSRF Risk High (mitigated by SameSite) Low (no auto-send by browser)

XSS Risk Lower (HttpOnly flag) Higher (if stored in localStorage)

Revocation Immediate (delete session) Complex (blacklist needed)

Mobile/API Less suitable Highly suitable

Microservices Difficult (sticky sessions) Ideal (stateless validation)

Performance DB lookup per request Cryptographic verify only

Token Size Small (session ID only) Larger (encoded claims)

5. When to Use Which?


• Use Session Cookies for: Traditional web apps, monolithic architectures, when immediate
revocation is critical.
• Use Token-Based Auth for: REST APIs, Single Page Applications (SPAs), Mobile apps,
Microservices, Cross-domain scenarios.

6. Best Practices
• Always use HTTPS to protect both cookies and tokens in transit.
• Store JWTs in httpOnly cookies rather than localStorage to mitigate XSS.
• Implement CSRF tokens alongside session cookies.
• Use short expiry for access tokens with refresh token rotation.
• Validate all JWT claims (exp, iss, aud) on the server side.

7. Conclusion
Both session cookies and token-based authentication are valid strategies. Session cookies excel in
traditional applications with immediate revocation needs, while JWT-based authentication is the
modern standard for scalable, stateless API security. The choice depends on the application
architecture, scalability needs, and security requirements.
Q2. Discuss the importance of API Security and explain its best practices.

1. Introduction to API Security


An API (Application Programming Interface) is the backbone of modern software ecosystems,
enabling communication between applications, services, and devices. With the explosion of cloud
computing, microservices, and mobile applications, APIs have become prime targets for
cyberattacks. API security encompasses the practices, protocols, and tools used to protect APIs from
misuse, unauthorized access, and data breaches.

2. Importance of API Security


2.1 APIs Expose Business Logic
Unlike traditional web pages, APIs expose the core business logic and data directly. A vulnerable API
can leak sensitive user data, financial records, or proprietary business intelligence, causing
irreparable damage.

2.2 Increasing API Attack Surface


According to the OWASP API Security Top 10, API vulnerabilities are among the most exploited
weaknesses. Common incidents include the 2019 Facebook API breach, Peloton API exposure, and
the T-Mobile API data leak affecting millions of users.

2.3 Regulatory Compliance


Regulations like GDPR, HIPAA, PCI-DSS, and SOC2 mandate the protection of user data processed
through APIs. Failure to secure APIs results in legal penalties and loss of customer trust.

2.4 Financial and Reputational Impact


• Data breaches cost an average of $4.45 million per incident (IBM, 2023).
• API attacks can lead to service disruption, revenue loss, and customer churn.
• Intellectual property theft via poorly secured APIs can devastate businesses.

3. Common API Security Threats


Threat Description Impact

Broken Object Level Auth Access other users' data by changing IDs Data breach

Broken Auth Weak authentication mechanisms Account takeover

Excessive Data Exposure API returns more data than needed Data leakage

Injection (SQLi/XSS) Malicious input in API parameters DB compromise

Security Misconfiguration Default settings, open ports Unauthorized access

Rate Limiting Absent No throttling on endpoints DDoS / Brute force

Broken Function Level Auth Lower roles access admin functions Privilege escalation

SSRF Server fetches attacker-controlled URLs Internal network exposure

4. API Security Best Practices


4.1 Authentication & Authorization
• Use OAuth 2.0 with OpenID Connect for delegated authorization.
• Implement Role-Based Access Control (RBAC) and Attribute-Based Access Control (ABAC).
• Enforce Object-Level Authorization — validate that the requesting user owns the resource.
• Use strong password policies and multi-factor authentication (MFA) for user-facing APIs.

4.2 Input Validation & Sanitization


• Validate all input data against a strict schema (type, length, format, range).
• Reject unexpected fields — use allowlisting not denylisting.
• Sanitize inputs to prevent SQL injection, XSS, XML injection, and command injection.
• Use parameterized queries / prepared statements for all database interactions.

4.3 Transport Layer Security


• Enforce TLS 1.2 / TLS 1.3 for all API communications — never allow HTTP.
• Use HSTS (HTTP Strict Transport Security) headers.
• Implement certificate pinning in mobile API clients.
• Validate SSL/TLS certificates and prevent self-signed certificate acceptance in production.

4.4 Rate Limiting & Throttling


• Limit requests per user/IP/API key to prevent brute force and DDoS.
• Implement graduated throttling: warn before blocking.
• Use token bucket or leaky bucket algorithms for smooth rate control.
• Return HTTP 429 (Too Many Requests) with Retry-After headers.

4.5 API Key & Token Management


• Rotate API keys regularly and revoke compromised keys immediately.
• Store API keys in secrets managers (AWS Secrets Manager, HashiCorp Vault).
• Use short-lived access tokens (15–60 min) with refresh token rotation.
• Scope API keys to minimum required permissions.

4.6 Logging, Monitoring & Alerting


• Log all API requests: timestamp, endpoint, user ID, IP, request/response codes.
• Implement real-time anomaly detection using SIEM tools.
• Set alerts for unusual patterns: spike in 401/403 errors, high-volume requests.
• Ensure logs are tamper-proof and stored securely with retention policies.

4.7 API Gateway & WAF


• Deploy an API Gateway (AWS API Gateway, Kong, Apigee) as a central enforcement point.
• Use a Web Application Firewall (WAF) to filter malicious traffic.
• Implement mutual TLS (mTLS) for service-to-service API authentication.

4.8 Security Testing


• Conduct regular DAST (Dynamic Application Security Testing) and SAST.
• Perform penetration testing and bug bounty programs.
• Use tools like OWASP ZAP, Burp Suite, Postman, and Newman for API security testing.

5. API Security Architecture Diagram


[Client] → [API Gateway + WAF] → [Auth Server (OAuth2/JWT)] → [Microservices] → [Database]
Each layer provides a defense-in-depth mechanism. The API Gateway handles authentication, rate
limiting, and logging before routing to internal services.

6. Conclusion
API security is not optional — it is a foundational requirement in modern software development.
Organizations must adopt a defense-in-depth strategy combining authentication, authorization,
encryption, monitoring, and continuous testing to protect their APIs against evolving threats.
Following OWASP API Security Top 10 guidelines provides a solid baseline for secure API design.
Q3. Explain OAuth2 and its workflow for securing service-to-service APIs.

1. Introduction to OAuth2
OAuth 2.0 (Open Authorization 2.0) is an industry-standard authorization framework defined in RFC
6749. It allows a third-party application to obtain limited access to a service on behalf of a user or
another service, without sharing credentials. OAuth2 is widely adopted by Google, Facebook, GitHub,
and most enterprise API platforms.
In the context of service-to-service (machine-to-machine) communication, OAuth2 provides a secure,
standardized mechanism for one service to authenticate and authorize itself to another service
without human intervention.

2. Key Roles in OAuth2


Role Description Example

Resource Owner Entity that owns the data/resource End user or service account

Client Application requesting access Microservice A, Mobile App

Authorization Server Issues tokens after authentication Auth0, Keycloak, AWS Cognito

Resource Server Hosts the protected API/resource Microservice B, REST API

3. OAuth2 Grant Types (Flows)


Grant Type Use Case Service-to-Service?

Authorization Code User-facing web/mobile apps No

Implicit Legacy SPAs (deprecated) No

Client Credentials Machine-to-machine (M2M) YES ✓

Resource Owner Password Trusted first-party apps Limited

Device Code Smart TV / CLI devices No

Refresh Token Renewing access tokens Yes (combined)

Note: For service-to-service API security, the Client Credentials Grant is the primary OAuth2 flow.

4. Client Credentials Flow – Step-by-Step


4.1 Overview
The Client Credentials Grant is used when a service (client) needs to authenticate itself to another
service (resource server) without acting on behalf of a user. The client authenticates using its own
credentials (client_id and client_secret).

4.2 Detailed Workflow


• Step 1 — Registration: Service A registers with the Authorization Server and receives a client_id
and client_secret.
• Step 2 — Token Request: Service A sends a POST request to the token endpoint:
POST /oauth/token Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client;_id=svcA&client;_secret=secret&scope;=read:orders
• Step 3 — Token Issuance: The Authorization Server validates credentials and returns an
Access Token (JWT):
{ 'access_token': 'eyJhbGci...', 'token_type': 'Bearer', 'expires_in': 3600, 'scope': 'read:orders' }
• Step 4 — API Call: Service A includes the token in the Authorization header when calling
Service B:
GET /api/orders Authorization: Bearer eyJhbGci...
• Step 5 — Token Validation: Service B (Resource Server) validates the JWT signature, expiry,
issuer, and audience claims.
• Step 6 — Response: If valid, Service B processes the request and returns the response.
• Step 7 — Token Refresh: Before expiry, Service A requests a new token using its credentials
(no refresh token in this flow).

5. JWT Token Validation at Resource Server


• Verify the signature using the Authorization Server's public key (JWKS endpoint).
• Check exp (expiry) — reject expired tokens.
• Check iss (issuer) — must match the known Authorization Server.
• Check aud (audience) — must include the Resource Server's identifier.
• Check scope — must include the required permission (e.g., read:orders).
• Optionally check jti (JWT ID) against a blacklist for revoked tokens.

6. Security Considerations for Service-to-Service OAuth2


6.1 Secure Storage of Client Secrets
• Never hardcode client_secret in source code.
• Use environment variables, Kubernetes Secrets, or Vault.
• Rotate secrets periodically and on suspected compromise.

6.2 Mutual TLS (mTLS) as Alternative


For high-security environments, use mTLS where both client and server present certificates. This
eliminates the need for client_secret and provides stronger authentication.

6.3 Token Scoping & Least Privilege


• Request only the minimum scopes required.
• Different services should use different client credentials.
• Implement fine-grained scope checks at the resource server.

6.4 Token Lifetime Management


• Use short-lived access tokens (15–60 minutes).
• Implement token introspection endpoint for real-time validation.
• Cache tokens and reuse until near expiry to reduce Auth Server load.

7. OAuth2 in Microservices Architecture


In a microservices environment, OAuth2 with Client Credentials is combined with:
• API Gateway: Centralizes token validation for all incoming requests.
• Service Mesh (Istio/Linkerd): Handles mTLS between services automatically.
• Token Propagation: Gateway validates external JWT and passes service-specific tokens
internally.
• Sidecar Proxy: Each microservice has a sidecar that handles auth, so business logic is
decoupled.

8. Comparison: API Keys vs OAuth2 for Service-to-Service


Aspect API Keys OAuth2 (Client Credentials)

Authentication Static key Dynamic token with credentials

Expiry No automatic expiry Built-in expiry (exp claim)

Granularity Coarse-grained Fine-grained scopes

Revocation Delete the key Token expiry / introspection

Security Level Medium High

Standards Non-standard RFC 6749 standard

9. Conclusion
OAuth2 with the Client Credentials grant is the gold standard for securing service-to-service API
communication. It provides standardized, time-limited, scope-restricted access tokens that are
cryptographically verifiable without server-side session state. Combined with mTLS, API Gateways,
and proper secret management, OAuth2 forms the cornerstone of a secure microservices API
architecture.
Q4. Explain the main security threats to APIs and how can they be mitigated?

1. Introduction
APIs are the most targeted components in modern applications. The OWASP API Security Top 10
(2023) identifies the most critical API vulnerabilities. Understanding these threats and their mitigations
is essential for building secure API-driven systems. APIs are exploited through logical flaws, weak
authentication, and insecure configurations — often harder to detect than traditional web
vulnerabilities.

2. OWASP API Security Top 10 – Threats & Mitigations


Threat 1: Broken Object Level Authorization (BOLA / IDOR)
Description: The most common API vulnerability. An attacker manipulates object IDs in API requests
to access resources belonging to other users. Example: GET /api/orders/1234 — changing 1234 to
1235 accesses another user's order.
Impact: Unauthorized data access, data breach, privacy violations.
Mitigation:
• Validate that the authenticated user owns or has permission to access the requested object.
• Use indirect references (UUIDs) instead of sequential IDs.
• Implement authorization checks at the data access layer, not just the controller.

Threat 2: Broken Authentication


Description: Weak or improperly implemented authentication allows attackers to impersonate users.
Includes weak passwords, missing MFA, improper token validation, credential stuffing.
Mitigation:
• Use OAuth2 / OpenID Connect with strong token validation.
• Enforce MFA for sensitive endpoints.
• Implement account lockout after repeated failed attempts.
• Validate all JWT claims (exp, iss, aud, alg).

Threat 3: Broken Object Property Level Authorization


Description: API allows users to modify object properties they should not have access to. Example:
A user updates their profile and includes an 'admin': true field that gets saved.
Mitigation:
• Use allowlists for acceptable input properties — reject unexpected fields.
• Separate DTOs (Data Transfer Objects) for input and output.
• Never auto-map user input directly to database models (mass assignment protection).

Threat 4: Unrestricted Resource Consumption


Description: No limits on API requests, file sizes, or computational resources leads to DoS, resource
exhaustion, and financial attacks on usage-billed APIs.
Mitigation:
• Implement rate limiting, throttling, and quota management.
• Set maximum payload size limits.
• Use circuit breakers to prevent cascading failures.
• Monitor for unusual consumption patterns.

Threat 5: Broken Function Level Authorization


Description: Users access administrative API functions they should not be able to use. Example: A
regular user calls DELETE /admin/users/123.
Mitigation:
• Implement RBAC (Role-Based Access Control) enforced at every endpoint.
• Deny by default — explicitly grant access, don't assume restriction.
• Separate admin APIs onto different hosts/networks.

Threat 6: Unrestricted Access to Sensitive Business Flows


Description: Attackers abuse legitimate business workflows at scale — e.g., buying out all event
tickets using automated bots, or mass-creating accounts.
Mitigation:
• Implement CAPTCHA and bot detection for sensitive flows.
• Apply device fingerprinting and behavioral analytics.
• Limit transaction volumes per user/device within a timeframe.

Threat 7: Server-Side Request Forgery (SSRF)


Description: API fetches a remote resource based on user-supplied URL, allowing attackers to
probe internal networks, cloud metadata services ([Link] or internal systems.
Mitigation:
• Validate and allowlist acceptable URL schemes and domains.
• Block requests to private IP ranges (10.x, 172.16.x, 192.168.x, 169.254.x).
• Use network-level controls to prevent API servers from making external requests.

Threat 8: Security Misconfiguration


Description: Default settings, unnecessary HTTP methods enabled, verbose error messages, open
CORS policies, missing security headers.
Mitigation:
• Disable unused HTTP methods (TRACE, PATCH if not needed).
• Configure CORS strictly — specify allowed origins explicitly.
• Return generic error messages — never expose stack traces.
• Set security headers: Content-Security-Policy, X-Frame-Options, etc.

Threat 9: Improper Inventory Management


Description: Organizations expose old, unpatched, or undocumented API versions. Attackers find
and exploit these shadow APIs.
Mitigation:
• Maintain a complete API inventory using API gateways and discovery tools.
• Deprecate and remove old API versions promptly.
• Use API versioning strategies (URI versioning, header versioning).

Threat 10: Unsafe Consumption of APIs


Description: Your API blindly trusts third-party APIs it consumes, leading to injection attacks through
third-party data.
Mitigation:
• Validate and sanitize all data received from third-party APIs.
• Use TLS for all third-party API communications.
• Apply the same security standards to consumed APIs as to your own.

3. Additional Critical Threats


3.1 Injection Attacks (SQL, NoSQL, Command)
• Use parameterized queries, ORMs, and input validation.
• Apply principle of least privilege for database accounts.

3.2 Man-in-the-Middle (MITM) Attacks


• Enforce TLS 1.2/1.3 with certificate validation.
• Use HSTS and certificate pinning.

3.3 API Key Leakage


• Scan code repositories for exposed API keys (GitGuardian, TruffleHog).
• Rotate compromised keys immediately.

4. Defense-in-Depth Strategy
Layer Controls

Network Firewall, VPC, Private subnets for internal APIs

Transport TLS 1.3, HSTS, Certificate validation

Authentication OAuth2, JWT, MFA, API Keys with rotation

Authorization RBAC, ABAC, Object-level checks

Input Schema validation, sanitization, WAF

Rate Limiting Throttling, quotas, circuit breakers

Monitoring SIEM, anomaly detection, audit logs

Testing DAST, penetration testing, OWASP ZAP

5. Conclusion
API threats are diverse and constantly evolving. A single vulnerability can lead to massive data
breaches, financial losses, and reputational damage. Organizations must adopt OWASP API Security
Top 10 as a baseline, implement layered security controls, continuously monitor API traffic, and
regularly test their APIs for vulnerabilities. Security must be built into every stage of the API lifecycle
— from design to decommissioning.
Q5. Compare API Keys and OAuth2 in terms of security, usability, and risk.

1. Introduction
API Keys and OAuth2 are two of the most widely used mechanisms for API authentication and
authorization. API Keys are simple, static credentials, while OAuth2 is a sophisticated authorization
framework. Both serve different purposes and have distinct security profiles, usability characteristics,
and risk factors.

2. API Keys – Overview


2.1 What Are API Keys?
API Keys are unique, randomly generated strings (tokens) that identify and authenticate a client
application. They are typically included in request headers, query parameters, or request bodies.

2.2 How API Keys Work


• Developer registers an application with the API provider.
• Provider generates a unique API Key (e.g., sk-abc123xyz789).
• Client includes the key in requests: X-API-Key: sk-abc123xyz789 or
?api_key=sk-abc123xyz789.
• API server validates the key against its store and grants/denies access.

2.3 Characteristics
• Static credentials — do not expire unless manually rotated.
• No built-in user identity — identifies the application, not the user.
• Simple to implement — no complex OAuth flows.
• No standardized format — each provider implements differently.

3. OAuth2 – Overview
3.1 What Is OAuth2?
OAuth2 is a standardized authorization framework (RFC 6749) that provides delegated access
through time-limited, scope-restricted tokens. It separates authentication from authorization and
supports multiple grant types for different use cases.

3.2 Key Features


• Tokens are time-limited (access token expiry via exp claim).
• Fine-grained scopes control what actions a token permits.
• Tokens are cryptographically signed (RS256, HS256).
• Supports user delegation, service-to-service, and device flows.
• Standard protocol — compatible across identity providers.

4. Detailed Comparison
4.1 Security Comparison
Security Aspect API Keys OAuth2 (JWT)

Token Lifetime Permanent (until revoked) Short-lived (15 min – 1 hr)


Cryptographic Signing None — opaque string RS256/HS256 signature

Scope/Permission Control None / coarse-grained Fine-grained scopes

Transport Security Relies entirely on HTTPS HTTPS + signed token

Revocation Delete key (immediate) Expiry / blacklist / introspection

Replay Attack Risk High (no expiry) Low (short expiry + jti)

Credential Exposure Key visible in logs/URLs Bearer token, short-lived

Identity Context No user identity User sub, roles, claims embedded

Multi-service Use Single service typically Cross-service with audience claim

4.2 Usability Comparison


Usability Aspect API Keys OAuth2

Implementation Complexity Very simple Complex (flows, endpoints, tokens)

Client Complexity Minimal — include key in header Requires auth flow implementation

Developer Experience Easy to get started Steeper learning curve

Debugging Easy — static key Complex — token issues, expiry

Documentation Minimal needed Extensive (flows, scopes, errors)

Third-party Integration Limited Excellent (standard protocol)

Mobile App Support Simple but risky Well-supported (PKCE flow)

SSO Support Not supported Native support via OpenID Connect

4.3 Risk Comparison


Risk Factor API Keys OAuth2

Key/Token Leakage High impact — permanent access Lower — token expires quickly

Brute Force Risk Possible without rate limiting Mitigated by auth server lockout

Insider Threat Static key shared among team Tokens scoped per user/service

Credential Stuffing Vulnerable MFA + short tokens mitigate

MITM Attack Catastrophic if key captured Token expires — limited window

Misconfiguration Risk Lower (simple mechanism) Higher (complex config)

Over-privileged Access Common — all-or-nothing Controlled via scopes

5. Use Case Recommendations


Use Case Recommended Approach

Public APIs (low sensitivity) API Keys (simple, developer-friendly)


User data access APIs OAuth2 (Authorization Code + PKCE)

Service-to-service (M2M) OAuth2 (Client Credentials Grant)

Partner integrations OAuth2 (scoped, auditable)

Internal tooling APIs API Keys (with rotation policy)

Mobile applications OAuth2 with PKCE flow

Payment/healthcare APIs OAuth2 + mTLS (highest security)

6. Hybrid Approach
Many production systems use both API Keys and OAuth2 complementarily:
• API Keys for initial app registration and developer identification (rate limiting, billing).
• OAuth2 tokens for actual resource access and authorization.
• API Gateway validates the API Key for request routing, then verifies the OAuth2 token for
authorization.

7. Security Best Practices for Each


API Key Best Practices
• Generate cryptographically random, long keys (256+ bits).
• Never include keys in URLs — use headers (X-API-Key).
• Rotate keys periodically and on suspected compromise.
• Scope keys to specific IP addresses or operations where possible.
• Monitor and alert on unusual key usage patterns.

OAuth2 Best Practices


• Always validate JWT signature, expiry, issuer, and audience.
• Use PKCE for all public clients (mobile, SPA).
• Implement token introspection for real-time validation.
• Store tokens securely — prefer httpOnly cookies over localStorage.
• Implement refresh token rotation and binding.

8. Conclusion
API Keys are simple and suitable for low-sensitivity, developer-facing APIs where ease of use is
paramount. OAuth2 is the superior choice for production APIs handling sensitive data, user
delegation, or cross-service authentication. The decision should be based on the security
requirements, user context, and operational complexity the team can manage. For enterprise and
regulated environments, OAuth2 is strongly recommended.
Q6. Analyze the role of Rate Limiting and Throttling in ensuring API availability.

1. Introduction
API availability is a critical quality attribute for any production system. Rate limiting and throttling are
essential traffic management techniques that protect APIs from overload, abuse, and
denial-of-service attacks. Without these controls, a single misbehaving client or attacker can exhaust
server resources and make the API unavailable to all users — a situation known as a DoS (Denial of
Service) or API abuse scenario.

2. Definitions
2.1 Rate Limiting
Rate limiting restricts the number of API requests a client can make within a defined time window. It is
a hard cap — once the limit is reached, subsequent requests are rejected until the window resets.
Example: A client is allowed maximum 100 requests per minute. The 101st request returns HTTP 429
(Too Many Requests).

2.2 Throttling
Throttling controls the rate at which requests are processed, often by queuing or delaying excess
requests rather than outright rejecting them. It smooths request flow to maintain consistent
throughput.
Example: Instead of rejecting the 101st request, the server queues it and processes it when capacity
is available, introducing controlled delay.

3. Why Rate Limiting & Throttling are Essential


Threat / Problem How Rate Limiting Helps

DDoS Attacks Caps per-IP requests, limiting attack impact

Brute Force Auth Attacks Limits login attempts per account/IP

Web Scraping / Data Harvesting Makes mass data extraction impractical

API Abuse / Misuse Enforces fair usage policies

Cost Control (Cloud APIs) Prevents unexpected billing spikes

Resource Exhaustion Protects backend servers from overload

Cascading Failures Prevents one service overwhelming another

4. Rate Limiting Algorithms


4.1 Fixed Window Counter
The simplest approach. A counter tracks requests in a fixed time window (e.g., per minute). Resets at
the start of each window. Vulnerable to boundary attacks where clients burst at window edges.
• Pros: Simple to implement, low memory usage.
• Cons: Allows 2x burst at window boundaries.

4.2 Sliding Window Log


Maintains a log of timestamps for each request. On each request, it counts requests within the last N
seconds from the current time. More accurate but memory-intensive.
• Pros: Eliminates boundary burst problem.
• Cons: High memory consumption for high-traffic APIs.

4.3 Sliding Window Counter


Hybrid approach combining fixed window simplicity with sliding window accuracy. Approximates the
sliding window using weighted counters from the current and previous windows.
• Formula: Current_count = prev_window_count × (1 - elapsed%) + current_window_count

4.4 Token Bucket


A bucket holds tokens (max capacity N). Tokens are added at a constant rate (refill rate). Each
request consumes one token. If the bucket is empty, the request is rejected or queued. Allows
controlled bursting.
• Pros: Allows short bursts, smooth average rate control.
• Cons: Slightly complex to implement.
• Used by: AWS API Gateway, Nginx.

4.5 Leaky Bucket


Requests enter a queue (bucket) and are processed at a fixed rate (leak rate). Excess requests
overflow (are rejected). Ensures a constant output rate regardless of bursty input.
• Pros: Very smooth output, prevents bursts from reaching backend.
• Cons: Can introduce latency for legitimate bursts.

5. Rate Limiting Dimensions


Dimension Description Example

Per User Limit per authenticated user 100 req/min per user ID

Per IP Address Limit per client IP 200 req/min per IP

Per API Key Limit per registered key 1000 req/hour per key

Per Endpoint Limit per specific route POST /login: 5 req/min

Global Total API rate limit 10,000 req/sec system-wide

Per Tenant For multi-tenant SaaS Based on subscription tier

6. HTTP Response for Rate-Limited Requests


When rate limiting is triggered, the API should return:
• Status Code: 429 Too Many Requests
• Header: Retry-After: 60 (seconds until retry is allowed)
• Header: X-RateLimit-Limit: 100 (total allowed requests)
• Header: X-RateLimit-Remaining: 0 (remaining requests in window)
• Header: X-RateLimit-Reset: 1700000000 (Unix timestamp of window reset)
• Body: { 'error': 'rate_limit_exceeded', 'message': 'Too many requests. Please retry after 60
seconds.' }
7. Throttling Strategies
7.1 Graduated Throttling
Instead of immediate rejection, the server applies progressive delays as usage increases: warn at
80% limit, slow at 95%, block at 100%. This provides a better user experience.

7.2 Priority Queuing


Different request types are given different priorities. Critical operations (payments, authentication) are
processed first; non-critical requests (analytics, reporting) are queued.

7.3 Adaptive Throttling


Dynamically adjusts limits based on current server load. When CPU/memory is high, limits are
tightened; when resources are available, limits are relaxed. Used by Google's gRPC framework.

8. Implementation Locations
• API Gateway Level: Kong, AWS API Gateway, Apigee — centralized enforcement.
• Load Balancer Level: Nginx, HAProxy — network-level protection.
• Application Level: Middleware in [Link], Spring Boot, FastAPI.
• Distributed Cache: Redis-based counters for distributed rate limiting across multiple instances.

9. Rate Limiting in Microservices


In microservices, rate limiting must be distributed. A Redis-backed sliding window counter ensures all
service instances share the same counter, preventing rate limit bypass through load balancing. Tools
like Envoy Proxy (in Istio service mesh) provide built-in rate limiting at the service mesh level.

10. Conclusion
Rate limiting and throttling are indispensable for ensuring API availability, fairness, and resilience.
They protect against abuse, prevent resource exhaustion, enable fair multi-tenant usage, and reduce
the impact of DDoS attacks. A well-designed rate limiting strategy uses multiple dimensions
(per-user, per-IP, per-endpoint), appropriate algorithms (token bucket for most cases), and clear
HTTP responses to guide clients. Combined with monitoring and alerting, rate limiting is a
cornerstone of production-grade API infrastructure.
Q7. Discuss the role of Service Mesh in Microservice API Security.

1. Introduction
A Service Mesh is a dedicated infrastructure layer that manages service-to-service communication in
microservices architectures. It handles cross-cutting concerns like security, observability, traffic
management, and reliability without requiring changes to the application code. From a security
perspective, the service mesh is transformative — it moves security controls from application code to
the infrastructure layer, ensuring consistent enforcement across all services.
Popular service mesh implementations include Istio, Linkerd, Consul Connect, and AWS App Mesh.

2. Architecture of a Service Mesh


2.1 Components
• Data Plane: Lightweight proxy sidecars (typically Envoy) deployed alongside each microservice
instance.
• Control Plane: Centralized management component (Istiod in Istio) that configures the proxies.
• Sidecar Proxy: Intercepts all inbound and outbound traffic for the microservice.
Every network call goes: Service A → Sidecar Proxy A → (network) → Sidecar Proxy B → Service B.
The sidecars enforce all security policies transparently.

3. Security Capabilities of Service Mesh


3.1 Mutual TLS (mTLS) — Transport Security
mTLS is the cornerstone security feature of service meshes. Unlike standard TLS where only the
server presents a certificate, mTLS requires both the client and server to authenticate with
certificates.
• The service mesh automatically provisions and rotates X.509 certificates for each service
(SPIFFE/SPIRE standard).
• Certificates are issued based on service identity (SPIFFE ID:
spiffe://[Link]/ns/prod/sa/payments-service).
• All service-to-service communication is encrypted and mutually authenticated — even inside the
cluster.
• No application code changes needed — the sidecar proxy handles all TLS operations.
• Eliminates risks from network sniffing, MITM attacks, and impersonation within the cluster.

3.2 Service-to-Service Authorization (Authorization Policies)


The service mesh enforces fine-grained access control between services. Administrators define
policies like: 'Only the orders-service can call the payments-service on port 8080 via POST /api/pay.'
• Deny-by-default: Only explicitly authorized communication is permitted.
• Policies are enforced at the network level by sidecar proxies.
• No application code changes needed — centrally managed policies.
• Prevents lateral movement: A compromised service cannot freely call other services.

3.3 JWT Authentication at Service Mesh Level


The service mesh can validate JWT tokens at the proxy level before requests reach the application.
This offloads authentication logic from every microservice.
• Configure JWT validation rules centrally in the control plane.
• Proxy validates token signature, expiry, issuer, and audience.
• Only valid, authenticated requests reach the application code.
• Invalid tokens are rejected with 401 at the proxy — no application processing.

3.4 Traffic Encryption & Segmentation


• All inter-service traffic is encrypted with mTLS — zero trust within the cluster.
• Network segmentation via service mesh policies — services communicate only on authorized
paths.
• Egress policies control which external services a microservice can call.
• Ingress policies control what traffic can enter the mesh from outside.

3.5 Certificate Management & Rotation


• Service mesh acts as an internal Certificate Authority (CA).
• Automatically issues, rotates, and revokes certificates based on service identity.
• Short-lived certificates (24 hours) reduce the impact of certificate compromise.
• SPIFFE (Secure Production Identity Framework For Everyone) standard ensures portable
identities.

4. Observability for Security


4.1 Traffic Visibility
The service mesh provides complete visibility into all service-to-service communication — which
services communicate, at what frequency, with what error rates. This is critical for detecting
anomalies.
• Distributed tracing (Jaeger, Zipkin) — traces requests across services.
• Metrics (Prometheus/Grafana) — latency, error rates, request volumes per service pair.
• Access logs — all requests between services logged with metadata.

4.2 Anomaly Detection


• Sudden spike in requests from one service to another → potential data exfiltration.
• Unexpected service calling a sensitive API → potential lateral movement after compromise.
• Increased error rates → potential attack in progress.

5. Traffic Management for Security Resilience


• Circuit Breaker: Stops traffic to failing services, preventing cascade failures from DoS.
• Retry Policies: With backoff — avoids overwhelming recovering services.
• Timeout Enforcement: Prevents slowloris-type attacks from holding connections.
• Traffic Mirroring: Duplicates traffic to shadow environments for security testing.
• Canary Deployments: Roll out security patches gradually and safely.

6. Comparison: Security Without vs With Service Mesh


Security Concern Without Service Mesh With Service Mesh

Inter-service encryption Manual TLS in each service Automatic mTLS everywhere

Service authentication Shared secrets / API keys Certificate-based SPIFFE ID


Authorization between services Application-level code Centralized mesh policies

Certificate management Manual / complex Automatic rotation

Traffic visibility Application-level logs only Full mesh observability

Policy enforcement Inconsistent per team Uniform, centrally managed

7. Service Mesh Security in Practice – Istio Example


• PeerAuthentication: Enforces mTLS for all services in a namespace.
• AuthorizationPolicy: Only payment-service can call order-service on /api/orders.
• RequestAuthentication: Validates JWT from external IdP for inbound requests.
• DestinationRule: Configures TLS mode for traffic to specific services.

8. Conclusion
Service mesh fundamentally elevates microservices API security by decoupling security concerns
from application code and enforcing them consistently at the infrastructure level. mTLS ensures all
inter-service communication is encrypted and authenticated. Authorization policies enforce
least-privilege access between services. Certificate management is automated and reliable. The
result is a zero-trust network where every service must prove its identity for every interaction,
dramatically reducing the blast radius of any security breach.
Q8. Evaluate the effectiveness of Audit Logging in securing APIs and detecting
threats.

1. Introduction
Audit logging is the systematic recording of API activity — every request, response, authentication
event, authorization decision, and system event. In the context of API security, audit logs serve as the
'black box' of the system — essential for post-incident forensics, real-time threat detection,
compliance auditing, and behavioral analysis. Without comprehensive audit logging, security teams
are essentially blind to what is happening in their API infrastructure.

2. What Should API Audit Logs Capture?


Log Field Description Security Value

Timestamp ISO 8601 with timezone Timeline reconstruction

Request ID Unique correlation ID Distributed tracing

Client IP Source IP address Geographic anomalies, blocking

User/Service ID Authenticated identity Attribution, insider threats

HTTP Method GET, POST, PUT, DELETE Unusual method detection

Endpoint/Path API resource accessed Sensitive endpoint monitoring

Query Parameters URL parameters (sanitized) Injection pattern detection

Request Headers Auth, Content-Type, etc. Auth bypass detection

Response Code 200, 401, 403, 500, etc. Failure pattern analysis

Response Time Latency in milliseconds Timing attack detection

Payload Size Request/Response bytes Data exfiltration detection

Geo-location Country/region from IP Anomalous access detection

User Agent Client application/version Bot detection

Auth Method JWT, API Key, OAuth Auth mechanism analysis

3. Role of Audit Logging in API Security


3.1 Real-Time Threat Detection
Audit logs feed SIEM (Security Information and Event Management) systems that apply correlation
rules to detect threats in real time.
• High 401/403 rate from single IP → Brute force / credential stuffing attack.
• Sudden spike in requests to sensitive endpoints → Automated scraping or data exfiltration.
• Off-hours access to administrative APIs → Insider threat or compromised credentials.
• Sequential object ID enumeration → BOLA/IDOR attack in progress.
• Multiple failed auth attempts followed by success → Account takeover.

3.2 Post-Incident Forensics


After a security incident, audit logs allow investigators to reconstruct exactly what happened — which
endpoints were accessed, what data was retrieved, when the breach occurred, and how the attacker
progressed through the system. This is essential for:
• Determining the scope and impact of a breach.
• Identifying the initial attack vector.
• Tracing lateral movement across services.
• Providing evidence for legal proceedings.
• Meeting regulatory notification requirements (GDPR 72-hour breach notification).

3.3 Compliance & Regulatory Requirements


Regulation Audit Logging Requirement

GDPR (EU) Log all access to personal data; breach notification within 72 hours

HIPAA (USA) Audit controls for all PHI access; 6-year retention

PCI-DSS Log all access to cardholder data; 1-year retention minimum

SOX Financial API audit trails; immutable logs

ISO 27001 Comprehensive event logging and review processes

3.4 Behavioral Analytics & Anomaly Detection


Modern audit logging systems apply machine learning to establish baselines of normal API usage
and detect statistical anomalies:
• User normally accesses 50 records/day → sudden access of 50,000 records → alert.
• Service normally calls 3 endpoints → suddenly calling 15 → potential compromise.
• Login from new country not in user's history → geographic anomaly alert.

4. Log Security – Protecting the Logs Themselves


Audit logs are only effective if they themselves are secure. An attacker who can modify or delete logs
can cover their tracks.

4.1 Log Integrity


• Write logs to immutable, append-only storage (AWS CloudTrail, Azure Monitor Logs).
• Use cryptographic hashing (SHA-256) or digital signatures to detect tampering.
• Blockchain-based logging for highest integrity requirements.
• Implement WORM (Write Once Read Many) storage policies.

4.2 Log Access Control


• Strict RBAC — only authorized security personnel can access logs.
• Separate log storage from application infrastructure.
• Log access itself should be logged (meta-logging).
• Encrypt logs at rest (AES-256) and in transit (TLS).

4.3 Log Retention


• Define retention policies based on regulatory requirements (1–7 years depending on industry).
• Hot storage (recent 30 days) for active investigation.
• Cold storage (archival) for long-term compliance.
• Automated purging with audit trail of deletion.

5. Log Aggregation & SIEM Integration


• Centralize logs from all API components: gateway, application, database, auth server.
• Use log shippers (Fluentd, Filebeat, Logstash) to send to SIEM.
• SIEM platforms: Splunk, Elastic SIEM, AWS Security Hub, Microsoft Sentinel.
• Define correlation rules for automated alerting.
• Integrate with incident response workflows (PagerDuty, JIRA, Slack).

6. Limitations of Audit Logging


• Volume: High-traffic APIs generate massive log volumes — storage and analysis costs are
significant.
• False Positives: Overly sensitive rules generate alert fatigue for security teams.
• Latency: Real-time analysis adds processing overhead.
• PII in Logs: Request/response bodies may contain sensitive data — must be masked or
excluded.
• Insider Log Manipulation: Privileged users may attempt log tampering — requires separation of
duties.

7. Best Practices
• Log all authentication and authorization events, not just failures.
• Use structured logging (JSON) for easy parsing and querying.
• Include correlation/trace IDs for distributed request tracing.
• Mask sensitive fields (passwords, tokens, PAN numbers) in logs.
• Set up automated alerting with escalation procedures.
• Review logs regularly — both automated and manual reviews.
• Test log coverage — ensure critical events are actually being logged.

8. Conclusion
Audit logging is not merely a compliance checkbox — it is a critical active security control. Effective
audit logging enables real-time threat detection, rapid incident response, regulatory compliance, and
behavioral analysis. However, logs must be comprehensive, integrity-protected, access-controlled,
and actively monitored to deliver security value. A well-implemented audit logging strategy can be the
difference between detecting a breach in minutes versus discovering it months later. In the modern
threat landscape, comprehensive audit logging is a non-negotiable component of API security
architecture.
Q9. How locking down network connections enhances API security.

1. Introduction
Network-level security forms the foundational layer of API security — the first line of defense before
any application-level controls are engaged. Locking down network connections means restricting,
controlling, and monitoring all network paths to and from API endpoints. This principle follows the
'defense-in-depth' model: even if application-level controls fail, network controls provide a safety net
that limits the damage an attacker can cause.

2. Core Concepts of Network Lockdown


2.1 Principle of Least Network Privilege
Every service should only have network access to the specific resources it needs — no more. A
payment service should not be able to reach the HR database. This limits the blast radius of any
compromise.

2.2 Zero Trust Networking


The Zero Trust model assumes that no network — internal or external — is inherently trusted. Every
connection must be authenticated, authorized, and encrypted, regardless of whether it originates
inside or outside the corporate network.

3. Network Security Controls for APIs


3.1 Firewalls & Security Groups
Firewalls are the primary network gatekeepers. For API security:
• Allow inbound traffic only on necessary ports (443 for HTTPS, specific internal ports).
• Block all inbound traffic by default — allowlist only required sources.
• Use stateful firewall rules that track connection state.
• In cloud environments (AWS/GCP/Azure), use Security Groups and Network ACLs.
• Separate rules for public APIs vs internal APIs.

Direction Rule Purpose

Inbound Allow TCP 443 from [Link]/0 Public HTTPS API access

Inbound Allow TCP 8080 from [Link]/8 Internal service traffic only

Inbound Deny all other ports Block unauthorized access

Outbound Allow TCP 443 to known domains API external calls

Outbound Deny all other egress Prevent data exfiltration

3.2 Virtual Private Cloud (VPC) & Network Segmentation


• Deploy internal APIs in private subnets — no public internet access.
• Public APIs go through API Gateway in public subnet → forward to private services.
• Create separate VPCs or subnets for different environments (prod/staging/dev).
• Use VPC peering with explicit route tables — no implicit full-mesh connectivity.
• Implement micro-segmentation: each microservice in its own network segment.
3.3 API Gateway as Network Choke Point
All external API traffic should pass through an API Gateway. This creates a single, controlled entry
point that:
• Terminates TLS and re-encrypts for backend communication.
• Enforces authentication before forwarding to internal services.
• Applies WAF rules to filter malicious requests.
• Provides centralized rate limiting and IP blocking.
• Hides internal service topology from external clients.

3.4 Transport Layer Security (TLS) Enforcement


• Enforce TLS 1.2 minimum (TLS 1.3 preferred) for all API connections.
• Disable weak cipher suites (RC4, DES, 3DES, NULL ciphers).
• Implement HSTS (HTTP Strict Transport Security) with max-age >= 31536000.
• Disable HTTP redirect to HTTPS — reject HTTP outright.
• Certificate pinning for high-security mobile API clients.
• Mutual TLS (mTLS) for service-to-service internal API communication.

3.5 IP Allowlisting & Blocklisting


• For partner/enterprise APIs: restrict access to known IP ranges.
• Maintain dynamic blocklists from threat intelligence feeds.
• Geo-blocking: Block requests from countries with no legitimate users.
• Implement automatic IP blocking after repeated failed authentication.
• Use CDN with edge security (Cloudflare, Akamai) for DDoS protection.

3.6 Web Application Firewall (WAF)


A WAF operates at Layer 7 (application layer) and filters HTTP/HTTPS traffic based on rules:
• OWASP Core Rule Set (CRS): Blocks SQL injection, XSS, path traversal, RCE patterns.
• Custom rules: Block specific user agents, request patterns, or payloads.
• Rate-based rules: Automatically block IPs exceeding request thresholds.
• Bot management: Distinguish legitimate bots (Googlebot) from malicious ones.
• Managed rules from cloud providers (AWS WAF, Azure WAF, Cloudflare WAF).

3.7 Network Monitoring & Intrusion Detection


• Deploy Network IDS/IPS (Snort, Suricata) to monitor API traffic patterns.
• Use VPC Flow Logs to record all network traffic for analysis.
• Monitor for port scanning, protocol violations, and anomalous connection patterns.
• Integrate network telemetry with SIEM for correlation with application events.

3.8 DDoS Protection


• Use cloud-native DDoS protection (AWS Shield, Azure DDoS Protection).
• Implement anycast network diffusion to absorb volumetric attacks.
• Configure rate limiting at the CDN/edge layer before traffic reaches API.
• Maintain emergency IP blocklists for known attack sources.
• Design APIs for graceful degradation under load.
4. Network Segmentation Architecture
Recommended three-tier network architecture for API security:
• DMZ (Demilitarized Zone): API Gateway, WAF, Load Balancer — public-facing.
• Application Tier: Microservices, business logic — private subnet, not internet-accessible.
• Data Tier: Databases, caches — most restricted subnet, only accessible from application tier.

5. Impact of Network Lockdown on Security


Attack Vector How Network Lockdown Mitigates

Direct database access DB in private subnet, not reachable from internet

Service enumeration Internal services hidden behind API Gateway

DDoS attacks WAF + CDN absorbs volumetric traffic

MITM attacks TLS 1.3 encryption on all connections

Lateral movement Micro-segmentation limits service-to-service access

Data exfiltration Egress filtering blocks unauthorized outbound connections

Credential brute force IP blocking after repeated failures

6. Conclusion
Network-level security is the most fundamental layer of API protection. By implementing firewalls,
VPC segmentation, TLS enforcement, API Gateways, WAF, and DDoS protection, organizations
create a robust perimeter that significantly reduces the attack surface. Network lockdown ensures
that even if an application vulnerability is discovered, the attacker's ability to exploit it or extract data
is severely constrained by network-level controls. In a Zero Trust architecture, network controls work
in concert with application-level authentication and authorization to provide comprehensive API
security.
Q10. How Does Encryption Enhance API Security, and What Are the Different
Encryption Techniques Used?

1. Introduction
Encryption is the process of converting plaintext data into an unreadable format (ciphertext) using
cryptographic algorithms, such that only authorized parties with the correct decryption key can access
the original data. In API security, encryption is essential at multiple levels — protecting data in transit,
at rest, and in processing. It ensures confidentiality, integrity, and authenticity of API communications.

2. How Encryption Enhances API Security


2.1 Confidentiality
Encryption ensures that even if an attacker intercepts API traffic (MITM) or gains access to stored
data, the information remains unreadable. This protects sensitive data like credentials, PII, financial
information, and business data.

2.2 Integrity
Cryptographic techniques like HMAC and digital signatures ensure data has not been tampered with
in transit. If any bit of the message changes, the signature verification fails, alerting the receiver to
tampering.

2.3 Authentication
Asymmetric encryption enables mutual authentication. When a JWT is signed with a private key and
verified with the corresponding public key, the recipient can be certain the token was issued by the
legitimate authority.

2.4 Non-Repudiation
Digital signatures provide non-repudiation — the signer cannot deny having signed the data. This is
critical for API audit trails in financial and legal systems.

3. Types of Encryption Used in API Security


3.1 Symmetric Encryption
Definition: The same key is used for both encryption and decryption.

Algorithm Key Size Use in APIs Strength

AES-128 128 bits Data encryption at rest Strong

AES-256 256 bits Recommended for sensitive data Very Strong

AES-GCM 128/256 bits Authenticated encryption in TLS Strongest

ChaCha20 256 bits Mobile API encryption Strong

3DES 168 bits Legacy systems (deprecated) Weak

• Pros: Fast, efficient, suitable for large data volumes.


• Cons: Key distribution problem — both parties must securely share the key.
• Use Cases: Encrypting API payloads, database field encryption, file encryption.

3.2 Asymmetric (Public-Key) Encryption


Definition: Uses a key pair — public key (shared openly) for encryption, private key (kept secret) for
decryption.

Algorithm Key Size Use in APIs

RSA-2048 2048 bits Key exchange, JWT signing (RS256)

RSA-4096 4096 bits High-security certificate signing

ECDSA (P-256) 256 bits (equivalent) JWT signing (ES256), TLS certificates

Ed25519 255 bits Modern JWT signing, SSH

ECDH Varies Key agreement in TLS handshake

• Pros: Solves key distribution problem — public key can be shared freely.
• Cons: Slower than symmetric — used for key exchange and signatures, not bulk data.
• Use Cases: TLS certificate signing, JWT digital signatures, API key exchange.

3.3 Transport Layer Security (TLS)


Definition: TLS is a hybrid protocol that uses asymmetric encryption for key exchange and
authentication, then symmetric encryption for bulk data transfer.
• TLS 1.3 (current standard): Removes weak ciphers, faster handshake (1-RTT), forward secrecy
by default.
• Cipher Suite Example (TLS 1.3): TLS_AES_256_GCM_SHA384
• TLS Handshake: Client Hello → Server Hello + Certificate → Key Exchange → Symmetric
Session Key → Encrypted Communication.
• Perfect Forward Secrecy (PFS): Each session uses a new ephemeral key — past sessions
cannot be decrypted even if private key is compromised.
• Certificate Pinning: Client hardcodes the expected server certificate — prevents MITM with
rogue certificates.

3.4 Hashing (Cryptographic Hash Functions)


Definition: One-way transformation of data into a fixed-length digest. Cannot be reversed. Used for
integrity verification and password storage.

Algorithm Output Size Use in APIs Status

SHA-256 256 bits JWT signature (HS256), HMAC Recommended

SHA-384 384 bits JWT (HS384), TLS PRF Recommended

SHA-512 512 bits High-security hashing Recommended

bcrypt 60 chars Password hashing Recommended

Argon2id Variable Password hashing (best) Recommended

MD5 128 bits Legacy (broken) Deprecated

SHA-1 160 bits Legacy (broken) Deprecated

3.5 Message Authentication Codes (MAC / HMAC)


Definition: HMAC (Hash-based Message Authentication Code) combines a secret key with a hash
function to produce a tag that verifies both data integrity and authenticity.
• HMAC-SHA256 is used in JWT tokens (HS256) for symmetric signing.
• API request signing: AWS uses HMAC-SHA256 for authenticating API requests (AWS Signature
V4).
• Webhook verification: GitHub and Stripe sign webhook payloads with HMAC — receivers verify
authenticity.
Formula: HMAC(key, message) = H((key ⊕ opad) || H((key ⊕ ipad) || message))

3.6 End-to-End Encryption (E2EE)


In some high-security APIs (messaging, healthcare), payload encryption is applied at the application
level — data is encrypted before transmission and decrypted only at the final destination, not at
intermediate gateways.
• Uses: WhatsApp API, healthcare record APIs, financial transaction APIs.
• Advantage: Even the API Gateway or load balancer cannot read the payload.
• Implementation: PGP/GPG, NaCl (libsodium), or application-layer AES-GCM.

4. Encryption in API Authentication Tokens


JWT Encryption (JWE) vs JWT Signing (JWS)
Aspect JWS (Signed JWT) JWE (Encrypted JWT)

Purpose Integrity + Authentication Confidentiality

Header { alg: RS256 } { alg: RSA-OAEP, enc: A256GCM }

Payload Visible? Yes (Base64 encoded) No (encrypted)

Use Case Most API auth Sensitive claim protection

5. Encryption Best Practices for APIs


• Use TLS 1.3 for all API communications — disable older versions.
• Choose AES-256-GCM for symmetric encryption — provides both confidentiality and integrity.
• Use RSA-2048 minimum or ECDSA P-256 for asymmetric operations.
• Hash passwords with Argon2id or bcrypt — never MD5 or SHA-1.
• Rotate encryption keys regularly — use HSM (Hardware Security Module) for key storage.
• Enable Perfect Forward Secrecy in TLS configuration.
• Never implement custom cryptographic algorithms — use established libraries (OpenSSL,
libsodium, Bouncy Castle).

6. Conclusion
Encryption is the bedrock of API security. It protects data confidentiality in transit and at rest, ensures
message integrity, enables strong authentication, and provides non-repudiation. A layered encryption
strategy — TLS for transport, JWT signing for token integrity, AES for data at rest, and HMAC for
request signing — provides comprehensive protection against eavesdropping, tampering, and
impersonation. Modern APIs must treat encryption as a first-class requirement, not an afterthought.
Q11. Design an API security strategy incorporating OAuth2, API Keys, Encryption,
and Rate Limiting.

1. Introduction
Designing a comprehensive API security strategy requires combining multiple security controls in a
layered, defense-in-depth architecture. A robust strategy integrates OAuth2 for authorization, API
Keys for client identification, encryption for data protection, and rate limiting for availability. This
design addresses the complete API security lifecycle: authentication, authorization, data protection,
and availability.

2. Design Principles
• Defense in Depth: Multiple overlapping security layers — no single point of failure.
• Least Privilege: Minimum necessary access at every layer.
• Zero Trust: Verify every request — trust nothing implicitly.
• Fail Secure: On failure, deny access by default.
• Security by Design: Security built into API lifecycle, not added after.

3. Architecture Overview
The strategy is organized into four concentric security layers:
• Layer 1 — Network: TLS, firewall, WAF, DDoS protection.
• Layer 2 — Identity & Access: OAuth2 for authorization, API Keys for app identification.
• Layer 3 — Traffic Control: Rate limiting, throttling, quotas.
• Layer 4 — Data Protection: Payload encryption, response filtering, audit logging.

4. Component 1: OAuth2 for Authorization


4.1 Grant Type Selection Matrix
Client Type Grant Type Token Lifetime

User-facing Web App Authorization Code + PKCE Access: 15min, Refresh: 24hr

Mobile App Authorization Code + PKCE Access: 15min, Refresh: 7 days

Service-to-Service Client Credentials Access: 1hr, No refresh

Backend Batch Job Client Credentials Access: 1hr

Third-party Integration Authorization Code Access: 15min, Refresh: 30 days

4.2 Token Design


• Use RS256 (RSA + SHA256) for JWT signing — asymmetric, verifiable without shared secret.
• Standard JWT Claims: sub, iss, aud, exp, iat, jti (for revocation), scope, roles.
• Custom Claims: tenant_id, permissions, environment.
• Token Introspection Endpoint: Real-time token validation for sensitive operations.

4.3 Authorization Server Setup


• Deploy dedicated Auth Server (Keycloak, Auth0, AWS Cognito) — separate from business
APIs.
• Publish JWKS (JSON Web Key Set) endpoint for public key distribution.
• Implement refresh token rotation — each use invalidates old token.
• Enforce scope-based access — validate scopes at resource server per endpoint.

5. Component 2: API Keys for Client Identification


5.1 API Key Strategy
API Keys complement OAuth2 by identifying and managing client applications. Every application that
consumes the API must be registered and issued an API Key.

API Key Use Purpose

Application Identification Distinguish which app is making the request

Rate Limit Enforcement Apply per-app quotas and throttling

Analytics & Billing Track usage per application for metering

Incident Response Quickly revoke compromised app access

5.2 API Key Security


• Generate 256-bit cryptographically random keys.
• Hash keys before storing in database (SHA-256 + salt).
• Send keys in request headers only: X-API-Key: — never in URLs.
• Scope keys: each key has allowed endpoints, methods, and IP ranges.
• Automatic rotation: keys expire after 90 days, with grace period for renewal.
• Immediate revocation capability: invalidate compromised keys within seconds.

6. Component 3: Encryption Strategy


6.1 In Transit
• TLS 1.3 mandatory for all API endpoints — reject TLS 1.1 and below.
• HSTS header with max-age=31536000, includeSubDomains.
• mTLS for all service-to-service API communication.
• Certificate rotation every 90 days using automated tooling (cert-manager).

6.2 At Rest
• Encrypt all sensitive data fields in database: AES-256-GCM.
• Full disk encryption for all storage volumes hosting API data.
• Key Management: Use HSM or cloud KMS (AWS KMS, Azure Key Vault).
• Separate encryption keys per data classification tier (PII, financial, general).

6.3 Payload Encryption (sensitive APIs)


• For high-sensitivity endpoints (payments, health): encrypt request/response payload with JWE.
• API clients use server public key to encrypt payload — only server can decrypt.

7. Component 4: Rate Limiting & Throttling


7.1 Multi-Tier Rate Limiting
Tier Limit Algorithm Action
Per IP 200 req/min Token Bucket 429 + block 5min

Per API Key 1000 req/min Sliding Window 429 + notify app

Per User 100 req/min Sliding Window 429 + warn user

Per Endpoint Varies by endpoint Fixed Window 429 specific

Global API 100,000 req/sec Leaky Bucket Queue + shed

7.2 Sensitive Endpoint Limits


• POST /auth/login: 5 attempts per user per 5 minutes — account lockout after 10 failures.
• POST /auth/register: 3 accounts per IP per day.
• POST /payments: 10 transactions per user per minute.
• GET /export: 1 export per user per hour (prevents data harvesting).

8. API Gateway Configuration


The API Gateway serves as the central enforcement point for all security policies:
• Validate API Key on every request before routing.
• Verify OAuth2 Bearer token (signature, expiry, audience, scope).
• Apply rate limiting rules before routing to backend.
• WAF inspection of all request payloads.
• Strip internal headers before forwarding to backend services.
• Log all requests to centralized audit log system.
• Return standardized error responses — no backend error details exposed.

9. Security Monitoring & Response


• Real-time alerting: High 401/403 rates, rate limit hits, geographic anomalies.
• Automated response: IP blocking, account lockout, API key suspension.
• Monthly security reviews: Token usage, key rotation compliance, scope drift.
• Quarterly penetration testing of all API endpoints.

10. Conclusion
This integrated strategy creates a robust, layered API security posture. OAuth2 provides
standardized, fine-grained authorization. API Keys enable client management and usage tracking.
Encryption protects data at every stage. Rate limiting ensures availability for all legitimate users.
Together, these components address the complete OWASP API Security Top 10 and meet
requirements for enterprise, regulated-industry, and high-availability API platforms.
Q12. Propose a secure API architecture for a cloud-based microservices system.

1. Introduction
Cloud-based microservices systems present unique API security challenges: distributed services,
dynamic scaling, multiple communication paths, and complex service dependencies. A secure API
architecture for this environment must address external-facing API security, internal
service-to-service security, data protection, and operational security — all while maintaining the
scalability and agility that microservices are designed to deliver.

2. Architecture Goals
• Zero Trust: Every service and user must authenticate and authorize for every request.
• Defense in Depth: Multiple security layers — network, identity, application, data.
• Scalability: Security controls that scale horizontally without becoming bottlenecks.
• Observability: Complete visibility into all API traffic and security events.
• Resilience: Security failures fail gracefully without cascading outages.

3. High-Level Architecture Layers


Layer 1: Edge / Internet-Facing Layer
• CDN + DDoS Protection: Cloudflare or AWS CloudFront with Shield Advanced.
• Web Application Firewall (WAF): Filter malicious traffic before it reaches the API Gateway.
• Global Load Balancer: Distribute traffic across regions with geo-based routing.

Layer 2: API Gateway Layer


• API Gateway (Kong, AWS API Gateway, Apigee): Single entry point for all external API calls.
• Responsibilities: TLS termination, API Key validation, OAuth2 token verification, rate limiting,
request routing.
• Developer Portal: Manages API Key issuance, documentation, and developer onboarding.

Layer 3: Identity & Access Layer


• Authorization Server (Keycloak / Auth0 / AWS Cognito): Issues and manages OAuth2 tokens.
• Identity Provider (IdP): Handles user authentication (SAML, OIDC, social login).
• SPIFFE/SPIRE: Issues cryptographic identities (SVID) to each microservice.
• Secrets Manager (HashiCorp Vault / AWS Secrets Manager): Manages all credentials,
certificates, and API keys.

Layer 4: Service Mesh Layer


• Service Mesh (Istio): Manages all east-west (service-to-service) traffic.
• Automatic mTLS: All inter-service communication encrypted and mutually authenticated.
• Authorization Policies: Service-level RBAC enforced at the sidecar proxy.
• Traffic Management: Circuit breakers, retries, timeouts enforced by Envoy sidecars.

Layer 5: Microservices Application Layer


• Each microservice: Stateless, runs in container (Kubernetes pod) in private subnet.
• Input Validation: Schema validation, sanitization at each service boundary.
• Business Logic Authorization: Object-level authorization checks within each service.
• No direct database access from API Gateway — always through service layer.

Layer 6: Data Layer


• Databases in private subnets: No public IP, accessible only from application tier.
• Encryption at Rest: AES-256 for all database volumes.
• Row-Level Security: PostgreSQL RLS or equivalent — services can only query their data.
• Database Activity Monitoring (DAM): Monitor and alert on unusual database queries.
• Separate database per microservice: Prevents unauthorized cross-service data access.

4. External API Security Design


4.1 Client Authentication
Client Type Auth Mechanism Token Storage

Browser SPA OAuth2 Auth Code + PKCE httpOnly cookie

Mobile App OAuth2 Auth Code + PKCE Secure Enclave / Keystore

Third-party App OAuth2 Auth Code Secure backend storage

Partner Service OAuth2 Client Credentials Secrets Manager

Internal Service mTLS + SPIFFE Certificate (auto-rotated)

4.2 API Versioning & Lifecycle


• Use URI versioning: /api/v1/, /api/v2/ for clear version management.
• Deprecate old versions with sunset headers and 12-month EOL notice.
• Maintain API inventory in API Gateway — no undocumented/shadow APIs.

5. Internal Service-to-Service Security


5.1 mTLS with Service Mesh
• Istio PeerAuthentication: STRICT mode — all traffic must use mTLS.
• Automatic certificate rotation every 24 hours via SPIRE.
• Services identified by SPIFFE ID: spiffe://[Link]/ns/orders/sa/orders-svc.

5.2 Authorization Between Services


• Istio AuthorizationPolicy: Define explicit allowed communication paths.
• Example: Only 'payments-service' can call 'ledger-service' on POST /api/ledger/debit.
• Deny-all default: New services have zero connectivity until explicitly authorized.

6. Data Security Design


• Data Classification: Tag all data as Public, Internal, Confidential, or Restricted.
• Encryption at rest: AES-256-GCM for Confidential/Restricted data fields.
• API Response Filtering: Never return data beyond what the client's scope permits.
• PII Masking: Mask sensitive fields in logs (last 4 digits of card, partial email).
• Data Residency: Enforce cloud region constraints for regulated data (GDPR, HIPAA).

7. Observability & Incident Response


Component Tool Security Function

Distributed Tracing Jaeger / AWS X-Ray Track request path across services

Metrics Prometheus + Grafana Error rates, latency, auth failures

Log Aggregation ELK Stack / Splunk Centralized security event analysis

SIEM Microsoft Sentinel Threat correlation and alerting

Vulnerability Scanning Trivy, Snyk Container and dependency scanning

Secrets Scanning GitGuardian Prevent credential exposure in code

8. CI/CD Security Integration (DevSecOps)


• SAST: Static code analysis in CI pipeline before deployment.
• Container image scanning: Scan for vulnerabilities before pushing to registry.
• Infrastructure as Code (IaC) scanning: Detect security misconfigurations in Terraform.
• API contract testing: Validate security headers, auth enforcement, in automated tests.
• Automated secret rotation: Triggered on deployment events.

9. Conclusion
This cloud-based microservices API security architecture implements true zero trust across all layers.
External traffic is filtered by WAF and CDN before reaching the API Gateway, which enforces
authentication and rate limiting. Internal services communicate exclusively through a service mesh
with mTLS and fine-grained authorization policies. Data is protected at rest and in transit with
industry-standard encryption. Comprehensive observability ensures threats are detected rapidly. This
architecture is scalable, resilient, and aligned with modern cloud-native security best practices.
Q13. Develop a detailed security framework for addressing threats in API
communications.

1. Introduction
An API Security Framework is a structured, comprehensive set of policies, controls, processes, and
standards that govern how API communications are secured across the entire API lifecycle — from
design and development through deployment, monitoring, and decommissioning. This framework
addresses the full threat landscape identified by OWASP, NIST, and ISO 27001, providing a
practical, implementable reference for securing API communications in enterprise environments.

2. Framework Structure
This framework is organized into six pillars:
• Pillar 1: Governance & Policy
• Pillar 2: Identity & Access Management
• Pillar 3: Data Protection & Encryption
• Pillar 4: Traffic Management & Availability
• Pillar 5: Detection & Response
• Pillar 6: Security Testing & Validation

3. Pillar 1: Governance & Policy


3.1 API Inventory & Classification
• Maintain a complete, up-to-date API inventory using API Gateway and service discovery.
• Classify all APIs by sensitivity: Public, Partner, Internal, Restricted.
• Assign security tier to each API based on data sensitivity and business impact.
• Document API ownership, consumer list, and compliance requirements.

3.2 API Lifecycle Management


Phase Security Activities

Design Threat modeling, security requirements, API contract definition

Development Secure coding standards, SAST, dependency scanning

Testing DAST, penetration testing, API security testing (OWASP ZAP)

Deployment Security review gate, IaC scanning, secret management

Operations Continuous monitoring, vulnerability management, patching

Decommission Revoke credentials, archive audit logs, notify consumers

3.3 Security Policies


• API Security Policy: Defines minimum security requirements for all APIs.
• Access Control Policy: Specifies who can access which APIs under what conditions.
• Data Handling Policy: Rules for PII, financial data, and health data in APIs.
• Incident Response Policy: Defines response procedures for API security incidents.
• Change Management Policy: Security review required for all API changes.
4. Pillar 2: Identity & Access Management
4.1 Authentication Controls
API Type Authentication Method Implementation

Public APIs OAuth2 Authorization Code + PKCE Auth0 / Keycloak

Partner APIs OAuth2 Client Credentials + mTLS Dedicated auth server

Internal APIs mTLS + SPIFFE SVID Istio service mesh

Admin APIs OAuth2 + MFA + IP Allowlist Privileged access management

Webhook APIs HMAC signature verification Event-driven validation

4.2 Authorization Framework


• RBAC (Role-Based Access Control): Assign permissions based on organizational roles.
• ABAC (Attribute-Based Access Control): Fine-grained policies based on user, resource, and
environment attributes.
• Object-Level Authorization: Every data access validated against ownership/permission.
• Scope Enforcement: JWT scopes validated at each endpoint before processing.
• Deny by Default: All access denied unless explicitly permitted.

4.3 Credential Management


• All credentials stored in HSM or secrets manager — never in code or config files.
• Automated rotation: API keys every 90 days, JWT signing keys every 30 days, mTLS certs
every 24 hours.
• Credential breach response: Immediate revocation within 15 minutes of detection.
• Zero standing privileges: Access granted just-in-time for specific operations.

5. Pillar 3: Data Protection & Encryption


5.1 Encryption Standards
Data State Algorithm Key Management

In Transit TLS 1.3, mTLS PKI, automatic cert rotation

At Rest AES-256-GCM Cloud KMS, HSM

JWT Tokens RS256 / ES256 JWKS endpoint, key rotation

Passwords Argon2id (cost=3, 64MB) Per-user salt

API Keys SHA-256 + salt (storage) Secrets Manager

Sensitive Payload JWE (RSA-OAEP-256) Asymmetric key pairs

5.2 Data Minimization


• APIs return only the data fields the requesting client has permission to access.
• Response filtering at the API Gateway level based on client scope.
• Sensitive fields masked in logs: card numbers, SSN, API keys.
• Pagination enforced on bulk data endpoints — no unlimited data dumps.
6. Pillar 4: Traffic Management & Availability
6.1 Rate Limiting Framework
API Tier Rate Limit Burst Action on Exceed

Public Free 60 req/min/key 100 for 10sec 429 + Retry-After

Public Standard 500 req/min/key 800 for 10sec 429 + notify

Partner 5000 req/min/key Custom Negotiate

Internal 50,000 req/min Burst allowed Circuit breaker

Auth endpoints 5 attempts/5min None Lockout + alert

6.2 Resilience Controls


• Circuit Breaker: Stop traffic to failing services after 5 consecutive failures within 30 seconds.
• Retry Policy: Max 3 retries with exponential backoff — avoid thundering herd.
• Timeout Enforcement: 30-second maximum for all API requests.
• Bulkhead Pattern: Isolate failure domains — one service's failure doesn't cascade.
• Graceful Degradation: Return cached or partial data when backend is unavailable.

7. Pillar 5: Detection & Response


7.1 Threat Detection Rules
Rule Threshold Response

Auth failure spike >20 failures/min from one IP Block IP + alert

BOLA pattern Sequential ID access >100/min Block user + investigate

Rate limit evasion Multiple IPs same user-agent pattern Block user-agent pattern

Unusual data volume >10x baseline data returned Alert + throttle

New geographic access First access from new country MFA challenge + alert

Admin API after hours Admin endpoint access 10PM-6AM Alert + require MFA

Credential stuffing >50 user accounts tried from IP Block IP + alert SOC

7.2 Incident Response Procedures


• P1 (Critical — active breach): 15-minute response, immediate containment, incident
commander.
• P2 (High — active attack): 1-hour response, enhanced monitoring, on-call security team.
• P3 (Medium — anomaly detected): 4-hour response, investigation, root cause analysis.
• P4 (Low — policy violation): 24-hour response, review and remediation.

7.3 Forensics Readiness


• Immutable audit logs retained for 12 months minimum.
• Log all auth events, data access, configuration changes, and security control actions.
• Maintain network flow logs for all API traffic segments.
• Chain of custody procedures for security evidence.

8. Pillar 6: Security Testing & Validation


8.1 Testing Framework
Test Type Frequency Tools

SAST (Static Analysis) Every commit SonarQube, Checkmarx, Semgrep

Dependency Scanning Daily Snyk, OWASP Dependency-Check

DAST (Dynamic Testing) Every release OWASP ZAP, Burp Suite Pro

API Contract Testing Every release Dredd, Postman/Newman

Penetration Testing Quarterly Internal red team / third party

Red Team Exercise Annually Full attack simulation

Chaos Engineering Monthly Chaos Monkey, Gremlin

8.2 Security Metrics & KPIs


• Mean Time to Detect (MTTD): Target < 15 minutes for P1 incidents.
• Mean Time to Respond (MTTR): Target < 1 hour for P1 incidents.
• API Vulnerability Remediation: Critical within 24hrs, High within 7 days, Medium within 30 days.
• Certificate Expiry: Zero expired certificates in production (automated monitoring).
• Security Test Coverage: 100% of API endpoints covered by automated security tests.

9. Framework Implementation Roadmap


Phase Timeline Key Deliverables

Phase 1: Foundation Month 1-2 API inventory, auth standards, TLS enforcement

Phase 2: Controls Month 3-4 OAuth2, rate limiting, WAF, encryption

Phase 3: Monitoring Month 5-6 SIEM integration, alerting, audit logging

Phase 4: Testing Month 7-8 DAST, pen testing, red team exercise

Phase 5: Optimize Ongoing Metrics review, continuous improvement

10. Conclusion
This API Security Framework provides a comprehensive, structured approach to securing API
communications across the complete threat landscape. By addressing governance, identity, data
protection, traffic management, threat detection, and continuous testing, organizations can
systematically eliminate API vulnerabilities and respond rapidly to emerging threats. The framework is
designed to be implemented incrementally, allowing organizations to prioritize the highest-risk
controls first and build a mature security posture over time. Adherence to this framework ensures
compliance with OWASP, NIST, GDPR, PCI-DSS, and ISO 27001 requirements while maintaining
the agility and scalability demanded by modern cloud-based API architectures.
— End of Answer Script —
Prepared as per Anna University Examination Pattern | CO3 – API Security

You might also like