Real World Example

Where You See This

  • CERT-In rules in India require companies to keep security logs for 180 days and report incidents within 6 hours — audit logging is a legal requirement, not a nice-to-have.
  • PCI DSS (for anyone handling card data) requires MFA for admin access, strong cryptography, and quarterly vulnerability scans.
  • Bug bounty programmes (Razorpay, Flipkart, Zomato) pay researchers mostly for A01 Broken Access Control bugs — IDOR on order and address APIs is the classic find.

ShopEase Go-Live Security Checklist

AreaCheckWhere in this course
AuthenticationGoogle/OTP login, MFA for sellers and admins, short-lived tokens with refresh rotationOAuth2, Custom Authentication
Authorizationdeny by default, scopes per API, ownership checks, access-matrix test passingResource Server, Testing Security
Brute forcerate limits at edge + app, account lockout, OTP limitsAccount Lockout and Rate Limiting
Transport and browserHTTPS everywhere, HSTS preload, CSP enforced, frame-ancestors noneSecurity Headers
Servicesevery service validates JWTs, client credentials between services, no identity headersSecuring Microservices
Secretsno secrets in Git (gitleaks in CI), secret manager in prod, key rotation planSecrets Management
DependenciesSpring Boot on a supported patch version, Dependabot + OWASP Dependency-CheckOWASP Top 10
Monitoringlogin/denial audit logs, alerts on failure spikes, logs maskedAuditing Logins

OWASP Dependency-Check

Dependency scanning in the GitHub Actions pipeline:

./mvnw -q org.owasp:dependency-check-maven:check -DfailBuildOnCVSS=7

Example output

[INFO] Checking for updates and analyzing dependencies for vulnerabilities
[INFO] Analysis Complete (4 seconds)
[WARNING]
One or more dependencies were identified with known vulnerabilities in shopease:
commons-fileupload-1.4.jar (pkg:maven/commons-fileupload/[email protected]) : CVE-2023-24998
[ERROR] Failed to execute goal org.owasp:dependency-check-maven:check: One or more dependencies have CVSS score >= 7.0

Exercise: A tester reports: "GET /api/orders/1077/invoice returns another customer's invoice PDF." Which OWASP category is this, and how do you fix it in ShopEase?

Show answer
Category: A01 Broken Access Control (an IDOR).

Fix in the service, not only in the controller:

@PreAuthorize("hasAuthority('SCOPE_orders.read')")
public byte[] invoice(Long orderId, String callerId, boolean isAdmin) {
    Order order = orders.findById(orderId).orElseThrow(() -> new OrderNotFoundException(orderId));
    if (!isAdmin && !order.getCustomerId().equals(callerId)) {
        throw new OrderNotFoundException(orderId);   // 404, do not reveal that it exists
    }
    return invoiceRenderer.render(order);
}

Then add rows to AccessMatrixTest: another customer -> 404, owner -> 200, admin -> 200.