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

Code analysis actions #230

Merged
merged 7 commits into from
Apr 11, 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
15 changes: 8 additions & 7 deletions .github/workflows/trivy-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,21 @@ jobs:

- name: Build an image from Dockerfile
run: |
ls
ls cloud-harness/infrastructure/base-images
DOCKER_BUILDKIT=1 docker build -t cloudharness-base-debian:${{ github.sha }} cloud-harness -f ./cloud-harness/infrastructure/base-images/cloudharness-base-debian/Dockerfile
DOCKER_BUILDKIT=1 docker build -t cloudharness-django:${{ github.sha }} --build-arg CLOUDHARNESS_BASE_DEBIAN=cloudharness-base-debian:${{ github.sha }} ./cloud-harness/infrastructure/common-images/cloudharness-django/Dockerfile
DOCKER_BUILDKIT=1 docker build -t portal:${{ github.sha }} --build-arg CLOUDHARNESS_DJANGO=cloudharness-django:${{ github.sha }} ./applications/portal/Dockerfile
ls ./cloud-harness/infrastructure/common-images/cloudharness-django/Dockerfile
DOCKER_BUILDKIT=1 docker build -t cloudharness-django:${{ github.sha }} --build-arg CLOUDHARNESS_BASE_DEBIAN=cloudharness-base-debian:${{ github.sha }} ./cloud-harness/infrastructure/common-images/cloudharness-django
DOCKER_BUILDKIT=1 docker build -t portal:${{ github.sha }} --build-arg CLOUDHARNESS_DJANGO=cloudharness-django:${{ github.sha }} ./applications/portal

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@2a2157eb22c08c9a1fac99263430307b8d1bc7a2
uses: aquasecurity/trivy-action@master
with:
image-ref: 'portal:${{ github.sha }}'
format: 'template'
template: '@/contrib/sarif.tpl'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
35 changes: 35 additions & 0 deletions applications/portal/deploy/templates/scicrunch-import.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: hello
spec:
schedule: {{ .Values.apps.portal.scicrunch.cronjob.schedule }}
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: {{ .Values.apps.portal.deployment.image }}
imagePullPolicy: IfNotPresent
command:
- python
- manage.py
- scicrunch_import
env:
- name: CH_CURRENT_APP_NAME
value: {{ .Values.apps.portal.harness.name | quote }}
{{- include "deploy_utils.env" .root | nindent 8 }}
{{- include "deploy_utils.privenv" .root | nindent 8 }}
{{- if .Values.apps.portal.harness.env }}
{{- .Values.apps.portal.harness.env | toYaml | nindent 8 }}
{{- end }}
restartPolicy: OnFailure
volumeMounts:
- name: cloudharness-allvalues
mountPath: /opt/cloudharness/resources
readOnly: true
volumes:
- name: cloudharness-allvalues
configMap:
name: cloudharness-allvalues
3 changes: 2 additions & 1 deletion deployment/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*minimal*.yaml
*local*.yaml
*local*.yaml
compose
Loading
Loading