2026/11/19 - Inspector2 - 4 updated api methods
Changes Amazon Inspector Code Security now supports GitHub Enterprise Server integrations. For GitHub Enterprise Server and GitLab Self-Managed, you can connect over a private network by adding a VPC configuration when you create an integration.
{'details': {'githubEnterprise': {'instanceUrl': 'string',
'vpcConfiguration': {'codeConnectionsHostArn': 'string',
'securityGroups': ['string'],
'subnetIds': ['string'],
'tlsCertificate': 'string',
'vpcEndpointId': 'string',
'vpcId': 'string'}},
'gitlabSelfManaged': {'vpcConfiguration': {'codeConnectionsHostArn': 'string',
'securityGroups': ['string'],
'subnetIds': ['string'],
'tlsCertificate': 'string',
'vpcEndpointId': 'string',
'vpcId': 'string'}}},
'type': {'GITHUB_ENTERPRISE_SERVER'}}
Response {'status': {'DELETE_FAILED',
'DELETE_IN_PROGRESS',
'ESTABLISHING_CONNECTION_COMPLETED',
'ESTABLISHING_CONNECTION_FAILED',
'ESTABLISHING_CONNECTION_IN_PROGRESS',
'PENDING_MANIFEST_CODE'}}
Creates a code security integration with a source code repository provider.
After calling the CreateCodeSecurityIntegration operation, you complete authentication and authorization with your provider. Next you call the UpdateCodeSecurityIntegration operation to provide the details to complete the integration setup
See also: AWS API Documentation
Request Syntax
client.create_code_security_integration(
name='string',
type='GITLAB_SELF_MANAGED'|'GITHUB'|'GITHUB_ENTERPRISE_SERVER',
details={
'gitlabSelfManaged': {
'instanceUrl': 'string',
'accessToken': 'string',
'vpcConfiguration': {
'vpcId': 'string',
'vpcEndpointId': 'string',
'codeConnectionsHostArn': 'string',
'subnetIds': [
'string',
],
'securityGroups': [
'string',
],
'tlsCertificate': 'string'
}
},
'githubEnterprise': {
'instanceUrl': 'string',
'vpcConfiguration': {
'vpcId': 'string',
'vpcEndpointId': 'string',
'codeConnectionsHostArn': 'string',
'subnetIds': [
'string',
],
'securityGroups': [
'string',
],
'tlsCertificate': 'string'
}
}
},
tags={
'string': 'string'
}
)
string
[REQUIRED]
The name of the code security integration.
string
[REQUIRED]
The type of repository provider for the integration.
dict
The integration details specific to the repository provider type.
gitlabSelfManaged (dict) --
Details specific to creating an integration with a self-managed GitLab instance.
instanceUrl (string) -- [REQUIRED]
The URL of the self-managed GitLab instance.
accessToken (string) -- [REQUIRED]
The personal access token used to authenticate with the self-managed GitLab instance.
vpcConfiguration (dict) --
The VPC configuration used to connect to the self-managed GitLab instance in a private network. For publicly accessible instances, omit this field.
vpcId (string) -- [REQUIRED]
The ID of the VPC that Amazon Inspector connects through to reach the repository provider.
vpcEndpointId (string) -- [REQUIRED]
The ID of the VPC endpoint used for the connection.
codeConnectionsHostArn (string) --
The Amazon Resource Name (ARN) of the AWS CodeConnections host used for the connection.
subnetIds (list) --
The IDs of the subnets used for the connection.
(string) --
securityGroups (list) --
The IDs of the security groups used for the connection.
(string) --
tlsCertificate (string) --
The TLS certificate used to establish a trusted connection to the repository provider.
githubEnterprise (dict) --
Details specific to creating an integration with a GitHub Enterprise Server instance.
instanceUrl (string) -- [REQUIRED]
The URL of the GitHub Enterprise Server instance.
vpcConfiguration (dict) --
The VPC configuration used to connect to the GitHub Enterprise Server instance in a private network. For publicly accessible instances, omit this field.
vpcId (string) -- [REQUIRED]
The ID of the VPC that Amazon Inspector connects through to reach the repository provider.
vpcEndpointId (string) -- [REQUIRED]
The ID of the VPC endpoint used for the connection.
codeConnectionsHostArn (string) --
The Amazon Resource Name (ARN) of the AWS CodeConnections host used for the connection.
subnetIds (list) --
The IDs of the subnets used for the connection.
(string) --
securityGroups (list) --
The IDs of the security groups used for the connection.
(string) --
tlsCertificate (string) --
The TLS certificate used to establish a trusted connection to the repository provider.
dict
The tags to apply to the code security integration.
(string) --
(string) --
dict
Response Syntax
{
'integrationArn': 'string',
'status': 'PENDING'|'IN_PROGRESS'|'ACTIVE'|'INACTIVE'|'DISABLING'|'ESTABLISHING_CONNECTION_IN_PROGRESS'|'ESTABLISHING_CONNECTION_COMPLETED'|'ESTABLISHING_CONNECTION_FAILED'|'PENDING_MANIFEST_CODE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED',
'authorizationUrl': 'string'
}
Response Structure
(dict) --
integrationArn (string) --
The Amazon Resource Name (ARN) of the created code security integration.
status (string) --
The current status of the code security integration.
authorizationUrl (string) --
The URL used to authorize the integration with the repository provider.
{'instanceUrl': 'string',
'status': {'DELETE_FAILED',
'DELETE_IN_PROGRESS',
'ESTABLISHING_CONNECTION_COMPLETED',
'ESTABLISHING_CONNECTION_FAILED',
'ESTABLISHING_CONNECTION_IN_PROGRESS',
'PENDING_MANIFEST_CODE'},
'type': {'GITHUB_ENTERPRISE_SERVER'},
'vpcConfiguration': {'codeConnectionsHostArn': 'string',
'securityGroups': ['string'],
'subnetIds': ['string'],
'tlsCertificate': 'string',
'vpcEndpointId': 'string',
'vpcId': 'string'}}
Retrieves information about a code security integration.
See also: AWS API Documentation
Request Syntax
client.get_code_security_integration(
integrationArn='string',
tags={
'string': 'string'
}
)
string
[REQUIRED]
The Amazon Resource Name (ARN) of the code security integration to retrieve.
dict
The tags associated with the code security integration.
(string) --
(string) --
dict
Response Syntax
{
'integrationArn': 'string',
'name': 'string',
'type': 'GITLAB_SELF_MANAGED'|'GITHUB'|'GITHUB_ENTERPRISE_SERVER',
'status': 'PENDING'|'IN_PROGRESS'|'ACTIVE'|'INACTIVE'|'DISABLING'|'ESTABLISHING_CONNECTION_IN_PROGRESS'|'ESTABLISHING_CONNECTION_COMPLETED'|'ESTABLISHING_CONNECTION_FAILED'|'PENDING_MANIFEST_CODE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED',
'statusReason': 'string',
'createdOn': datetime(2015, 1, 1),
'lastUpdateOn': datetime(2015, 1, 1),
'authorizationUrl': 'string',
'vpcConfiguration': {
'vpcId': 'string',
'vpcEndpointId': 'string',
'codeConnectionsHostArn': 'string',
'subnetIds': [
'string',
],
'securityGroups': [
'string',
],
'tlsCertificate': 'string'
},
'instanceUrl': 'string',
'tags': {
'string': 'string'
}
}
Response Structure
(dict) --
integrationArn (string) --
The Amazon Resource Name (ARN) of the code security integration.
name (string) --
The name of the code security integration.
type (string) --
The type of repository provider for the integration.
status (string) --
The current status of the code security integration.
statusReason (string) --
The reason for the current status of the code security integration.
createdOn (datetime) --
The timestamp when the code security integration was created.
lastUpdateOn (datetime) --
The timestamp when the code security integration was last updated.
authorizationUrl (string) --
The URL used to authorize the integration with the repository provider. This is only returned if reauthorization is required to fix a connection issue. Otherwise, it is null.
vpcConfiguration (dict) --
The VPC configuration associated with the integration, if it connects to a repository provider in a private network.
vpcId (string) --
The ID of the VPC that Amazon Inspector connects through to reach the repository provider.
vpcEndpointId (string) --
The ID of the VPC endpoint used for the connection.
codeConnectionsHostArn (string) --
The Amazon Resource Name (ARN) of the AWS CodeConnections host used for the connection.
subnetIds (list) --
The IDs of the subnets used for the connection.
(string) --
securityGroups (list) --
The IDs of the security groups used for the connection.
(string) --
tlsCertificate (string) --
The TLS certificate used to establish a trusted connection to the repository provider.
instanceUrl (string) --
The URL of the self-managed GitLab or GitHub Enterprise Server instance associated with the integration.
tags (dict) --
The tags associated with the code security integration.
(string) --
(string) --
{'integrations': {'status': {'DELETE_FAILED',
'DELETE_IN_PROGRESS',
'ESTABLISHING_CONNECTION_COMPLETED',
'ESTABLISHING_CONNECTION_FAILED',
'ESTABLISHING_CONNECTION_IN_PROGRESS',
'PENDING_MANIFEST_CODE'},
'type': {'GITHUB_ENTERPRISE_SERVER'}}}
Lists all code security integrations in your account.
See also: AWS API Documentation
Request Syntax
client.list_code_security_integrations(
nextToken='string',
maxResults=123
)
string
A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page.
integer
The maximum number of results to return in a single call.
dict
Response Syntax
{
'integrations': [
{
'integrationArn': 'string',
'name': 'string',
'type': 'GITLAB_SELF_MANAGED'|'GITHUB'|'GITHUB_ENTERPRISE_SERVER',
'status': 'PENDING'|'IN_PROGRESS'|'ACTIVE'|'INACTIVE'|'DISABLING'|'ESTABLISHING_CONNECTION_IN_PROGRESS'|'ESTABLISHING_CONNECTION_COMPLETED'|'ESTABLISHING_CONNECTION_FAILED'|'PENDING_MANIFEST_CODE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED',
'statusReason': 'string',
'createdOn': datetime(2015, 1, 1),
'lastUpdateOn': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
integrations (list) --
A list of code security integration summaries.
(dict) --
A summary of information about a code security integration.
integrationArn (string) --
The Amazon Resource Name (ARN) of the code security integration.
name (string) --
The name of the code security integration.
type (string) --
The type of repository provider for the integration.
status (string) --
The current status of the code security integration.
statusReason (string) --
The reason for the current status of the code security integration.
createdOn (datetime) --
The timestamp when the code security integration was created.
lastUpdateOn (datetime) --
The timestamp when the code security integration was last updated.
nextToken (string) --
A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page.
{'details': {'github': {'stateToken': 'string'},
'githubEnterpriseServer': {'appInstallation': {'code': 'string',
'installationId': 'string',
'stateToken': 'string'},
'appRegistration': {'manifestCode': 'string'}},
'gitlabSelfManaged': {'stateToken': 'string'}}}
Response {'status': {'DELETE_FAILED',
'DELETE_IN_PROGRESS',
'ESTABLISHING_CONNECTION_COMPLETED',
'ESTABLISHING_CONNECTION_FAILED',
'ESTABLISHING_CONNECTION_IN_PROGRESS',
'PENDING_MANIFEST_CODE'}}
Updates an existing code security integration.
After calling the CreateCodeSecurityIntegration operation, you complete authentication and authorization with your provider. Next you call the UpdateCodeSecurityIntegration operation to provide the details to complete the integration setup
See also: AWS API Documentation
Request Syntax
client.update_code_security_integration(
integrationArn='string',
details={
'gitlabSelfManaged': {
'authCode': 'string',
'stateToken': 'string'
},
'github': {
'code': 'string',
'installationId': 'string',
'stateToken': 'string'
},
'githubEnterpriseServer': {
'appInstallation': {
'code': 'string',
'installationId': 'string',
'stateToken': 'string'
},
'appRegistration': {
'manifestCode': 'string'
}
}
}
)
string
[REQUIRED]
The Amazon Resource Name (ARN) of the code security integration to update.
dict
[REQUIRED]
The updated integration details specific to the repository provider type.
gitlabSelfManaged (dict) --
Details specific to updating an integration with a self-managed GitLab instance.
authCode (string) -- [REQUIRED]
The authorization code received from the self-managed GitLab instance to update the integration.
stateToken (string) --
The PKCE state token used to validate the authorization request.
github (dict) --
Details specific to updating an integration with GitHub.
code (string) -- [REQUIRED]
The authorization code received from GitHub to update the integration.
installationId (string) -- [REQUIRED]
The installation ID of the GitHub App associated with the integration.
stateToken (string) --
The PKCE state token used to validate the authorization request.
githubEnterpriseServer (dict) --
Details specific to updating an integration with a GitHub Enterprise Server instance.
appInstallation (dict) --
Details for completing the GitHub App installation step of the GitHub Enterprise Server integration.
code (string) -- [REQUIRED]
The authorization code received from GitHub Enterprise Server.
installationId (string) -- [REQUIRED]
The installation ID of the GitHub App associated with the integration.
stateToken (string) --
The PKCE state token used to validate the authorization request.
appRegistration (dict) --
Details for completing the GitHub App manifest registration step of the GitHub Enterprise Server integration.
manifestCode (string) -- [REQUIRED]
The manifest code used to register the GitHub App on the GitHub Enterprise Server instance.
dict
Response Syntax
{
'integrationArn': 'string',
'status': 'PENDING'|'IN_PROGRESS'|'ACTIVE'|'INACTIVE'|'DISABLING'|'ESTABLISHING_CONNECTION_IN_PROGRESS'|'ESTABLISHING_CONNECTION_COMPLETED'|'ESTABLISHING_CONNECTION_FAILED'|'PENDING_MANIFEST_CODE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'
}
Response Structure
(dict) --
integrationArn (string) --
The Amazon Resource Name (ARN) of the updated code security integration.
status (string) --
The current status of the updated code security integration.