Skip to content

Conversation

@ashnamehrotra
Copy link
Contributor

@ashnamehrotra ashnamehrotra commented Nov 20, 2025

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):

Fixes unit tests and updates all vulnerable modules/handles api incompatibilities introduced. Also fixes golang lint errors aside from revive lint (issue created for this for follow up as there are large file changes needed). Remaining vulnerability is from latest version of Trivy binary and cannot be resolved on eraser side:

ashnamehrotra@MacBookPro eraser % trivy image ghcr.io/aquasecurity/trivy:0.67.2
....
usr/local/bin/trivy (gobinary)

Total: 8 (UNKNOWN: 0, LOW: 0, MEDIUM: 4, HIGH: 4, CRITICAL: 0)

┌─────────────────────────────────────┬────────────────┬──────────┬────────┬───────────────────┬─────────────────────┬──────────────────────────────────────────────────────────────┐
│               Library               │ Vulnerability  │ Severity │ Status │ Installed Version │    Fixed Version    │                            Title                             │
├─────────────────────────────────────┼────────────────┼──────────┼────────┼───────────────────┼─────────────────────┼──────────────────────────────────────────────────────────────┤
│ github.com/containerd/containerd    │ CVE-2024-25621 │ HIGH     │ fixed  │ v1.7.28           │ 1.7.29              │ containerd is an open-source container runtime. Versions     │
│                                     │                │          │        │                   │                     │ 0.1.0 through ...                                            │
│                                     │                │          │        │                   │                     │ https://avd.aquasec.com/nvd/cve-2024-25621                   │
│                                     ├────────────────┼──────────┤        │                   │                     ├──────────────────────────────────────────────────────────────┤
│                                     │ CVE-2025-64329 │ MEDIUM   │        │                   │                     │ containerd is an open-source container runtime. Versions     │
│                                     │                │          │        │                   │                     │ 1.7.28 and be ...                                            │
│                                     │                │          │        │                   │                     │ https://avd.aquasec.com/nvd/cve-2025-64329                   │
├─────────────────────────────────────┼────────────────┼──────────┤        ├───────────────────┼─────────────────────┼──────────────────────────────────────────────────────────────┤
│ github.com/containerd/containerd/v2 │ CVE-2024-25621 │ HIGH     │        │ v2.1.4            │ 2.0.7, 2.1.5, 2.2.0 │ containerd is an open-source container runtime. Versions     │
│                                     │                │          │        │                   │                     │ 0.1.0 through ...                                            │
│                                     │                │          │        │                   │                     │ https://avd.aquasec.com/nvd/cve-2024-25621                   │
│                                     ├────────────────┼──────────┤        │                   │                     ├──────────────────────────────────────────────────────────────┤
│                                     │ CVE-2025-64329 │ MEDIUM   │        │                   │                     │ containerd is an open-source container runtime. Versions     │
│                                     │                │          │        │                   │                     │ 1.7.28 and be ...                                            │
│                                     │                │          │        │                   │                     │ https://avd.aquasec.com/nvd/cve-2025-64329                   │
├─────────────────────────────────────┼────────────────┼──────────┤        ├───────────────────┼─────────────────────┼──────────────────────────────────────────────────────────────┤
│ github.com/opencontainers/selinux   │ CVE-2025-52881 │ HIGH     │        │ v1.12.0           │ 1.13.0              │ runc: opencontainers/selinux: container escape and denial of │
│                                     │                │          │        │                   │                     │ service due to arbitrary write...                            │
│                                     │                │          │        │                   │                     │ https://avd.aquasec.com/nvd/cve-2025-52881                   │
├─────────────────────────────────────┼────────────────┼──────────┤        ├───────────────────┼─────────────────────┼──────────────────────────────────────────────────────────────┤
│ golang.org/x/crypto                 │ CVE-2025-47914 │ MEDIUM   │        │ v0.42.0           │ 0.45.0              │ SSH Agent servers do not validate the size of messages when  │
│                                     │                │          │        │                   │                     │ processing...                                                │
│                                     │                │          │        │                   │                     │ https://avd.aquasec.com/nvd/cve-2025-47914                   │
│                                     ├────────────────┤          │        │                   │                     ├──────────────────────────────────────────────────────────────┤
│                                     │ CVE-2025-58181 │          │        │                   │                     │ SSH servers parsing GSSAPI authentication requests do not    │
│                                     │                │          │        │                   │                     │ validate the ...                                             │
│                                     │                │          │        │                   │                     │ https://avd.aquasec.com/nvd/cve-2025-58181                   │
├─────────────────────────────────────┼────────────────┼──────────┤        ├───────────────────┼─────────────────────┼──────────────────────────────────────────────────────────────┤
│ stdlib                              │ CVE-2025-58187 │ HIGH     │        │ 1.25.2            │ 1.24.9, 1.25.3      │ Due to the design of the name constraint checking algorithm, │
│                                     │                │          │        │                   │                     │ the proce...                                                 │
│                                     │                │          │        │                   │                     │ https://avd.aquasec.com/nvd/cve-2025-58187                   │
└─────────────────────────────────────┴───────

Special notes for your reviewer:

- Convert .golangci.yaml from v1 to v2 format with version: '2'
- Replace deprecated linters: exportloopref -> copyloopvar
- Move formatters (gofmt, gofumpt, goimports) to formatters section
- Update linters.disable-all to linters.default: none
- Update Go version in CI from 1.21 to 1.23 to match go.mod
- Add exclusion for docs directory to avoid linting generated files

Fixes the CI error: 'unsupported version of the configuration'

Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
@christensenjairus
Copy link

Thanks for looking into this @ashnamehrotra! We look forward to the new release :)

Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 0% with 65 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/remover/remover.go 0.00% 18 Missing ⚠️
controllers/imagejob/imagejob_controller.go 0.00% 11 Missing ⚠️
main.go 0.00% 10 Missing ⚠️
controllers/imagelist/imagelist_controller.go 0.00% 8 Missing ⚠️
pkg/collector/collector.go 0.00% 6 Missing ⚠️
pkg/scanners/template/scanner_template.go 0.00% 4 Missing ⚠️
...ollers/imagecollector/imagecollector_controller.go 0.00% 2 Missing ⚠️
pkg/scanners/trivy/trivy.go 0.00% 2 Missing ⚠️
test/e2e/util/utils.go 0.00% 2 Missing ⚠️
controllers/configmap/configmap.go 0.00% 1 Missing ⚠️
... and 1 more
Flag Coverage Δ
unittests 3.87% <0.00%> (-10.97%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
controllers/controller.go 0.00% <ø> (ø)
pkg/scanners/trivy/helpers.go 0.00% <ø> (ø)
pkg/scanners/trivy/types.go 30.15% <ø> (-8.68%) ⬇️
pkg/utils/utils.go 13.30% <ø> (+1.46%) ⬆️
...party/open-policy-agent/gatekeeper/helmify/main.go 0.00% <ø> (ø)
version/version.go 100.00% <ø> (ø)
controllers/configmap/configmap.go 0.00% <0.00%> (ø)
controllers/util/util.go 0.00% <0.00%> (ø)
...ollers/imagecollector/imagecollector_controller.go 0.00% <0.00%> (ø)
pkg/scanners/trivy/trivy.go 0.00% <0.00%> (ø)
... and 7 more

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
func checkNodeFitness(pod *corev1.Pod, node *corev1.Node) bool {
nodeInfo := framework.NewNodeInfo()
nodeInfo.SetNode(node)
// Check if node has sufficient resources for the pod
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we reimplement this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The framework package it was using introduces k8s.io/kubernetes vulnerabilities which is what this was trying to resolve. In order to upgrade this to latest version, it would require major controller runtime api changes. By removing the dependency on this we can eliminate both the dependency and vulns.

return nil, err
}

//nolint:staticcheck // SA1019: grpc.DialContext is deprecated but maintains required blocking behavior
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we open issues for these too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created issue to track #1188

Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
@christensenjairus
Copy link

christensenjairus commented Dec 2, 2025

One of the specific vulns we're looking to get remediated by a new release is CVE-2025-58188

@ashnamehrotra @sozercan

Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
Signed-off-by: Ashna Mehrotra <ashnamehrotra@gmail.com>
Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! lgtm

@sozercan
Copy link
Member

sozercan commented Dec 2, 2025

@christensenjairus yes, after this is merged and we cut a release that CVE will be resolved since we'll be building with latest version of Go

@ashnamehrotra ashnamehrotra merged commit 88b606c into eraser-dev:main Dec 2, 2025
91 of 94 checks passed
ashnamehrotra added a commit to ashnamehrotra/eraser that referenced this pull request Dec 2, 2025
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: Ashna Mehrotra <ashnamehrotra@gmail.com>
Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
ashnamehrotra added a commit that referenced this pull request Dec 2, 2025
Signed-off-by: ashnamehrotra <ashnamehrotra@gmail.com>
Signed-off-by: Ashna Mehrotra <ashnamehrotra@gmail.com>
Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
alexlebens pushed a commit to alexlebens/infrastructure that referenced this pull request Dec 3, 2025
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [eraser](https://github.com/eraser-dev/eraser) | minor | `v1.3.1` -> `1.4.1` |

---

### Release Notes

<details>
<summary>eraser-dev/eraser (eraser)</summary>

### [`v1.4.1`](https://github.com/eraser-dev/eraser/releases/tag/v1.4.1)

[Compare Source](eraser-dev/eraser@v1.3.1...v1.4.1)

#### Chores

- Prepare v1.4.0 release ([#&#8203;1085](eraser-dev/eraser#1085)) [#&#8203;1085](eraser-dev/eraser#1085) ([github-actions\[bot\]](eraser-dev/eraser@e89d585))
- Prepare v1.4.1 release ([#&#8203;1190](eraser-dev/eraser#1190)) [#&#8203;1190](eraser-dev/eraser#1190) ([github-actions\[bot\]](eraser-dev/eraser@bb7634b))
- fix vulnerabilities and CI failures ([#&#8203;1179](eraser-dev/eraser#1179)) ([Ashna Mehrotra](eraser-dev/eraser@a9cfd88))
- revert "chore: Prepare v1.4.1 release" ([#&#8203;1191](eraser-dev/eraser#1191)) [#&#8203;1191](eraser-dev/eraser#1191) ([Ashna Mehrotra](eraser-dev/eraser@311e972))
- release 1.4.1 cherry pick module upgrades ([#&#8203;1192](eraser-dev/eraser#1192)) [#&#8203;1192](eraser-dev/eraser#1192) ([Ashna Mehrotra](eraser-dev/eraser@96b21ed))
- Prepare v1.4.1 release ([#&#8203;1193](eraser-dev/eraser#1193)) [#&#8203;1193](eraser-dev/eraser#1193) ([github-actions\[bot\]](eraser-dev/eraser@4b1a834))

#### Commits

- [`1d7dabe`](eraser-dev/eraser@1d7dabe): Upgrade OpenTelemetry modules to v1.37.0 and migrate deprecated APIs ([#&#8203;1160](eraser-dev/eraser#1160)) (Copilot)
- [`a5e6a65`](eraser-dev/eraser@a5e6a65): Merge branch 'release-1.4' of github.com:Azure/eraser into release-1.4 (ashnamehrotra)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi41LjAiLCJ1cGRhdGVkSW5WZXIiOiI0Mi41LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImNoYXJ0Il19-->

Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/2217
Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net>
Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
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.

3 participants