From d7dbd94dea7843822892298675e531236e447749 Mon Sep 17 00:00:00 2001 From: Sergio Date: Thu, 12 Sep 2024 12:40:54 -0400 Subject: [PATCH] chore: change check name --- .../__init__.py | 0 ...ns_origin_traffic_encrypted.metadata.json} | 6 ++-- ...distributions_origin_traffic_encrypted.py} | 6 ++-- ...ibutions_origin_traffic_encrypted_test.py} | 32 +++++++++---------- 4 files changed, 21 insertions(+), 23 deletions(-) rename prowler/providers/aws/services/cloudfront/{cloudfront_distributions_custom_origin_traffic_encrypted => cloudfront_distributions_origin_traffic_encrypted}/__init__.py (100%) rename prowler/providers/aws/services/cloudfront/{cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted.metadata.json => cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted.metadata.json} (92%) rename prowler/providers/aws/services/cloudfront/{cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted.py => cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted.py} (86%) rename tests/providers/aws/services/cloudfront/{cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted_test.py => cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted_test.py} (84%) diff --git a/prowler/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/__init__.py b/prowler/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/__init__.py similarity index 100% rename from prowler/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/__init__.py rename to prowler/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/__init__.py diff --git a/prowler/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted.metadata.json b/prowler/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted.metadata.json similarity index 92% rename from prowler/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted.metadata.json rename to prowler/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted.metadata.json index cc5f1dd58e7..8864cd74e20 100644 --- a/prowler/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted.metadata.json +++ b/prowler/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted.metadata.json @@ -1,10 +1,8 @@ { "Provider": "aws", - "CheckID": "cloudfront_distributions_custom_origin_traffic_encrypted", + "CheckID": "cloudfront_distributions_origin_traffic_encrypted", "CheckTitle": "Check if CloudFront distributions encrypt traffic to custom origins.", - "CheckType": [ - "NIST 800-53 Controls" - ], + "CheckType": [], "ServiceName": "cloudfront", "SubServiceName": "", "ResourceIdTemplate": "arn:partition:cloudfront:region:account-id:distribution/resource-id", diff --git a/prowler/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted.py b/prowler/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted.py similarity index 86% rename from prowler/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted.py rename to prowler/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted.py index 549aa5d4f0f..668995e7407 100644 --- a/prowler/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted.py +++ b/prowler/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted.py @@ -4,7 +4,7 @@ ) -class cloudfront_distributions_custom_origin_traffic_encrypted(Check): +class cloudfront_distributions_origin_traffic_encrypted(Check): def execute(self): findings = [] for distribution in cloudfront_client.distributions.values(): @@ -14,7 +14,7 @@ def execute(self): report.resource_id = distribution.id report.resource_tags = distribution.tags report.status = "PASS" - report.status_extended = f"CloudFront Distribution {distribution.id} does encrypt traffic to custom origins." + report.status_extended = f"CloudFront Distribution {distribution.id} does encrypt traffic to custom origins." for origin in distribution.origins: if ( @@ -25,7 +25,7 @@ def execute(self): and distribution.viewer_protocol_policy == "allow-all" ): report.status = "FAIL" - report.status_extended = f"CloudFront Distribution {distribution.id} does not encrypt traffic to custom origins." + report.status_extended = f"CloudFront Distribution {distribution.id} does not encrypt traffic to custom origins." findings.append(report) diff --git a/tests/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted_test.py b/tests/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted_test.py similarity index 84% rename from tests/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted_test.py rename to tests/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted_test.py index 4de99d6931e..b2f1b8b94e9 100644 --- a/tests/providers/aws/services/cloudfront/cloudfront_distributions_custom_origin_traffic_encrypted/cloudfront_distributions_custom_origin_traffic_encrypted_test.py +++ b/tests/providers/aws/services/cloudfront/cloudfront_distributions_origin_traffic_encrypted/cloudfront_distributions_origin_traffic_encrypted_test.py @@ -15,7 +15,7 @@ REGION = "eu-west-1" -class Test_cloudfront_distributions_custom_origin_traffic_encrypted: +class Test_cloudfront_distributions_origin_traffic_encrypted: def test_no_distributions(self): cloudfront_client = mock.MagicMock cloudfront_client.distributions = {} @@ -24,11 +24,11 @@ def test_no_distributions(self): new=cloudfront_client, ): # Test Check - from prowler.providers.aws.services.cloudfront.cloudfront_distributions_custom_origin_traffic_encrypted.cloudfront_distributions_custom_origin_traffic_encrypted import ( - cloudfront_distributions_custom_origin_traffic_encrypted, + from prowler.providers.aws.services.cloudfront.cloudfront_distributions_origin_traffic_encrypted.cloudfront_distributions_origin_traffic_encrypted import ( + cloudfront_distributions_origin_traffic_encrypted, ) - check = cloudfront_distributions_custom_origin_traffic_encrypted() + check = cloudfront_distributions_origin_traffic_encrypted() result = check.execute() assert len(result) == 0 @@ -63,11 +63,11 @@ def test_distribution_no_traffic_encryption(self): new=cloudfront_client, ): # Test Check - from prowler.providers.aws.services.cloudfront.cloudfront_distributions_custom_origin_traffic_encrypted.cloudfront_distributions_custom_origin_traffic_encrypted import ( - cloudfront_distributions_custom_origin_traffic_encrypted, + from prowler.providers.aws.services.cloudfront.cloudfront_distributions_origin_traffic_encrypted.cloudfront_distributions_origin_traffic_encrypted import ( + cloudfront_distributions_origin_traffic_encrypted, ) - check = cloudfront_distributions_custom_origin_traffic_encrypted() + check = cloudfront_distributions_origin_traffic_encrypted() result = check.execute() assert len(result) == 1 @@ -110,11 +110,11 @@ def test_distribution_http_only(self): new=cloudfront_client, ): # Test Check - from prowler.providers.aws.services.cloudfront.cloudfront_distributions_custom_origin_traffic_encrypted.cloudfront_distributions_custom_origin_traffic_encrypted import ( - cloudfront_distributions_custom_origin_traffic_encrypted, + from prowler.providers.aws.services.cloudfront.cloudfront_distributions_origin_traffic_encrypted.cloudfront_distributions_origin_traffic_encrypted import ( + cloudfront_distributions_origin_traffic_encrypted, ) - check = cloudfront_distributions_custom_origin_traffic_encrypted() + check = cloudfront_distributions_origin_traffic_encrypted() result = check.execute() assert len(result) == 1 @@ -158,11 +158,11 @@ def test_distribution_match_viewer_allow_all(self): new=cloudfront_client, ): # Test Check - from prowler.providers.aws.services.cloudfront.cloudfront_distributions_custom_origin_traffic_encrypted.cloudfront_distributions_custom_origin_traffic_encrypted import ( - cloudfront_distributions_custom_origin_traffic_encrypted, + from prowler.providers.aws.services.cloudfront.cloudfront_distributions_origin_traffic_encrypted.cloudfront_distributions_origin_traffic_encrypted import ( + cloudfront_distributions_origin_traffic_encrypted, ) - check = cloudfront_distributions_custom_origin_traffic_encrypted() + check = cloudfront_distributions_origin_traffic_encrypted() result = check.execute() assert len(result) == 1 @@ -205,11 +205,11 @@ def test_distribution_traffic_encrypted(self): new=cloudfront_client, ): # Test Check - from prowler.providers.aws.services.cloudfront.cloudfront_distributions_custom_origin_traffic_encrypted.cloudfront_distributions_custom_origin_traffic_encrypted import ( - cloudfront_distributions_custom_origin_traffic_encrypted, + from prowler.providers.aws.services.cloudfront.cloudfront_distributions_origin_traffic_encrypted.cloudfront_distributions_origin_traffic_encrypted import ( + cloudfront_distributions_origin_traffic_encrypted, ) - check = cloudfront_distributions_custom_origin_traffic_encrypted() + check = cloudfront_distributions_origin_traffic_encrypted() result = check.execute() assert len(result) == 1