Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

fix(data): aws_privesc separate output key from cloud.aws aws_findings (MOD-052)

Mafifrizi40a928e14058
diff --git a/ares/modules/cloud/aws_privesc.py b/ares/modules/cloud/aws_privesc.py
index 5027240..084d527 100644
--- a/ares/modules/cloud/aws_privesc.py
+++ b/ares/modules/cloud/aws_privesc.py
@@ -65,7 +65,7 @@ class AWSPrivescModule(BaseModule):
OPSEC: LOW
MITRE: "T1078.004", "T1548", "T1098"
- OUTPUTS: "aws_privesc_paths", "aws_findings"
+ OUTPUTS: "aws_privesc_paths", "iam_privesc_paths"
"""
MODULE_ID = "cloud.aws_privesc"
MODULE_NAME = "AWS IAM Privilege Escalation"
@@ -77,7 +77,7 @@ class AWSPrivescModule(BaseModule):
MODULE_AUTHOR = "ARES Team <[email protected]>"
OPSEC_LEVEL = OpsecLevel.LOW
REQUIRES = []
- OUTPUTS = ["aws_privesc_paths", "aws_findings"]
+ OUTPUTS = ["aws_privesc_paths", "iam_privesc_paths"]
MITRE_TECHNIQUES = ["T1078.004", "T1548", "T1098"]
PARAMS_MODEL = AWSPrivescParams
@@ -338,5 +338,5 @@ class AWSPrivescModule(BaseModule):
"errors": result.get("errors", []),
}
raw["aws_privesc_paths"] = self._findings # OUTPUTS key
- raw["aws_findings"] = self._findings # OUTPUTS key
+ raw["iam_privesc_paths"] = self._findings # OUTPUTS key
return self._findings[:], raw
diff --git a/tests/unit/test_artifact_normalizer_pipeline.py b/tests/unit/test_artifact_normalizer_pipeline.py
index 156545e..b32d40b 100644
--- a/tests/unit/test_artifact_normalizer_pipeline.py
+++ b/tests/unit/test_artifact_normalizer_pipeline.py
@@ -169,6 +169,44 @@ def test_aws_privesc_pipeline_recovers_paths(normalizer: ArtifactNormalizer, sto
assert "AdminEscalationRole" in cloud_res[0].resource_id
+def test_aws_privesc_output_key_separation(normalizer: ArtifactNormalizer, store: ArtifactStore):
+ """MOD-052: aws_privesc must use iam_privesc_paths and not overwrite aws_findings."""
+ from unittest.mock import MagicMock
+ from ares.modules.cloud.aws_privesc import AWSPrivescModule
+ assert "iam_privesc_paths" in AWSPrivescModule.OUTPUTS
+ assert "aws_findings" not in AWSPrivescModule.OUTPUTS
+
+ # Simulate existing cloud.aws findings in raw
+ cloud_aws_findings = {
+ "s3": {
+ "public_buckets": [{"name": "confidential-backup"}]
+ },
+ "region": "us-east-1",
+ }
+ raw = {
+ "aws_findings": cloud_aws_findings,
+ "s3": cloud_aws_findings["s3"],
+ "region": "us-east-1",
+ }
+
+ # aws_privesc populates raw
+ mod = AWSPrivescModule(MagicMock(), MagicMock(), MagicMock())
+ mod._findings = ["privesc_found"]
+ raw["aws_privesc_paths"] = mod._findings
+ raw["iam_privesc_paths"] = mod._findings
+
+ # aws_findings must not be overwritten by list[Finding]
+ assert raw["aws_findings"] == cloud_aws_findings
+ assert isinstance(raw["aws_findings"], dict)
+ assert raw["iam_privesc_paths"] == ["privesc_found"]
+
+ # Verify cloud.aws S3 normalization still succeeds
+ added = normalizer.normalize("cloud.aws", ["aws_findings"], raw, store)
+ assert added >= 1
+ buckets = [r for r in store.get(ArtifactType.CLOUD_RESOURCE) if r.resource_type == "s3_bucket"]
+ assert any(b.resource_id == "confidential-backup" for b in buckets)
+
+
# ── Batch of P0 Handlers (Langkah 2B) ─────────────────────────────────────────
def test_cleartext_credentials_pipeline(normalizer: ArtifactNormalizer, store: ArtifactStore):