Lesson 12: Login Protection, Sessions, Cookies and CSRF
F5 ASM CLASSROOM • LESSON 12
Level: Intermediate to advanced | Suggested study and lab time: 75 minutes
Instructor: Harpreet Singh Virdi, CISSP, CCSP
Start Here / Course Guide · All lessons
Protect a workflow, not just a page
Login protection requires understanding how the application authenticates a user and reports success or failure. A URL named /login tells you very little by itself. Some applications return HTTP 200 for both outcomes, use redirects, or authenticate through an external identity provider.
Separate the threats
Brute force involves repeated attempts to guess credentials. Credential stuffing uses credentials stolen elsewhere. Session hijacking abuses an existing authenticated session. Cross-site request forgery (CSRF) tricks a user's browser into submitting an unwanted authenticated action. These threats need different controls and cannot be solved by one generic “login security” switch.
Model login behavior
Record the login URL, method, username field, session behavior, and reliable success/failure indicators. For a supported login-page configuration, use indicators that match the application. Incorrect detection can classify normal logins as failures or miss attacks. Available brute-force, device, and session capabilities depend on your license and release.
Guided lab
- Create synthetic users in your isolated application and verify account recovery works.
- Record one successful and one unsuccessful login using sanitized requests and responses.
- Configure the supported login-page detection settings based on those observations.
- Begin with observation where supported. Confirm that the system distinguishes success and failure correctly.
- Run a small, bounded set of failed logins agreed for the lab. Record the detection period and threshold you selected; these are lab values, not production recommendations.
- Inspect the events, then test successful login and recovery after mitigation ends.
- Check the effect on two synthetic users sharing a source address to understand the risk of IP-based treatment.
Expected result: failed attempts are classified accurately, the intended response occurs, and ordinary users can still sign in. Stop the test if you cause unintended lockout.
Understand CSRF
A browser may automatically attach session cookies to requests. CSRF defenses help verify that a state-changing request belongs to the intended application interaction. Application anti-CSRF tokens, suitable cookie settings, and origin-related checks form part of the design. Where using ASM CSRF features, verify their documented prerequisites and behavior for your version.
Browser-oriented protections can depend on inserted cookies, tokens, or page processing. APIs, mobile clients, cross-domain flows, and modern frontends may behave differently. Test them explicitly. CORS settings are not a universal substitute for CSRF protection or authorization.
Mini-exercise
Draw the journey from login to adding a delivery address to logout. Mark which requests change state, what proves identity, and what proves that each action is authorized. Identify where a CSRF defense is expected.
Knowledge check
Why can blocking one IP after repeated failures affect innocent users?
Instructor answer
Many users can share an outward-facing address through NAT or a proxy. An IP is not a unique user identity. Select and test supported detection and mitigation scopes with that limitation in mind.
Further reading
- F5 documentation: changing security policy settings
- F5 documentation: mitigating brute force attacks
- F5 documentation: preventing session hijacking and tracking user sessions
Independent educational material. Menus, defaults, and feature availability vary by BIG-IP release and license. Use the documentation for your installed version. Perform exercises only in your authorized lab. Examples and expected results are instructional; these labs have not been executed on a BIG-IP device for this blog.
Comments
Post a Comment