mcp-server-semgrep
Version:
MCP Server for Semgrep Integration - static code analysis with AI
50 lines (49 loc) • 1.34 kB
YAML
rules:
- id: aws-lambda-environment-unencrypted
patterns:
- pattern-inside: |
resource "aws_lambda_function" $ANYTHING {
...
}
- pattern-either:
- patterns:
- pattern: |
environment { ... }
- pattern-not-inside: |
resource $A $B {
...
kms_key_arn = ...
...
}
- patterns:
- pattern: |
kms_key_arn = ...
- pattern-not-inside: |
resource $A $B {
...
environment { ... }
...
}
- pattern: kms_key_arn = ""
message: >-
By default, the AWS Lambda Environment is encrypted using AWS-managed keys.
However, for added security, it's recommended to configure your own AWS KMS encryption key to protect your environment variables in Lambda.
You can either create a new aws_kms_key resource or use the ARN of an existing key in your AWS account to do so.
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