Key file permissions error message incorrectly identifies ownership issues
samnissen opened this issue · comments
Environment
Provide at least:
- Ruby Version -- 2.4.1 (affects any)
- Symmetric Encryption Version -- 4.2.0 (affects many)
- Application/framework names and versions (e.g. Rails, Sinatra, Puma, etc.). -- Rails (n/a)
- Full Stack Trace, if an exception is being raised.
SymmetricEncryption::ConfigError: Symmetric Encryption key file '/etc/rails/keys/app.key' has the wrong permissions: 100600. Expected 100600.
/usr/local/rvm/gems/ruby-2.4.1/gems/symmetric-encryption-4.2.0/lib/symmetric_encryption/keystore/file.rb:52:in `read'
/usr/local/rvm/gems/ruby-2.4.1/gems/symmetric-encryption-4.2.0/lib/symmetric_encryption/keystore.rb:168:in `read_key'
/usr/local/rvm/gems/ruby-2.4.1/gems/symmetric-encryption-4.2.0/lib/symmetric_encryption/cipher.rb:22:in `from_config'
/usr/local/rvm/gems/ruby-2.4.1/gems/symmetric-encryption-4.2.0/lib/symmetric_encryption/config.rb:87:in `block in ciphers'
/usr/local/rvm/gems/ruby-2.4.1/gems/symmetric-encryption-4.2.0/lib/symmetric_encryption/config.rb:87:in `collect'
/usr/local/rvm/gems/ruby-2.4.1/gems/symmetric-encryption-4.2.0/lib/symmetric_encryption/config.rb:87:in `ciphers'
/usr/local/rvm/gems/ruby-2.4.1/gems/symmetric-encryption-4.2.0/lib/symmetric_encryption/config.rb:22:in `load!'
/usr/local/rvm/gems/ruby-2.4.1/gems/symmetric-encryption-4.2.0/lib/symmetric_encryption/railtie.rb:41:in `block in <class:Railtie>'
/usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
/usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
/usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `each'
/usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.2.3/lib/rails/application.rb:95:in `inherited'
/home/app/webapp/config/application.rb:13:in `<module:Rp2>'
/home/app/webapp/config/application.rb:12:in `<top (required)>'
/home/app/webapp/Rakefile:4:in `require'
/home/app/webapp/Rakefile:4:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:22:in `block in perform'
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke'
/usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Expected Behavior
- Describe your expectation of how Symmetric Encryption should behave.
SE would indicate ownership mismatch when true - Ideally, provide a standalone Ruby script or a link to an example repository that helps reproduce the issue.
(That would require providing a docker build.)
Actual Behavior
- Describe or show the actual behavior.
SE does not indicate ownership mismatch -- instead indicates the file permissions are incorrect when they are correct. - Provide text or screen capture showing the behavior.
See stack trace above.
Pull Request
- Consider submitting a Pull Request with a fix for the issue.
- Or, even a Pull request that only includes a test that reproduces the problem.
Inbound shortly.