Skip to content

Commit

Permalink
Merge pull request #21 from vasac/trivy
Browse files Browse the repository at this point in the history
Add nightly Trivy scan for main branch
  • Loading branch information
rlubke authored Apr 27, 2023
2 parents 1ed29ee + 4fc360c commit b80d0af
Show file tree
Hide file tree
Showing 14 changed files with 141 additions and 6 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#
# Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

# ---------------------------------------------------------------------------
# Coherence Helidon Sock Shop Actions Scheduled Trivy Scan
# ---------------------------------------------------------------------------
name: Scheduled Trivy Scan

on:
workflow_dispatch:
push:
branches:
- 'main'
schedule:
# Every day at midnight
- cron: '0 0 * * *'

jobs:
build:
runs-on: ubuntu-latest

# Checkout the source, we need a depth of zero to fetch all of the history otherwise
# the copyright check cannot work out the date of the files from Git.
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Run Trivy vulnerability scanner in fs mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
exit-code: '1'
55 changes: 55 additions & 0 deletions .github/workflows/trivy-scan-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#
# Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

# ---------------------------------------------------------------------------
# Coherence Helidon Sock Shop Actions Scheduled Trivy Image Scan
# ---------------------------------------------------------------------------
name: Scheduled Trivy Images Scan
on:
workflow_dispatch:
schedule:
# Every day at midnight
- cron: '0 0 * * *'

jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
package:
- carts
- catalog
- orders
- payment
- shipping
- users
steps:
- name: Run Trivy vulnerability scanner on ${{ matrix.package }}
uses: aquasecurity/trivy-action@master
with:
image-ref: 'ghcr.io/oracle/coherence-helidon-sockshop-${{ matrix.package }}:latest'
format: 'table'
exit-code: '1'
3 changes: 2 additions & 1 deletion carts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-mp</artifactId>
<version>3.1.2</version>
<version>3.2.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -240,6 +240,7 @@
<jvmFlag>-XX:InitialRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MinRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MaxRAMPercentage=70</jvmFlag>
<jvmFlag>-Djdk.serialFilter=*;!*</jvmFlag>
</jvmFlags>
<ports>
<port>7001</port>
Expand Down
3 changes: 2 additions & 1 deletion catalog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-mp</artifactId>
<version>3.1.2</version>
<version>3.2.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -237,6 +237,7 @@
<jvmFlag>-XX:InitialRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MinRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MaxRAMPercentage=70</jvmFlag>
<jvmFlag>-Djdk.serialFilter=*;!*</jvmFlag>
</jvmFlags>
<ports>
<port>7001</port>
Expand Down
2 changes: 2 additions & 0 deletions k8s/coherence/carts/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
jvm:
memory:
heapSize: 2g
args:
- "-Djdk.serialFilter=*;!*"
coherence:
metrics:
enabled: true
Expand Down
2 changes: 2 additions & 0 deletions k8s/coherence/catalog/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
jvm:
memory:
heapSize: 2g
args:
- "-Djdk.serialFilter=*;!*"
coherence:
metrics:
enabled: true
Expand Down
2 changes: 2 additions & 0 deletions k8s/coherence/orders/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
jvm:
memory:
heapSize: 2g
args:
- "-Djdk.serialFilter=*;!*"
coherence:
metrics:
enabled: true
Expand Down
2 changes: 2 additions & 0 deletions k8s/coherence/payment/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
jvm:
memory:
heapSize: 2g
args:
- "-Djdk.serialFilter=*;!*"
coherence:
metrics:
enabled: true
Expand Down
2 changes: 2 additions & 0 deletions k8s/coherence/shipping/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
jvm:
memory:
heapSize: 2g
args:
- "-Djdk.serialFilter=*;!*"
coherence:
metrics:
enabled: true
Expand Down
2 changes: 2 additions & 0 deletions k8s/coherence/users/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
jvm:
memory:
heapSize: 2g
args:
- "-Djdk.serialFilter=*;!*"
coherence:
metrics:
enabled: true
Expand Down
3 changes: 2 additions & 1 deletion orders/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-mp</artifactId>
<version>3.1.2</version>
<version>3.2.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -248,6 +248,7 @@
<jvmFlag>-XX:InitialRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MinRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MaxRAMPercentage=70</jvmFlag>
<jvmFlag>-Djdk.serialFilter=*;!*</jvmFlag>
</jvmFlags>
<ports>
<port>7001</port>
Expand Down
3 changes: 2 additions & 1 deletion payment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-mp</artifactId>
<version>3.1.2</version>
<version>3.2.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -256,6 +256,7 @@
<jvmFlag>-XX:InitialRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MinRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MaxRAMPercentage=70</jvmFlag>
<jvmFlag>-Djdk.serialFilter=*;!*</jvmFlag>
</jvmFlags>
<ports>
<port>7001</port>
Expand Down
3 changes: 2 additions & 1 deletion shipping/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-mp</artifactId>
<version>3.1.2</version>
<version>3.2.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -255,6 +255,7 @@
<jvmFlag>-XX:InitialRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MinRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MaxRAMPercentage=70</jvmFlag>
<jvmFlag>-Djdk.serialFilter=*;!*</jvmFlag>
</jvmFlags>
<ports>
<port>7001</port>
Expand Down
3 changes: 2 additions & 1 deletion users/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-mp</artifactId>
<version>3.1.2</version>
<version>3.2.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -240,6 +240,7 @@
<jvmFlag>-XX:InitialRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MinRAMPercentage=70</jvmFlag>
<jvmFlag>-XX:MaxRAMPercentage=70</jvmFlag>
<jvmFlag>-Djdk.serialFilter=*;!*</jvmFlag>
</jvmFlags>
<ports>
<port>7001</port>
Expand Down

0 comments on commit b80d0af

Please sign in to comment.