Skip to content

Commit b685579

Browse files
authored
Add an automated vulnerability check (#86)
1 parent 52e090e commit b685579

File tree

7 files changed

+62
-9
lines changed

7 files changed

+62
-9
lines changed

.circleci/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ jobs:
7979
- checkout
8080
- restore_cache:
8181
key: gradle-{{ checksum "build.gradle" }}
82-
8382
- run: ./gradlew downloadDependencies --daemon
8483
- save_cache:
8584
key: gradle-{{ checksum "build.gradle" }}
8685
paths:
8786
- ~/.gradle/caches
8887
- ~/.gradle/wrapper
88+
- run:
89+
name: Audit Dependencies
90+
command: ./gradlew dependencyCheckAnalyze
8991
- run:
9092
name: Run Unit Tests
9193
command: ./gradlew test --daemon
@@ -129,4 +131,4 @@ workflows:
129131
branches:
130132
ignore: /.*/
131133
tags:
132-
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
134+
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.5.3 (May 06, 2022)
2+
* Add an automated vulnerability check
3+
14
## 2.5.2 (April 08, 2022)
25
* Updated the Sailor version to 3.3.9
36

build.gradle

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apply plugin: 'java'
33
apply plugin: 'idea'
44
apply plugin: 'eclipse'
55
apply plugin: 'groovy'
6+
apply plugin: org.owasp.dependencycheck.gradle.DependencyCheckPlugin
67

78
sourceSets {
89
integrationTest {
@@ -59,18 +60,38 @@ dependencies {
5960
// The following 3 dependencies are to workaround this: https://github.com/elasticio/sailor-jvm/issues/59
6061
compile 'com.fasterxml.jackson.core:jackson-core:2.10.1'
6162
compile 'com.fasterxml.jackson.core:jackson-annotations:2.10.1'
62-
compile 'com.fasterxml.jackson.core:jackson-databind:2.10.1'
63+
compile 'com.fasterxml.jackson.core:jackson-databind:2.13.2.2'
6364
compile 'com.google.code.gson:gson:2.8.6'
6465
compile 'com.microsoft.sqlserver:mssql-jdbc:6.4.0.jre8'
6566
compile 'io.elastic:sailor-jvm:3.3.9'
66-
compile 'mysql:mysql-connector-java:8.0.20'
67-
compile 'org.postgresql:postgresql:42.2.18'
67+
compile 'mysql:mysql-connector-java:8.0.29'
68+
compile 'org.postgresql:postgresql:42.2.25'
6869

6970
testCompile 'io.github.cdimascio:java-dotenv:5.1.0'
7071
testCompile 'org.hsqldb:hsqldb:2.0.0'
7172
testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
7273
}
7374

75+
check.dependsOn dependencyCheckAnalyze
76+
77+
dependencyCheck {
78+
format = 'ALL'
79+
// Dependency Check script will fail in case there are critical (9.0-10.0) vulnerabilities.
80+
// It should be configured to 7 (high and critical), but so far is not possible as 'axis' library
81+
// and log4j issues which does not have any updates that solve the problem
82+
failBuildOnCVSS = 7
83+
suppressionFile='./dependencyCheck-suppression.xml'
84+
}
85+
86+
buildscript {
87+
repositories {
88+
mavenCentral()
89+
}
90+
dependencies {
91+
classpath 'org.owasp:dependency-check-gradle:6.0.3'
92+
}
93+
}
94+
7495
wrapper {
7596
gradleVersion = '5.4.1'
7697
}

component.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"title": "Database",
33
"description": "Database JDBC connector",
4-
"version": "2.5.2",
5-
"buildType": "docker",
4+
"version": "2.5.3",
65
"credentials": {
76
"verifier": "io.elastic.jdbc.JdbcCredentialsVerifier",
87
"fields": {

dependencyCheck-suppression.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
3+
<suppress>
4+
<notes><![CDATA[
5+
file name: logback-jackson-0.1.5.jar
6+
]]>
7+
</notes>
8+
<packageUrl regex="true">^pkg:maven/ch\.qos\.logback\.contrib/logback\-jackson@.*$</packageUrl>
9+
<cve>CVE-2017-5929</cve>
10+
<cve>CVE-2021-42550</cve>
11+
</suppress>
12+
<suppress>
13+
<notes><![CDATA[
14+
file name: logback-json-classic-0.1.5.jar
15+
]]>
16+
</notes>
17+
<packageUrl regex="true">^pkg:maven/ch\.qos\.logback\.contrib/logback\-json\-classic@.*$</packageUrl>
18+
<cpe>cpe:/a:qos:logback</cpe>
19+
</suppress>
20+
<suppress>
21+
<notes><![CDATA[
22+
file name: logback-json-core-0.1.5.jar
23+
]]>
24+
</notes>
25+
<packageUrl regex="true">^pkg:maven/ch\.qos\.logback\.contrib/logback\-json\-core@.*$</packageUrl>
26+
<cpe>cpe:/a:qos:logback</cpe>
27+
</suppress>
28+
</suppressions>

src/test/groovy/io/elastic/jdbc/integration/actions/insert_action/InsertActionMySQLSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ class InsertActionMySQLSpec extends Specification {
6868

6969
expect:
7070
records.size() == 1
71-
records.get(0) == '{id=1, name=Taurus, radius=12, destination=null, visible=true, createdat=2015-02-19 10:10:10.0, diameter=24}'
71+
records.get(0) == '{id=1, name=Taurus, radius=12, destination=null, visible=true, createdat=2015-02-19T10:10:10, diameter=24}'
7272
}
7373
}

src/test/groovy/io/elastic/jdbc/integration/actions/upsert_row_by_primary_key/UpsertRowByPrimaryKeyMySQLSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class UpsertRowByPrimaryKeyMySQLSpec extends Specification {
116116

117117
expect:
118118
records.size() == 1
119-
records.get(0) == '{id=1, name=Taurus, date=2015-02-19 10:10:10.0, radius=123, destination=null, visible=true, ' +
119+
records.get(0) == '{id=1, name=Taurus, date=2015-02-19T10:10:10, radius=123, destination=null, visible=true, ' +
120120
'visibledate=null}'
121121
}
122122

0 commit comments

Comments
 (0)