Skip to content

GuardDuty Detector Disallow Features and Data Sources #4153

@BwL1289

Description

@BwL1289

CloudFormation Lint Version

1.28.0

What operating system are you using?

Mac

Describe the bug

Resource handler returned message: "The request failed because both data sources and features were provided. You can provide only one; it is recommended to use features.

When setting up GuardDuty, you cannot specify both Data Sources and Features. It's recommended to use Features. Cfn-lint should catch this.

Expected behavior

Cfn-lint raises an error when both Data Sources and Features are specified.

Reproduction template

SecuritySvcGuardDutyDetectorC58A14AA:
    Type: AWS::GuardDuty::Detector
    Properties:
      DataSources:
        MalwareProtection:
          ScanEc2InstanceWithFindings:
            EbsVolumes: false
        S3Logs:
          Enable: true
      Enable: true
      Features:
        - Name: S3_DATA_EVENTS
          Status: ENABLED
        - Name: RDS_LOGIN_EVENTS
          Status: ENABLED
        - Name: RUNTIME_MONITORING
          Status: ENABLED
      FindingPublishingFrequency: ONE_HOUR
      Tags:
        - Key: service-name
          Value: security-svc
    Metadata:
      aws:cdk:path: CoreStackDev/SecuritySvc/GuardDutyDetector

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions