Amazon Web Services
runZero integrates with Amazon Web Services (AWS) to give you better visibility across your cloud environment. The integration imports data from each applicable API to add detail to your asset inventory:
With AWS synced, you can see at a glance how many EC2 instances, elastic load balancers, relational database services, FSx file systems, and VPCs you have running, along with their region, account, and more.
The integration imports all running EC2 instances, RDS instances, Lambda functions, FSx file systems, VPCs, and active application, network, gateway, or classic load balancers. You can connect it to a single AWS account or to all accounts in your organization, and it imports data across multiple regions.
Getting started
runZero supports these AWS resource types:
- EC2 instances
- Elastic load balancers
- RDS instances
- Lambda instances
- FSx file systems
- VPCs
To set up the AWS integration:
- Configure AWS to allow API access for runZero.
- Add the AWS credential to runZero, including the access key and secret key.
- Choose whether to run the integration as a scan probe or connector task.
- Activate the AWS integration to sync your data with runZero.
Requirements
Before you set up the AWS integration:
- Make sure you have access to the AWS console.
- Use AWS Organizations if you want to connect to multiple accounts.
- With AWS Organizations and a compatible credential, such as the IAM Role Credential, runZero enumerates the member accounts to sync all of their data.
Step 1: Create an AWS credential
runZero can authenticate to AWS with any of these credential types:
- IAM Role Credential (recommended): runZero authenticates to AWS with an IAM role that you create in your AWS account. No long-term access keys are needed.
- IAM Role credentials are not supported for self-hosted instances, GovCloud-based accounts, or Explorer tasks. Use IAM Key credentials in those cases.
- IAM Role Credential - Manual Account Selection (alternative): runZero authenticates to AWS the same way as the IAM Role Credential, but with account IDs you specify by hand rather than AWS Organization subaccounts. Recommended only for advanced use cases.
- IAM Key Credential (deprecated): runZero authenticates to AWS with an IAM user and long-term access keys.
Option A: IAM role credential
To give runZero authenticated access to AWS through an IAM role, you need an External ID. An external ID is a unique ID that runZero provides for your IAM role. You use it when configuring the IAM role so that only your runZero account can access the role.
For more on external IDs in cross-account access, see AWS’ documentation on the confused deputy problem.
Step 1a.1: Create a runZero credential and external ID
To generate an external ID, create an AWS IAM Role credential in the runZero console:
-
Go to the Credentials page and click Add Credential.
-
Choose AWS IAM Role from the list of credential types.
-
Name the credential, for example
AWS IAM Role. -
In the AWS IAM role ARN field, enter the full ARN of the IAM role you will create in the next step. An IAM role ARN has the format
arn:aws:iam::123456789012:role/runzero-sync, where123456789012is your AWS account ID andrunzero-syncis the name of the role you will create.If you don’t know your AWS account ID yet, use
arn:aws:iam::XXXXXXXXXXXX:role/runzero-syncas a placeholder and update it later. -
Click Save to save the credential and generate an external ID.
Verify & Save won’t work yet, because the IAM role doesn’t exist in AWS. You’ll test the credential in Step 1a.3.
-
Copy the external ID. You’ll need it in the next step.
Step 1a.2: Create AWS IAM role(s)
Follow the directions below to create an IAM role in every AWS account you want to sync with runZero. If you use AWS Organizations, reuse the same role name and external ID from your credential in each account.
The preferred way to create the IAM role is with CloudFormation StackSets:
- Create a
runzero-cloudformation-stackset.jsonfile with the following content. Replace<externalID>with the external ID generated in the runZero console.
"Resources": {
"IamrunZeroAccessRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"RoleName": "runzero-sync",
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::336004405641:root"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "<externalID>"
}
}
}]
},
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess",
"arn:aws:iam::aws:policy/AmazonRDSReadOnlyAccess",
"arn:aws:iam::aws:policy/AWSLambda_ReadOnlyAccess",
"arn:aws:iam::aws:policy/AmazonFSxReadOnlyAccess",
"arn:aws:iam::aws:policy/AWSOrganizationsReadOnlyAccess",
"arn:aws:iam::aws:policy/AmazonInspector2ReadOnlyAccess"
]
}
}
}
- Go to CloudFormation > StackSets and click Create StackSet.
- Select Template is ready and Upload a template file. Upload the template you just created.
- Enter a name for the StackSet, for example runZero-IAM-Role. Click next.
- (Optional) Set tags. Click next.
- Set deployment options. Click next.
- Review and create the StackSet.
- The StackSet creates an IAM role with the format
arn:aws:iam::<accountID>:role/runzero-sync. Copy the full ARN of the role. You’ll need it in Step 1a.3.
To create the IAM role(s) manually instead:
- Sign in to the AWS console.
- Go to Identity and Access Management (IAM) > Roles to create a role that gives runZero access.
- Click the Create role button.
- On the “Select trusted entity” step:
- Select AWS account in the Trusted entity type panel.
- Select Another AWS account in the An AWS account panel.
- Enter
336004405641for the account ID. This is the account runZero uses to access your AWS account. - Check the Require external ID… checkbox and enter the external ID generated in Step 1a.1.
- Click the Next button.
- On the “Add permissions” step, select the following AWS managed policies and click the Next button. These grant runZero read-only access to the inventory in your AWS account.
AmazonEC2ReadOnlyAccessto sync EC2, ELB, and VPC resourcesAmazonRDSReadOnlyAccessto sync RDS instancesAWSLambda_ReadOnlyAccessto sync Lambda functionsAmazonFSxReadOnlyAccessto sync FSx file systemsAWSOrganizationsReadOnlyAccessto sync AWS Organization account informationAmazonInspector2ReadOnlyAccessto import AWS Inspector vulnerability findings for EC2 instances and Lambda functions
- On the “Name, review, and create” step, enter a role name, such as
runzero-sync, and a description. Click the Create role button. - Copy the full ARN of the new role. It has the format
arn:aws:iam::<accountID>:role/<roleName>. You’ll need it in Step 1a.3.
Additional notes:
- A StackSet often can’t configure the payer account by default. In that case, the StackSet can configure all member accounts, and you may need to configure the payer account manually.
- If you intend to sync AWS regions that are not enabled by default, change the region compatibility of the global STS endpoint. In the AWS console, go to IAM > Account Settings > Security Token Service (STS) and change the Global Endpoint to be compatible with “All AWS Regions.”
Step 1a.3: Update the runZero credential
- Return to the runZero console, go to the Credentials page, and edit the credential you created in Step 1a.1.
- Update the AWS IAM role ARN field with the full ARN of the role you created in Step 1a.2.
- Click Verify & Save to save and test the credential.
The credential is ready. Continue to Step 2 to set up and activate the connection that brings in data from AWS.
Option B: IAM role credential with manual account selection
Choose this option only when the default IAM Role Credential can’t target the subset of AWS accounts you need. It adds operational overhead, so weigh it carefully.
Step 1b.1: Create a runZero credential and external ID
This step is almost the same as step 1a.1.
To generate an external ID, create an AWS IAM Role credential in the runZero console:
-
Go to the Credentials page and click Add Credential.
-
Choose AWS IAM Role - Manual Account Selection from the list of credential types.
-
Name the credential, for example
AWS IAM Role - Manual. -
In the AWS IAM Role field, enter the name of the role you are using for all accounts.
-
Enter a newline-separated list of the account IDs to import asset information from. An AWS account ID is a 12-digit number, so an entry looks like
123456789012. -
Click Save to save the credential and generate an external ID.
Verify & Save won’t work yet, because the IAM role doesn’t exist in AWS. You’ll test the credential in Step 1b.3.
-
Copy the external ID. You’ll need it in the next step.
Step 1b.2: Create AWS IAM role(s)
Follow the directions in step 1a.2: the setup is the same. Repeat them in each account you intend to import asset data from, because this credential type doesn’t use AWS Organizations the way the IAM Role Credential does.
Step 1b.3: Update the runZero credential
- Return to the runZero console, go to the Credentials page, and edit the credential you created in Step 1b.1.
- Click Verify & Save to save and test the credential.
The credential is ready. Continue to Step 2 to set up and activate the connection that brings in data from AWS.
Option C: IAM key credential
If you created an IAM role in Option A above, skip this section and proceed to Step 2. This option authenticates runZero to AWS with an IAM user and long-term access keys, which we don’t recommend. Use an IAM role instead.
Step 1c.1: Create an AWS IAM user
- Sign in to the AWS console. If you use AWS Organizations and intend to sync multiple accounts, sign in to the AWS Organizations management account, sometimes called the “payer” or “root” account.
- Go to Identity and Access Management (IAM) > Users and select or create a user that gives runZero API access.
- Click Add permissions > Attach existing policies directly. Search for and attach the policies for the services you want to sync:
AmazonEC2ReadOnlyAccessto sync EC2, ELB, and VPC resourcesAmazonRDSReadOnlyAccessto sync RDS instancesAWSLambda_ReadOnlyAccessto sync Lambda functionsAmazonFSxReadOnlyAccessto sync FSx file systemsAWSOrganizationsReadOnlyAccessto sync AWS Organization account informationAmazonInspector2ReadOnlyAccessto import AWS Inspector vulnerability findings for EC2 instances and Lambda functions
- Add an inline policy that allows assuming runZero roles in sub-accounts (only required with AWS Organizations):
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "arn:aws:iam::*:role/<rolename>" }] } - From the user summary screen, open the Security credentials tab and click Create access key.
- Save the Access key ID and Secret access key. You’ll need them in Step 1c.3.
- If you intend to sync AWS regions that are not enabled by default, change the region compatibility of the global STS endpoint. In the AWS console, go to IAM > Account Settings > Security Token Service (STS) and change the Global Endpoint to be compatible with “All AWS Regions.”
Step 1c.2: Add an IAM role to sub-accounts
If you use AWS Organizations and want runZero to sync all accounts in your organization, create an IAM role in each sub-account that lets the IAM user from Step 1c.1 assume it. If you aren’t using AWS Organizations, skip this step and proceed to Step 1c.3.
In every AWS sub-account:
- Go to Identity and Access Management (IAM) > Roles and click Create role.
- Choose Another AWS Account for the type of trusted entity.
- For Account ID, enter the ID of your organization’s management account.
- Click Next: Permissions.
- Attach the
AmazonEC2ReadOnlyAccesspolicy if you want to sync EC2, ELB, and VPC resources. - Attach the
AmazonRDSReadOnlyAccesspolicy if you want to sync RDS instances. - Attach the
AWSLambda_ReadOnlyAccesspolicy if you want to sync Lambda functions. - Attach the
AmazonFSxReadOnlyAccesspolicy if you want to sync FSx file systems. - Attach the
AmazonInspector2ReadOnlyAccesspolicy if you want to import AWS Inspector vulnerability findings for EC2 instances and Lambda functions. - Click Next: Tags and optionally add tags.
- Click Next: Review and name the role. (The role must have the same name in every account.)
- Click Create role.
Step 1c.3: Add the AWS credential to runZero
- Go to the Credentials page in runZero and click Add Credential.
- Name the credential, for example
AWS IAM User. - Choose AWS Access & Secret from the list of credential types.
- Fill in the credential:
- In AWS access key, enter the access key ID from Step 1c.1.
- In AWS secret access key, enter the secret access key from Step 1c.1.
- In AWS role, enter the assumed role used to connect to other accounts in your organization. This is the role name you used in Step 1c.2.
- Select the region(s) that you want to sync.
- Save the credential.
Step 2: Choose how to configure the AWS integration
You can run the AWS integration as either a scan probe or a connector task. A scan probe gathers integration data during a scan task. A connector task runs on its own, from the cloud or from one of your Explorers, and performs only the integration sync.
Step 3: Set up and activate the AWS integration to sync data
After you add your AWS credential, set up a connector task or scan probe to sync your data.
Step 3a: Configure the AWS integration as a connector task
A connection needs a schedule and a site. The schedule sets when the sync runs, and the site is where runZero creates new AWS-only assets.
- Activate a connection to AWS. All available third-party connections are reachable from the integrations page, your inventory, or the tasks page.
- Choose the credential you added earlier. If it isn’t listed, make sure the credential has access to your current organization.
- Name the task, for example
AWS sync. - Schedule the sync to run once or on a recurring schedule. It starts on the date and time you set.
- Under Task configuration:
- Choose the site to add your assets to. All newly discovered assets are stored in this site. You can also choose Automatically create a new site per VPC or Automatically create a new site per account, and runZero creates the sites for newly discovered assets or accounts.
- Choose whether to automatically delete stale AWS assets. With this option checked, runZero deletes AWS assets it saw in an earlier sync but did not find in the most recent one.
- Choose whether to include AWS assets that are not currently running. With this option checked, runZero imports asset data for AWS assets that are not in a running state.
- Under Service options, select the services to sync data from. You must choose at least one.
- To import AWS Inspector vulnerability findings for your EC2 instances and Lambda functions, switch the Import AWS vulnerabilities toggle to Yes. The credential’s IAM role or user needs the
AmazonInspector2ReadOnlyAccessmanaged policy (or the equivalentinspector2:ListFindingspermission) attached in each account you sync. See Step 1: Create an AWS credential above. runZero imports findings only for resources that AWS Inspector has already scanned and matched to an existing EC2 instance or Lambda function. - To exclude from the import any assets that runZero has not scanned, switch the Exclude unknown assets toggle to Yes. By default, the integration includes assets that runZero has not scanned.
- Activate the connection when you are done. The sync runs on the schedule you set, and the Scheduled tasks page shows when the next sync will occur.
Step 3b: Configure the AWS integration as a scan probe
- Create a new scan task or select a future or recurring scan task from your Tasks page.
- Add or update the scan parameters as needed.
- On the Probes and SNMP tab, choose which additional probes to include, set the AWS toggle to Yes, and change any default options if needed.
- On the Credentials tab, set the AWS toggle for the credential you want to use to Yes.
- Click Initialize scan to save the scan task and run it immediately or at the scheduled time.
Step 4: View AWS assets
After a successful sync, go to your inventory to view your AWS assets. They show an AWS icon in the Source column.
To filter for AWS assets, try these queries:
- View all AWS assets:
source:aws - View all AWS EC2 instances:
source:aws AND has:"@aws.ec2.instanceID" - View all AWS Elastic Load Balancers:
source:aws AND (has:"@aws.elb.loadBalancerArn" OR has:"@aws.elb.loadBalancerName") - View all AWS VPCs:
source:aws AND has:"@aws.vpc.vpcID"
Click into an asset to see its attributes as returned by the AWS APIs.
Troubleshooting
If the integration isn’t working, the questions and answers below may help.
Why is the Amazon Web Services integration unable to connect?
- Check whether the AWS integration is returning any data.
- Query the inventory rather than the task details to review all the data available from this integration.
- In some cases, an integration’s configuration limits how much data reaches the runZero console.
- Some integrations require specific actions that are easy to overlook. If you miss a step during setup, the integration may not work correctly. Review this page and follow the steps exactly.
- If the AWS integration can’t connect, check the task log for errors. Common errors include:
- 500: server error, unable to connect to the endpoint
- 404: hitting an unknown endpoint on the server
- 403: not authorized, likely a credential issue
Why aren’t AWS Inspector vulnerabilities showing up on my EC2 or Lambda assets?
- Confirm the Import AWS vulnerabilities option is enabled on the connector task or scan probe. This is separate from selecting the EC2 or Lambda service options.
- Confirm the IAM role or user behind the credential has the
AmazonInspector2ReadOnlyAccessmanaged policy (or a custom policy grantinginspector2:ListFindings) attached in the specific AWS account and region being synced. Every member account needs this permission, not just the payer/root account. If it is missing, the task log shows anAccessDeniedExceptionsimilar to:AccessDeniedException: User: arn:aws:sts::<account-id>:assumed-role/<role-name>/runZeroAWSIntegrationSession is not authorized to perform: inspector2:ListFindings on resource: arn:aws:inspector2:<region>:<account-id>:/findings/list because no identity-based policy allows the inspector2:ListFindings action - Confirm that AWS Inspector scanning (EC2 deep inspection and/or Lambda standard scanning) is activated for the account and region, and that AWS Inspector has scanned the resource. runZero imports only findings that AWS Inspector has already generated; it does not trigger new scans.
- For Lambda functions, confirm the function was invoked or updated within the last 90 days, uses the
$LATESTversion, and is not excluded from scanning by tag or a customer-managed KMS key.