-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into AppServiceIPResctrictionDefaultActionSCMDeny
- Loading branch information
Showing
57 changed files
with
4,812 additions
and
2,216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
cdk_integration_tests/src/typescript/APIGatewayAuthorization/fail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Import necessary AWS CDK packages | ||
import * as apigateway from '@aws-cdk/aws-apigateway'; | ||
import { Resource } from '@aws-cdk/core'; | ||
|
||
// Example resource and method declarations | ||
const resource: Resource = new Resource(); // Placeholder for actual resource initialization | ||
|
||
// Test cases for the policy patterns | ||
|
||
// This should match the first pattern and not be sanitized by the second pattern | ||
// SOURCE | ||
const method1 = resource.addMethod('GET', new apigateway.MockIntegration(), { | ||
apiKeyRequired: false | ||
}); |
14 changes: 14 additions & 0 deletions
14
cdk_integration_tests/src/typescript/APIGatewayAuthorization/fail__2__.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Import necessary AWS CDK packages | ||
import * as apigateway from '@aws-cdk/aws-apigateway'; | ||
import { Resource } from '@aws-cdk/core'; | ||
|
||
// Example resource and method declarations | ||
const resource: Resource = new Resource(); // Placeholder for actual resource initialization | ||
|
||
// Test cases for the policy patterns | ||
|
||
// This should match the second pattern | ||
// SINK | ||
const method2 = resource.addMethod('POST', new apigateway.MockIntegration(), { | ||
authorizationType: apigateway.AuthorizationType.NONE | ||
}); |
15 changes: 15 additions & 0 deletions
15
cdk_integration_tests/src/typescript/APIGatewayAuthorization/pass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Import necessary AWS CDK packages | ||
import * as apigateway from '@aws-cdk/aws-apigateway'; | ||
import { Resource } from '@aws-cdk/core'; | ||
|
||
// Example resource and method declarations | ||
const resource: Resource = new Resource(); // Placeholder for actual resource initialization | ||
|
||
// Test cases for the policy patterns | ||
|
||
// This should not match any pattern as it includes an authorization type | ||
// SANITIZER | ||
const method3 = resource.addMethod('PUT', new apigateway.MockIntegration(), { | ||
authorizationType: apigateway.AuthorizationType.COGNITO, | ||
apiKeyRequired: true | ||
}); |
13 changes: 13 additions & 0 deletions
13
cdk_integration_tests/src/typescript/APIGatewayAuthorization/pass__2__.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Import necessary AWS CDK packages | ||
import * as apigateway from '@aws-cdk/aws-apigateway'; | ||
import { Resource } from '@aws-cdk/core'; | ||
|
||
// Example resource and method declarations | ||
const resource: Resource = new Resource(); // Placeholder for actual resource initialization | ||
|
||
// Test cases for the policy patterns | ||
|
||
// This should not match any pattern as it includes an authorization type and is not open | ||
const method4 = resource.addMethod('DELETE', new apigateway.MockIntegration(), { | ||
authorizationType: apigateway.AuthorizationType.IAM | ||
}); |
19 changes: 19 additions & 0 deletions
19
cdk_integration_tests/src/typescript/AppSyncFieldLevelLogs/fail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Import necessary AWS CDK packages | ||
import * as appsync from '@aws-cdk/aws-appsync'; | ||
|
||
// Example of a log configuration that does not enable field-level logging | ||
// FINDING | ||
const logConfig: appsync.LogConfig = { | ||
// log configuration details | ||
}; | ||
|
||
// This should match the pattern and be flagged as a vulnerability | ||
// SINK | ||
const graphqlApiWithoutLogs = new appsync.GraphqlApi(this, 'apiWithoutLogs', { | ||
// other configuration details | ||
logConfig: { | ||
// Incorrect or missing fieldLogLevel configuration | ||
} | ||
}); | ||
|
||
// The SAST engine should flag 1 vulnerability: `graphqlApiWithoutLogs`. |
16 changes: 16 additions & 0 deletions
16
cdk_integration_tests/src/typescript/AppSyncFieldLevelLogs/pass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Import necessary AWS CDK packages | ||
import * as appsync from '@aws-cdk/aws-appsync'; | ||
|
||
// Example of a log configuration that does not enable field-level logging | ||
// FINDING | ||
const logConfig: appsync.LogConfig = { | ||
// log configuration details | ||
}; | ||
|
||
// This should not match the pattern as it includes a logConfig with FieldLogLevel | ||
const graphqlApiWithLogs = new appsync.GraphqlApi(this, 'apiWithLogs', { | ||
// other configuration details | ||
logConfig: { | ||
fieldLogLevel: appsync.FieldLogLevel.ALL // This is the correct configuration | ||
} | ||
}); |
19 changes: 19 additions & 0 deletions
19
cdk_integration_tests/src/typescript/AppSyncLogging/fail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Import necessary AWS CDK packages | ||
import * as appsync from '@aws-cdk/aws-appsync'; | ||
|
||
// Example of a log configuration | ||
// FINDING | ||
const logConfig: appsync.LogConfig = { | ||
// log configuration details | ||
}; | ||
|
||
// This should match the pattern and be flagged as a vulnerability | ||
// SINK | ||
const graphqlApiWithoutRole = new appsync.GraphqlApi(this, 'apiWithoutRole', { | ||
// other configuration details | ||
logConfig: { | ||
// log configuration details without role | ||
} | ||
}); | ||
|
||
// The SAST engine should flag 1 vulnerability: `graphqlApiWithoutRole`. |
Oops, something went wrong.