Skip to content

Commit

Permalink
Merge branch 'main' into 'feat/composer-intalled-json'
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Oct 30, 2023
2 parents 7d4aeea + ca50b77 commit 6725093
Show file tree
Hide file tree
Showing 358 changed files with 16,537 additions and 4,560 deletions.
31 changes: 31 additions & 0 deletions .github/DISCUSSION_TEMPLATE/adopters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
title: "<company name>"
labels: ["adopters"]
body:
- type: textarea
id: info
attributes:
label: "[Optional] How do you use Trivy?"
validations:
required: false
- type: checkboxes
attributes:
label: "[Optional] Which targets are you scanning with Trivy?"
options:
- label: "Container Image"
- label: "Filesystem"
- label: "Git Repository"
- label: "Virtual Machine Image"
- label: "Kubernetes"
- label: "AWS"
- label: "SBOM"
validations:
required: false
- type: checkboxes
attributes:
label: "[Optional] What kind of issues are scanning with Trivy?"
options:
- label: "Software Bill of Materials (SBOM)"
- label: "Known vulnerabilities (CVEs)"
- label: "IaC issues and misconfigurations"
- label: "Sensitive information and secrets"
- label: "Software licenses"
2 changes: 1 addition & 1 deletion .github/DISCUSSION_TEMPLATE/bugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ body:
- type: markdown
attributes:
value: |
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=adopters).
2 changes: 1 addition & 1 deletion .github/DISCUSSION_TEMPLATE/false-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ body:
- type: markdown
attributes:
value: |
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=adopters).
2 changes: 1 addition & 1 deletion .github/DISCUSSION_TEMPLATE/ideas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ body:
- type: markdown
attributes:
value: |
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=adopters).
2 changes: 1 addition & 1 deletion .github/DISCUSSION_TEMPLATE/q-a.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ body:
- type: markdown
attributes:
value: |
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=show-and-tell).
We would be happy if you could share how you are using Trivy [here](https://github.com/aquasecurity/trivy/discussions/new?category=adopters.
53 changes: 0 additions & 53 deletions .github/DISCUSSION_TEMPLATE/show-and-tell.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/auto-close-issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Auto-close issues

on:
issues:
types: [opened]

jobs:
close_issue:
runs-on: ubuntu-latest
steps:
- name: Close issue if user does not have write or admin permissions
uses: actions/github-script@v6
with:
script: |
// Get the issue creator's username
const issueCreator = context.payload.issue.user.login;
// Check the user's permissions for the repository
const repoPermissions = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: issueCreator
});
const permission = repoPermissions.data.permission;
// If the user does not have write or admin permissions, leave a comment and close the issue
if (permission !== 'write' && permission !== 'admin') {
const commentBody = "Please see https://aquasecurity.github.io/trivy/latest/community/contribute/issue/";
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
body: commentBody
});
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
state: 'closed',
state_reason: 'not_planned'
});
console.log(`Issue #${context.payload.issue.number} closed because ${issueCreator} does not have sufficient permissions.`);
}
30 changes: 30 additions & 0 deletions .github/workflows/auto-update-labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Auto-update labels
on:
push:
paths:
- 'misc/triage/labels.yaml'
branches:
- main

jobs:
deploy:
name: Auto-update labels
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/[email protected]

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

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

- name: update labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mage label
2 changes: 1 addition & 1 deletion .github/workflows/canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Restore Trivy binaries from cache
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: dist/
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/check-go-versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check Go versions of dependencies
on:
pull_request:
paths:
- 'go.mod'
workflow_dispatch:

jobs:
check-go-versions:
name: Check Go versions of dependencies
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@v4
with:
go-version: stable

# This workflow is a workaround before the "old stable" version becomes Go 1.21.
# To avoid updating dependencies that require Go 1.21, we use this workflow
# Example of wrong update:
# https://github.com/aquasecurity/trivy/discussions/5323#discussioncomment-7186321
- name: Check that dependencies doesn't require Go 1.21
run: |
go mod tidy
if grep -q "go 1.21" go.mod; then
echo "One of new dependencies requires Go '1.21'. Use 'go get [email protected]' to fix this."
exit 1
fi
3 changes: 2 additions & 1 deletion .github/workflows/mkdocs-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout main
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
persist-credentials: true
Expand All @@ -21,6 +21,7 @@ jobs:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
pip install -r docs/build/requirements.txt
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mkdocs-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout main
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
persist-credentials: true
Expand All @@ -23,6 +23,7 @@ jobs:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
pip install -r docs/build/requirements.txt
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
- name: Install Helm
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
- name: Install chart-releaser
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.0
with:
fetch-depth: 0

- name: Restore Trivy binaries from cache
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: dist/
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
Expand All @@ -35,7 +35,7 @@ jobs:
sudo apt-get -y install rpm reprepro createrepo-c distro-info
- name: Checkout trivy-repo
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.0
with:
repository: ${{ github.repository_owner }}/trivy-repo
path: trivy-repo
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/reusable-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
contents: read # Not required for public repositories, but for clarity
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v7
uses: easimon/maximize-build-space@v8
with:
root-reserve-mb: 35840 # The Go cache (`~/.cache/go-build` and `~/go/pkg`) requires a lot of storage space.
remove-android: 'true'
Expand All @@ -36,40 +36,40 @@ jobs:
remove-haskell: 'true'

- name: Cosign install
uses: sigstore/cosign-installer@a5d81fb6bdbcbb3d239e864d6552820420254494
uses: sigstore/cosign-installer@4a861528be5e691840a69536975ada1d4c30349d

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Show available Docker Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to docker.io registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to ghcr.io registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.GH_USER }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to ECR
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: public.ecr.aws
username: ${{ secrets.ECR_ACCESS_KEY_ID }}
password: ${{ secrets.ECR_SECRET_ACCESS_KEY }}

- name: Checkout code
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.0
with:
fetch-depth: 0

Expand All @@ -93,7 +93,7 @@ jobs:
- name: GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: v1.16.2
version: v1.20.0
args: release -f=${{ inputs.goreleaser_config}} ${{ inputs.goreleaser_options}}
env:
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
public.ecr.aws/aquasecurity/trivy:canary
- name: Cache Trivy binaries
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: dist/
# use 'github.sha' to create a unique cache folder for each run.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.0

- name: Run Trivy vulnerability scanner and create GitHub issues
uses: knqyf263/[email protected]
Expand Down
Loading

0 comments on commit 6725093

Please sign in to comment.