Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OJ-2897: Remove redaction of lambda and API log groups #486

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 18 additions & 153 deletions infrastructure/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ Resources:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/CiMappingFunction
RetentionInDays: 30

PIIRedactedCiMappingFunctionLogsSubscriptionFilterCSLS:
CiMappingFunctionLogsSubscriptionFilterCSLS:
Type: AWS::Logs::SubscriptionFilter
Condition: IsNotDevLikeEnvironment
Properties:
DestinationArn:
!FindInMap [PlatformConfiguration, !Ref Environment, CSLSEGRESS]
FilterPattern: ""
LogGroupName: !Ref PIIRedactedCiMappingFunctionLogGroup
LogGroupName: !Ref CiMappingFunctionLogGroup

CredentialSubjectFunction:
Type: AWS::Serverless::Function
Expand All @@ -237,14 +237,14 @@ Resources:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/CredentialSubjectFunction
RetentionInDays: 30

PIIRedactedCredentialSubjectFunctionLogsSubscriptionFilterCSLS:
CredentialSubjectFunctionLogsSubscriptionFilterCSLS:
Type: AWS::Logs::SubscriptionFilter
Condition: IsNotDevLikeEnvironment
Properties:
DestinationArn:
!FindInMap [PlatformConfiguration, !Ref Environment, CSLSEGRESS]
FilterPattern: ""
LogGroupName: !Ref PIIRedactedCredentialSubjectFunctionLogGroup
LogGroupName: !Ref CredentialSubjectFunctionLogGroup

JwtSignerFunction:
Type: AWS::Serverless::Function
Expand Down Expand Up @@ -274,14 +274,14 @@ Resources:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/JwtSignerFunction
RetentionInDays: 30

PIIRedactedJwtSignerFunctionLogsSubscriptionFilterCSLS:
JwtSignerFunctionLogsSubscriptionFilterCSLS:
Type: AWS::Logs::SubscriptionFilter
Condition: IsNotDevLikeEnvironment
Properties:
DestinationArn:
!FindInMap [PlatformConfiguration, !Ref Environment, CSLSEGRESS]
FilterPattern: ""
LogGroupName: !Ref PIIRedactedJwtSignerFunctionLogGroup
LogGroupName: !Ref JwtSignerFunctionLogGroup

OTGFunction:
Type: AWS::Serverless::Function
Expand All @@ -305,14 +305,14 @@ Resources:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/OTGFunction
RetentionInDays: 30

PIIRedactedOTGFunctionLogsSubscriptionFilterCSLS:
OTGFunctionLogsSubscriptionFilterCSLS:
Type: AWS::Logs::SubscriptionFilter
Condition: IsNotDevLikeEnvironment
Properties:
DestinationArn:
!FindInMap [PlatformConfiguration, !Ref Environment, CSLSEGRESS]
FilterPattern: ""
LogGroupName: !Ref PIIRedactedOTGFunctionLogGroup
LogGroupName: !Ref OTGFunctionLogGroup

OTGFunctionFatalErrorMetricFilter:
Type: AWS::Logs::MetricFilter
Expand Down Expand Up @@ -409,14 +409,14 @@ Resources:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/MatchingFunction
RetentionInDays: 30

PIIRedactedMatchingFunctionLogsSubscriptionFilterCSLS:
MatchingFunctionLogsSubscriptionFilterCSLS:
Type: AWS::Logs::SubscriptionFilter
Condition: IsNotDevLikeEnvironment
Properties:
DestinationArn:
!FindInMap [PlatformConfiguration, !Ref Environment, CSLSEGRESS]
FilterPattern: ""
LogGroupName: !Ref PIIRedactedMatchingFunctionLogGroup
LogGroupName: !Ref MatchingFunctionLogGroup

SsmParametersFunction:
Type: AWS::Serverless::Function
Expand All @@ -443,14 +443,14 @@ Resources:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/SsmParametersFunction
RetentionInDays: 30

PIIRedactedSsmParametersFunctionLogsSubscriptionFilterCSLS:
SsmParametersFunctionLogsSubscriptionFilterCSLS:
Type: AWS::Logs::SubscriptionFilter
Condition: IsNotDevLikeEnvironment
Properties:
DestinationArn:
!FindInMap [PlatformConfiguration, !Ref Environment, CSLSEGRESS]
FilterPattern: ""
LogGroupName: !Ref PIIRedactedSsmParametersFunctionLogGroup
LogGroupName: !Ref SsmParametersFunctionLogGroup

TimeFunction:
Type: AWS::Serverless::Function
Expand All @@ -474,14 +474,14 @@ Resources:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/TimeFunction
RetentionInDays: 30

PIIRedactedTimeFunctionLogsSubscriptionFilterCSLS:
TimeFunctionLogsSubscriptionFilterCSLS:
Type: AWS::Logs::SubscriptionFilter
Condition: IsNotDevLikeEnvironment
Properties:
DestinationArn:
!FindInMap [PlatformConfiguration, !Ref Environment, CSLSEGRESS]
FilterPattern: ""
LogGroupName: !Ref PIIRedactedTimeFunctionLogGroup
LogGroupName: !Ref TimeFunctionLogGroup

UserAgent:
Type: AWS::SSM::Parameter
Expand Down Expand Up @@ -552,14 +552,14 @@ Resources:
LogGroupName: !Sub "/aws/vendedlogs/apigateway/${AWS::StackName}-${PublicNinoCheckApi}-public-AccessLogs"
RetentionInDays: 30

PIIRedactedPublicNinoCheckApiLogsSubscriptionFilterCSLS:
PublicNinoCheckApiLogsSubscriptionFilterCSLS:
Type: AWS::Logs::SubscriptionFilter
Condition: IsNotDevLikeEnvironment
Properties:
DestinationArn:
!FindInMap [PlatformConfiguration, !Ref Environment, CSLSEGRESS]
FilterPattern: ""
LogGroupName: !Ref PIIRedactedPublicNinoCheckApiAccessLogGroup
LogGroupName: !Ref PublicNinoCheckApiAccessLogGroup

PublicNinoCheckApiFatalErrorMetricFilter:
Type: AWS::Logs::MetricFilter
Expand Down Expand Up @@ -655,14 +655,14 @@ Resources:
LogGroupName: !Sub "/aws/vendedlogs/apigateway/${AWS::StackName}-${PrivateNinoCheckApi}-private-AccessLogs"
RetentionInDays: 30

PIIRedactedPrivateNinoCheckApiLogsSubscriptionFilterCSLS:
PrivateNinoCheckApiLogsSubscriptionFilterCSLS:
Type: AWS::Logs::SubscriptionFilter
Condition: IsNotDevLikeEnvironment
Properties:
DestinationArn:
!FindInMap [PlatformConfiguration, !Ref Environment, CSLSEGRESS]
FilterPattern: ""
LogGroupName: !Ref PIIRedactedPrivateNinoCheckApiAccessLogGroup
LogGroupName: !Ref PrivateNinoCheckApiAccessLogGroup

PrivateNinoCheckApiFatalErrorMetricFilter:
Type: AWS::Logs::MetricFilter
Expand Down Expand Up @@ -2082,60 +2082,6 @@ Resources:
# #
####################################################################

PIIRedactedCiMappingFunctionLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/CiMappingFunction-pii-redacted
RetentionInDays: 30

PIIRedactedCredentialSubjectFunctionLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/CredentialSubjectFunction-pii-redacted
RetentionInDays: 30

PIIRedactedJwtSignerFunctionLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/JwtSignerFunction-pii-redacted
RetentionInDays: 30

PIIRedactedOTGFunctionLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/OTGFunction-pii-redacted
RetentionInDays: 30

PIIRedactedMatchingFunctionLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/MatchingFunction-pii-redacted
RetentionInDays: 30

PIIRedactedSsmParametersFunctionLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/SsmParametersFunction-pii-redacted
RetentionInDays: 30

PIIRedactedTimeFunctionLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/TimeFunction-pii-redacted
RetentionInDays: 30

PIIRedactedPublicNinoCheckApiAccessLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub "/aws/vendedlogs/apigateway/${AWS::StackName}-${PublicNinoCheckApi}-public-AccessLogs-pii-redacted"
RetentionInDays: 30

PIIRedactedPrivateNinoCheckApiAccessLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub "/aws/vendedlogs/apigateway/${AWS::StackName}-${PrivateNinoCheckApi}-private-AccessLogs-pii-redacted"
RetentionInDays: 30

PIIRedactedNinoCheckStateMachineLogGroup:
Type: AWS::Logs::LogGroup
Properties:
Expand Down Expand Up @@ -2217,87 +2163,6 @@ Resources:
Principal: !Join [ ".", [ "logs", !Ref "AWS::Region", "amazonaws.com" ] ]
SourceAccount: !Ref AWS::AccountId

CiMappingFunctionLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Properties:
FilterName: "PII Redaction"
DestinationArn: !GetAtt PIIRedactFunction.Arn
FilterPattern: ""
LogGroupName: !Ref CiMappingFunctionLogGroup

CredentialSubjectFunctionLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Properties:
FilterName: "PII Redaction"
DestinationArn: !GetAtt PIIRedactFunction.Arn
FilterPattern: ""
LogGroupName: !Ref CredentialSubjectFunctionLogGroup

JwtSignerFunctionLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Properties:
FilterName: "PII Redaction"
DestinationArn: !GetAtt PIIRedactFunction.Arn
FilterPattern: ""
LogGroupName: !Ref JwtSignerFunctionLogGroup

OTGFunctionLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Properties:
FilterName: "PII Redaction"
DestinationArn: !GetAtt PIIRedactFunction.Arn
FilterPattern: ""
LogGroupName: !Ref OTGFunctionLogGroup

MatchingFunctionLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Properties:
FilterName: "PII Redaction"
DestinationArn: !GetAtt PIIRedactFunction.Arn
FilterPattern: ""
LogGroupName: !Ref MatchingFunctionLogGroup

SsmParametersFunctionLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Properties:
FilterName: "PII Redaction"
DestinationArn: !GetAtt PIIRedactFunction.Arn
FilterPattern: ""
LogGroupName: !Ref SsmParametersFunctionLogGroup

TimeFunctionLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Properties:
FilterName: "PII Redaction"
DestinationArn: !GetAtt PIIRedactFunction.Arn
FilterPattern: ""
LogGroupName: !Ref TimeFunctionLogGroup

PublicNinoCheckApiLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Properties:
FilterName: "PII Redaction"
DestinationArn: !GetAtt PIIRedactFunction.Arn
FilterPattern: ""
LogGroupName: !Ref PublicNinoCheckApiAccessLogGroup

PrivateNinoCheckApiLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Properties:
FilterName: "PII Redaction"
DestinationArn: !GetAtt PIIRedactFunction.Arn
FilterPattern: ""
LogGroupName: !Ref PrivateNinoCheckApiAccessLogGroup

NinoCheckStateMachineLogsSubscriptionFilter:
Type: AWS::Logs::SubscriptionFilter
DependsOn: PIIRedactFunctionCloudWatchPermissions
Expand Down