diff --git a/Dockerfile b/Dockerfile index 359469b..9683502 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,10 +8,9 @@ ADD Gemfile.lock /sectools RUN apk --update add openssh-client && apk --update add bash && \ rm -rf /var/cache/apk/* -RUN gem install ssh_scan bundler +RUN gem install bundler -RUN apk --update add --virtual build-dependencies ruby-dev build-base && \ - apk --update add git && \ +RUN apk --update add --virtual build-dependencies ruby-dev build-base git && \ bundle install && \ apk del build-dependencies && \ rm -rf /var/cache/apk/* @@ -43,6 +42,8 @@ ENV SCB_COMMIT_ID ${COMMIT_ID} ENV SCB_REPOSITORY_URL ${REPOSITORY_URL} ENV SCB_BRANCH ${BRANCH} +ENV SSH_SCAN_VERSION "0.0.42" + LABEL org.opencontainers.image.title="secureCodeBox scanner-webserver-ssh" \ org.opencontainers.image.description="SSH_Scan integration for secureCodeBox" \ org.opencontainers.image.authors="iteratec GmbH" \ diff --git a/Gemfile b/Gemfile index df4ed8e..89c9989 100644 --- a/Gemfile +++ b/Gemfile @@ -3,5 +3,6 @@ source 'https://rubygems.org' gem "sinatra", '2.0.8.1' gem "rest-client", '2.1.0' gem "ssh_scan", '0.0.42' +gem "thin" -gem "ruby-scanner-scaffolding", :git => "https://github.com/secureCodeBox/ruby-scanner-scaffolding.git", :tag => "v1.0.0" \ No newline at end of file +gem "ruby-scanner-scaffolding", :git => "https://github.com/secureCodeBox/ruby-scanner-scaffolding.git", :tag => "v1.1.1" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 2efd337..98e1495 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/secureCodeBox/ruby-scanner-scaffolding.git - revision: fff6c92edffb1f55bde432156ffd60c38c034e49 - tag: v1.0.0 + revision: d9dab7bd9588f5000ac45cbfb4cf7b1f2cc049b5 + tag: v1.1.1 specs: ruby-scanner-scaffolding (1.0.0) @@ -9,8 +9,11 @@ GEM remote: https://rubygems.org/ specs: bindata (2.4.3) + daemons (1.3.1) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) + eventmachine (1.2.7) + eventmachine (1.2.7-x64-mingw32) ffi (1.12.1-x64-mingw32) http-accept (1.7.0) http-cookie (1.0.3) @@ -49,6 +52,10 @@ GEM netaddr (= 1.5.1) sshkey sshkey (2.0.0) + thin (1.7.2) + daemons (~> 1.0, >= 1.0.9) + eventmachine (~> 1.0, >= 1.0.4) + rack (>= 1, < 3) tilt (2.0.10) unf (0.1.4) unf_ext @@ -63,6 +70,7 @@ DEPENDENCIES ruby-scanner-scaffolding! sinatra (= 2.0.8.1) ssh_scan (= 0.0.42) + thin BUNDLED WITH 2.1.4 diff --git a/src/main.rb b/src/main.rb index 3f964fa..1e60b9a 100644 --- a/src/main.rb +++ b/src/main.rb @@ -9,6 +9,8 @@ set :port, 8_080 set :bind, '0.0.0.0' set :environment, :production +set :server, 'thin' +disable :logging, :static, :show_exceptions client = SshWorker.new( diff --git a/src/ssh_worker.rb b/src/ssh_worker.rb index 75e7590..0a941b7 100644 --- a/src/ssh_worker.rb +++ b/src/ssh_worker.rb @@ -48,4 +48,12 @@ def work(job_id, targets) scannerType: 'ssh' } end + + def version + if ENV.key? 'SSH_SCAN_VERSION' + ENV["SSH_SCAN_VERSION"] + else + "unkown" + end + end end