-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: vulnz Docker #87
Closed
Closed
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
30e3295
feat: vulnz Docker
derhecht 6833696
Merge branch 'main' into main
derhecht 1e23e3d
Merge branch 'main' into main
derhecht c96a0a9
Merge branch 'main' into main
derhecht bcd497c
fix: stop gzipping in vulnz Docker after cache cve
derhecht 50b35fb
fix: update documentation according to gzip feature
derhecht File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
FROM httpd:alpine | ||
|
||
ARG BUILD_DATE | ||
ARG BUILD_VERSION | ||
|
||
ARG http_proxy | ||
ARG https_proxy | ||
ARG no_proxy | ||
|
||
LABEL authors="derhecht,stevespringett,jeremylong" | ||
LABEL maintainer="[email protected]" | ||
LABEL name="jeremylong/vulnz" | ||
LABEL version=$BUILD_VERSION | ||
LABEL org.label-schema.schema-version="1.0" | ||
LABEL org.label-schema.build-date=$BUILD_DATE | ||
LABEL org.label-schema.name="jeremylong/vulnz" | ||
LABEL org.label-schema.description="Persist the data using the open-vulnerability-store." | ||
LABEL org.label-schema.url="https://github.com/jeremylong/Open-Vulnerability-Project" | ||
LABEL org.label-schema.vcs-url="https://github.com/jeremylong/Open-Vulnerability-Project" | ||
LABEL org.label-schema.vendor="jeremylong" | ||
LABEL org.label-schema.version=$BUILD_VERSION | ||
LABEL org.label-schema.docker.cmd="docker run -it --rm --name mirror -e NVD_API_KEY=YOUR_API_KEY_HERE -p 80:80 jeremylong/vulnz" | ||
|
||
ENV user=mirror | ||
ENV BUILD_VERSION=$BUILD_VERSION | ||
|
||
RUN apk update && \ | ||
apk add --no-cache openjdk11 dcron nss supervisor && \ | ||
addgroup -S "$user" && \ | ||
adduser -S "$user" -G "$user" && \ | ||
chown -R "$user":"$user" /usr/local/apache2/htdocs && \ | ||
rm -v /usr/local/apache2/htdocs/index.html | ||
|
||
COPY ["/src/docker/conf/supervisord.conf", "/etc/supervisor/conf.d/supervisord.conf"] | ||
COPY ["/src/docker/scripts/mirror.sh", "/mirror.sh"] | ||
COPY ["/src/docker/crontab/mirror", "/etc/crontabs/mirror"] | ||
COPY ["/src/docker/conf/mirror.conf", "/usr/local/apache2/conf"] | ||
COPY ["/build/libs/vulnz-$BUILD_VERSION.jar", "/usr/local/bin/vulnz"] | ||
|
||
EXPOSE 80/tcp | ||
|
||
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf", "-l", "/var/log/supervisord.log", "-j", "/var/run/supervisord.pid"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# | ||
# Configuration for the httpd mirror | ||
# | ||
ServerName localhost | ||
<Directory /usr/local/apache2/htdocs> | ||
Options +Indexes +MultiViews | ||
IndexOptions FancyIndexing -SuppressLastModified | ||
</Directory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[supervisord] | ||
nodaemon=true | ||
user=root | ||
|
||
[program:crond] | ||
command=crond -s /var/spool/cron/crontabs -f | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
|
||
[program:httpd] | ||
command=/usr/local/bin/httpd-foreground | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
|
||
[program:initialize_htdocs] | ||
command=/mirror.sh | ||
autorestart=false | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
user=mirror |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 0 * * * /mirror.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
echo "Updating..." | ||
|
||
CACHE_DIR=/usr/local/apache2/htdocs | ||
|
||
java -jar /usr/local/bin/vulnz cve --cache --directory $CACHE_DIR | ||
cd $CACHE_DIR || (echo "$CACHE_DIR not found - could not zip cve files\!" && exit 1) | ||
for file in *.json; do gzip -k "${file}"; done | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this step still required? in 5.0.3 the output is produced already gzip'ed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if so, of course not. i will update.