Skip to content

Commit 756bb11

Browse files
authored
add securityContext to deployment (#163)
* add securityContext to deployment * add .trivyignore file * add github output mode
1 parent 0355aaf commit 756bb11

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

.github/workflows/pr-build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- main
66
pull_request_target:
7-
branches:
7+
branches:
88
- main
99

1010
jobs:
@@ -24,16 +24,17 @@ jobs:
2424
with:
2525
username: ${{ secrets.DOCKERHUB_READ_USER }}
2626
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
27-
27+
2828
- name: Build with Gradle
2929
uses: hypertrace/github-actions/gradle@main
30-
with:
30+
with:
3131
args: assemble dockerBuildImages
3232

3333
- name: Run Trivy vulnerability scanner
3434
uses: hypertrace/github-actions/trivy-image-scan@main
3535
with:
3636
image: hypertrace/attribute-service
37+
output-mode: github
3738

3839
validate-helm-charts:
3940
runs-on: ubuntu-22.04

.trivyignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# openssl
2+
CVE-2023-0464 exp:2023-05-01

helm/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ spec:
5757
{{- with .Values.topologySpreadConstraints }}
5858
topologySpreadConstraints:
5959
{{- toYaml . | nindent 8}}
60+
{{- end }}
61+
{{- with .Values.securityContext }}
62+
securityContext:
63+
{{- toYaml . | nindent 8 }}
6064
{{- end }}
6165
containers:
6266
- name: {{ .Chart.Name }}

helm/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ affinity: {}
2626

2727
topologySpreadConstraints: []
2828

29+
securityContext: {}
30+
2931
javaOpts: "-XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=75.0 -XX:MaxDirectMemorySize=128M -XX:+ExitOnOutOfMemoryError"
3032

3133
livenessProbe:

0 commit comments

Comments
 (0)