Class: CustomCops::DontPrintAllEnv
- Inherits:
-
RuboCop::Cop::Base
- Object
- RuboCop::Cop::Base
- CustomCops::DontPrintAllEnv
- Defined in:
- lib/simplycop/custom_cops/dont_print_all_env.rb
Constant Summary collapse
- MSG =
This cop checks if someone accidentally print all environment variables
because some of them may contain secrets.
'Printing all Environment Variables is extremely risky ' \ 'If this code has been run, then it is likely that secrets have been ' \ 'exposed in plaintext. Please alert `#infosec` about this so it can be ' \ 'investigated immediately.'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
30 31 32 33 34 |
# File 'lib/simplycop/custom_cops/dont_print_all_env.rb', line 30 def on_send(node) return unless convert_env_to_hash_or_array?(node) || print_all_env_shell?(node) add_offense(node.loc.selector) end |