Integrations
An integration connects AWS Continuum to a source provider, such as a GitHub organization, a GitLab group, or an Amazon S3 bucket. You create an integration once, and then choose it when you create an environment. The steps to create an integration are the same for every capability. An integration is a shared resource, so you manage it in the navigation pane under Shared resources.
The following table shows which capabilities use each integration.
| Integration | Code vulnerabilities | Penetration testing |
|---|---|---|
| GitHub | Yes | Yes |
| GitLab | Yes | Yes |
| Amazon S3 | Yes | No* |
*You can still provide source code from Amazon S3 in a penetration test. For more information, see Amazon S3 buckets.
Amazon S3 integrations apply only to code vulnerabilities. Penetration testing uses GitHub and GitLab integrations only.
AWS Continuum IP addresses
AWS Continuum connects to your source code repositories from a fixed set of IP addresses, one set per AWS Region. The same IP addresses are used for every supported source code provider: GitHub and GitLab. This includes GitLab self-managed instances that are reachable over the public internet.
If your repository provider or the network in front of it restricts access with an IP allow list, add the AWS Continuum IP addresses for your environment's AWS Region to that allow list. Wait a few minutes for the change to take effect, then create the integration. Examples include a GitHub organization IP allow list, a GitLab allowed IP range, or a firewall in front of a self-managed GitLab instance.
The following IP addresses are used to access your connected repositories:
-
US East (N. Virginia) (
us-east-1)-
34.228.181.128 -
44.219.176.187 -
54.226.244.221
-
-
US West (Oregon) (
us-west-2)-
34.212.16.133 -
52.89.67.212 -
54.187.135.61
-
GitHub
To use code hosted in GitHub, create a GitHub integration.
If your GitHub organization restricts access with an IP allow list, first add the AWS Continuum IP addresses. For more information, see AWS Continuum IP addresses.
Use a GitHub account that can install the GitHub app, or request approval from an organization owner.
To configure a GitHub integration
-
Open the AWS Continuum console at https://console.aws.amazon.com/continuum/
. -
In the navigation pane, under Shared resources, choose Integrations.
-
Choose Add integration.
-
For Source provider, select GitHub.
-
For Name, enter an integration name.
-
For GitHub account, select Personal account or Organization.
-
If you selected Organization, enter the GitHub organization name for Organization name.
-
If the GitHub app is not installed, choose Install GitHub app. Install the app in the account that you selected.
-
If GitHub requires organization approval, wait for an owner to approve the installation.
-
If you opened the GitHub installation tab, close it and return to the AWS Continuum console.
-
Choose Authorize with GitHub and create.
-
Complete authorization in the GitHub window.
-
Return to the AWS Continuum console.
-
If the console still shows Waiting for GitHub after you authorize, choose Cancel authorization. Start authorization again.
After you create the integration, you can choose it when you create an environment. For more information, see Next steps.
Troubleshooting GitHub integrations
Incorrect GitHub account
An access denied error occurs for one of the following reasons:
-
You installed the GitHub app in your GitHub organization, but you selected Personal account instead of Organization for GitHub account.
-
You selected Organization, but you left Organization name blank or entered a name that doesn't match the organization that you installed the app in.
To resolve this, do the following:
-
In GitHub, uninstall the app from the organization.
-
In the AWS Continuum console, restart the integration process by choosing Add integration. Install and authorize the app in your organization again.
-
For GitHub account, select Organization.
-
Make sure that the Organization name that you enter is exactly the same as the name of the organization that you installed the app in.
-
Choose Authorize with GitHub and create.
Insufficient GitHub permissions
When you install the GitHub app in an organization, the button on the installation page depends on your role. An organization member sees Authorize & Request. An organization owner sees Install & Authorize.
To verify whether you are a member or an owner, do the following:
-
Go to github.com, and choose your profile.
-
On the menu, choose Organizations.
-
Find the organization in the list. GitHub shows whether you are a member or an owner next to the organization name.
To verify the installation, AWS Continuum lists the apps that are installed in the organization. It uses the GitHub account that authorized the app. GitHub allows only organization owners to list installed apps. Registration fails for a member even after an owner approves the installation request of the member.
To resolve this, do one of the following:
-
Have an organization owner complete the whole integration process: install the app, authorize it, and create the integration in the AWS Continuum console.
-
Have an owner change your role in the GitHub organization from member to owner, and then restart the integration process.
GitLab
To use code hosted in GitLab, create a GitLab integration. AWS Continuum supports GitLab.com and self-managed GitLab instances, and connects to GitLab only over HTTPS.
If your GitLab group or self-managed instance restricts access by IP address, first add the AWS Continuum IP addresses. For more information, see AWS Continuum IP addresses.
A GitLab integration authenticates with a GitLab access token. You can use a personal, group, or project access token for a GitLab group or project. AWS Continuum validates the token when you create the integration. If the token can't access the group or project that you specify, AWS Continuum doesn't create the integration.
For code vulnerabilities, AWS Continuum works only with GitLab groups and projects whose visibility is Private. It doesn't support internal or public projects.
Create a dedicated access token for this integration, and don't reuse it with other tools.
If the token has the self_rotate scope, AWS Continuum rotates it automatically with a
90-day lifetime. Otherwise, replace the token before it expires. For more information about
securing GitLab integrations, see Security for GitLab integrations in AWS Continuum.
To configure a GitLab integration
-
Open the AWS Continuum console at https://console.aws.amazon.com/continuum/
. -
In the navigation pane, under Shared resources, choose Integrations.
-
Choose Add integration.
-
For Source provider, select GitLab.
-
For Name, enter an integration name.
-
For GitLab instance, select GitLab.com or a self-managed instance. If you select a self-managed instance, enter the instance URL. The URL must use HTTPS.
-
For Access token, enter a personal, group, or project access token with the
apiscope and at least the Maintainer role on the group or project. -
For What this integration reads, choose Group to read every project in a group, including subgroups. Choose Project to read a single project. You can't change this choice after you create the integration.
-
For Group path or Project path, enter the full path as it appears in the GitLab URL, such as
anycompany/platformoranycompany/platform/checkout.
After you create the integration, you can choose it when you create an environment. For more information, see Next steps.
Using a single project from GitLab
To use only one GitLab project, use a project integration, or use a group integration and select only that project in the environment.
To use a project integration
-
When you create the integration, for What this integration reads, choose Project.
-
For Project path, enter the project's full path. Use a personal or project access token with at least the Maintainer role on the project.
The integration reads only that project.
To use a group integration
-
When you create the environment, for Integration, select the group integration.
-
For Projects, enter only the project's path, such as
group/project. The project must be in the integration's group or one of its subgroups.
In the API, a project integration is a CreateIntegration request whose
gitlab configuration sets targetType to PROJECT and
targetPath to the project's full path. In CreateEnvironment, each
entry in repositorySources selects one project. Its repository
value is the project's full path.
Amazon S3
Amazon S3 integrations apply only to code vulnerabilities. Penetration testing doesn't use them.
Penetration tests can still use content in Amazon S3. Add the bucket in the Source code and documentation step of the environment setup instead. For more information, see Amazon S3 buckets.
To scan code stored in Amazon S3, prepare a bucket with your code. Create an AWS Identity and Access Management (IAM) role that grants AWS Continuum access to the bucket. Then create an Amazon S3 integration.
In the following example, replace amzn-s3-demo-bucket with your
bucket name. Replace my-app.zip with your package file name.
The example source URI is
s3://.
Its object key is amzn-s3-demo-bucket/code/my-app.zipcode/. The corresponding
Source code base path value is my-app.zipcode/.
To prepare an Amazon S3 source
-
Create an Amazon S3 bucket in the same account and AWS Region where you enable AWS Continuum.
-
Choose a prefix in the bucket for your source code, such as
code/. You configure this prefix when creating the environment. -
Upload your code under the chosen prefix as a .zip package. For instructions on uploading objects, see Uploading objects in the Amazon S3 User Guide.
-
In the Amazon S3 console, on Upload: status, confirm that the upload succeeded. If the upload fails, resolve the error before continuing.
Granting bucket access
As an administrator, create an IAM role in the same account as the bucket. The role
path must be /continuum/integrations/. The role needs a permissions policy for the
bucket and a trust policy so that AWS Continuum can assume the role.
In addition to the read permissions for the console, the IAM principal that creates the integration must have the following permissions:
-
continuum:CreateIntegrationto create the integration -
iam:ListRolesto select the integration role -
s3:ListAllMyBucketsto browse Amazon S3 buckets -
iam:PassRoleto pass the integration role
Restrict iam:PassRole to the integration role. Use the
iam:PassedToService condition key with the value
continuum.amazonaws.com.
For information about permissions required to create an integration in the console, see Allowing users to access the AWS Continuum console.
Save the following JSON permissions policy as integration-permissions.json.
Use it to let AWS Continuum list the bucket and read source objects and versions under your code
and context prefixes. It also grants AWS Continuum permission to upload and read patches under
continuum-patches/.
Grant s3:ListBucket without a condition. AWS Continuum uses this permission to
validate access to the bucket when you create the integration.
Use each configured prefix exactly, including any trailing slash. If you omit these values, the defaults are code/ and context/, respectively. Your source files can be stored under other prefixes, but the policy must grant access to those prefixes.
Replace bucket-name with the bucket used by your integration. Replace code-prefix with the Source code base path value. Replace context-prefix with the Knowledge documents base path value:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ListSourceBucket", "Effect": "Allow", "Action": [ "s3:ListBucket" ], "Resource": "arn:aws:s3:::bucket-name" }, { "Sid": "ReadSourcePrefixes", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:GetObjectVersion" ], "Resource": [ "arn:aws:s3:::bucket-name/code-prefix*", "arn:aws:s3:::bucket-name/context-prefix*" ] }, { "Sid": "DeliverContinuumPatches", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:GetObjectVersion" ], "Resource": "arn:aws:s3:::bucket-name/continuum-patches/*" } ] }
Use the following trust policy so that the AWS Continuum service principal,
continuum.amazonaws.com, can assume the role with an external ID. Replace
external-id with the external ID that you enter when creating the
integration. Save the policy as trust-policy.json:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ContinuumAccess", "Effect": "Allow", "Principal": { "Service": "continuum.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "sts:ExternalId": "external-id" } } } ] }
To create the role, configure the AWS CLI with a customer administrator principal that can create the role and attach an inline policy. Save both policy files in the current directory.
If a command fails, resolve the error before continuing. If create-role
returns EntityAlreadyExists, choose an unused role name and use it consistently
in these commands.
To create the integration role (AWS CLI)
-
Create the role with the required path.
PROMPT>aws iam create-role \ --role-name ContinuumIntegrationRole \ --path /continuum/integrations/ \ --assume-role-policy-document file://trust-policy.jsonThe command returns details of the new role.
-
Attach the bucket permissions as an inline policy.
PROMPT>aws iam put-role-policy \ --role-name ContinuumIntegrationRole \ --policy-name ContinuumIntegrationAccess \ --policy-document file://integration-permissions.jsonThis command produces no output on success.
-
Verify that the role's Amazon Resource Name (ARN) includes
role/continuum/integrations/.PROMPT>aws iam get-role \ --role-name ContinuumIntegrationRole \ --query 'Role.Arn' \ --output textThe output has the following format, where
account-idis your AWS account ID androle-nameis the role name that you used in the commands:arn:aws:iam::account-id:role/continuum/integrations/role-name
If a command returns an access denied error, ask your administrator to check your
permissions. These commands require iam:CreateRole, iam:PutRolePolicy,
and iam:GetRole, respectively.
For information about diagnosing policies that deny access, see Troubleshoot access denied error messages in the IAM User Guide.
Changes to IAM roles and policies can take time to become available. Before you use the role to create the integration, allow time for the changes to propagate. For more information, see Changes that I make are not always immediately visible in the IAM User Guide.
Keep the role and its policies while an integration uses them. When you no longer need an integration, first update or delete every environment that references it, and then delete the integration. After deleting every integration that uses the role, delete the role and its policies if no other workload uses them. For information about deleting roles, see Delete roles or instance profiles in the IAM User Guide.
For more information about external IDs, see Access to AWS accounts owned by third parties in the IAM User Guide.
Creating Amazon S3 integrations
After you prepare the bucket and IAM role, create an Amazon S3 integration. The integration connects the bucket and role so that an environment can access your code.
To configure an Amazon S3 integration
-
Open the AWS Continuum console at https://console.aws.amazon.com/continuum/
. -
In the navigation pane, under Shared resources, choose Integrations.
-
Choose Add integration.
-
For Source provider, select Amazon S3.
-
For Name, enter an integration name.
-
For S3 bucket, choose how to specify the bucket. Do one of the following:
-
To navigate to a bucket, choose Browse S3. Select your bucket.
-
To enter an ARN, choose Enter bucket ARN manually. For Bucket ARN, enter the bucket ARN.
-
-
For IAM role ARN, select the role that you created.
-
For External ID, enter the value required by the role's
sts:ExternalIdcondition. The integration value must match the trust policy value. -
Choose Create integration.
After you create the integration, you can choose it when you create an environment. For more information, see Next steps.
If access validation fails, check the required role path. Verify the integration role trust policy and matching external ID. Check that the role's permissions allow access to the bucket and prefixes that you use.
Customer managed keys
When you create a GitHub or GitLab integration, you can specify a customer managed key from AWS Key Management Service (AWS KMS) to encrypt the data that belongs to that integration. This includes the integration's credentials and the content that AWS Continuum handles for the integration, such as pull request submissions. If you don't specify a key, AWS Continuum uses AWS owned keys.
To use a customer managed key, choose the key in the encryption settings when you create
the integration. In the API, include the kmsKeyId parameter when you call
CreateIntegration.
Before you create the integration, update the key policy so that AWS Continuum can use the key. You can't add, change, or remove the key of an existing integration. For the required key policy statements, see Required AWS KMS permissions.
Amazon S3 integrations don't support customer managed keys.
Next steps
After you create an integration, select it when you create an environment:
-
For code vulnerabilities, see Creating an environment.
-
For penetration testing, see Creating an environment. Use a GitHub or GitLab integration.