Insecure service configuration - IAM
Description
In compliance with the different security standards for cloud computing such as ISO 27017 and NIST SP 800-144, no sensitive information should be stored among the information that is uploaded to the cloud, as this may result in data leakage, as in the case of AWS IAM passwords.
Impact
Generate data leakage within the sensitive information that is uploaded to the cloud, for example, the case of how through the credentials that were stored in the code can be obtained data from the buckets and AWS services.
Recommendation
Do not store credentials in the code, it is necessary to use environment variables and protected secret sources.
Threat
Internal attacker with access to services configurations.
Expected Remediation Time
⌚ 45 minutes.
Score
Default score using CVSS 3.1. It may change depending on the context of the vulnerability.
Base
- Attack vector: A
- Attack complexity: L
- Privileges required: N
- User interaction: N
- Scope: U
- Confidentiality: L
- Integrity: N
- Availability: N
Temporal
- Exploit code madurity: X
- Remediation level: O
- Report confidence: X
Result
- Vector string: CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:X/RL:O/RC:X
- Score:
- Base: 4.3
- Temporal: 4.1
- Severity:
- Base: Medium
- Temporal: Medium
Code Examples
Compliant code
All resource credentials are stored using environment variables
resource "aws_iam_policy" "policy" {
name = "test_policy"
path = "/mypath"
description = "My test policy"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = [
"ec2:Describe*",
]
Effect = "Allow"
Resource = "db_critical"
},
]
})
}
Non compliant code
Some resources have their credentials stored in the code
resource "aws_iam_policy" "policy" {
name = "test_policy"
path = "/mypath"
description = "My test policy"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = [
"ec2:Describe*",
]
Effect = "Allow"
Resource = "db_critical"
Password = "my_service_password"
},
]
})
}
Requirements
Search for vulnerabilities in your apps for free with our automated security testing! Start your 21-day free trial and discover the benefits of our Continuous Hacking Machine Plan. If you prefer a full service that includes the expertise of our ethical hackers, don't hesitate to contact us for our Continuous Hacking Squad Plan.