Getting started with penetration testing
This guide covers Continuum for penetration testing, which you use in the AWS Continuum console. If you run penetration tests in the AWS Security Agent console or web application, see the AWS Security Agent User Guide instead. For the differences, see Comparing Continuum for penetration testing and AWS Security Agent.
To start using AWS Continuum for penetration testing, you create an environment. An environment groups the target domains, AWS resources, and access settings that you use to test one application.
Prerequisites
Before you begin, make sure that you have the following:
-
Permissions to create AWS Identity and Access Management (IAM) roles in your AWS account
-
A domain that you own, where you can add a DNS record or host a file
-
(White box tests) Source code or documents for your application. For code in GitHub or GitLab, create an integration for the source provider. You manage integrations in the navigation pane under Shared resources, Integrations. To create one, see GitHub or GitLab. For source archives, build artifacts, or application documents, use an Amazon S3 bucket.
-
(Optional) The virtual private cloud (VPC), subnets, and security groups that host your application, if the application isn't reachable from the internet
Creating an environment
Create an environment for each application that you want to test. When you finish, you have an environment with its own service role, ready for target domains and penetration tests. You can skip the optional pages and add those settings later.
If you already have an integration, you can also start from its details page. To do so, choose Create environment for penetration testing.
To start creating an environment
-
Open the AWS Continuum console at https://console.aws.amazon.com/continuum/
. -
In the navigation pane, under Penetration testing, choose Overview.
-
Choose Create Environment.
The console guides you through the setup in steps. The test scope that you choose in the first step decides which of the other steps appear.
To create and set up the environment
-
On the Test scope page, choose what you want the agent to test. Then choose Next.
-
Live endpoint, source code, and documentation – A white-box test. AWS Continuum tests your live application with source code or internal documents. This option combines external and context-informed testing. It requires a verified target domain and source code or documents. The console marks this option Recommended.
-
Live endpoint – A black-box test. AWS Continuum tests your live application from the outside, without source code or internal documents. This option is closest to what an external attacker can reach. It requires a verified target domain.
The console shows only the setup steps that apply to your choice. If you choose Live endpoint, the console omits the Source code and documentation step.
-
-
On the Create Environment page, for Environment name, enter a unique name of up to 255 characters. Then choose Next.
When you choose Next, AWS Continuum creates the environment. The remaining pages appear under Complete setup.
AWS Continuum encrypts the data of the environment with a key that AWS owns and manages for you. To change the service role, expand Advanced. The Service role is the IAM role that AWS Continuum uses to access resources in your account. Choose one of the following options:
-
Create default role – AWS Continuum creates the role and adds the necessary permissions policy. For Service role name, the console suggests a name that starts with
aws-continuum-pentest-, followed by a timestamp. You can change the name. The name can have up to 64 alphanumeric characters and the characters+=,.@-_. It can't contain spaces, and it must be unique across all roles in the account. -
Use an existing service role – Choose your own role. The role must already have the permissions listed after this procedure.
-
-
On the Target domains page, add and verify the domains that you want to test, or skip this step and add a domain later. Penetration tests run only against verified domains that you own. Then choose Save and next.
To add a domain, choose Add domain. To manage the domains in the table, select a domain, and then choose One-click verification, Verify, Update Domain, Remove Domain, or Manage tags.
If the domain is hosted in Amazon Route 53 in the same account, select the domain and choose One-click verification. The console creates and verifies the DNS record, and the Status column can show Auto verified. For a custom domain, copy the record name and verification token from the table, add them to your DNS provider, and then choose Verify. For details, see Verifying target domains.
-
(White box only) On the Source code and documentation page, add the source code or documents that the agent can use while testing. Then continue to the next step.
For details, see Source code and documentation settings.
-
(Optional) On the Additional configuration page, add the AWS resources that tests in this environment can use, for broader test coverage. Then choose Save and next.
For details, see Additional configuration settings.
-
On the Review page, review the saved environment configuration. Test types shows the type of test that the environment supports, such as White box with the status Available, and the table lists your target domains. Then choose Complete setup.
If you chose Use an existing service role, the role must already have the following:
-
A trust policy that the
pentesting.continuum.amazonaws.comservice principal uses to assume the role, limited by theaws:SourceAccountandaws:SourceArnconditions. The environment doesn't exist yet, so useenvironments/*inaws:SourceArn. -
The base permissions policy. For the policy, see Permissions policies.
When you choose resources on the Source code and documentation and Additional configuration pages, the console adds or updates the policies for those resources on the role. For more information about what the role must already have, see Trust policy and Permissions policies.
The environment appears on the Overview page.
Source code and documentation settings
The Source code and documentation page appears only for white-box tests. It lets you add the source code and documents that the agent can use while testing. White-box tests need source code or documents. The page has the following parts:
-
Connected integrations – The GitHub and GitLab integrations that this environment has access to. Use Settings and Add to manage them. To create an integration, see Integrations.
-
A section for each connected integration – The repositories of the integration that the environment uses.
-
S3 buckets – Buckets that hold source archives, build artifacts, or application documents.
Repositories
Each integration section lists its repositories in a table. The table has a Repository column and a Code remediation column. Use the buttons above the table, such as Add and Remove selected resources, to change the repositories. To search the table, use Find resources.
To add repositories
For more information about code remediation, see Remediating a penetration test finding.
Amazon S3 buckets
Choose Amazon S3 buckets if you plan to provide source archives, build artifacts, or application documents as input to AWS Continuum.
To add S3 buckets
-
On the Source code and documentation page, under S3 buckets, add your Amazon S3 bucket.
Make sure that the service role has permissions to read the bucket. For the policy, see Permissions policies.
You can also add GitHub or GitLab repositories, or upload files when you create a penetration test. The information that you provide helps AWS Continuum ensure thorough coverage, reduce false positives, and deliver actionable results. Amazon S3 integrations aren't used for penetration testing; add the bucket here instead.
Additional configuration settings
The Additional configuration page lets you add optional AWS resources for broader test coverage. All settings on this page are optional. The page groups the resources as follows. Choose a resource type to expand it.
-
Reach the target – The VPC, subnets, and security groups for an application endpoint that runs in a private network
-
Store test logs – Amazon CloudWatch Logs log groups where the agent stores logs from penetration tests
-
Provide test credentials – AWS Secrets Manager secrets and Lambda functions that hold sign-in credentials
Penetration tests in the environment can use only the resources that you choose here. The service role of the environment must have permissions for each resource. When you choose resource types on this page, the console adds or updates the policies for those resources on the role. For the policies, see Permissions policies.
Reach the target
If your application endpoint runs in a private network, such as test domains hosted within a VPC, select the VPC, subnets, and security groups that the agent uses to reach it.
To configure VPC settings
-
Under Reach the target, expand VPCs, and choose the VPC that hosts your private target domains.
-
Choose the VPC subnets that AWS Continuum should use.
TipFor high availability, choose multiple subnets from multiple Availability Zones. Make sure that your subnets include a NAT gateway for outbound connectivity.
-
Choose the VPC security groups that AWS Continuum should use.
ImportantMake sure that your security groups allow outbound connections for AWS Continuum to perform penetration testing.
For each penetration test, you then choose the VPC, subnet, and security group to use. For more information, see VPC resources.
Store test logs
Choose where the agent stores logs from your penetration test runs. The agent writes to Amazon CloudWatch Logs log groups.
To configure CloudWatch logging
-
Under Store test logs, expand CloudWatch logs, and then choose an existing Amazon CloudWatch Logs log group.
If you don't choose a log group, AWS Continuum creates one when the test runs. The log group
is named
aws-continuum/pentest/.environment-id/pentest-id
Make sure that the service role has permissions to write to the log groups that you choose. For the policy, see Permissions policies.
Provide test credentials
If your application requires authentication credentials for testing, AWS Continuum can securely retrieve them from AWS Secrets Manager secrets or Lambda functions. You can skip this group during setup. When you're ready, you can enter the credentials, and the console helps you store them securely in AWS Secrets Manager.
To configure resources for test credentials
-
Under Provide test credentials, expand Secrets, and then choose the AWS Secrets Manager secrets that contain credentials for your application.
-
Expand Lambda functions, and then choose the functions that can provide authentication credentials for your application. AWS Continuum invokes these functions during penetration tests to obtain credentials dynamically.
When you create a penetration test, you can reference these secrets and functions for authenticated testing. For details, including the format that a function returns, see Providing test credentials for penetration testing.
Make sure that the service role has permissions to read the secrets and invoke the functions. For the policies, see Permissions policies.
Checking that the environment is ready
Before you create a penetration test, confirm that the environment has what the test needs.
To check the environment setup
-
On the environment page, choose the Overview tab.
-
In Penetration testing setup, expand View setup details.
-
For each row that isn't configured, choose the link in the Actions column.
The setup table has the following rows:
-
Service role – Every test needs a service role.
-
Target domains – Every test needs at least one verified domain.
-
Source repositories – White-box tests need source code or documents.
-
Network access (VPC) – Only tests of private targets need VPC access.
When you configure the required rows, the setup shows that the environment is ready for black-box or white-box testing. The Review page of the setup also shows the test types that the environment supports.
Cleaning up
If you no longer need an environment, delete it. Target domains are shared, so deleting an environment doesn't delete them.
Deleting an environment also deletes its penetration tests, their runs, and their findings. You can't undo this action.
To delete an environment
-
In the navigation pane, under Penetration testing, choose Overview, and then choose the environment name.
-
Choose Delete Environment, and then confirm.
To delete a target domain, on the Target Domains page, select the domain and choose Delete.
Next steps
-
Verify your target domains. See Verifying target domains.
-
Create and run your first penetration test. See Creating a penetration test.
-
Review the findings of the run. A penetration test can take several hours to complete, depending on the size and complexity of your application. The run begins with a preflight phase that checks that your target endpoints are reachable before testing starts. If a preflight check fails, the run stops before testing begins. Open the Preflight tab to see which check failed, resolve it, and start a new run. See Viewing penetration test findings and Troubleshooting penetration tests.