Skip to content

Commit de98bfb

Browse files
authored
ConformancePack revert (#108)
1 parent a1e482f commit de98bfb

File tree

3 files changed

+7
-23
lines changed

3 files changed

+7
-23
lines changed

arch/templates/ConformancePack.yaml

+3-11
Original file line numberDiff line numberDiff line change
@@ -479,20 +479,12 @@ Resources:
479479
Properties:
480480
ConfigRuleName: gc02_check_access_management_attestation
481481
Description: Checks S3 bucket for the access management attestation document.
482-
483482
InputParameters:
484-
S3AccessReviewDocumentPath:
485-
Fn::If:
486-
- S3AccessReviewDocumentPath
487-
- Ref: S3AccessReviewDocumentPath
488-
- AWS::NoValue
489-
490-
S3AccessManagementAttestationDocumentPath:
483+
s3ObjectPath:
491484
Fn::If:
492-
- S3AccessManagementAttestationDocumentPath
485+
- s3AccessManagementAttestationDocumentPath
493486
- Ref: S3AccessManagementAttestationDocumentPath
494-
- AWS::NoValue
495-
487+
- Ref: AWS::NoValue
496488
ExecutionRoleName:
497489
Fn::If:
498490
- GCLambdaExecutionRoleName

arch/templates/main.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ Resources:
11421142
Action:
11431143
- "redshift:DescribeClusters"
11441144
- "redshift:DescribeClusterParameters"
1145-
Resource:
1145+
Resource:
11461146
- !Sub "arn:${AWS::Partition}:redshift:*:*:cluster:*"
11471147
- !Sub "arn:${AWS::Partition}:redshift:*:*:parametergroup:*"
11481148
Effect: Allow

src/lambda/gc02_check_access_management_attestation/app.py

+3-11
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,13 @@ def lambda_handler(event, context):
7777
event,
7878
[build_evaluation(aws_account_id, "NOT_APPLICABLE", event, gr_requirement_type=gr_requirement_type)],
7979
)
80-
81-
pdf_paths = [
82-
rule_parameters["S3AccessReviewDocumentPath"],
83-
rule_parameters["S3AccessManagementAttestationDocumentPath"]
84-
]
8580

86-
missing_files = [path for path in pdf_paths if not check_s3_object_exists(aws_s3_client, path)]
87-
88-
if not missing_files:
81+
if check_s3_object_exists(aws_s3_client, rule_parameters["s3ObjectPath"]):
8982
compliance_type = "COMPLIANT"
90-
annotation = "Both required access management documents found"
83+
annotation = "Access Management Attestation document found"
9184
else:
9285
compliance_type = "NON_COMPLIANT"
93-
annotation = f"Missing documents: {', '.join(missing_files)}"
94-
86+
annotation = "Access Management Attestation document NOT found"
9587

9688
logger.info(f"{compliance_type}: {annotation}")
9789
evaluations.append(build_evaluation(aws_account_id, compliance_type, event, annotation=annotation))

0 commit comments

Comments
 (0)