Conversation
* Added a dependabot config to automate creation of pull requests for maven, github-actions, docker and docker-compose version upgrades. Will be active once merged into main. * Fixed missing tika-core version in maven api v2 dependency copy config. * Pinned base docker images in Dockerfiles. * Reconfigured GitHub Actions workflows: New build.yml workflow with automated maven and docker builds. Maven build configured to run tests and other elements in parallel. Docker images are scanned with trivy, trivy results are published to the internal GitHub Security Code Scanning results page. Docker images are signed and can be verified using ```cosign verify ghcr.io/datasharingframework/<image>:<tag>@sha256:<digest> --certificate-identity-regexp "https://github.com/datasharingframework/dsf/.*" --certificate-oidc-issuer "https://token.actions.githubusercontent.com"```. A cyclonedx SBOM is generated for the docker images and attached to the registry, SBOM is signed by cosign. New workflow includes codeql config. * New build.yml workflow is configured to run for pushes in release/* and hotfix/* branches, on Git tag pushes (regular releases, milestone and release candidates), on pull request to main and develop (opened, synchronize, reopened and closed events) as well as on a weakly schedule. * Releases are triggered via Git tags: If a commit is tagged that is part of the main branch, the docker images are tagged with a.b, a.b.c and 'latest'. Other Git tags (e.g. in a hotfix branch) will result in a.b and a.b.c for regular releases, and (e.g. in a release branch) a.b.c-RCx or a.b.c-Mx for preview releases. Merged pull requests into the develop branch trigger a docker image build that is tagged with 'develop'.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
|
The Node.js 20 deprecation warning in https://github.com/datasharingframework/dsf/actions/runs/23116834123 is related to |
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - name: Download quick-build results | ||
| uses: actions/download-artifact/@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 |
There was a problem hiding this comment.
actions/download-artifact/@7 -> actions/download-artifact@7 (remove tailing /)
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - name: Download quick-build results | ||
| uses: actions/download-artifact/@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 |
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - name: Download quick-build results | ||
| uses: actions/download-artifact/@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 |
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - name: Download quick-build results | ||
| uses: actions/download-artifact/@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 |
| id: main | ||
| run: echo "main=$( [ "$GITHUB_SHA" = "$(git rev-parse HEAD)" ] && echo true || echo false )" >> $GITHUB_OUTPUT | ||
|
|
||
| maven-full: |
There was a problem hiding this comment.
do we need the .m2 directory here from the fast build for some of the tasks?
| - name: Formatter, Impsort, Enforcer, License Check | ||
| cmd: mvn compile test-compile license:check -Dmaven.buildNumber.skip=true | ||
| - name: DAO Tests (not Binary) | ||
| cmd: mvn failsafe:integration-test --fail-at-end -P!generate-source-and-javadoc-jars -Dimpsort.skip=true -Dformatter.skip=true -Dlicense.skip=true -Denforcer.skip -Dmaven.buildNumber.skip=true -DskipShadePlugin=true -Dfailsafe.includes=**/*DaoTest -Dfailsafe.excludes=**/BinaryDaoTest -DforkCount=2 |
There was a problem hiding this comment.
maybe create an env definition for that like
env:
MAVEN_SKIP_FLAGS: "-Dimpsort.skip=true -Dformatter.skip=true -Dlicense.skip=true -Denforcer.skip -Dmaven.buildNumber.skip=true -DskipShadePlugin=true"
| - name: Unit Tests | ||
| cmd: mvn dependency:properties surefire:test --fail-at-end -P!generate-source-and-javadoc-jars -Dimpsort.skip=true -Dformatter.skip=true -Dlicense.skip=true -Denforcer.skip -Dmaven.buildNumber.skip=true -DskipShadePlugin=true | ||
| name: ${{ matrix.mvn.name }} | ||
| timeout-minutes: 8 |
|
We could improve the pipeline, if we fail it on Maybe we could:
- name: Scan Docker image with Trivy (full report)
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
with:
image-ref: ghcr.io/${{ github.repository_owner }}/${{ matrix.image.name }}:${{ github.sha }}
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
if: always()
with:
sarif_file: 'trivy-results.sarif'
+ - name: Fail on CRITICAL or HIGH vulnerabilities
+ uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
+ with:
+ image-ref: ghcr.io/${{ github.repository_owner }}/${{ matrix.image.name }}:${{ github.sha }}
+ format: 'table'
+ exit-code: '1'
+ severity: 'CRITICAL,HIGH'
+ trivyignores: '.trivyignore' |
Improved Actions workflow and dependabot config:
cosign verify ghcr.io/datasharingframework/<image>:<tag>@sha256:<digest> --certificate-identity-regexp "https://github.com/datasharingframework/dsf/.*" --certificate-oidc-issuer "https://token.actions.githubusercontent.com". A cyclonedx SBOM is generated for the docker images and attached to the registry, SBOM is signed by cosign. New workflow includes codeql config.closes #434