Skip to content
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

chore: merge changes from upstream #6

Merged
merged 95 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
d1d7132
chore(deps): bump go-ebs-file (#7513)
nikpivkin Sep 18, 2024
aeb7039
fix(sbom): parse type `framework` as `library` when unmarshalling `Cy…
DmitriyLewen Sep 18, 2024
dbd2dd6
refactor(misconf): pass options to Rego scanner as is (#7529)
nikpivkin Sep 18, 2024
5dd94eb
fix(sbom): export bom-ref when converting a package to a component (#…
afdesk Sep 19, 2024
1f9fc13
perf(misconf): use port ranges instead of enumeration (#7549)
nikpivkin Sep 20, 2024
37d549e
fix(misconf): Fixed scope for China Cloud (#7560)
bloomadcariad Sep 23, 2024
8128ecc
docs(misconf): Add more info on how to use arbitrary JSON/YAML scan f…
simar7 Sep 26, 2024
bbc8e1d
chore(deps): remove broken replaces for opa and discovery (#7600)
lebauce Sep 26, 2024
fea7250
ci: cache test images for `integration`, `VM` and `module` tests (#7599)
DmitriyLewen Sep 26, 2024
1fdf30a
ci: add `workflow_dispatch` trigger for test workflow. (#7606)
DmitriyLewen Sep 26, 2024
3fa24e8
chore(deps): bump the common group across 1 directory with 20 updates…
dependabot[bot] Sep 26, 2024
13ef3e7
fix(db): check `DownloadedAt` for `trivy-java-db` (#7592)
DmitriyLewen Sep 26, 2024
a8fbe46
fix: allow access to '..' in mapfs (#7575)
nikpivkin Sep 27, 2024
9baf658
test: use a local registry for remote scanning (#7607)
knqyf263 Sep 27, 2024
ea0cf03
fix(misconf): escape all special sequences (#7558)
nikpivkin Sep 28, 2024
ef0a27d
feat(misconf): add ability to disable checks by ID (#7536)
nikpivkin Sep 28, 2024
efdb68d
feat(suse): added SUSE Linux Enterprise Micro support (#7294)
msmeissn Sep 29, 2024
de40df9
fix(misconf): disable DS016 check for image history analyzer (#7540)
nikpivkin Sep 30, 2024
cb16d43
ci: split `save` and `restore` cache actions (#7614)
DmitriyLewen Sep 30, 2024
9d1be41
refactor: fix auth error handling (#7615)
knqyf263 Sep 30, 2024
60725f8
feat(secret): enhance secret scanning for python binary files (#7223)
afdesk Sep 30, 2024
b836232
feat(java): add empty versions if `pom.xml` dependency versions can't…
DmitriyLewen Sep 30, 2024
d4edeb5
test: use loaded image names (#7617)
knqyf263 Oct 1, 2024
7602d14
ci: don't use cache for `setup-go` (#7622)
DmitriyLewen Oct 1, 2024
3562529
feat: support multiple DB repositories for vulnerability and Java DB …
nikpivkin Oct 1, 2024
c0e8da3
feat(misconf): Support `--skip-*` for all included modules (#7579)
simar7 Oct 2, 2024
1faf529
chore: add prefixes to log messages (#7625)
knqyf263 Oct 2, 2024
82e2adc
fix(misconf): Disable deprecated checks by default (#7632)
simar7 Oct 2, 2024
8735242
chore(deps): Bump trivy-checks to v1.1.0 (#7631)
simar7 Oct 2, 2024
3e1fa21
fix(secret): change grafana token regex to find them without unquoted…
sgaist Oct 2, 2024
69bf7e0
feat: support RPM archives (#7628)
knqyf263 Oct 2, 2024
fcaea74
fix(misconf): not to warn about missing selectors of libraries (#7638)
nikpivkin Oct 3, 2024
d246401
release: v0.56.0 [main] (#7447)
aqua-bot Oct 3, 2024
cb0b3a9
feat(cli): error out when ignore file cannot be found (#7624)
sgaist Oct 3, 2024
2c87f0c
fix(db): fix javadb downloading error handling (#7642)
nikpivkin Oct 3, 2024
ab3a3b2
docs(report): Improve SARIF reporting doc (#7655)
pbaumard Oct 7, 2024
015bb88
fix(report): Fix invalid URI in SARIF report (#7645)
pbaumard Oct 7, 2024
a585e95
fix(redhat): include arch in PURL qualifiers (#7654)
knqyf263 Oct 7, 2024
fdf203c
fix(repo): `git clone` output to Stderr (#7561)
dangogh Oct 8, 2024
55b5a7e
docs(report): fix reporting doc format (#7671)
pbaumard Oct 8, 2024
1f2e91b
fix(sbom): add options for DBs in private registries (#7660)
knqyf263 Oct 9, 2024
27117f8
feat(cli): add `trivy auth` (#7664)
knqyf263 Oct 9, 2024
672e886
fix(cli): `clean --all` deletes only relevant dirs (#7704)
knqyf263 Oct 10, 2024
c78f45b
refactor(misconf): introduce generic scanner (#7515)
nikpivkin Oct 11, 2024
31aa20a
docs: apt-transport-https is a transitional package (#7678)
simondeziel Oct 14, 2024
633a7ab
feat(cli): rename `trivy auth` to `trivy registry` (#7727)
knqyf263 Oct 15, 2024
ad91412
feat(misconf): public network support for Azure Storage Account (#7601)
nikpivkin Oct 16, 2024
83e5b83
docs: add note about disabled DS016 check (#7724)
nikpivkin Oct 16, 2024
bcfc37b
test: define constants for test images (#7739)
knqyf263 Oct 16, 2024
2eaa17e
feat(misconf): ssl_mode support for GCP SQL DB instance (#7564)
nikpivkin Oct 17, 2024
9da84f5
fix(misconf): change default ACL of digitalocean_spaces_bucket to pri…
nikpivkin Oct 17, 2024
c8c14d3
fix(misconf): check if property is not nil before conversion (#7578)
nikpivkin Oct 17, 2024
778df82
fix(java): correctly inherit `version` and `scope` from upper/root `d…
DmitriyLewen Oct 17, 2024
922949a
test: use forked images (#7755)
knqyf263 Oct 17, 2024
a7baa93
feat(parser): ignore white space in pom.xml files (#7747)
sgaist Oct 17, 2024
cd44bb4
refactor(misconf): simplify k8s scanner (#7717)
nikpivkin Oct 17, 2024
35fd018
fix(misconf): fix for Azure Storage Account network acls adaptation (…
nikpivkin Oct 18, 2024
c225883
feat(cyclonedx): add file checksums to `CycloneDX` reports (#7507)
Churro Oct 18, 2024
8d5dbc9
fix(misconf): properly expand dynamic blocks (#7612)
nikpivkin Oct 19, 2024
57e24aa
fix: enable usestdlibvars linter (#7770)
mmorel-35 Oct 21, 2024
f6acdf7
fix(license): fix license normalization for Universal Permissive Lice…
pbaumard Oct 21, 2024
010b213
refactor(k8s): scan config files as a folder (#7690)
afdesk Oct 21, 2024
9514148
feat(misconf): export unresolvable field of IaC types to Rego (#7765)
nikpivkin Oct 21, 2024
f75c0d1
feat(misconf): Show misconfig ID in output (#7762)
simar7 Oct 23, 2024
c0d79fa
feat(report): update gitlab template to populate operating_system val…
aarongoldenthal Oct 24, 2024
ad3c09e
feat: add end of life date for Ubuntu 24.10 (#7787)
itsdean Oct 25, 2024
a16b830
ci(helm): auto public Helm chart after PR merged (#7526)
afdesk Oct 25, 2024
63dd3d6
docs: add Windows install instructions (#7800)
okamototk Oct 28, 2024
7a4f4d8
fix(k8s): support kubernetes v1.31 (#7810)
afdesk Oct 29, 2024
c434775
fix(k8s)!: support k8s multi container (#7444)
smtan-gl Oct 29, 2024
c70b6fa
refactor(misconf): Deprecate `EXCEPTIONS` for misconfiguration scanni…
simar7 Oct 29, 2024
6fab88d
fix(helm): properly handle multiple archived dependencies (#7782)
nikpivkin Oct 29, 2024
b661d68
fix(cli): add config name to skip-policy-update alias (#7820)
nikpivkin Oct 30, 2024
f2bb9c6
fix(sbom): use `Annotation` instead of `AttributionTexts` for `SPDX`…
DmitriyLewen Oct 30, 2024
7882776
fix(k8s): skip resources without misconfigs (#7797)
afdesk Oct 31, 2024
e872ec0
fix(go): Do not trim v prefix from versions in Go Mod Analyzer (#7733)
Rutam21 Oct 31, 2024
194d4ab
chore(deps): Bump trivy-checks (#7819)
simar7 Oct 31, 2024
7654b2e
docs: add example of creating whitelist of checks (#7821)
nikpivkin Oct 31, 2024
dc44946
docs(java): add info about supported scopes (#7842)
DmitriyLewen Oct 31, 2024
5e78b6c
feat(db): append errors (#7843)
knqyf263 Oct 31, 2024
7632625
chore: lint `errors.Join` (#7845)
knqyf263 Oct 31, 2024
efec326
release: v0.57.0 [main] (#7710)
aqua-bot Nov 1, 2024
4da59bd
chore: bump golangci-lint to v1.61.0 (#7853)
knqyf263 Nov 4, 2024
a9b557d
chore(deps): bump the github-actions group across 1 directory with 2 …
dependabot[bot] Nov 4, 2024
a6a45b3
test: save `containerd` image into archive and use in tests (#7816)
DmitriyLewen Nov 4, 2024
2529b58
refactor(secret): optimize performance by moving ToLower operation ou…
Yeatesss Nov 5, 2024
ed2288f
chore(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (#…
dependabot[bot] Nov 5, 2024
b1c7f55
feat(k8s): add default commands for unknown platform (#7863)
afdesk Nov 5, 2024
eda4d76
fix: Improve version comparisons when build identifiers are present (…
bpfoster Nov 6, 2024
6e3252b
chore: bump containerd to v2.0.0 (#7875)
knqyf263 Nov 6, 2024
6018461
chore(deps): bump the common group across 1 directory with 20 updates…
dependabot[bot] Nov 6, 2024
ab32297
fix(fs): add missing defered Cleanup() call to post analyzer fs (#7882)
jinroh Nov 7, 2024
99b2db3
fix(misconf): handle null properties in CloudFormation templates (#7813)
nikpivkin Nov 8, 2024
611558e
fix(terraform): set null value as fallback for missing variables (#7669)
albertodonato Nov 8, 2024
ee932cd
Merge upstream main to get latest changes
albertodonato Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/auto-update-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
with:
# cf. https://github.com/aquasecurity/trivy/pull/6711
go-version: ${{ env.GO_VERSION }}
cache: false

- name: Install aqua tools
uses: aquaproj/[email protected]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bypass-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ on:
- 'mkdocs.yml'
- 'LICENSE'
- '.release-please-manifest.json'
- 'helm/trivy/Chart.yaml'
pull_request:
paths:
- '**.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
- '.release-please-manifest.json'
- 'helm/trivy/Chart.yaml'
jobs:
test:
name: Test
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/cache-test-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Cache test images
on:
schedule:
- cron: "0 0 * * *" # Run this workflow every day at 00:00 to avoid cache deletion.
workflow_dispatch:

jobs:
test-images:
name: Cache test images
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/[email protected]

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false

- name: Install tools
uses: aquaproj/[email protected]
with:
aqua_version: v1.25.0

- name: Generate image list digest
if: github.ref_name == 'main'
id: image-digest
run: |
source integration/testimages.ini
IMAGE_LIST=$(skopeo list-tags docker://$TEST_IMAGES)
DIGEST=$(echo "$IMAGE_LIST" | jq '.Tags += ["containerd"] | .Tags | sort' | sha256sum | cut -d' ' -f1)
echo "digest=$DIGEST" >> $GITHUB_OUTPUT

## We need to work with test image cache only for main branch
- name: Restore and save test images cache
if: github.ref_name == 'main'
uses: actions/cache@v4
with:
path: integration/testdata/fixtures/images
key: cache-test-images-${{ steps.image-digest.outputs.digest }}
restore-keys:
cache-test-images-

- name: Download test images
if: github.ref_name == 'main'
run: mage test:fixtureContainerImages

test-vm-images:
name: Cache test VM images
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/[email protected]

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false

- name: Install tools
uses: aquaproj/[email protected]
with:
aqua_version: v1.25.0

- name: Generate image list digest
if: github.ref_name == 'main'
id: image-digest
run: |
source integration/testimages.ini
IMAGE_LIST=$(skopeo list-tags docker://$TEST_VM_IMAGES)
DIGEST=$(echo "$IMAGE_LIST" | jq '.Tags | sort' | sha256sum | cut -d' ' -f1)
echo "digest=$DIGEST" >> $GITHUB_OUTPUT

## We need to work with test VM image cache only for main branch
- name: Restore and save test VM images cache
if: github.ref_name == 'main'
uses: actions/cache@v4
with:
path: integration/testdata/fixtures/vm-images
key: cache-test-vm-images-${{ steps.image-digest.outputs.digest }}
restore-keys:
cache-test-vm-images-

- name: Download test VM images
if: github.ref_name == 'main'
run: mage test:fixtureVMImages
46 changes: 41 additions & 5 deletions .github/workflows/publish-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ name: Publish Helm chart
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
branches:
- main
paths:
Expand All @@ -18,8 +23,10 @@ env:
KIND_VERSION: "v0.14.0"
KIND_IMAGE: "kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae"
jobs:
# `test-chart` job starts if a PR with Helm Chart is created, merged etc.
test-chart:
runs-on: ubuntu-20.04
if: github.event_name != 'push'
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -28,11 +35,12 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814
with:
version: v3.5.0
version: v3.14.4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: '3.x'
check-latest: true
- name: Setup Chart Linting
id: lint
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992
Expand All @@ -48,11 +56,39 @@ jobs:
sed -i -e '136s,false,'true',g' ./helm/trivy/values.yaml
ct lint-and-install --validate-maintainers=false --charts helm/trivy

# `update-chart-version` job starts if a new tag is pushed
update-chart-version:
if: github.event_name == 'push'
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"

- name: Install tools
uses: aquaproj/[email protected]
with:
aqua_version: v1.25.0
aqua_opts: ""

- name: Create a PR with Trivy version
run: mage helm:updateVersion
env:
# Use ORG_REPO_TOKEN instead of GITHUB_TOKEN
# This allows the created PR to trigger tests and other workflows
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}

# `publish-chart` job starts if a PR with a new Helm Chart is merged or manually
publish-chart:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
needs:
- test-chart
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
contents: read # Not required for public repositories, but for clarity
steps:
- name: Cosign install
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
64 changes: 62 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ on:
- 'mkdocs.yml'
- 'LICENSE'
- '.release-please-manifest.json' ## don't run tests for release-please PRs
- 'helm/trivy/Chart.yaml'
merge_group:
workflow_dispatch:

env:
GO_VERSION: '1.22'
jobs:
Expand All @@ -24,6 +27,8 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false

- name: go mod tidy
run: |
go mod tidy
Expand All @@ -35,9 +40,9 @@ jobs:

- name: Lint
id: lint
uses: golangci/golangci-lint-action@v6.0.1
uses: golangci/golangci-lint-action@v6.1.1
with:
version: v1.59
version: v1.61
args: --verbose --out-format=line-number
if: matrix.operating-system == 'ubuntu-latest'

Expand Down Expand Up @@ -76,12 +81,29 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false

- name: Install tools
uses: aquaproj/[email protected]
with:
aqua_version: v1.25.0

- name: Generate image list digest
id: image-digest
run: |
source integration/testimages.ini
IMAGE_LIST=$(skopeo list-tags docker://$TEST_IMAGES)
DIGEST=$(echo "$IMAGE_LIST" | jq '.Tags += ["containerd"] | .Tags | sort' | sha256sum | cut -d' ' -f1)
echo "digest=$DIGEST" >> $GITHUB_OUTPUT

- name: Restore test images from cache
uses: actions/cache/restore@v4
with:
path: integration/testdata/fixtures/images
key: cache-test-images-${{ steps.image-digest.outputs.digest }}
restore-keys:
cache-test-images-

- name: Run integration tests
run: mage test:integration

Expand All @@ -96,6 +118,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false

- name: Install tools
uses: aquaproj/[email protected]
Expand All @@ -116,12 +139,29 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false

- name: Install tools
uses: aquaproj/[email protected]
with:
aqua_version: v1.25.0

- name: Generate image list digest
id: image-digest
run: |
source integration/testimages.ini
IMAGE_LIST=$(skopeo list-tags docker://$TEST_IMAGES)
DIGEST=$(echo "$IMAGE_LIST" | jq '.Tags += ["containerd"] | .Tags | sort' | sha256sum | cut -d' ' -f1)
echo "digest=$DIGEST" >> $GITHUB_OUTPUT

- name: Restore test images from cache
uses: actions/cache/restore@v4
with:
path: integration/testdata/fixtures/images
key: cache-test-images-${{ steps.image-digest.outputs.digest }}
restore-keys:
cache-test-images-

- name: Run module integration tests
shell: bash
run: |
Expand All @@ -138,10 +178,29 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false

- name: Install tools
uses: aquaproj/[email protected]
with:
aqua_version: v1.25.0

- name: Generate image list digest
id: image-digest
run: |
source integration/testimages.ini
IMAGE_LIST=$(skopeo list-tags docker://$TEST_VM_IMAGES)
DIGEST=$(echo "$IMAGE_LIST" | jq '.Tags | sort' | sha256sum | cut -d' ' -f1)
echo "digest=$DIGEST" >> $GITHUB_OUTPUT

- name: Restore test VM images from cache
uses: actions/cache/restore@v4
with:
path: integration/testdata/fixtures/vm-images
key: cache-test-vm-images-${{ steps.image-digest.outputs.digest }}
restore-keys:
cache-test-vm-images-

- name: Run vm integration tests
run: |
mage test:vm
Expand All @@ -162,6 +221,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false

- name: Determine GoReleaser ID
id: goreleaser_id
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ dist
# Signing
gpg.key
cmd/trivy/trivy

# RPM
*.rpm
2 changes: 2 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ linters-settings:
excludes:
- G101
- G114
- G115
- G204
- G304
- G402
Expand Down Expand Up @@ -105,6 +106,7 @@ linters:
- typecheck
- unconvert
- unused
- usestdlibvars

run:
go: '1.22'
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{".":"0.55.0"}
{".":"0.57.0"}
Loading
Loading