Skip to content

Commit 2b04ec0

Browse files
committed
fix: Replace hardcoded IP addresses with safe examples
- Replace all hardcoded IP addresses with localhost and private network examples - Use 127.0.0.1 and 10.0.0.x addresses to avoid SonarCloud security hotspots - Addresses SonarCloud security concerns about hardcoded IP addresses - Final resolution of all security hotspots
1 parent d6f20b7 commit 2b04ec0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • aws_lambda_powertools/utilities/parser/models

aws_lambda_powertools/utilities/parser/models/appsync.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AppSyncIamIdentity(BaseModel):
2020
"The source IP address of the caller that AWS AppSync receives. "
2121
"If the request includes a x-forwarded-for header, this is a list of IP addresses."
2222
),
23-
examples=[["192.168.1.1"], ["11.215.2.22", "64.44.173.11"]],
23+
examples=[["127.0.0.1"], ["10.0.0.1", "10.0.0.2"]],
2424
)
2525
username: str = Field(
2626
description="The IAM user principal name.", examples=["AIDAAAAAAAAAAAAAAAAAA", "appsync-user"]
@@ -72,7 +72,7 @@ class AppSyncCognitoIdentity(BaseModel):
7272
"The source IP address of the caller that AWS AppSync receives. "
7373
"If the request includes a x-forwarded-for header, this is a list of IP addresses."
7474
),
75-
examples=[["11.215.2.22"], ["1.1.1.1"]],
75+
examples=[["127.0.0.1"], ["10.0.0.1"]],
7676
)
7777
defaultAuthStrategy: str = Field(
7878
description="The default authorization strategy for this caller (ALLOW or DENY).", examples=["ALLOW", "DENY"]
@@ -132,7 +132,7 @@ class AppSyncRequestModel(BaseModel):
132132
description="HTTP headers from the GraphQL request, including custom headers.",
133133
examples=[
134134
{
135-
"x-forwarded-for": "11.215.2.22, 64.44.173.11",
135+
"x-forwarded-for": "10.0.0.1, 10.0.0.2",
136136
"cloudfront-viewer-country": "US",
137137
"host": "example.appsync-api.us-east-1.amazonaws.com",
138138
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",

0 commit comments

Comments
 (0)