View a markdown version of this page

Providing test credentials for penetration testing - AWS Continuum

Providing test credentials for penetration testing

Provide credentials to enable AWS Continuum to test authenticated areas of your web applications. Without credentials, AWS Continuum can test only publicly accessible pages and APIs.

Important

Some identity providers block sign-in from automated browsers under their own anti-automation policies. A provider that does this can refuse the browser of AWS Continuum before it evaluates your credentials. Sign-in then fails even though the credentials are valid. Each provider controls whether it applies these checks and when.

If your application delegates sign-in to such a provider, provide a credential that AWS Continuum can replay rather than earn by signing in. For more information, see Selecting a static credential from AWS Secrets Manager and Penetration test sign-in blocked by an identity provider.

Configuring authentication credentials

You add credentials on the Credentials page of the penetration test workflow. Each credential is a login. For each login, you choose a credential provider.

To add a login
  1. In the penetration test creation workflow, go to the Credentials page.

  2. Choose Add login, and then enter a Login name that is unique within this penetration test.

  3. For Target URL, choose the URL where the test uses these credentials. You must choose it from the list of target URLs of the test.

  4. For Credential provider, choose how to provide the credentials. For the options, see the following sections.

Choose Create new credential to enter credentials directly. It's best for development and testing environments. For production environments and sensitive credentials, use AWS-native credential management. With it, you choose one of the following credential providers:

  • IAM role – For applications that use Amazon Cognito or IAM authentication

  • Secrets Manager – For secure credential storage with encryption and rotation

  • Lambda – For dynamic credential generation or complex authentication flows

Important

Use test accounts with representative access rather than personal or administrative accounts. Test against a non-production environment, and don't use an account that has access to production systems.

Entering credentials directly

To enter credentials directly
  1. For Credential provider, choose Create new credential.

  2. Enter the user name and password.

To add two-factor authentication and save the credential
  1. (Optional) For applications that require two-factor authentication, provide a time-based one-time password (TOTP) secret. You can do either of the following:

    • Enter the TOTP secret directly, for example totp-secret, or enter the full otpauth://totp/ URI, for example otpauth://totp/ExampleCorp:user@example.com?secret=totp-secret&issuer=ExampleCorp.

    • Choose the upload icon to upload a QR code image from the setup page of your authenticator app. AWS Continuum scans the QR code locally and extracts the TOTP URI automatically.

    When you provide a TOTP secret, AWS Continuum generates fresh one-time codes and enters them when it detects a two-factor authentication prompt during sign-in.

  2. Enter usage instructions that describe how to sign in with these credentials. To start from a worked example, choose one of the examples below the field, and then edit the inserted text.

  3. Choose Save, or choose Save and test to save the credential and test the sign-in right away. For more information about testing, see Credentials.

Using AWS-native credential management

When you choose IAM role, Secrets Manager, or Lambda, AWS Continuum retrieves your credentials directly from the AWS resource by using the service role of the environment. Enter usage instructions to tell AWS Continuum how to apply those credentials to your application. For example, state which login URL to go to and which form fields to fill in.

Note

Secrets Manager secrets, Lambda functions, and IAM roles must be in the same AWS account as your environment. AWS Continuum doesn't support cross-account credentials.

The service role of the environment needs permissions for the resource. For the policies, see Permissions policies.

Selecting an IAM role for AWS Continuum to assume

Use this option for applications that use Amazon Cognito, Amazon API Gateway with IAM authentication, or other AWS-native authentication systems. AWS Continuum assumes the role at the start of each penetration test run. It then uses the returned temporary credentials to sign requests to your application.

To configure the IAM role
  1. Add the role to your environment. You can choose only roles that you added to the environment as a login credential in the penetration test configuration.

  2. Configure the trust policy of the role so that AWS Continuum can assume it. Use the same trust policy as the service role. For the policy, see Trust policy.

The role also needs permissions to access the authentication system of your application, such as API Gateway or Amazon Cognito.

Selecting a static credential from AWS Secrets Manager

Use this option to retrieve credentials securely from AWS Secrets Manager with encryption, rotation, and access auditing.

The service role must have secretsmanager:GetSecretValue and secretsmanager:DescribeSecret permissions.

AWS Continuum retrieves the secret value directly from Secrets Manager. Use the usage instructions to tell AWS Continuum how to apply the credentials to the sign-in flow of your application. For example, state which URL to go to and which form fields to fill in. You can use any format to store your secret, because AWS Continuum interprets the format by using your instructions.

For example, if AWS Continuum is to submit a user name and password sign-in form at https://example.com/login, you can format your secret as JSON with username and password fields. If the application requires TOTP-based two-factor authentication, include a totpSecret field with either the TOTP secret or a full otpauth://totp/ URI:

{ "username": "username", "password": "password", "totpSecret": "totp-secret" }
  • username – The user name that AWS Continuum signs in with

  • password – The password for that user

  • totpSecret – (Optional) The TOTP secret or a full otpauth://totp/ URI. Include it only if the application uses TOTP-based two-factor authentication.

To configure the authentication instructions
  1. Set Target URL to https://example.com, or to any other URL that you choose from the list of target URLs.

  2. Enter the following usage instructions: "Navigate to https://example.com/login and enter the provided username and password into the form."

As another example, if you have an API key to provide in an HTTP header, you can store it as plaintext:

"api-key"

Then enter the following usage instructions: "Set the X-API-Key header to the provided API key for all requests."

Important

AWS Continuum supports TOTP-based two-factor authentication and email-based multi-factor authentication (MFA). It doesn't support SMS, push notifications, or hardware keys. For applications that send a one-time code or verification link by email, see Configuring email MFA.

Selecting a Lambda function to retrieve credentials dynamically

Use this option for complex authentication systems, dynamic credential generation, or integration with external identity providers.

The service role must have lambda:InvokeFunction permissions, and the function must complete within 30 seconds.

When the penetration test runs, AWS Continuum invokes your AWS Lambda function synchronously. It passes an event that identifies the penetration test and the credential that it's resolving:

{ "pentest_arn": "pentest-arn", "actor_identifier": "Credential1" }
  • pentest_arn – The Amazon Resource Name (ARN) of the penetration test that the credential is being resolved for. Use it to scope, authorize, or audit the request within your function.

  • actor_identifier – The login name that you assigned to this credential in the console, for example Credential1. Use it to return the correct credential when a single function serves multiple credentials.

AWS Continuum uses the output of the function directly as the credential. Use the usage instructions to tell AWS Continuum how to apply the credentials to your application, the same way that you do with Secrets Manager. For examples of how to format the output of your function, see Selecting a static credential from AWS Secrets Manager.

Configuring email MFA

Use email MFA when your application sends a one-time code or verification link by email as part of its authentication flow. If your application uses an authenticator app instead, provide a TOTP secret as described in Entering credentials directly.

When you enable email MFA, AWS Continuum generates a unique email address for each credential. During sign-in, AWS Continuum reads the messages that arrive at this address and submits the code or link to complete authentication. You can also view these messages yourself, as described in Viewing email MFA messages.

You can use the address in two ways, depending on whether you test with a new user account or an existing mailbox:

  • Sign up a test user with the address – Enter the address as the email address when you create a test user in your application. Your application sends its MFA messages to the address directly, so you don't need your own mailbox or a forwarding rule. To open a verification message that your application sends when it creates the account, see Viewing email MFA messages.

  • Forward from your own mailbox – Keep using an existing test account, and create a rule in your email provider that forwards only the MFA messages of your application to the address. For more information, see Setting up email forwarding.

Note

Email MFA is available for both directly entered credentials and AWS-native credential providers.

Enabling email MFA

To enable email MFA
  1. On the Credentials page, add a login and enter your credentials as described earlier in this topic.

  2. Expand the two-factor authentication settings, and then choose Email MFA.

  3. Create the penetration test. AWS Continuum then displays the email MFA forwarding address for the credential. You can't choose this address yourself.

  4. Copy the address. Then either sign up a test user in your application with it, or configure forwarding in your email provider.

If you dismiss the display before you copy the address, you can retrieve it later from the configuration page of the penetration test. The page shows the email MFA forwarding address for each credential.

Setting up email forwarding

Create a separate forwarding rule for each credential that uses email MFA. The general steps are the same for every provider:

  1. Sign in to the email account that receives the MFA messages of your application.

  2. Create a rule that matches only the MFA messages of your application. For example, match on the sender address or on a subject line that identifies the message.

  3. Set the rule to forward matching messages to the MFA forwarding address that you copied.

  4. Send a test MFA message from your application, and then confirm that the rule forwards it.

Some providers send a verification message to the destination address and require you to open a link in that message before forwarding begins. You can complete this step by viewing the verification message as described in Viewing email MFA messages.

The following providers support forwarding to the MFA forwarding address:

  • Gmail and Google Workspace – Add the address under Settings, Forwarding and POP/IMAP. Open the verification message that Gmail sends to it. Then create a filter that forwards only the MFA messages of your application. Leave blanket forwarding disabled so that Gmail forwards only the messages that your filter matches. For more information, see Automatically forward Gmail messages to another account in the Google documentation.

  • Microsoft 365 and Outlook – Create an inbox rule that forwards or redirects matching messages. For more information, see Use rules to automatically forward messages in the Microsoft documentation.

  • Yahoo Mail – Use a Yahoo account dedicated to testing, because Yahoo forwards the whole account rather than selected messages. Forwarding requires a Yahoo Mail Plus subscription, and Yahoo doesn't offer it in all locales. For more information, see Enable automatic email forwarding in Yahoo Mail in the Yahoo documentation.

  • iCloud Mail – Create a rule that forwards matching messages. Each rule forwards to one address. For more information, see Automatically forward email in Mail on iCloud.com in the iCloud User Guide.

  • Custom domains and self-hosted mail servers – Add a server-side alias, sieve rule, or filter that forwards only the matching messages. For more information, consult the documentation of your mail server.

Note

You can also forward MFA messages manually. Because MFA codes expire quickly, forward each message to the MFA forwarding address as soon as it arrives during sign-in.

Important

Forward only the MFA messages of your application. Don't forward your entire inbox. A narrow rule keeps unrelated email out of the penetration test and limits what your rule sends to AWS Continuum.

Viewing email MFA messages

You can view the messages that arrive at the MFA forwarding address of a credential. Use this to read a verification link when you sign up a test user with the address. You can also use it to confirm that your forwarding rule works, or to troubleshoot a sign-in that failed at the MFA step.

To view the messages in the console, open the penetration test and choose its configuration page. The page lists each credential with its own email MFA forwarding address. Choose View inbox under the address for the credential whose messages you want to read.

Data retention

AWS Continuum stores the messages that it receives at the forwarding address only to complete the penetration test sign-in. You can view a message only during the 24 hours after it arrives.

Configuring multiple credentials

To test different user roles or authentication systems, do the following:

  1. On the Credentials page, choose Add login.

  2. Configure the additional credential by using any of the credential providers.

  3. To remove a credential, choose the remove icon in its row.