Skip to content

fix: DescribeInstances multi-filter + tag: support (#305); bump Go toolchain to 1.26.4 - #307

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/305-instance-filters-and-cves
Jun 3, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/305-instance-filters-and-cves

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Two related correctness/security fixes.

#305 — DescribeInstances filter bug (Fixed)

describeInstances only read Filter.1 and only honoured instance-state-name, so any Filter.2+ and all tag: filters were silently dropped — returning instances the caller had explicitly filtered out. Order-dependent: a running-only query led by a tag: filter would still return terminated instances. Found by spawn's Tier 0 CLI-against-substrate suite.

Fix: adopt the shared extractEC2Filters helper (the same one describeRouteTables adopted in #293) and AND-combine every filter via a new ec2InstanceMatchesFilters. Supported keys: instance-state-name, instance-state-code, instance-id, instance-type, image-id, vpc-id, subnet-id, key-name, tag:<key>, tag-key. Unknown filter keys match nothing rather than silently passing (the cardinal sin the issue calls out).

Tests: the exact acceptance scenario (launch+tag → describe with [tag:spawn:managed=true, instance-state-name=running] returns it, then terminate → same query excludes it), plus filter-order independence and the unknown-key case. Existing EC2 suite stays green.

Note: availability-zone/placement.availability-zone is not supported — EC2Instance has no AZ field today; it falls to the match-nothing path. Out of scope here; can be added with the field later.

Go toolchain → 1.26.4 (Security)

The Go Vulnerability Check was failing on main (and on PR #304) due to call-reachable stdlib advisories — GO-2026-5039 (net/textproto, reachable via http.Server.Serve) and GO-2026-5037 (crypto/x509) — fixed in go1.26.4 while CI built with 1.26.3. Added toolchain go1.26.4 to go.mod and test/e2e/go.mod; CI reads go-version-file: go.mod, so it now installs the patched toolchain. Verified locally: govulncheck ./... → 0 call-reachable vulnerabilities.

make test (race) + make lint clean on 1.26.4.

Closes #305

…olchain to 1.26.4

#305: describeInstances only read Filter.1 and only honored instance-state-name,
silently dropping Filter.2+ and all tag: filters — returning instances the caller
filtered out (order-dependent). Now uses the shared extractEC2Filters helper and
AND-combines all filters via new ec2InstanceMatchesFilters; supports
instance-state-name/-code, instance-id, instance-type, image-id, vpc-id,
subnet-id, key-name, tag:<key>, tag-key. Unknown keys match nothing (never
silently pass). Regression test covers launch+tag → terminate → state-filtered
describe excludes it, plus filter-order independence.

Security: bump go.mod + test/e2e/go.mod toolchain to go1.26.4 to clear
call-reachable stdlib advisories (GO-2026-5039 net/textproto, GO-2026-5037
crypto/x509); govulncheck now reports zero call-reachable vulnerabilities.

make test (race) + lint clean on 1.26.4.

Closes #305
@scttfrdmn
scttfrdmn merged commit c23dbd0 into main Jun 3, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/305-instance-filters-and-cves branch June 3, 2026 04:15
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.64865% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ec2_plugin.go 48.64% 19 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DescribeInstances only reads Filter.1 and only honors instance-state-name — multi-filter and tag: filters silently dropped

1 participant