AWS

Tutorials

Integrate Orca into your AWS CSPM with Cloudquery

Here at CloudQuery, we’re all about increasing confidence in your Cloud Security Posture Management (CSPM). Whether you are interested in creating a comprehensive AWS asset inventory or are only interested in targeting specific AWS services, CloudQuery can give you quick, actionable insights on AWS resources in your own database. Let’s explore how to use CloudQuery’s Orca plugin to integrate security data with your exported AWS cloud resource data.

Why incorporate Orca into your AWS CSPM?

Orca is an agentless Cloud-Native Application Protection Platform (CNAPP) that collects data directly from your cloud configuration and the workload’s runtime block storage out-of-band. Orca allows your organization and DevOps teams to seamlessly find, prioritize, and remediate cloud misconfigurations, vulnerabilities, and compliance issues. Connecting Orca to your AWS cloud data can allow you to build a custom approach to monitoring your cloud security posture.

How to setup Orca and CloudQuery

Let’s cover a few basic setup steps to connect your AWS resources to Orca security data.

  1. Export your AWS data to PostgreSQL
  2. Export your Orca data to PostgreSQL
  3. Include aws_ec2_instances and aws_lambda_functions tables in your AWS sync configuration

Integrating Orca control results into your AWS EC2 instances data

Once you have synced your AWS and Orca sources to your PostgreSQL database you can combine these two data sources. In this example, you will be looking at which running AWS EC2 instances, using the aws_ec2_instances table, are alerting and which controls have failure results. You will have two schemas for this example, aws and orca . You can use the below query to find all synced EC2 instances that have a control failure per Orca:

select distinct
aws.account_id as aws_account_id,
aws.region as region,
aws.arn as aws_resource_id,
aws.instance_id as instance_id,
aws.instance_type as instance_type,
aws.launch_time as launch_time,
oa.state_last_seen as alert_state_last_seen,
oa.description as alert_description,
oa.details as alert_details,
oa.recommendation as alert_remediation_recommendation
from
aws.aws_ec2_instances aws
left join
orca.orca_alerts oa on aws.instance_id = oa.asset_vendor_id
inner join
orca.orca_compliance_framework_tests cft on oa.rule_id = cft.rule_id
where
aws.state ->> 'Name' = 'running'
and
cft.result = 'FAIL';

In this query, you select some AWS EC2 instance descriptive fields while utilizing the instance_id field to join to the orca_alerts table using the asset_vendor_id provided by Orca. You also can utilize the result field in the orca_compliance_framework_tests table to select for only those instances that have a failure result.

Finding vulnerabilities in your AWS Lambda Functions using Orca and CloudQuery

You can also use Orca and CloudQuery to determine which of your AWS resources may be susceptible to vulnerabilities. In this example, you will use the aws_lambda_functions and orca_cves tables. You can use the below query to determine which of your lambda functions may be vulnerable:

select
aws.account_id as aws_account_id,
aws.region as region,
aws.arn as aws_resource_id,
cve.first_seen as vuln_first_seen,
cve.affected_packages,
cve.fix_available,
cve.severity,
cve.source_link
from
aws.aws_lambda_functions aws
left join
orca.orca_cves cve on cve.asset_vendor_id = aws.arn;

In this query, as before, you can use the asset_vendor_id field to join to your lambda function ARN. This allows you to select for descriptive fields about your lambda functions as well as actionable fields from your Orca scan, including which packages have been found vulnerable, severity of the vulnerability, if a fix is available, as well as the link back to NIST for more information about the vulnerability.

Be secure in your CSPM using CloudQuery and Orca today. Try CloudQuery with no credit card required and gain immediate insights into vulnerabilities and misconfigurations in your AWS environment. If you have any questions or want to connect with our engineering team, contact us or join our Community.

Want to see CloudQuery in action? Schedule a demo with our team or check out the platform documentation to learn more.

Want help getting started? Join the CloudQuery community to connect with other users and experts, or message our team directly here if you have any questions.

Try CloudQuery yourself

Self-hosted, open source, and free to start. Or schedule a demo to see the managed version.

Related posts

AWS

Security

Tutorials

Finding AWS Unrestricted Outbound Access in 2026: EC2, Lambda, and Beyond

Find EC2, Lambda, and ECS Fargate resources with unrestricted outbound access in AWS using SQL. Why egress controls still break attack chains in 2026.

Joe Karlsson

Joe Karlsson

May 5, 2026

AWS

Security

Tutorials

AWS IAM Identity Center with Google Workspace as an IdP: 2026 Step-by-Step Guide

Set up AWS IAM Identity Center with Google Workspace: SAML authentication, SCIM user provisioning, and group sync with CLI or ssosync. Updated for 2026.

Joe Karlsson

Joe Karlsson

May 5, 2026

AWS

Cloud Infrastructure

Security

Tutorials

Integrate AbuseIPDB Threat Intelligence with CloudQuery

Enrich your cloud asset inventory with AbuseIPDB threat intelligence to identify public cloud IPs with known abuse reports.

Joe Karlsson

Joe Karlsson

April 20, 2026

AWS

Cloud Infrastructure

Tutorials

How to Query ipinfo.io Data with CloudQuery

Learn how to enrich your cloud asset inventory with ipinfo.io IP geolocation and threat intelligence data using CloudQuery.

Joe Karlsson

Joe Karlsson

April 20, 2026

AWS

Security

Tutorials

AWS IAM Identity Center (Formerly AWS SSO): The Complete 2026 Guide

AWS IAM Identity Center replaced AWS SSO in 2022. Learn how to set it up, configure permission sets, use the AWS CLI, and audit access with CloudQuery.

Joe Karlsson

Joe Karlsson

April 6, 2026

AWS

Tutorials

AWS Pinpoint Is Being Deprecated: How to Assess Your Migration Scope

AWS Pinpoint reaches end of support October 2026. Query your Pinpoint usage across all accounts to find what needs migrating before the deadline.

Joe Karlsson

Joe Karlsson

March 24, 2026

AWS

Best Practices

Tutorials

CloudQuery Sync Performance: A Practical Troubleshooting Guide

Diagnose why CloudQuery syncs slow down after plugin upgrades, identify expensive tables, and use the CLI command that replaces the tables wildcard.

Joe Karlsson

Joe Karlsson

March 6, 2026

AWS

Security

Tutorials

Set Up AWS CLI with SSO (IAM Identity Center) — Step by Step

Set up AWS CLI v2 with IAM Identity Center in 5 minutes. Covers SSO registration scopes, sso-session config, token refresh, and multi-account profiles.

Yevgeny Pats

Yevgeny Pats

February 25, 2026

AWS

Cloud Infrastructure

Tutorials

AWS Lambda Python 3.9 End-of-Support: Find and Upgrade Every Affected Function

AWS Lambda Python 3.9 security patches stopped Dec 15, 2025. Find every affected function across all accounts with SQL queries and upgrade to 3.12 or 3.13.

Joe Karlsson

Joe Karlsson

February 10, 2026

Own your pipeline.
Own your data.