Memcached Disabled

  • Query id: dd0971a6-09c3-4168-8474-a7ef8fbfd99d
  • Query name: Memcached Disabled
  • Platform: CloudFormation
  • Severity: Medium
  • Category: Encryption
  • URL: Github

Description

Check if the Memcached is disabled on the ElastiCache
Documentation

Code samples

Code samples with security vulnerabilities

Postitive test num. 1 - yaml file
AWSTemplateFormatVersion: 2010-09-09
Description: A sample template
Resources:
  ElasticacheCluster3:
    Type: 'AWS::ElastiCache::CacheCluster'
    Properties:
      Engine: redis
      CacheNodeType: cache.t2.micro
      NumCacheNodes: '1'
      VpcSecurityGroupIds:
        - !GetAtt
          - ElasticacheSecurityGroup
          - GroupId
Postitive test num. 2 - json file
{
  "Description": "A sample template",
  "Resources": {
    "ElasticacheCluster4": {
        "Type": "AWS::ElastiCache::CacheCluster",
        "Properties": {
            "Engine": "redis",
            "CacheNodeType": "cache.t2.micro",
            "NumCacheNodes": "1",
            "VpcSecurityGroupIds": [
                {
                    "Fn::GetAtt": [
                        "ElasticacheSecurityGroup",
                        "GroupId"
                    ]
                }
            ]
        }
    }
  },
  "AWSTemplateFormatVersion": "2010-09-09T00:00:00Z"
}

Code samples without security vulnerabilities

Negative test num. 1 - yaml file
AWSTemplateFormatVersion: 2010-09-09
Description: A sample template
Resources:
  ElasticacheCluster:
    Type: 'AWS::ElastiCache::CacheCluster'
    Properties:
      Engine: memcached
      CacheNodeType: cache.t2.micro
      NumCacheNodes: '1'
      VpcSecurityGroupIds:
        - !GetAtt
          - ElasticacheSecurityGroup
          - GroupId
Negative test num. 2 - json file
{
  "Description": "A sample template",
  "Resources": {
    "ElasticacheCluster2": {
        "Type": "AWS::ElastiCache::CacheCluster",
        "Properties": {
            "Engine": "memcached",
            "CacheNodeType": "cache.t2.micro",
            "NumCacheNodes": "1",
            "VpcSecurityGroupIds": [
                {
                    "Fn::GetAtt": [
                        "ElasticacheSecurityGroup",
                        "GroupId"
                    ]
                }
            ]
        }
    }
  },
  "AWSTemplateFormatVersion": "2010-09-09T00:00:00Z"
}