Repository navigation
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
14
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
14 commits
Select commit
Hold shift + click to select a range
7bfb3ff
distgen: Add manifest, multispec and shared files.
jackorp 7384b4c
distgen: Move the per-version Gemfile for distgen.
jackorp eed9ef2
distgen: Move test apps to top-level test/ dir.
jackorp b766e19
distgen: Re-add generated test-app Gemfiles.
jackorp e8548c7
distgen: Generalize version-specific README.md to be usable across ve…
jackorp 129602b
Remove dead symlinks into the git submodules.
jackorp e246ad9
distgen: Remove content_sets.yml from Ruby 2.5.
jackorp 5e645ad
distgen: Ruby 3.0's s2i assemble does not need comments now.
jackorp 1ecc60f
distgen: Generated 2.5 bin/assemble removes trailing whitespace.
jackorp 4145477
distgen: Split from-dockerfile test due to Ruby 2.5's bundler.
jackorp 9946050
distgen: test-fips is generated without exception.
jackorp ff5b4b9
distgen: Fully re-generate files.
jackorp 523d623
Regenerate version table to reflect distgen reality.
jackorp dfc2a45
readme: Fix section about Dockerfiles to mention the c10s suffix corr…
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,4 +1,4 @@ | ||
| FROM ubi8/ruby-25 | ||
| FROM registry.access.redhat.com/ubi8/ruby-25 | ||
|
|
||
| ADD --chown=default:root app-src ./ | ||
|
|
||
|
|
||
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 | ||
|
frenzymadness marked this conversation as resolved.
|
||
|
|
||
| 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.
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.