Identity-based policy examples for 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.
Penetration testing policies in this guide use the continuum: action prefix and the pentesting.continuum.amazonaws.com service principal. AWS Security Agent policies use the securityagent: prefix and the securityagent.amazonaws.com service principal. A policy written for one service doesn't work for the other.
By default, your users and roles don't have permission to create or modify penetration testing resources, or to start runs. Your AWS Identity and Access Management (IAM) administrator must create IAM policies that grant these permissions, and then attach the policies to the users, groups, or roles that need them. Creating and attaching these policies requires administrator access. If you aren't an administrator, ask your IAM administrator to do it for you.
The following examples use the continuum action prefix. For more information
about the actions that penetration testing uses, see Actions for penetration testing. For more information about policy best practices, see
Policy best practices. For more information about
creating a policy from one of these examples, see Creating policies using the JSON editor in the IAM User Guide.
These examples grant the actions on all resources ("Resource": "*"). They don't
include actions for managing integrations, such as continuum:CreateIntegration. For
more information about other policy examples, see Identity-based policy examples for AWS Continuum.
Example: Give administrators full access to penetration testing
Use this policy to give administrators full access to penetration testing. To create and attach this policy, you need administrator access to your AWS account. If you aren't an administrator, ask one to create the policy for you. With this policy, you can create environments and penetration tests, manage target domains, start and stop runs, update findings, and start code remediation.
The ManagePenetrationTesting statement grants the penetration testing
actions. The ManageEnvironments statement grants the actions to create, view,
update, and delete environments. This policy doesn't include iam:PassRole. To let
users pass the environment's service role to AWS Continuum, also attach the policy in Example: Pass the service role to AWS Continuum.
The following policy grants full access to penetration testing actions and environments:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ManagePenetrationTesting", "Effect": "Allow", "Action": [ "continuum:ListPentests", "continuum:BatchGetPentests", "continuum:ListPentestJobsForPentest", "continuum:BatchGetPentestJobs", "continuum:BatchGetPentestJobContentMetadata", "continuum:ListPentestJobTasks", "continuum:BatchGetPentestJobTasks", "continuum:ListPentestActorMessages", "continuum:ListPentestFindings", "continuum:BatchGetPentestFindings", "continuum:ListPentestDiscoveredEndpoints", "continuum:ListPentestDiscoveredDomains", "continuum:ListPentestThreats", "continuum:BatchGetPentestThreats", "continuum:ListPentestThreatModelRunsForPentest", "continuum:BatchGetPentestThreatModelRuns", "continuum:BatchGetPentestLoginValidationRuns", "continuum:ListTargetDomains", "continuum:BatchGetTargetDomains", "continuum:ListPentestArtifacts", "continuum:GetPentestArtifact", "continuum:BatchGetPentestArtifactMetadata", "continuum:ListPentestIntegratedResources", "continuum:StartPentestJob", "continuum:StopPentestJob", "continuum:CreatePentest", "continuum:UpdatePentest", "continuum:BatchDeletePentests", "continuum:UpdatePentestFinding", "continuum:StartPentestCodeRemediation", "continuum:UpdatePentestDiscoveredDomains", "continuum:StartPentestLoginValidationRun", "continuum:StartPentestThreatModelRun", "continuum:StopPentestThreatModelRun", "continuum:CreateTargetDomain", "continuum:UpdateTargetDomain", "continuum:DeleteTargetDomain", "continuum:VerifyTargetDomain", "continuum:CreatePentestArtifact", "continuum:DeletePentestArtifact", "continuum:ListPentestResourcesFromIntegration", "continuum:UpdatePentestIntegratedResources" ], "Resource": "*" }, { "Sid": "ManageEnvironments", "Effect": "Allow", "Action": [ "continuum:GetEnvironment", "continuum:ListEnvironments", "continuum:CreateEnvironment", "continuum:UpdateEnvironment", "continuum:DeleteEnvironment" ], "Resource": "*" } ] }
Example: View penetration tests, runs, and findings
Use this policy for users who only review results. With this policy, you can view environments, penetration tests, runs and their tasks, findings, threats, target domains, and artifacts. You can't create, change, or delete anything, and you can't start or stop a run.
The following policy grants read-only access to penetration tests, runs, and findings:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ViewPenetrationTests", "Effect": "Allow", "Action": [ "continuum:ListPentests", "continuum:BatchGetPentests", "continuum:ListPentestJobsForPentest", "continuum:BatchGetPentestJobs", "continuum:BatchGetPentestJobContentMetadata", "continuum:ListPentestJobTasks", "continuum:BatchGetPentestJobTasks", "continuum:ListPentestActorMessages", "continuum:ListPentestFindings", "continuum:BatchGetPentestFindings", "continuum:ListPentestDiscoveredEndpoints", "continuum:ListPentestDiscoveredDomains", "continuum:ListPentestThreats", "continuum:BatchGetPentestThreats", "continuum:ListPentestThreatModelRunsForPentest", "continuum:BatchGetPentestThreatModelRuns", "continuum:BatchGetPentestLoginValidationRuns", "continuum:ListTargetDomains", "continuum:BatchGetTargetDomains", "continuum:ListPentestArtifacts", "continuum:GetPentestArtifact", "continuum:BatchGetPentestArtifactMetadata", "continuum:ListPentestIntegratedResources" ], "Resource": "*" }, { "Sid": "ViewEnvironments", "Effect": "Allow", "Action": [ "continuum:GetEnvironment", "continuum:ListEnvironments" ], "Resource": "*" } ] }
Example: Start and stop runs
Use this policy for users who run existing penetration tests but don't create, change, or
delete them. In addition to the view permissions, you can start and stop runs, including threat
model runs. Starting a
revalidation run uses the same continuum:StartPentestJob action as starting a full
run, so you can also revalidate findings. For more information about revalidating findings, see
Revalidating penetration test findings.
You can't use this policy to change a finding's status or to start code remediation, because those actions change your findings and can open pull requests.
This policy grants only the permissions to start and stop runs. Attach it together with the policy in Example: View penetration tests, runs, and findings, which grants the permissions to view penetration tests, runs, and findings.
The following policy grants the permissions to start and stop runs:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "StartAndStopRuns", "Effect": "Allow", "Action": [ "continuum:StartPentestJob", "continuum:StopPentestJob", "continuum:StartPentestThreatModelRun", "continuum:StopPentestThreatModelRun" ], "Resource": "*" } ] }
Example: Pass the service role to AWS Continuum
When you create or update an environment that uses an IAM role, you need permission to pass
that role to AWS Continuum. Use this policy to grant that permission for a single role. The
iam:PassedToService condition limits the permission to
pentesting.continuum.amazonaws.com, so the role can't be passed to another
service. For more information about the service role, see Service role for penetration testing.
Replace with your AWS account ID.
Replace account-id with the IAM path of the role, and
role-path with the name of the role. The console accepts
a role from any path. When the console creates the role for you, the role is in the
role-name/service-role/ path. For a role in the root path, omit the path and its
slash.
The following policy grants permission to pass one role to AWS Continuum:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PassPenetrationTestingServiceRole", "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::account-id:role/role-path/role-name", "Condition": { "StringEquals": { "iam:PassedToService": "pentesting.continuum.amazonaws.com" } } } ] }