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

test trivy-vulnerability-scanner #699

Merged
merged 17 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Run Trivy vulnerability scanner

on: [ push ]

jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
image: ['wis2box-management', 'wis2box-mqtt-metrics-collector', 'wis2box-broker']
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build docker image ${{ matrix.image }}
run: |
docker build -t ${{ matrix.image }}:test ${{ matrix.image }}
- name: Run Trivy vulnerability scanner on ${{ matrix.image }}
if: always()
uses: aquasecurity/[email protected]
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1
with:
image-ref: ${{ matrix.image }}:test
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
2 changes: 1 addition & 1 deletion wis2box-broker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
###############################################################################

FROM eclipse-mosquitto:2.0.15
FROM eclipse-mosquitto:2.0.20

RUN mkdir -p /data/wis2box/mosquitto
RUN ln -s /mosquitto /data/wis2box/mosquitto
Expand Down
6 changes: 6 additions & 0 deletions wis2box-broker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ for i in `env | grep -Ee "\<WIS2BOX_BROKER_USERNAME_[[:alnum:]]+"`; do
echo "topic readwrite ${!topic}" >> /mosquitto/config/acl.conf
done

# set ownership of mosquitto files
chown -R mosquitto:mosquitto /mosquitto

# set permission of acl.conf to 0700
chmod 0700 /mosquitto/config/acl.conf

/usr/sbin/mosquitto -c /mosquitto/config/mosquitto.conf
Loading