-
Notifications
You must be signed in to change notification settings - Fork 20
68 lines (63 loc) · 1.93 KB
/
security-scan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: docker security scan
on: [push, pull_request]
# example of how to restrict to one branch and push event
#on:
# push:
# branches:
# - test_branch
env:
USE_TESTING_TIMEOUTS: "true"
OPENSTUDIO_VERSION: 3.9.0
OPENSTUDIO_VERSION_SHA: a000d0ea29
OPENSTUDIO_VERSION_EXT: "-rc3"
DOCKER_COMPOSE_VERSION: 1.21.1
BUNDLE_WITHOUT: native_ext
jobs:
docker-scan:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: setup
shell: bash
run: ./ci/github-actions/setup.sh
env:
BUILD_TYPE: docker
- name: docker
shell: bash
run: |
export OPENSTUDIO_TAG=3.9.0
sed -i -E "s/.git//g" .dockerignore
docker volume create --name=osdata
docker images --all
docker --version
docker-compose --version
docker-compose -f docker-compose.test.yml build --build-arg OPENSTUDIO_VERSION=$OPENSTUDIO_TAG web
env:
CI: true
OS_SERVER_NUMBER_OF_WORKERS: 4
BUILD_TYPE: docker
COMPOSE_INTERACTIVE_NO_CLI: 1
- name: Cleanup Docker resources and space
shell: bash
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Run docker vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
# the image should have been built and tagged in the previous steps
image-ref: 'nrel/openstudio-server:latest'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
timeout: 15m0s
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload container scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: 'trivy-results.sarif'