code_reviews
Creates, updates, deletes, gets or lists a code_reviews resource.
Overview
| Name | code_reviews |
| Type | Resource |
| Id | aws.securityagent.code_reviews |
Fields
The following fields are returned by SELECT queries:
- batch_get_code_reviews
- list_code_reviews
| Name | Datatype | Description |
|---|---|---|
code_reviews | array | The list of code reviews that were found. |
not_found | array | List of code review IDs. |
| Name | Datatype | Description |
|---|---|---|
agent_space_id | string | The unique identifier of the agent space that contains the code review. |
code_review_id | string | The unique identifier of the code review. |
created_at | string (date-time) | The date and time the code review was created, in UTC format. |
title_ | string | The title of the code review. |
updated_at | string (date-time) | The date and time the code review was last updated, in UTC format. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_get_code_reviews | select | region | Retrieves information about one or more code reviews in an agent space. | |
list_code_reviews | select | region | Returns a paginated list of code review summaries for the specified agent space. | |
create_code_review | insert | region, title, agentSpaceId, assets | Creates a new code review configuration in an agent space. A code review defines the parameters for automated security-focused code analysis. | |
update_code_review | update | region, codeReviewId, agentSpaceId | Updates an existing code review configuration. | |
batch_delete_code_reviews | exec | region, codeReviewIds, agentSpaceId | Deletes one or more code reviews from an agent space. | |
start_code_review_job | exec | region, agentSpaceId, codeReviewId | Starts a new code review job for a code review configuration. The job executes the security-focused code analysis defined in the code review. | |
stop_code_review_job | exec | region, agentSpaceId, codeReviewJobId | Stops a running code review job. The job transitions to a stopping state and then to stopped after cleanup completes. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- batch_get_code_reviews
- list_code_reviews
Retrieves information about one or more code reviews in an agent space.
SELECT
code_reviews,
not_found
FROM aws.securityagent.code_reviews
WHERE region = '{{ region }}' -- required
;
Returns a paginated list of code review summaries for the specified agent space.
SELECT
agent_space_id,
code_review_id,
created_at,
title_,
updated_at
FROM aws.securityagent.code_reviews
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_code_review
- Manifest
Creates a new code review configuration in an agent space. A code review defines the parameters for automated security-focused code analysis.
INSERT INTO aws.securityagent.code_reviews (
title,
agentSpaceId,
assets,
serviceRole,
logConfig,
codeRemediationStrategy,
validationMode,
maxTaskHours,
region
)
SELECT
'{{ title }}' /* required */,
'{{ agentSpaceId }}' /* required */,
'{{ assets }}' /* required */,
'{{ serviceRole }}',
'{{ logConfig }}',
'{{ codeRemediationStrategy }}',
'{{ validationMode }}',
{{ maxTaskHours }},
'{{ region }}'
RETURNING
agent_space_id,
assets,
code_remediation_strategy,
code_review_id,
created_at,
log_config,
max_task_hours,
service_role,
title_,
updated_at,
validation_mode
;
# Description fields are for documentation purposes
- name: code_reviews
props:
- name: region
value: "{{ region }}"
description: Required parameter for the code_reviews resource.
- name: title
value: "{{ title }}"
- name: agentSpaceId
value: "{{ agentSpaceId }}"
- name: assets
description: |
The collection of assets used in a pentest configuration, including endpoints, actors, documents, source code repositories, and integrated repositories.
value:
endpoints:
- uri: "{{ uri }}"
actors:
- identifier: "{{ identifier }}"
uris: "{{ uris }}"
authentication:
providerType: "{{ providerType }}"
value: "{{ value }}"
description: "{{ description }}"
enableEmailMfa: {{ enableEmailMfa }}
mfaForwardingAddress: "{{ mfaForwardingAddress }}"
documents:
- s3Location: "{{ s3Location }}"
artifactId: "{{ artifactId }}"
integratedDocument:
integrationId: "{{ integrationId }}"
resourceId: "{{ resourceId }}"
sourceCode:
- s3Location: "{{ s3Location }}"
integratedRepositories:
- integrationId: "{{ integrationId }}"
providerResourceId: "{{ providerResourceId }}"
branch: "{{ branch }}"
- name: serviceRole
value: "{{ serviceRole }}"
description: |
ARN of an IAM role that the service can assume to access customer resources.
- name: logConfig
description: |
The Amazon CloudWatch Logs configuration for pentest job logging.
value:
logGroup: "{{ logGroup }}"
logStream: "{{ logStream }}"
- name: codeRemediationStrategy
value: "{{ codeRemediationStrategy }}"
description: |
Strategy for automated code remediation.
valid_values: ['AUTOMATIC', 'DISABLED']
- name: validationMode
value: "{{ validationMode }}"
description: |
Mode of validation to perform on findings
valid_values: ['DISABLED', 'SIMULATED']
- name: maxTaskHours
value: {{ maxTaskHours }}
UPDATE examples
- update_code_review
Updates an existing code review configuration.
UPDATE aws.securityagent.code_reviews
SET
codeReviewId = '{{ codeReviewId }}',
agentSpaceId = '{{ agentSpaceId }}',
title = '{{ title }}',
assets = '{{ assets }}',
serviceRole = '{{ serviceRole }}',
logConfig = '{{ logConfig }}',
codeRemediationStrategy = '{{ codeRemediationStrategy }}',
validationMode = '{{ validationMode }}',
maxTaskHours = {{ maxTaskHours }}
WHERE
region = '{{ region }}' --required
AND codeReviewId = '{{ codeReviewId }}' --required
AND agentSpaceId = '{{ agentSpaceId }}' --required
RETURNING
agent_space_id,
assets,
code_remediation_strategy,
code_review_id,
created_at,
log_config,
max_task_hours,
service_role,
title_,
updated_at,
validation_mode;
Lifecycle Methods
- batch_delete_code_reviews
- start_code_review_job
- stop_code_review_job
Deletes one or more code reviews from an agent space.
EXEC aws.securityagent.code_reviews.batch_delete_code_reviews
@region='{{ region }}' --required
@@json=
'{
"codeReviewIds": "{{ codeReviewIds }}",
"agentSpaceId": "{{ agentSpaceId }}"
}'
;
Starts a new code review job for a code review configuration. The job executes the security-focused code analysis defined in the code review.
EXEC aws.securityagent.code_reviews.start_code_review_job
@region='{{ region }}' --required
@@json=
'{
"agentSpaceId": "{{ agentSpaceId }}",
"codeReviewId": "{{ codeReviewId }}",
"diffSource": "{{ diffSource }}"
}'
;
Stops a running code review job. The job transitions to a stopping state and then to stopped after cleanup completes.
EXEC aws.securityagent.code_reviews.stop_code_review_job
@region='{{ region }}' --required
@@json=
'{
"agentSpaceId": "{{ agentSpaceId }}",
"codeReviewJobId": "{{ codeReviewJobId }}"
}'
;