-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR#2357 (aws plugin 1.5.0) breaks aws_ecr_image_scan_finding - 'List' call for table 'aws_ecr_image_scan_finding' is missing 1 required qual: column:'repository_name' #2367
Comments
pinging @ParthaI as you worked on the PR and other issue |
… manage the complex join queries Closes #2367
Hello @captainfalcon23, I’ve raised a draft PR with some updates to the table design to better handle complex queries. However, the design hasn’t been finalized yet. If you have some time, could you please try it out on the PR branch and share your feedback? Thank you! |
Hey @ParthaI sorry for the delay. I tested this today. So good news and bad news. Good news is the query now runs to completion. Bad news is that vulnerabilities for ALL image tags in a repo are being returned, instead of just the image specified in the join here:
On another topic, while the old plugin works, I noticed a while ago that due to the same above join, I assume aws_ecr_image_scan_finding has a parent hydrate using listAwsEcrImageTags. What happens is, this parent hydrate doesn't pass the context of which account it is from, so when using an aggregator, it tries all accounts defined, so the logs fill with:
Just thought to mention it while working on this particular table. |
Hello @captainfalcon23, Apologies for the delay. I have cross-checked the code in the PR you mentioned, and the results appear to be returning as expected. It seems like there is some issue while using the aggregator connection with CTE expression. While the rows are not being populated for all the accounts we have configured in our connection config. I am digging into it. The In the Common Table Expressions (CTEs), if a repository belongs to a specific account but is not available in another, the query will return Additionally, I have already handled the "Not Found" error code for the parent hydrate function in the table. I have also updated the query by adding Thank you for being so patient! |
Hello @captainfalcon23, I cross-verified the result it is working as expected. I think we are good over there. Query result: with images_with_tags AS (
SELECT
_ctx ->> 'connection_name' AS AWS_ACCOUNT_NAME,
account_id,
region,
repository_name,
image_pushed_at,
jsonb_array_elements_text(image_tags) AS image_tag
FROM
myawsaccount.aws_ecr_image
),
findings as (
select
f._ctx ->> 'connection_name' AS AWS_ACCOUNT_NAME,
f.account_id,
f.region,
f.repository_name,
f.severity,
f.attributes
from
myawsaccount.aws_ecr_image_scan_finding as f,
images_with_tags as t
where f.repository_name = t.repository_name
)
select
f._ctx ->> 'connection_name',
f.image_tag,
f.name AS COMMON_VULN_ID,
f.uri AS VULN_INFO_URL,
f.severity AS VULN_SEVERITY,
jsonb_path_query(f.attributes, '$[*] ? (@.Key == "package_name")') ->> 'Value' AS VULN_PACKAGE_NAME,
jsonb_path_query(f.attributes, '$[*] ? (@.Key == "package_version")') ->> 'Value' AS VULN_PACKAGE_VERSION
FROM
myawsaccount.aws_ecr_image_scan_finding as f,
images_with_tags as t
where
f.repository_name = t.repository_name
and f.image_tag = t.image_tag
and f.account_id = t.account_id
and f.region = t.region
+--------------------+-----------+----------------+--------------------------------------------------------------+---------------+-------------------+-----------------------------------+
| ?column? | image_tag | common_vuln_id | vuln_info_url | vuln_severity | vuln_package_name | vuln_package_version |
+--------------------+-----------+----------------+--------------------------------------------------------------+---------------+-------------------+-----------------------------------+
| aws_zero_intg_test | latest | CVE-2025-0395 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2025-0395 | MEDIUM | glibc | 2.31-0ubuntu9.16 |
| aws_zero_intg_test | latest | CVE-2025-23022 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2025-23022 | MEDIUM | freetype | 2.10.1-2ubuntu0.3 |
| aws_zero_intg_test | latest | CVE-2024-50602 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-50602 | MEDIUM | expat | 2.2.9-1ubuntu0.7 |
| aws_zero_intg_test | latest | CVE-2017-11164 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2017-11164 | INFORMATIONAL | pcre3 | 2:8.39-12ubuntu0.1 |
| aws_zero_intg_test | latest | CVE-2024-10041 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-10041 | MEDIUM | pam | 1.3.1-5ubuntu4.7 |
| aws_zero_intg_test | latest | CVE-2023-2004 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-2004 | MEDIUM | freetype | 2.10.1-2ubuntu0.3 |
| aws_zero_intg_test | latest | CVE-2022-49043 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-49043 | MEDIUM | libxml2 | 2.9.10+dfsg-5ubuntu0.20.04.7 |
| aws_zero_intg_test | latest | CVE-2023-50495 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-50495 | LOW | ncurses | 6.2-0ubuntu2.1 |
| aws_zero_intg_test | latest | CVE-2023-26604 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-26604 | LOW | systemd | 245.4-4ubuntu3.24 |
| aws_zero_intg_test | latest | CVE-2022-41409 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-41409 | LOW | pcre2 | 10.34-7ubuntu0.1 |
| aws_zero_intg_test | latest | CVE-2023-29383 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-29383 | LOW | shadow | 1:4.8.1-1ubuntu5.20.04.5 |
| aws_zero_intg_test | latest | CVE-2023-45918 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-45918 | LOW | ncurses | 6.2-0ubuntu2.1 |
| aws_zero_intg_test | latest | CVE-2024-56433 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-56433 | MEDIUM | shadow | 1:4.8.1-1ubuntu5.20.04.5 |
| aws_zero_intg_test | latest | CVE-2023-7008 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-7008 | LOW | systemd | 245.4-4ubuntu3.24 |
| aws_zero_intg_test | latest | CVE-2024-6716 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-6716 | LOW | tiff | 4.1.0+git191117-2ubuntu0.20.04.14 |
| aws_zero_intg_test | latest | CVE-2022-32325 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-32325 | LOW | libjpeg-turbo | 2.0.3-0ubuntu1.20.04.3 |
| aws_zero_intg_test | latest | CVE-2016-20013 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2016-20013 | INFORMATIONAL | glibc | 2.31-0ubuntu9.16 |
| aws_zero_intg_test | latest | CVE-2013-4235 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2013-4235 | LOW | shadow | 1:4.8.1-1ubuntu5.20.04.5 |
| aws_zero_intg_test | latest | CVE-2022-3857 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-3857 | LOW | libpng1.6 | 1.6.37-2 |
| aws_zero_intg_test | latest | CVE-2016-2781 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2016-2781 | LOW | coreutils | 8.30-3ubuntu2 |
| aws_zero_intg_test | latest | CVE-2022-3219 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-3219 | LOW | gnupg2 | 2.2.19-3ubuntu2.2 |
| aws_zero_intg_test | latest | CVE-2024-34459 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-34459 | LOW | libxml2 | 2.9.10+dfsg-5ubuntu0.20.04.7 |
| aws_zero_intg_test | latest | CVE-2015-9019 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2015-9019 | LOW | libxslt | 1.1.34-4ubuntu0.20.04.1 |
| aws_zero_intg_test | latest | CVE-2024-2236 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-2236 | LOW | libgcrypt20 | 1.8.5-5ubuntu1.1 |
| aws_zero_intg_test | latest | CVE-2024-50602 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-50602 | MEDIUM | expat | 2.2.9-1ubuntu0.7 |
| aws_zero_intg_test | latest | CVE-2022-49043 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-49043 | MEDIUM | libxml2 | 2.9.10+dfsg-5ubuntu0.20.04.7 |
| aws_zero_intg_test | latest | CVE-2015-9019 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2015-9019 | LOW | libxslt | 1.1.34-4ubuntu0.20.04.1 |
| aws_zero_intg_test | latest | CVE-2024-2236 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-2236 | LOW | libgcrypt20 | 1.8.5-5ubuntu1.1 |
| aws_zero_intg_test | latest | CVE-2023-2004 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-2004 | MEDIUM | freetype | 2.10.1-2ubuntu0.3 |
| aws_zero_intg_test | latest | CVE-2017-11164 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2017-11164 | INFORMATIONAL | pcre3 | 2:8.39-12ubuntu0.1 |
| aws_zero_intg_test | latest | CVE-2025-0395 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2025-0395 | MEDIUM | glibc | 2.31-0ubuntu9.16 |
| aws_zero_intg_test | latest | CVE-2022-32325 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-32325 | LOW | libjpeg-turbo | 2.0.3-0ubuntu1.20.04.3 |
| aws_zero_intg_test | latest | CVE-2024-10041 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-10041 | MEDIUM | pam | 1.3.1-5ubuntu4.7 |
| aws_zero_intg_test | latest | CVE-2025-23022 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2025-23022 | MEDIUM | freetype | 2.10.1-2ubuntu0.3 |
| aws_zero_intg_test | latest | CVE-2016-2781 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2016-2781 | LOW | coreutils | 8.30-3ubuntu2 |
| aws_zero_intg_test | latest | CVE-2023-29383 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-29383 | LOW | shadow | 1:4.8.1-1ubuntu5.20.04.5 |
| aws_zero_intg_test | latest | CVE-2022-3857 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-3857 | LOW | libpng1.6 | 1.6.37-2 |
| aws_zero_intg_test | latest | CVE-2022-3219 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-3219 | LOW | gnupg2 | 2.2.19-3ubuntu2.2 |
| aws_zero_intg_test | latest | CVE-2023-7008 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-7008 | LOW | systemd | 245.4-4ubuntu3.24 |
| aws_zero_intg_test | latest | CVE-2024-56433 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-56433 | MEDIUM | shadow | 1:4.8.1-1ubuntu5.20.04.5 |
| aws_zero_intg_test | latest | CVE-2024-34459 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-34459 | LOW | libxml2 | 2.9.10+dfsg-5ubuntu0.20.04.7 |
| aws_zero_intg_test | latest | CVE-2023-45918 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-45918 | LOW | ncurses | 6.2-0ubuntu2.1 |
| aws_zero_intg_test | latest | CVE-2016-20013 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2016-20013 | INFORMATIONAL | glibc | 2.31-0ubuntu9.16 |
| aws_zero_intg_test | latest | CVE-2023-50495 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-50495 | LOW | ncurses | 6.2-0ubuntu2.1 |
| aws_zero_intg_test | latest | CVE-2022-41409 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-41409 | LOW | pcre2 | 10.34-7ubuntu0.1 |
| aws_zero_intg_test | latest | CVE-2023-26604 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-26604 | LOW | systemd | 245.4-4ubuntu3.24 |
| aws_zero_intg_test | latest | CVE-2024-6716 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-6716 | LOW | tiff | 4.1.0+git191117-2ubuntu0.20.04.14 |
| aws_zero_intg_test | latest | CVE-2013-4235 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2013-4235 | LOW | shadow | 1:4.8.1-1ubuntu5.20.04.5 |
| aws | latest | CVE-2016-2781 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2016-2781 | LOW | coreutils | 8.30-3ubuntu2 |
| aws | latest | CVE-2020-22916 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2020-22916 | MEDIUM | xz-utils | 5.2.4-1ubuntu1.1 |
| aws | latest | CVE-2017-11164 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2017-11164 | INFORMATIONAL | pcre3 | 2:8.39-12ubuntu0.1 |
| aws | latest | CVE-2023-45918 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-45918 | LOW | ncurses | 6.2-0ubuntu2.1 |
| aws | latest | CVE-2023-29383 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-29383 | LOW | shadow | 1:4.8.1-1ubuntu5.20.04.5 |
| aws | latest | CVE-2023-7008 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2023-7008 | LOW | systemd | 245.4-4ubuntu3.23 |
| aws | latest | CVE-2022-3219 | http://people.ubuntu.com/~ubuntu-security/cve/CVE-2022-3219 | LOW | gnupg2 | 2.2.19-3ubuntu2.2 | |
Describe the bug
When using AWS provider 1.4.0, the following query works fine and returns results with no errors as expected and works fine. However, after upgrading to aws plugin 1.5.0, we get the following error:
Steampipe version (
steampipe -v
)Steampipe v1.0.1
Plugin version (
steampipe plugin list
)hub.steampipe.io/plugins/turbot/[email protected] | 1.4.0
hub.steampipe.io/plugins/turbot/aws@latest | 1.5.0
To reproduce
Run the query above using aws plugin 1.40 and 1.5.0
Expected behavior
Query should continue to work, as from what I can see in the PR, only an additional qual was added, which I wouldn't have expected would affect this functionaility.
Additional context
Refer #2356 and #2357
The text was updated successfully, but these errors were encountered: