Skip to content

Commit

Permalink
[ROCK-1318] Fix disocvery vulnerabilities (#183)
Browse files Browse the repository at this point in the history
* Do not build vulnerable drivers

* Bump quartz transitive dependency from vulnerable 2.1.7 to 2.3.2

* Bump crossdata-jdbc4 version 2.14.4-1830fff -> 2.16.2-2e12375
  • Loading branch information
grios-stratio authored Feb 4, 2020
1 parent b9777b7 commit 1ca9893
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ENV MAVEN_VERSION="3.2.5" \
M2_HOME=/usr/lib/mvn

# To generate local docker, comment mvn dependency:get and mv. Download jar in ./bin/lib/
# http://qa.stratio.com/repository/releases/com/stratio/jdbc/stratio-crossdata-jdbc4/2.14.4-1830fff/stratio-crossdata-jdbc4-2.14.4-1830fff.jar
# http://qa.stratio.com/repository/releases/com/stratio/crossdata/driver/stratio-crossdata-jdbc4/2.16.2-2e12375/stratio-crossdata-jdbc4-2.16.2-2e12375.jar
RUN apk add --update wget && \
cd /tmp && \
wget "http://ftp.unicamp.br/pub/apache/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" && \
Expand All @@ -42,9 +42,9 @@ RUN apk add --update wget && \
mvn package -f /app/source/local-query-execution-factory/pom.xml && \
mv /app/source/local-query-execution-factory/target/local-query-execution-factory-0.2.jar /app/source/bin/lib/local-query-execution-factory-0.2.jar && \
mvn install:install-file -Dfile=/app/source/bin/lib/local-query-execution-factory-0.2.jar -DgroupId=com.stratio.metabase -DartifactId=local-query-execution-factory -Dversion=0.2 -Dpackaging=jar && \
mvn dependency:get -DgroupId=com.stratio.jdbc -DartifactId=stratio-crossdata-jdbc4 -Dversion=2.14.4-1830fff -DremoteRepositories=http://sodio.stratio.com/repository/public/ -Dtransitive=false && \
mv /root/.m2/repository/com/stratio/jdbc/stratio-crossdata-jdbc4/2.14.4-1830fff/stratio-crossdata-jdbc4-2.14.4-1830fff.jar /app/source/bin/lib/stratio-crossdata-jdbc4-2.14.4-1830fff.jar && \
mvn install:install-file -Dfile=/app/source/bin/lib/stratio-crossdata-jdbc4-2.14.4-1830fff.jar -DgroupId=com.stratio.jdbc -DartifactId=stratio-crossdata-jdbc4 -Dversion=2.14.4-1830fff -Dpackaging=jar
mvn dependency:get -DgroupId=com.stratio.crossdata.driver -DartifactId=stratio-crossdata-jdbc4 -Dversion=2.16.2-2e12375 -DremoteRepositories=http://sodio.stratio.com/repository/public/ -Dtransitive=false && \
mv /root/.m2/repository/com/stratio/crossdata/driver/stratio-crossdata-jdbc4/2.16.2-2e12375/stratio-crossdata-jdbc4-2.16.2-2e12375.jar /app/source/bin/lib/stratio-crossdata-jdbc4-2.16.2-2e12375.jar && \
mvn install:install-file -Dfile=/app/source/bin/lib/stratio-crossdata-jdbc4-2.16.2-2e12375.jar -DgroupId=com.stratio.crossdata.driver -DartifactId=stratio-crossdata-jdbc4 -Dversion=2.16.2-2e12375 -Dpackaging=jar

# lein: backend dependencies and building
ADD https://raw.github.com/technomancy/leiningen/stable/bin/lein /usr/local/bin/lein
Expand Down
4 changes: 2 additions & 2 deletions bin/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ mvn package -f ./local-query-execution-factory/pom.xml
cp ./local-query-execution-factory/target/local-query-execution-factory-0.2.jar ./bin/lib/local-query-execution-factory-0.2.jar
mvn install:install-file -Dfile=./bin/lib/local-query-execution-factory-0.2.jar -DgroupId=com.stratio.metabase -DartifactId=local-query-execution-factory -Dversion=0.2 -Dpackaging=jar

mvn dependency:copy -Dartifact=com.stratio.jdbc:stratio-crossdata-jdbc4:2.14.4-1830fff -DoutputDirectory=./bin/lib/
mvn install:install-file -Dfile=./bin/lib/stratio-crossdata-jdbc4-2.14.4-1830fff.jar -DgroupId=com.stratio.jdbc -DartifactId=stratio-crossdata-jdbc4 -Dversion=2.14.4-1830fff -Dpackaging=jar
mvn dependency:copy -Dartifact=com.stratio.crossdata.driver:stratio-crossdata-jdbc4:2.16.2-2e12375 -DoutputDirectory=./bin/lib/
mvn install:install-file -Dfile=./bin/lib/stratio-crossdata-jdbc4-2.16.2-2e12375.jar -DgroupId=com.stratio.crossdata.driver -DartifactId=stratio-crossdata-jdbc4 -Dversion=2.16.2-2e12375 -Dpackaging=jar
2 changes: 1 addition & 1 deletion modules/drivers/crossdata/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:min-lein-version "2.5.0"

:dependencies
[[com.stratio.jdbc/stratio-crossdata-jdbc4 "2.14.4-1830fff"
[[com.stratio.crossdata.driver/stratio-crossdata-jdbc4 "2.16.2-2e12375"
:exclusions [com.fasterxml.jackson.core/jackson-core]]]

:profiles
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,9 @@
<version>0.4.5</version>
</dependency>
<dependency>
<groupId>com.stratio.jdbc</groupId>
<groupId>com.stratio.crossdata.driver</groupId>
<artifactId>stratio-crossdata-jdbc4</artifactId>
<version>2.14.4-1830fff</version>
<version>2.16.2-2e12375</version>
<exclusions>
<exclusion>
<artifactId>clojure</artifactId>
Expand Down
8 changes: 6 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@
slingshot]]
[clj-time "0.15.1"] ; library for dealing with date/time
[clojurewerkz/quartzite "2.1.0" ; scheduling library
:exclusions [c3p0]]
:exclusions [c3p0
;; < STRATIO - upgrade quartz for fix vulnerabilities
org.quartz-scheduler/quartz]]
[org.quartz-scheduler/quartz "2.3.2"]
;; STRATIO >
[colorize "0.1.1" :exclusions [org.clojure/clojure]] ; string output with ANSI color codes (for logging)
[com.cemerick/friend "0.2.3" ; auth library
:exclusions [commons-codec
Expand Down Expand Up @@ -114,7 +118,7 @@
[org.tcrawley/dynapath "1.0.0"] ; Dynamically add Jars (e.g. Oracle or Vertica) to classpath
[org.yaml/snakeyaml "1.23"] ; YAML parser (required by liquibase)
[potemkin "0.4.5"] ; utility macros & fns
[com.stratio.jdbc/stratio-crossdata-jdbc4 "2.14.4-1830fff"
[com.stratio.crossdata.driver/stratio-crossdata-jdbc4 "2.16.2-2e12375"
:exclusions [org.clojure/clojure
org.bouncycastle/bcpkix-jdk15on
org.bouncycastle/bcprov-jdk15on
Expand Down
7 changes: 6 additions & 1 deletion src/metabase/task.clj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@
;; get a connection from our application DB connection pool. Quartz will close it (i.e., return it to the pool)
;; when it's done
(jdbc/get-connection (db/connection)))
(shutdown [_]))
(shutdown [_])
;; <STRATIO - bumping quartz to fix vulnerabilities forces us to implement this method
;; of the ConnectionProvider interface (in old quartz version it was not called)
(initialize [_])
;; STRATIO >
)

(when-not *compile-files*
(System/setProperty "org.quartz.dataSource.db.connectionProvider.class" (.getName ConnectionProvider)))
Expand Down

0 comments on commit 1ca9893

Please sign in to comment.