Skip to content

Commit 6493dbd

Browse files
authored
Merge pull request #1851 from cybozu/disable-trivy
Disable Trivy
2 parents 09707cb + 032870e commit 6493dbd

File tree

4 files changed

+71
-64
lines changed

4 files changed

+71
-64
lines changed

.circleci/config.yml

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -121,34 +121,38 @@ jobs:
121121
- run:
122122
name: Install Trivy
123123
command: |
124-
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
125-
- run:
126-
name: Scan images
127-
command: |
128-
if [ "${CIRCLE_BRANCH}" != "main" ]; then
129-
exit 0
130-
fi
131-
if [ ! -f BUILDS ]; then
132-
echo "no need to scan << parameters.container-image >>."
133-
exit 0
134-
fi
124+
echo 'Trivy is disabled.'
125+
# - run:
126+
# name: Install Trivy
127+
# command: |
128+
# curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
129+
# - run:
130+
# name: Scan images
131+
# command: |
132+
# if [ "${CIRCLE_BRANCH}" != "main" ]; then
133+
# exit 0
134+
# fi
135+
# if [ ! -f BUILDS ]; then
136+
# echo "no need to scan << parameters.container-image >>."
137+
# exit 0
138+
# fi
135139

136-
dir=<< parameters.dir >>
137-
if [ "$dir" = "" ]; then dir=<< parameters.container-image >> ; fi
138-
targets="<< parameters.targets >>"
139-
if [ "$targets" = "" ]; then
140-
images=<< parameters.container-image >>
141-
else
142-
images=
143-
for target in $targets; do
144-
images="$images << parameters.container-image >>-$target"
145-
done
146-
fi
147-
TAG=$(cat $dir/TAG)
148-
for image in $images; do
149-
echo "scanning $image:$TAG ..."
150-
YAMORY_IMAGE_IDENTIFIER="quay.io/cybozu/$image" YAMORY_IMAGE_NAME="quay.io/cybozu/$image:$TAG" sh -c "$(curl -sSf -L https://mw-receiver.yamory.io/image/script/trivy)"
151-
done
140+
# dir=<< parameters.dir >>
141+
# if [ "$dir" = "" ]; then dir=<< parameters.container-image >> ; fi
142+
# targets="<< parameters.targets >>"
143+
# if [ "$targets" = "" ]; then
144+
# images=<< parameters.container-image >>
145+
# else
146+
# images=
147+
# for target in $targets; do
148+
# images="$images << parameters.container-image >>-$target"
149+
# done
150+
# fi
151+
# TAG=$(cat $dir/TAG)
152+
# for image in $images; do
153+
# echo "scanning $image:$TAG ..."
154+
# YAMORY_IMAGE_IDENTIFIER="quay.io/cybozu/$image" YAMORY_IMAGE_NAME="quay.io/cybozu/$image:$TAG" sh -c "$(curl -sSf -L https://mw-receiver.yamory.io/image/script/trivy)"
155+
# done
152156

153157
workflows:
154158
main:

.github/actions/build_envoy/action.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ runs:
105105
# Input comma-separated tags: <tag>,<branch1>,<branch2>,...
106106
tags: ${{ steps.prepare.outputs.tag }}${{ steps.prepare.outputs.branch && format(',{0}', steps.prepare.outputs.branch) }}
107107
load: true
108-
- name: Scan images
109-
if: ${{ steps.prepare.outputs.scan }}
110-
uses: ./.github/actions/trivy_scan
111-
with:
112-
dir: ${{ inputs.dir }}
113-
container-image: ${{ inputs.container-image }}
114-
tag: ${{ steps.prepare.outputs.tag }}
115-
yamory_token: ${{ inputs.yamory_token }}
108+
# - name: Scan images
109+
# if: ${{ steps.prepare.outputs.scan }}
110+
# uses: ./.github/actions/trivy_scan
111+
# with:
112+
# dir: ${{ inputs.dir }}
113+
# container-image: ${{ inputs.container-image }}
114+
# tag: ${{ steps.prepare.outputs.tag }}
115+
# yamory_token: ${{ inputs.yamory_token }}
116116
- name: Test image
117117
if: ${{ steps.prepare.outputs.build }}
118118
shell: bash

.github/actions/build_push/action.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ runs:
9797
# Input comma-separated tags: <tag>,<branch1>,<branch2>,...
9898
tags: ${{ steps.prepare.outputs.tag }}${{ steps.prepare.outputs.branch && format(',{0}', steps.prepare.outputs.branch) }}
9999
target: ${{ inputs.target }}
100-
- name: Scan images
101-
if: ${{ steps.prepare.outputs.scan }}
102-
uses: ./.github/actions/trivy_scan
103-
with:
104-
dir: ${{ inputs.dir }}
105-
container-image: ${{ inputs.container-image }}
106-
tag: ${{ steps.prepare.outputs.tag }}
107-
yamory_token: ${{ inputs.yamory_token }}
100+
# - name: Scan images
101+
# if: ${{ steps.prepare.outputs.scan }}
102+
# uses: ./.github/actions/trivy_scan
103+
# with:
104+
# dir: ${{ inputs.dir }}
105+
# container-image: ${{ inputs.container-image }}
106+
# tag: ${{ steps.prepare.outputs.tag }}
107+
# yamory_token: ${{ inputs.yamory_token }}

.github/actions/trivy_scan/action.yaml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,32 @@ inputs:
1212
tag:
1313
description: "container tag"
1414
required: true
15-
yamory_token:
16-
description: "Yamory Access Token"
17-
required: true
15+
# yamory_token:
16+
# description: "Yamory Access Token"
17+
# required: true
1818

1919
runs:
2020
using: "composite"
2121
steps:
22-
- name: Install Trivy
23-
shell: bash
24-
run: |
25-
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
26-
- name: Scan images
22+
- name: Skip
2723
shell: bash
28-
env:
29-
YAMORY_ACCESS_TOKEN: ${{ inputs.yamory_token }}
30-
run: |
31-
echo
32-
echo "scanning ${{ inputs.tag }} ..."
33-
if [[ "${{ inputs.tag }}" == "ghcr.io/cybozu/golang:"* ]]; then
34-
dir=${{ inputs.dir }}
35-
BRANCH=$(cat $dir/BRANCH)
36-
image=${{ inputs.container-image }}:$BRANCH
37-
else
38-
image=${{ inputs.container-image }}
39-
fi
40-
YAMORY_IMAGE_IDENTIFIER="ghcr.io/cybozu/$image" YAMORY_IMAGE_NAME="${{ inputs.tag }}" bash -c "$(curl -sSf -L https://mw-receiver.yamory.io/image/script/trivy)"
24+
run: echo 'Trivy is disabled.'
25+
# - name: Install Trivy
26+
# shell: bash
27+
# run: |
28+
# curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
29+
# - name: Scan images
30+
# shell: bash
31+
# env:
32+
# YAMORY_ACCESS_TOKEN: ${{ inputs.yamory_token }}
33+
# run: |
34+
# echo
35+
# echo "scanning ${{ inputs.tag }} ..."
36+
# if [[ "${{ inputs.tag }}" == "ghcr.io/cybozu/golang:"* ]]; then
37+
# dir=${{ inputs.dir }}
38+
# BRANCH=$(cat $dir/BRANCH)
39+
# image=${{ inputs.container-image }}:$BRANCH
40+
# else
41+
# image=${{ inputs.container-image }}
42+
# fi
43+
# YAMORY_IMAGE_IDENTIFIER="ghcr.io/cybozu/$image" YAMORY_IMAGE_NAME="${{ inputs.tag }}" bash -c "$(curl -sSf -L https://mw-receiver.yamory.io/image/script/trivy)"

0 commit comments

Comments
 (0)