Class: Terracop::Cop::Aws::OpenSsh
- Inherits:
-
SecurityGroupRuleCop
- Object
- Base
- SecurityGroupRuleCop
- Terracop::Cop::Aws::OpenSsh
- Defined in:
- lib/terracop/cop/aws/open_ssh.rb
Overview
This cop warns against an ingress rule from 0.0.0.0/0 on port 22 (SSH). That is a Very Bad Idea™.
Instance Attribute Summary
Attributes inherited from Base
#attributes, #index, #name, #offenses, #type
Instance Method Summary collapse
Methods inherited from Base
config, cop_name, #human_name, #initialize, #offense, run
Constructor Details
This class inherits a constructor from Terracop::Cop::Base
Instance Method Details
#check ⇒ Object
31 32 33 34 35 |
# File 'lib/terracop/cop/aws/open_ssh.rb', line 31 def check return unless ingress? && any_ip? && tcp? && port?(22) offense('Do not leave port 22 (SSH) open to the world.', :security) end |