CASE Java Course Outline
CASE Java Course Outline
Course Outline
SRE Phases
o Security Requirement Elicitation
o Security Requirement Analysis
o Security Requirement Specification
o Security Requirement Management
Common Mistakes Made in Each Phase of SRE
Different Security Requirement Engineering Approaches/Model
Abuse Case and Security Use Case Modeling
Abuse Cases
Threatens Relationship
Abuse Case Modeling Steps
Abuse Cases: Advantages and Disadvantages
Abuse Case Template
Security Use Cases
Security Use Cases are Abuse Case Driven
Modeling Steps for Security Use Cases
Mitigates Relationship
Abuse Case vs Security Use Case
Security Use Case: Advantages and Disadvantages
Security Use Case Template
Security Use Case Guidelines
Example 1: Use Case for Online Bidding System
Example 1: Abuse Case for Online Bidding System
Example 1: Security Use Case for Online Bidding System
Example 2: Use Case for ATM System
Example 2: Abuse Case for ATM System
Example 2: Security Use Case for ATM System
Example 3: Use Case for E-commerce System
Example 3: Abuse Case for E-commerce System
Example 3: Security Use Case for E-commerce System
o Fail Securely
o Apply Defense in Depth
o Do Not Trust User Input
o Reduce Attack Surface
o Enable Auditing and Logging
o Keep Security Simple
o Separation of Duties
o Fix Security Issues Correctly
o Apply Security in Design Phase
o Protect Sensitive Data
o Exception Handling
o Secure Memory Management
o Protect Memory or Storage Secrets
o Fundamentals of Control Granularity
o Fault Tolerance
o Fault Detection
o Fault Removal
o Fault Avoidance
o Loose Coupling
o High Cohesion
o Change Management and Version Control
Threat Modeling
Threat Modeling Phases
o Attack Surface Evaluation
o Threat Identification
o Impact Analysis
o Control Recommendations
Threat Modeling Process
o Identify Security Objective
o Application Overview
o Decompose Application
o Identify Threats
o Identify Vulnerabilities
Identify Security Objective
o How to Identify Security Objectives
Create an Application Overview
Draw the End-to-End Deployment Architecture
Identify Various User Roles
Identify Use Cases Scenarios
Identify Technologies
Identify Application Security Mechanisms
Decompose Application
Prepare and Document Threat Model Information
o Example: Threat Model Information
Identify the External Dependencies
o External Dependencies: Example
Identify the Entry Points
o Entry Points: Example
Identify the Assets
o Assets: Example
Identify the Trust Levels
o Trust Levels: Example
Define Trust Levels to Entry points
Define Trust Levels to Assets
Perform Application Modelling using Data Flow Diagrams (DFDs)
Determine the Threats: Identify the Goal of an Attacker and Create Threat Profile
o Example: Attacker’s Goal/Threat Profile and Vulnerabilities Associated
Determine the Threats: Create a Security Profile
Identify the Threats
o The STRIDE Model
Example: Threat Categorized and Identified using STRIDE
Determine Countermeasures and Mitigation Security Controls
Types of Authentication
Declarative vs Programmatic Authentication
Declarative Security Implementation
Programmatic Security Implementation
Java EE Authentication Implementation Example
Basic Authentication
How to Implement Basic Authentication?
Form-based Authentication
Form-based Authentication Implementation
Implementing Kerberos-Based Authentication
Secured Kerberos Implementation
Client Certificate Authentication
Certificate Generation with Keytool
Implementing Encryption and Certificates in Client Application
Authentication Weaknesses and Prevention
Brute Force Attack
Web-based Enumeration Attack
Weak Password Attacks
Introduction to Authorization
JEE Based Authorization
o Declarative
o Programmatic
Access Control Model
Discretionary Access Control (DAC)
Mandatory Access Control (MAC)
Role-based Access Control (RBAC)
Servlet Container
Authorizing Users by Servlets
EJB Authorization
EJB Authorization Controls
Declaring Roles
HTTP Authentication Schemes
Authorization Common Mistakes and Countermeasures
Common Mistakes
Authentication and Authorization in Spring Security Framework
Spring Security Framework
Spring Security Modules
Spring Authentication
Storing Username and Password
Securing Authentication Provider
Implementing HTTP Basic Authentication
Form-based Authentication
Implementing Digest Authentication
Security Expressions
URL-based Authorization
JSP Page Content Authorization
JSP Page Content Authorization with Domain Object’s ACL
Method Authorization
Configuring Anonymous Login
Logout Feature Configuration
Remember-Me Authentication
Integrating Spring Security with JAAS
Spring JAAS Implementation
Defensive Coding Practices against Broken Authentication and Authorization
Do Not Store Password in Java String Object
Avoid Cookie based Remember-Me Use Persistent Remember-Me
Implement Appropriate Session Timeout
Prevent Session Stealing by Securing SessionID Cookie
Secure Development Checklists: Broken Authentication and Session Management
o PasswordEncoder
Implementing BCryptPasswordEncoder()
Configuring BCryptPasswordEncoder() in Spring Security
JavaScript Object Signing and Encryption (JOSE)
Attacks against JWT, JWS and JWE
Implementing JWS using Jose4J
Implementing JWE using Jose4J
Implementing JWK using Jose4J
Dos and Don’ts in Java Cryptography
Dos and Don’ts
o Avoid using Insecure Cryptographic Algorithms
o Avoid using Statistical PRNG, Inadequate Padding and Insufficient Key Size
o Implement Strong Entropy
o Implement Strong Algorithms
Best Practices for Java Cryptography
Module 09 Static and Dynamic Application Security Testing (SAST & DAST)
Static Application Security Testing
Static Application Security Testing (SAST)
Objectives of SAST
Why SAST
Skills required for SAST
What to look for in SAST
Common Vulnerabilities Identified Through SAST
Types of SAST
o Automated Source Code Analysis
o Manual Source Code Review
Where does Secure Code Review Fit in SDLC?
SAST Steps
SAST Activities- flow Chart
Recommendation for Effective SAST
SAST Deliverable
Automated Source Code Analysis
o Static Code Analysis using Checkmarx Static Code Analysis
o Static Code Analysis using Visual Code Grepper (VCG)
o Static Code Analysis using HP Fortify
o Static Code Analysis using Rational AppScan Source Edition
Selecting Static Analysis Tool
Manual Secure Code Review
Manual Secure Code Review for Most Common Vulnerabilities
Code Review for PCI DSS Compliance
Code Review for Blacklisting Validation Approach
Code Review for Client-side Validation Approach
Code Review for Non-parametrized SQL Query
Code Review for XSS Vulnerability
Code Review for Weak Password Authentication
o Authorization
o Session Management
o Cryptography
o Exception Handling
o Logging
SAST Finding
SAST Report
SAST Reporting
Dynamic Application Security Testing (DAST)
Types of DAST
o Automated Application Vulnerability Scanning
o Manual Application Penetration Testing
SAST Vs DAST
Automated Application Vulnerability Scanning Tools
Web Application Security Scanners
o WebInspect
o IBM SecurityAppScan
Additional Web Application Vulnerability Scanners
Proxy-based Security Testing Tools
Burp Suite
OWASP Zed Attack Proxy (ZAP)
Additional Proxy-based Security Testing Tools
Choosing Between SAST and DAST
Check and Configure the Security of Machine Hosting Web Server, Application
Server, Database Server and Network Devices
Physical Security
Host Level Security
Ensuring Security at Network Level
Network Level Security
o Router
o Firewall
o Switch
Ensuring Security at Application Level
Web Application Firewall (WAF)
o Benefits of WAF
o WAF Limitations
o WAF Vendors
Ensuring Security at Web Container Level (Tomcat)
Install and Configure Tomcat Securely
Remove Server Banner
Start Tomcat with Security Manager
Configure Default Servlet Not to Serve Index Pages
Replace Default Error Page
Replace Default server.xml
Protect Shutdown Port
Restrict Access to Tomcat Manager Applications
Protecting Resources with Realms
Store Passwords as Digest
Do Not Run Tomcat as Root
Configure Restricted Datasets
Session Handling using App Mode in Tomcat
Role Based Security
Securing Tomcat at Network level
Java Runtime Security Configurations