Skip to content

Commit

Permalink
Merge branch 'master' into do-20241211-xmlutil-checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
dotasek committed Dec 11, 2024
2 parents 68b2be5 + afbbe2a commit 866a208
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 38 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '18 18 * * 1'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
32 changes: 32 additions & 0 deletions .github/workflows/owasp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- env:
NVD_API_KEY:
${{ secrets.NVD_API_KEY }}
run: |
mvn -DskipTests install -P OWASP_CHECK
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: target/dependency-check-report.sarif
# Optional category for the results
# Used to differentiate multiple results for one commit

category: OWASP-dependency-check
39 changes: 39 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Trivy Security Scans

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

workflow_dispatch:

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run static analysis
uses: aquasecurity/trivy-action@master
env:
# temporary workaround for rate limiting on github
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db
with:
scan-type: 'fs'
vuln-type: 'library'
scanners: 'vuln,secret,config'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'MEDIUM,HIGH,CRITICAL'


- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
category: 'code'
1 change: 0 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
* Check for whole numbers on canonical conversion
6 changes: 3 additions & 3 deletions master-branch-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ steps:
displayName: 'Create .mvn/settings.xml'
# Runs 'mvn package'
- task: Maven@3
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
Expand Down Expand Up @@ -89,7 +89,7 @@ steps:
# Deploy the SNAPSHOT artifact to sonatype nexus.
# This is done for the master branch merges only.
- task: Maven@3
- task: Maven@4
displayName: 'Deploy to Sonatype staging'
inputs:
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
Expand All @@ -99,7 +99,7 @@ steps:

# Deploy the SNAPSHOT artifact to GitHub packages.
# This is done for the master branch merges only.
- task: Maven@3
- task: Maven@4
displayName: 'Deploy to GitHub Packages'
inputs:
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
Expand Down
3 changes: 3 additions & 0 deletions owasp-suppression-file.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
</suppressions>
77 changes: 45 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<packaging>jar</packaging>
<groupId>org.fhir</groupId>
<artifactId>ucum</artifactId>
<version>1.0.8</version>
<version>1.0.9-SNAPSHOT</version>

<name>Ucum-java</name>
<description>FHIR Java library providing UCUM Services</description>
Expand Down Expand Up @@ -101,8 +101,23 @@
</distributionManagement>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>11.1.1</version>
<configuration>
<nvdApiKeyEnvironmentVariable>NVD_API_KEY</nvdApiKeyEnvironmentVariable>
<suppressionFiles>
<suppressionFile>cve-suppression.xml</suppressionFile>
</suppressionFiles>
<formats>sarif,html</formats>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -180,35 +195,6 @@
<skip>true</skip>
</configuration>
</plugin>

<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>deploy</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
-->
</plugins>
</build>

Expand Down Expand Up @@ -236,7 +222,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down Expand Up @@ -345,5 +331,32 @@
</plugins>
</build>
</profile>
<profile>
<id>OWASP_CHECK</id>
<build>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<configuration>
<suppressionFiles>
<suppressionFile>owasp-suppression-file.xml</suppressionFile>
</suppressionFiles>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<configuration>
<failBuildOnCVSS>10</failBuildOnCVSS>
<skipTestScope>true</skipTestScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion pull-request-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pool:
vmImage: ubuntu-latest

steps:
- task: Maven@3
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
Expand Down
2 changes: 1 addition & 1 deletion release-branch-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ steps:
displayName: 'Create .mvn/settings.xml'
# Runs 'mvn package'
- task: Maven@3
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
Expand Down

0 comments on commit 866a208

Please sign in to comment.