-
Notifications
You must be signed in to change notification settings - Fork 156
Distgen migration for Ruby containers #653
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
jackorp
wants to merge
13
commits into
sclorg:master
Choose a base branch
from
jackorp:distgen_migration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9478be5
distgen: Add manifest, multispec and shared files.
jackorp 6bd6b74
distgen: Move the per-version Gemfile for distgen.
jackorp ca8989b
distgen: Move test apps to top-level test/ dir.
jackorp 15edefc
distgen: Re-add generated test-app Gemfiles.
jackorp d0f28bb
distgen: Generalize version-specific README.md to be usable across ve…
jackorp 8c4d66b
Remove dead symlinks into the git submodules.
jackorp 9b74d83
distgen: Remove content_sets.yml from Ruby 2.5.
jackorp 6608277
distgen: Ruby 3.0's s2i assemble does not need comments now.
jackorp 3f617ed
distgen: Generated 2.5 bin/assemble removes trailing whitespace.
jackorp e9949ae
distgen: Split from-dockerfile test due to Ruby 2.5's bundler.
jackorp 71d9907
distgen: test-fips is generated without exception.
jackorp 098822b
distgen: Fully re-generate files.
jackorp 6f3253e
Regenerate version table to reflect distgen reality.
jackorp 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 hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| FROM ubi8/ruby-25 | ||
| FROM registry.access.redhat.com/ubi8/ruby-25 | ||
|
|
||
| ADD --chown=default:root app-src ./ | ||
|
|
||
| RUN bundle install --path bundle | ||
|
|
||
| CMD exec bundle exec "rackup -P /tmp/rack.pid --host 0.0.0.0 --port 8080" |
Empty file.
Empty file.
This file contains hidden or 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,13 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| source 'https://rubygems.org' | ||
|
|
||
| gem 'sinatra' | ||
|
|
||
| gem 'rackup' | ||
|
|
||
| # Use webrick for simple HTTP transport. | ||
| # this is not a production grade server, but gets the job done for the | ||
| # purpose of just sending something over for a request. | ||
| # Additionally there is an option to add SSL later here. | ||
| gem 'webrick' |
This file contains hidden or 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,72 @@ | ||
| require 'sinatra' | ||
| require 'openssl' | ||
|
|
||
| set :server, 'webrick' | ||
| set :bind, '0.0.0.0' | ||
| set :port, 8080 | ||
|
|
||
| MESSAGE = "My secret text\n".freeze | ||
|
|
||
| get '/symmetric/aes-256-cbc' do | ||
| fips_state = OpenSSL.fips_mode ? 'enabled' : 'disabled' | ||
| # This should pass with and without FIPS. | ||
| cipher = OpenSSL::Cipher.new('aes-256-cfb') | ||
| cipher.encrypt | ||
| cipher.random_key | ||
| cipher.random_iv | ||
| enc = cipher.update(MESSAGE) + cipher.final | ||
| return 200, enc | ||
| rescue => e | ||
| return 409, "Unexpected failure with aes-256-cbc, fips #{fips_state}, #{e.inspect}\nBacktrace:\n#{e.backtrace}\n" | ||
| end | ||
|
|
||
| get '/symmetric/des-ede-cbc' do | ||
| status = 200 | ||
| fips_state = OpenSSL.fips_mode ? 'enabled' : 'disabled' | ||
|
|
||
| cipher = OpenSSL::Cipher.new('des-ede-cbc') | ||
| cipher.encrypt | ||
| # This fails in FIPS only once we try to get a key for the 3DES. | ||
| cipher.random_key | ||
| cipher.random_iv | ||
| cipher.update(MESSAGE) + cipher.final | ||
| rescue OpenSSL::Cipher::CipherError => e | ||
| return status, "Failed with fips #{fips_state} #{e.inspect}\n" if OpenSSL.fips_mode | ||
|
|
||
| return 500, "Failed with fips #{fips_state} #{e.inspect}\nBacktrace:\n#{e.backtrace}\n" | ||
| rescue => e | ||
| return 409, "Unexpected failure with des-ede-cbc, fips #{fips_state}, #{e.inspect}\nBacktrace:\n#{e.backtrace}\n" | ||
| end | ||
|
|
||
| get '/hash/sha256' do | ||
| status = 200 | ||
|
|
||
| fips_state = OpenSSL.fips_mode ? 'enabled' : 'disabled' | ||
| message = "SHA256 succeeded, fips is #{fips_state}" | ||
|
|
||
| OpenSSL::Digest.digest('SHA256', MESSAGE) | ||
|
|
||
| return status, message | ||
| rescue => e | ||
| return 409, "Unexpected failure with SHA256, fips #{fips_state}, #{e.inspect}\nBacktrace:\n#{e.backtrace}\n" | ||
| end | ||
|
|
||
| get '/hash/md5' do | ||
| status = 200 | ||
|
|
||
| fips_state = OpenSSL.fips_mode ? 'enabled' : 'disabled' | ||
| message = "MD5 succeeded, fips is #{fips_state}" | ||
|
|
||
| OpenSSL::Digest.digest('MD5', MESSAGE) | ||
|
|
||
| # FIPS is on, but this passed, that shouldn't be the case. | ||
| status = 500 if OpenSSL.fips_mode | ||
|
|
||
| return status, message | ||
| rescue OpenSSL::Digest::DigestError => e | ||
| return status, "Failed with fips #{fips_state} #{e.inspect}\n" if OpenSSL.fips_mode | ||
|
|
||
| return 500, "Failed with fips #{fips_state} #{e.inspect}\nBacktrace:\n#{e.backtrace}\n" | ||
| rescue => e | ||
| return 409, "Unexpected failure with MD5, fips #{fips_state}, #{e.inspect}\nBacktrace:\n#{e.backtrace}\n" | ||
| end |
This file contains hidden or 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,2 @@ | ||
| require './app' | ||
| run Sinatra::Application |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.