Skip to content

Commit 424e755

Browse files
RUBY-Restore-Pipeline (#103)
* Updated ffi env settings for ruby 3.0 * Rspec fix
1 parent 1fde2d0 commit 424e755

11 files changed

+26
-11
lines changed

app/controllers/vulneruby_engine/insecure_algorithm_controller.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def run
1515
@result = {
1616
digest: Vulneruby::Trigger::CryptoBadMac.run_digest_md5,
1717
random: Vulneruby::Trigger::CryptoWeakRandomness.run_rand,
18-
cipher: Vulneruby::Trigger::CryptoBadCipher.run_bad_cipher
18+
# Bad Ciphers are deprecated in OpenSSL 3.X
19+
# cipher: Vulneruby::Trigger::CryptoBadCipher.run_bad_cipher
1920
}
2021

2122
render('layouts/vulneruby_engine/insecure_algorithm/run')

docker/Dockerfile_agent

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ ARG RUBY_VER=3.0
33
FROM ghcr.io/contrast-security-oss/vulneruby_engine/base:${RUBY_VER}
44

55
ENV CI_TEST=true
6+
7+
# If ruby is 3.0 then use ffi 1.15.5:
8+
RUN if [ "$RUBY_VER" = "3.0" ]; \
9+
then echo "RUBY_VER is 3.0" && export CONTRAST__PIPELINE__RUN=true; \
10+
fi
11+
612
COPY agent/* agent/
713
RUN rm contrast_security.yaml || true
814
COPY contrast_security.yaml contrast_security.yaml

docker/Dockerfile_base

+8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ RUN gem install bundler
3131
ENV PUMA=true
3232
ENV THIN=true
3333

34+
# If ruby is 3.0 then use ffi 1.15.5:
35+
RUN if [ "$RUBY_VER" = "3.0" ]; \
36+
then echo "RUBY_VER is 3.0" && export CONTRAST__PIPELINE__RUN=true \
37+
&& bundle config build.ffi -- --disable-system-libffi \
38+
&& gem install ffi -v 1.15.5 -- -- disable-system-libffi; \
39+
fi
40+
41+
3442
RUN bundle config set with 'puma' 'thin'
3543
RUN bundle config force_ruby_platform true \
3644
&& bundle config build.nokogiri --use-system-libraries

docker/Dockerfile_passenger_max

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV PORT=$PORT_ARG
88
ENV PASSENGER_MAX=true
99
RUN bundle config set with 'passenger_max'
1010

11-
RUN bundle update
11+
RUN bundle install
1212

1313
# Copy configuration files to root directory:
1414
RUN cp /app/contrast_security.yaml /app/spec/dummy/contrast_security.yaml
@@ -22,4 +22,4 @@ RUN bundle exec rake db:version
2222

2323
# Name and run the application
2424
RUN ./docker/app_name_generator.sh Passenger_max >> /tmp/app_name.txt
25-
CMD redis-server & cat /tmp/app_name.txt && CONTRAST__APPLICATION__NAME=$(cat /tmp/app_name.txt) PASSENGER_START_TIMEOUT=300 bundle exec rails s -p $PORT
25+
CMD redis-server & cat /tmp/app_name.txt && CONTRAST__APPLICATION__NAME=$(cat /tmp/app_name.txt) PASSENGER_START_TIMEOUT=300 bundle exec rails s -p $PORT

docker/Dockerfile_passenger_min

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV PORT=$PORT_ARG
88
ENV PASSENGER_MIN=true
99
RUN bundle config set with 'passenger_min'
1010

11-
RUN bundle update
11+
RUN bundle install
1212

1313
# Copy configuration files to root directory:
1414
RUN cp /app/contrast_security.yaml /app/spec/dummy/contrast_security.yaml
@@ -22,4 +22,4 @@ RUN bundle exec rake db:version
2222

2323
# Name and run the application
2424
RUN ./docker/app_name_generator.sh Passenger_min >> /tmp/app_name.txt
25-
CMD redis-server & cat /tmp/app_name.txt && CONTRAST__APPLICATION__NAME=$(cat /tmp/app_name.txt) PASSENGER_START_TIMEOUT=300 bundle exec rails s -p $PORT
25+
CMD redis-server & cat /tmp/app_name.txt && CONTRAST__APPLICATION__NAME=$(cat /tmp/app_name.txt) PASSENGER_START_TIMEOUT=300 bundle exec rails s -p $PORT

docker/Dockerfile_puma_max

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ENV WEB_CONCURRENCY=1
1111
ENV PUMA_MAX=true
1212
RUN bundle config set with 'puma_max'
1313

14-
RUN bundle update
14+
RUN bundle install
1515

1616
# So we may use whatever command we want to trigger rake, to be sure
1717
# that the agent is not braking the rake task

docker/Dockerfile_puma_min

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ENV WEB_CONCURRENCY=1
1111
ENV PUMA_MIN=true
1212
RUN bundle config set with 'puma_min'
1313

14-
RUN bundle update
14+
RUN bundle install
1515

1616
# So we may use whatever command we want to trigger rake, to be sure
1717
# that the agent is not braking the rake task

docker/Dockerfile_thin_max

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV PORT=$PORT_ARG
88
ENV THIN_MAX=true
99
RUN bundle config set with 'thin_max'
1010

11-
RUN bundle update
11+
RUN bundle install
1212

1313
# So we may use whatever command we want to trigger rake, to be sure
1414
# that the agent is not braking the rake task

docker/Dockerfile_thin_min

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV PORT=$PORT_ARG
88
ENV THIN_MIN=true
99
RUN bundle config set with 'thin_min'
1010

11-
RUN bundle update
11+
RUN bundle install
1212

1313
# So we may use whatever command we want to trigger rake, to be sure
1414
# that the agent is not braking the rake task

docker/Dockerfile_unicorn_max

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV PORT=$PORT_ARG
88
ENV UNICORN_MAX=true
99
RUN bundle config set with 'unicorn_max'
1010

11-
RUN AGENT_PATH=`gem which contrast-agent` bundle update && bundle install
11+
RUN AGENT_PATH=`gem which contrast-agent` bundle install
1212

1313
# So we may use whatever command we want to trigger rake, to be sure
1414
# that the agent is not braking the rake task

docker/Dockerfile_unicorn_min

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV PORT=$PORT_ARG
88
ENV UNICORN_MIN=true
99
RUN bundle config set with 'unicorn_min'
1010

11-
RUN AGENT_PATH=`gem which contrast-agent` bundle update && bundle install
11+
RUN AGENT_PATH=`gem which contrast-agent` bundle install
1212

1313
# So we may use whatever command we want to trigger rake, to be sure
1414
# that the agent is not braking the rake task

0 commit comments

Comments
 (0)