rules:
- id: aws-workspaces-user-volume-unencrypted
  patterns:
  - pattern: |
      resource "aws_workspaces_workspace" $ANYTHING {
        ...
      }
  - pattern-not-inside: |
      resource "aws_workspaces_workspace" $ANYTHING {
        ...
        user_volume_encryption_enabled = true
        ...
      }
  message: The AWS Workspace user volume is unencrypted. The AWS KMS encryption key protects user volume.
    To create your own, create a aws_kms_key resource or use the ARN string of a key in your account.
  languages: [hcl]
  severity: WARNING
  metadata:
    owasp:
    - A03:2017 - Sensitive Data Exposure
    cwe:
    - 'CWE-320: CWE CATEGORY: Key Management Errors'
    technology:
    - aws
    - terraform
    category: security
    references:
    - https://owasp.org/Top10/A02_2021-Cryptographic_Failures
    subcategory:
    - audit
    likelihood: LOW
    impact: LOW
    confidence: LOW
