Commit graph

1,185 commits

Author SHA1 Message Date
Kyle Quest
99af1cae80 wolfictl apk extract-locked-configs CLI command
Signed-off-by: Kyle Quest <kcq.public@gmail.com>
2026-05-17 14:12:13 -07:00
Kyle Quest
bfc0a69b6c Enhanced version of the wolfictl CLI with additional commands, flags and bug fixes
Signed-off-by: Kyle Quest <kcq.public@gmail.com>
2026-05-09 16:20:25 -07:00
Jon Johnson
8b8a869568
dag: Allow multiple pipeline dirs (#1899)
We can pass multiple pipeline dirs for melange configs, so we should
accept multiple in dag.NewPackages.

Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
2026-03-09 15:36:09 -07:00
dann frazier
1869558ab5
Merge pull request #1882 from dannf/lint/sccache-enabled
feat(lint): add rule to check for sccache/enable users
2026-02-25 11:43:02 -07:00
dann frazier
919245ac07
feat(lint): add rule to check for sccache/enable users
This pipeline is intended for local devel use only. Using it in elastic
will, at best, slow things down by caching things unnecessarily.
There may be other side-effects as well - let's just block them.

Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
2026-02-25 11:19:13 -07:00
Dimitri John Ledkov
af8a800aaa
Remove obsolete commands
These commands are now obsolete and new versions moved to cg.
2026-02-03 21:55:26 +01:00
Azimjon Ulmasov
c61a0258dc
lint: merge main
Signed-off-by: Azimjon Ulmasov <azimjon.ulmasov@chainguard.dev>
2026-01-21 11:35:08 -05:00
Azimjon Ulmasov
c55bc93caa
lint: drop redundant regex and some small fixes
Signed-off-by: Azimjon Ulmasov <azimjon.ulmasov@chainguard.dev>
2026-01-21 11:25:25 -05:00
Azimjon Ulmasov
abe70b4d29
lint: add fetch-templating rule to validate version templates
Signed-off-by: Azimjon Ulmasov <azimjon.ulmasov@chainguard.dev>
2026-01-20 12:49:50 -05:00
Łukasz 'sil2100' Zemczak
d2fc08fd00
Switch to SeverityWarning
Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
2026-01-20 18:41:52 +01:00
Łukasz 'sil2100' Zemczak
066dbe92cb
feat(pkg/lint): flag packages that depend on unversioned python packages
Signed-off-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@chainguard.dev>
2026-01-13 11:27:51 +01:00
Jon Johnson
c559967a28
lint: Handle multiple args
Now we can run:

```
wolfictl lint foo bar baz
```

This diff feels a little goofy but I didn't want to touch the actual
linter code, and this keeps the diff small and simple.

Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
2026-01-12 13:53:41 -08:00
Sergio Durigan Junior
abbc201c7f bump.go: Ignore bot-generated CVE/GHSA comments
octo-sts will [add CVE/GHSA
comments](352a0137b9) whenever it
bumps a package's epoch to fix a security issue.  This is good, but we
should remove those comments when we invoke `wolfictl bump`, otherwise
they will wrongly imply that the manual bump was related to the
security fix as well.

I tried to be conservative here and only remove the comments that
start with "(CVE|GHSA)-", because there is a possibility to find an
actual human-made comment and we don't want to touch those (although
IMO it should be considered bad practice to leave manual comments
right after the `epoch` definition).

Signed-off-by: Sergio Durigan Junior <sergiodj@chainguard.dev>
2025-12-03 12:06:58 -05:00
Kyle Steere
b2d10907af
fix integration test issue
Signed-off-by: Kyle Steere <kyle.steere@chainguard.dev>
2025-12-02 16:22:40 -06:00
Kyle Steere
848fb42347
fix deprecated VulnerabilityMetadata with direct references since m.vulnerability now contains the metadata
Signed-off-by: Kyle Steere <kyle.steere@chainguard.dev>
2025-12-02 16:13:23 -06:00
Sam Singh-Crawford
5c49260952
refactor: use explicit matching instead of prefix 2025-11-03 12:29:20 -05:00
Sam Singh-Crawford
0d8f17efb2
feat(pkg/sbom/cpe.go): include gitlab-operator-fips in the exception for gitlab-* cve matching
Modifying the gitlab-operator exception in this PR to extend to the FIPS
version of gitlab-operator:
https://github.com/wolfi-dev/wolfictl/pull/1755
2025-11-03 11:14:04 -05:00
Steve Beattie
0996670ede
lint: add linter for unused var-transform variables
Add a linter to find variables that are defined in the var-transform
section but don't get referenced elsewhere and thus are unnecessary
definitions. As an unneeded variable definition does not cause build
failures, the lint check reports at level 'warning'.

Sample result from wolfi-dev/os:

```
$ wolfictl lint at-spi2-core.yaml
2025/10/15 21:27:32 ERRO Package: at-spi2-core: [unused-var-transform]: var-transform creates unused variable "mangled-package-version" (WARNING)
```

Testcases are added for flagging simple cases as well as to ensure
that false positives don't occur.

v2: remove no longer used argument in walkNode().
v3: report all unused variable definitions, rather than the first one
    found, and adjust testcase for multiple unused variables.

Signed-off-by: Steve Beattie <steve.beattie@chainguard.dev>
2025-10-22 21:25:37 -07:00
Nghia Tran
8f261f97d3
lint
Signed-off-by: Nghia Tran <tcnghia@gmail.com>
2025-09-12 13:14:59 -07:00
Nghia Tran
dc30ff0256
Expose the DB built age as a func
Signed-off-by: Nghia Tran <tcnghia@gmail.com>
2025-09-12 13:06:27 -07:00
philroche
b17050123e
feat(pkg/sbom/cpe.go): Add exception for gitlab-operator to avoid matching as gitlab-* package and gitlab product
Not all gitlab-* packages should be treated as GitLab, but most of them are - as seen in

```
if strings.HasPrefix(name, "gitlab-") {
		attr.Vendor = "gitlab"
		attr.Product = "gitlab"
		attr.SWEdition = "community"

		return &attr
	}
```

Added in 1c050aa720

One notable exception is gitlab-operator, which is a Kubernetes operator
for managing GitLab installations, and not part of GitLab itself with
source @ https://gitlab.com/gitlab-org/cloud-native/gitlab-operator

Adding an explicit exception for this package to not match on `gitlab-*`

The reason for this change is because new gitlab-operator package was being matched with all older gitlab CVEs which is incorrect.

Signed-off-by: philroche <phil.roche@chainguard.dev>
2025-09-05 17:04:15 +01:00
Dan Luhring
582d0583b0
fix(sbom): remove rpm cataloger
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-09-03 07:48:16 -04:00
Dan Luhring
6e67550091
update comment
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-08-26 17:20:26 -04:00
Dan Luhring
74d296a2cc
chore(sbom): resolve warning for directory source
Syft logs a warning if you're using a directory source but don't set a 'source.Alias' value for the source. This log message isn't warning about anything that impacts the accuracy of the analysis, but it's nonetheless noisy and annoying. This PR plugs in an alias value to avoid the warning. It also moves the Syft-to-clog wiring slightly earlier to make the effect of this change reproducible with the local CLI.

Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-08-26 16:51:26 -04:00
Dan Luhring
4dfdeb10d4
update SBOM int test goldenfiles for syft 1.31.0
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-08-13 20:11:42 -04:00
James Page
a3ad72bd64 Rename option to packages-file 2025-08-11 12:21:41 +01:00
James Page
1f1aec20cb withdrawn-packages-file -> withdrawn-packages 2025-08-11 09:42:23 +01:00
James Page
f49bd73606 withdraw: add option to read from file
As part of the work to garbage collect older apk files we need to be
able to withdraw more packages that can be supported as command line
arguments from APK indexes; add option to pass the list of packages to
withdraw as a file to support larger withdrawal options.
2025-08-11 09:34:03 +01:00
Dan Luhring
c88ca6e7b1
test: update golden files for grype 0.97.0
Update test golden files to match the new vulnerability output
from grype 0.97.0. The new version produces different vulnerability
matches due to updated vulnerability database and matching logic.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-07-31 20:10:16 -04:00
Dan Luhring
b85b2a2fc6
fix: update distro.FromRelease call for grype 0.97.0 API change
Add nil as second parameter to distro.FromRelease to handle the new
fix channels API requirement. Since wolfictl doesn't scan Red Hat
systems and has no need for EUS channel functionality, passing nil
is appropriate.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-07-31 19:57:25 -04:00
Kevin Davis
6ae3819e57
Bump apko and melange + handle apko field renames
Bumps apko and melange to the latest version. Handle field renames from
latest apko version.
2025-07-30 16:17:50 -05:00
Konrad Zapalowicz
cce70b9964
lint: add rule to make sure update identifier matches git repo (#1693)
The update identifier must match the github repository because, otherwise,
updating the package fails. Actualy, we have had a case already where a package
definition was copied & pasted from another and these values were not updated
to match.

To catch any further mismatches like that this commit adds a new linter rule:
update-identifier-must-match-git-repository.

It checks, in a case insensitive manner, whether the GitHub repository URL
contains a GitHub identifier that matches the one from the update section of
the package yaml.

Furthermore, because a single package can have multiple pipelines, this linter
looks for a single match, i.e. a single repository URL from all of the
pipelines that are using git-checkout must match the update identifier in order
to pass.

Note that is possible to opt-out from it by using the #nolint feature with this
linter name. See:
update-identifier-not-matching-git-checkout-repository-nolint.yaml to see how
that is done.

Signed-off-by: Konrad Zapałowicz <konrad.zapalowicz@chainguard.dev>
2025-07-28 20:09:44 +02:00
Jon Johnson
1853c96509
Merge pull request #1676 from jonjohnsonjr/runtime-deps
Stop considering runtime deps for build order
2025-07-21 14:41:07 -07:00
Konrad Zapałowicz
a3f089593c
test(linter): reduce error messages ambiguity
The assert.Equal() expects the parameters to follow the "expected, actual"
order. However, the test assertions for linter rules were written in the
reversed order. While doing so has no functional consequences the output was
confusing.

This commit fixes that by introducing the proper order of parameters.

Signed-off-by: Konrad Zapałowicz <konrad.zapalowicz@chainguard.dev>
2025-07-21 12:16:38 +02:00
Hector Fernandez
aaffeec22d
scan: add a comment to justify the change to 120h
Signed-off-by: Hector Fernandez <hector@chainguard.dev>
2025-07-14 20:02:42 +02:00
Hector Fernandez
901ee4f34f
scan: add a warning when age is older than 48h for now
Signed-off-by: Hector Fernandez <hector@chainguard.dev>
2025-07-14 19:58:18 +02:00
Hector Fernandez
4d646d09ed
scan: make max db allowed build age configurable
Signed-off-by: Hector Fernandez <hector@chainguard.dev>
2025-07-14 19:07:03 +02:00
antitree
b4c3bf9d8a
Merge pull request #1649 from antitree/main
feat: Add linter to check for potentially hanging tests
2025-07-11 10:44:47 -04:00
Jon Johnson
cbdd780d82
Stop considering runtime deps for build order
This causes spurious cycles, and the reason for doing this (#1217) is no
longer relevant. If a transitive build dependency's runtime dependency
is important enough that we want to consider it for build ordering, it's
straightforward to add it as a direct build dependency.

Fixes #1385

Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
2025-07-10 13:55:55 -07:00
Dan Luhring
15eb9d9409
fix(scan): ensure deterministic ordering of merged findings
The merge logic was using map iteration which resulted in non-deterministic
ordering of findings. This caused integration tests to fail intermittently
as the output order would change between runs.

Fixed by adding a sort step after merging to ensure consistent ordering
using the existing Findings sort interface (by location, then name, then
vulnerability ID).

Updated all integration test golden files to reflect the new deterministic
output ordering.

Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-07-04 12:00:55 -04:00
Dan Luhring
fb404af98a
chore(scan): fix golangci-lint rangeValCopy warnings
Use index-based iteration instead of value copying for Finding structs
to avoid copying 216 bytes on each iteration. Also fixed:
- Changed packageKey field from 'type_' to 'typ' (avoiding reserved keyword)
- Ensured all files end with a newline

All tests pass and no functional changes were made.

Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-07-04 11:37:25 -04:00
Dan Luhring
688e0248e1
test(scan): update golden files for deduplicated vulnerability findings
Update integration test golden files to reflect the new behavior where
duplicate vulnerability findings are merged. The changes show:

- Reduced finding counts across all test cases (e.g., crane-0.14.0-r0
  dropped from 73 to 72 findings)
- Proper alias preservation in merged findings (e.g., GHSA findings now
  include their CVE aliases)
- Consistent deduplication behavior across different architectures

These changes are expected and demonstrate that the merge logic is working
correctly by:
1. Eliminating duplicate reports of the same vulnerability
2. Preserving all alias information in the remaining findings
3. Maintaining separation of findings from different packages

The reduction in findings improves the signal-to-noise ratio for users
while ensuring no vulnerability information is lost.

Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-07-04 11:30:44 -04:00
Dan Luhring
d1c661d207
feat(scan): deduplicate vulnerability findings with different IDs
Add logic to merge findings that represent the same vulnerability but are
reported under different identifiers (e.g., CVE-2023-1234 vs GHSA-xxxx).
This reduces noise in scan results when Grype reports the same vulnerability
multiple times through different matchers.

The implementation:
- Groups findings by package (name, type, location) before merging
- Identifies related findings when their ID/alias sets overlap
- Preserves the union of all aliases seen across merged findings
- Prefers findings with more complete alias data (GHSA > CVE)

This ensures that vulnerability filtering and advisory matching work
correctly by having access to all known aliases for each vulnerability,
while presenting cleaner output to users.

Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-07-04 11:15:45 -04:00
antitree
6b5bbe777c
Merge branch 'wolfi-dev:main' into main 2025-07-02 13:31:42 -04:00
antitree
026142edad
linter: avoid false positives for double ampersand (#6) 2025-07-02 13:30:08 -04:00
antitree
b3a3a33427
fix background process regex (#5) 2025-07-02 13:16:08 -04:00
antitree
90c445e019
lint: detect multiline background processes without redirect (#4) 2025-07-02 13:05:08 -04:00
antitree
2c3d0dcf62
fix lint false positive for -d (#3) 2025-07-02 12:55:27 -04:00
antitree
1e3ee6d85a
lint: detect daemon flags and redirects (#2) 2025-07-02 12:38:48 -04:00
Dan Luhring
d0785c17a9
chore(scan): add only primary evidence locations to findings
We've to discard other locations from the list, in part to keep the list of locations per finding minimal and thus easier to reason about as we're examining vulnerabilities for a package over time.

Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
2025-06-18 15:56:59 -04:00