AWS Security Agent Executor¶
Category: AI-Driven Security Testing
Script: aws_security_agent.py
Integration: Python SDK (boto3)
Faraday Plugin: Raw JSON
Website: https://securityagent.global.app.aws/
Description¶
Imports pentest results from AWS Security Agent into Faraday. The executor walks your agent spaces, pentests and pentest jobs, and creates vulnerabilities from the findings, plus informational records for discovered endpoints and jobs.
Prerequisites¶
- An AWS account with AWS Security Agent and at least one completed pentest
- AWS credentials (access key, or an IAM role available to the agent) with permission to list and read AWS Security Agent data
- A
boto3version that includes thesecurityagentclient, available in the agent's Python environment
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
AWS_ACCESS_KEY_ID |
No | Access key ID of an IAM principal with permission to list and read AWS Security Agent data. If not set, the standard AWS credential chain is used (for example an IAM role). Must be set together with AWS_SECRET_ACCESS_KEY. |
AWS_SECRET_ACCESS_KEY |
No | Secret access key paired with AWS_ACCESS_KEY_ID |
These variables are also accepted as execution arguments, so a single run can override them.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
AWS_SESSION_TOKEN |
password | No | Session token for temporary (STS) credentials. Only used when AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set. |
AWS_REGION |
string | No | AWS region to query (default: us-east-1) |
AWS_SECURITY_AGENT_AGENT_SPACE |
string | No | ID of a single agent space to import (e.g., as-<uuid>). Default: all agent spaces in the account. |
AWS_SECURITY_AGENT_PENTEST_ID |
string | No | ID of a single pentest to import (e.g., pt-<uuid>). Default: all pentests in each agent space. |
AWS_SECURITY_AGENT_JOB_ID |
string | No | ID of a single pentest job to import (e.g., pj-<uuid>). Default: all eligible jobs of each pentest. |
AWS_SECURITY_AGENT_MODE |
string | No | Comma-separated list of what to import: findings (pentest findings as vulnerabilities), endpoints (discovered endpoints as informational records) and jobs (one informational record per pentest job). Default: findings,endpoints. |
AWS_SECURITY_AGENT_MAX_SPACES |
integer | No | Maximum number of agent spaces to read (default: 20) |
AWS_SECURITY_AGENT_MAX_PENTESTS |
integer | No | Maximum number of pentests to read per agent space (default: 20) |
AWS_SECURITY_AGENT_MAX_JOBS |
integer | No | Maximum number of pentest jobs to read per pentest (default: 20) |
AWS_SECURITY_AGENT_MAX_PAGES |
integer | No | Maximum number of result pages to read for each list call (default: 20) |
AWS_SECURITY_AGENT_PAGE_SIZE |
integer | No | Number of records requested per API call (default: 100) |
AWS_SECURITY_AGENT_MIN_SEVERITY |
string | No | Minimum severity of the findings to import: info, low, medium, high or critical (default: info) |
AWS_SECURITY_AGENT_ONLY_COMPLETED |
string | No | Set to false to also import jobs that are not COMPLETED (for example in progress or failed). Default: true. |
YAML Configuration Example¶
executors:
aws_security_agent:
repo_executor: aws_security_agent.py
max_size: 65536
varenvs:
AWS_ACCESS_KEY_ID: "<aws_access_key_id>"
AWS_SECRET_ACCESS_KEY: "<aws_secret_access_key>"
params:
AWS_SESSION_TOKEN:
mandatory: false
type: password
base: string
AWS_REGION:
mandatory: false
type: string
base: string
AWS_SECURITY_AGENT_AGENT_SPACE:
mandatory: false
type: string
base: string
AWS_SECURITY_AGENT_PENTEST_ID:
mandatory: false
type: string
base: string
AWS_SECURITY_AGENT_JOB_ID:
mandatory: false
type: string
base: string
AWS_SECURITY_AGENT_MODE:
mandatory: false
type: string
base: string
AWS_SECURITY_AGENT_MAX_SPACES:
mandatory: false
type: integer
base: integer
AWS_SECURITY_AGENT_MAX_PENTESTS:
mandatory: false
type: integer
base: integer
AWS_SECURITY_AGENT_MAX_JOBS:
mandatory: false
type: integer
base: integer
AWS_SECURITY_AGENT_MAX_PAGES:
mandatory: false
type: integer
base: integer
AWS_SECURITY_AGENT_PAGE_SIZE:
mandatory: false
type: integer
base: integer
AWS_SECURITY_AGENT_MIN_SEVERITY:
mandatory: false
type: string
base: string
AWS_SECURITY_AGENT_ONLY_COMPLETED:
mandatory: false
type: string
base: string
How It Works¶
- Creates a boto3
securityagentclient for the region, using the given access keys or the standard AWS credential chain - Walks the account: agent spaces, then the pentests of each space, then the pentest jobs of each pentest (only
COMPLETEDjobs by default) - For each job, reads its details and, depending on
AWS_SECURITY_AGENT_MODE:findings: reads the findings (in batches of 25) and creates one vulnerability per finding. Severity comes from the finding's risk level (UNKNOWNandINFORMATIONALbecomeinfo). The description has the risk type, confidence and attack script. Evidence and impact go in the data field, and remediation in the resolution.endpoints: creates oneinforecord per discovered endpointjobs: creates oneinforecord with the job's title, status and overview
- Places everything under the pentest's target host, taken from the first endpoint URI of the job, and removes duplicates
Notes¶
- Each pentest target becomes one host. The host IP field holds the target's host name (taken from the endpoint URI) instead of an IP address, so each target gets its own host. If a job has no endpoint, the host is
aws-security-agent. AWS_SECURITY_AGENT_MIN_SEVERITYonly filters findings. Endpoint and job records are alwaysinfo.AWS_SECURITY_AGENT_JOB_IDandAWS_SECURITY_AGENT_PENTEST_IDselect a job or pentest directly, so theCOMPLETEDstatus check does not apply to a job you select by ID.- An invalid value in
AWS_SECURITY_AGENT_MODEstops the run. - The AWS permissions needed are the
securityagentlist and batch-get operations (for examplesecurityagent:List*andsecurityagent:BatchGet*). A failing AWS call stops the run. - Findings created on earlier runs are identified by their finding ID, so repeated imports update the same vulnerabilities.
- The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor. UseAWS_SECURITY_AGENT_MIN_SEVERITYto filter by severity.