class ApiGatewayCacheEncryptedRule
Public Instance Methods
audit_impl(cfn_model)
click to toggle source
# File lib/cfn-nag/custom_rules/ApiGatewayCacheEncryptedRule.rb, line 20 def audit_impl(cfn_model) violating_deployments = cfn_model.resources_by_type('AWS::ApiGateway::Deployment').select do |deployment| violating_deployment?(deployment) end violating_deployments.map(&:logical_resource_id) end
rule_id()
click to toggle source
# File lib/cfn-nag/custom_rules/ApiGatewayCacheEncryptedRule.rb, line 16 def rule_id 'W87' end
rule_text()
click to toggle source
# File lib/cfn-nag/custom_rules/ApiGatewayCacheEncryptedRule.rb, line 7 def rule_text 'ApiGateway Deployment should have cache data encryption enabled when caching is enabled' \ ' in StageDescription properties' end
rule_type()
click to toggle source
# File lib/cfn-nag/custom_rules/ApiGatewayCacheEncryptedRule.rb, line 12 def rule_type Violation::WARNING end
Private Instance Methods
violating_deployment?(deployment)
click to toggle source
# File lib/cfn-nag/custom_rules/ApiGatewayCacheEncryptedRule.rb, line 30 def violating_deployment?(deployment) !deployment.stageDescription.nil? && truthy?(deployment.stageDescription['CachingEnabled']) \ && !truthy?(deployment.stageDescription['CacheDataEncrypted']) end