Skip to content

CASSANDRA-18671: New git and prefetch OWASP db to docker image #94

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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Prefetch OWASP database
  • Loading branch information
jacek-lewandowski committed Jul 17, 2023
commit 3ff644e6f651521242c3e2d4a43c2e958b708704
43 changes: 43 additions & 0 deletions docker/testing/build-owasp-db.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<project basedir="." default="dependency-check-update" name="dependency-check-update">

<property name="dependency-check.version" value="8.3.1"/>
<property name="dependency-check.home.base" value="${basedir}/plugin"/>
<property name="dependency-check.home" value="${basedir}/plugin/dependency-check-ant"/>
<property name="owasp.data.dir" value="${user.home}/.cache/cassandra-owasp/dependency-check-ant"/>

<condition property="is.dependency.check.jar">
<available file="${dependency-check.home}/dependency-check-ant.jar" type="file" />
</condition>

<target name="dependency-check-download"
description="Fetch OWASP Dependency checker"
unless="is.dependency.check.jar">

<echo>Downloading OWASP Dependency checks ...</echo>

<mkdir dir="${dependency-check.home.base}"/>

<retry retrycount="3" retrydelay="10" >
<get src="https://github.com/jeremylong/DependencyCheck/releases/download/v${dependency-check.version}/dependency-check-ant-${dependency-check.version}-release.zip"
dest="${dependency-check.home.base}/dependency-check-ant-${dependency-check.version}-release.zip"/>
</retry>

<unzip src="${dependency-check.home.base}/dependency-check-ant-${dependency-check.version}-release.zip" dest="${dependency-check.home.base}"/>
</target>

<target name="dependency-check-update" description="Dependency-Check Update" depends="dependency-check-download">
<path id="dependency-check.path">
<pathelement location="${dependency-check.home}/dependency-check-ant.jar"/>
<fileset dir="${dependency-check.home}/lib">
<include name="*.jar"/>
</fileset>
</path>

<taskdef resource="dependency-check-taskdefs.properties">
<classpath refid="dependency-check.path" />
</taskdef>

<dependency-check-update dataDirectory="${owasp.data.dir}"/>
</target>

</project>
6 changes: 6 additions & 0 deletions docker/testing/ubuntu2004_j11.docker
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ RUN chown cassandra:cassandra ~/.ssh
RUN chown cassandra:cassandra ~/.ssh/config
RUN chmod 600 ~/.ssh/config

# Fetch the OWASP database
RUN mkdir -p /home/cassandra/dependency-check
COPY build-owasp-db.xml /home/cassandra/dependency-check/build.xml
RUN cd /home/cassandra/dependency-check && ant -f build.xml -Dowasp.data.dir=/home/cassandra/.cache/cassandra-owasp/dependency-check-ant && chown -R cassandra:cassandra /home/cassandra/.cache
RUN rm -rf /home/cassandra/dependency-check

# mark "/tmp" as a volume so it will get mounted as an ext4 mount and not
# the stupid aufs/CoW stuff that the actual docker container mounts will have.
# we've been seeing 3+ minute hangs when calling sync on an aufs backed mount
Expand Down