Authentication
Overview
Many applications have functionality behind authentication - admin panels, user dashboards, API endpoints requiring authorization, and more. To test these protected areas, Pensar needs authentication credentials. This guide explains how to provide credentials so the AI agent can authenticate and test your entire application surface.
Authentication credentials are provided when adding domains to your project. They’re stored securely and only used during penetration testing.
Why Provide Authentication?
Testing authenticated areas of your application is critical for comprehensive security coverage:
Test for broken access control, privilege escalation, and improper authorization checks.
Access endpoints and functionality that require authentication, dramatically increasing test coverage.
Discover Insecure Direct Object Reference (IDOR) vulnerabilities where users can access other users’ data.
Test session management, token handling, and authentication mechanism security.
Supported Authentication Types
Pensar supports multiple authentication mechanisms:
Username & Password
Bearer Token
Custom Headers
The most common authentication method for web applications.
What to Provide
- Username or Email: The credential used to log in
- Password: The corresponding password
- Role: Description of the user role (e.g., “admin”, “standard user”, “manager”)
- Context: Detailed instructions on how to use these credentials for authentication
Example Configuration
Create a dedicated test account for Pensar rather than using production user credentials. This account should have representative permissions but not access to sensitive production data.
Adding Authentication Credentials
Authentication is configured when adding domains to your project:
Choose Authentication Type
Select the authentication method your application uses (username/password, bearer token, etc.).
The AI agent uses your provided context to understand how to authenticate. The more detailed your context, the better the agent can navigate authentication flows.
Context Examples
Providing good context is crucial for successful authentication. Here are examples:
Simple Login Form
Multi-Step Authentication
Security Best Practices
Use Test Accounts
Always create dedicated test accounts for Pensar:
- Don’t use production user accounts
- Don’t use accounts with access to real customer data
- Create accounts specifically for security testing
- Use realistic permissions but isolate from production data
Never provide credentials for accounts with access to sensitive production data or systems.
Limit Permissions
Test accounts should have representative permissions but be limited:
- Grant enough access to test key functionality
- Avoid overly privileged accounts (e.g., super admin)
- Use role-based access control to limit scope
- Test multiple permission levels by providing multiple accounts
Consider providing multiple test accounts with different roles:
- Regular user account
- Manager/power user account
- Limited admin account
Use Staging Environments
When possible, test against staging rather than production:
- Staging credentials can be less restrictive
- No risk to production data or systems
- More flexibility for destructive testing
- Easier to reset state between tests
Rotate Test Credentials
Regularly rotate and update test credentials:
- Change test account passwords periodically
- Regenerate API tokens regularly
- Remove unused test accounts
- Monitor test account activity
Secure Credential Storage
Pensar handles credentials securely:
- Credentials are encrypted at rest
- Transmitted only over secure connections
- Only used during active penetration tests
- Not logged or exposed in reports
- Accessible only to your workspace team
You can update or remove credentials anytime in the Console.
Testing Multiple User Roles
To comprehensively test authorization, provide credentials for multiple user roles:
Troubleshooting Authentication
If authentication isn’t working during testing:
Verify Credentials Manually
Test the credentials yourself:
- Log in manually using the provided credentials
- Ensure the credentials still work
- Verify the account hasn’t been locked or disabled
- Check that the credentials have expected permissions
Check Context Accuracy
Review your authentication context: - Are all steps clearly explained? - Is the login URL correct? - Are there any missing steps (e.g., CAPTCHAs, 2FA)? - Does the flow match the current application behavior?
Review Test Results
Check the test logs in Pensar Console: - Look for authentication error messages - Verify the agent is following your auth steps correctly - Check if rate limiting is blocking login attempts - See if sessions are expiring too quickly
Update Configuration
Update your authentication configuration:
- Provide more detailed context
- Use a different authentication method if available
- Generate new tokens or passwords
- Add troubleshooting notes for the agent
Example Configurations
Here are complete examples for common scenarios:
E-Commerce Application
SaaS Platform
Custom API Authentication
Next Steps
Learn how to add and verify domains where you’ll configure authentication.
Understand how authentication enhances whitebox penetration testing.
See how authentication credentials improve blackbox testing coverage.
Return to the getting started guide to continue setup.