Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit 9abd4a0

Browse files
authored
Upgrade to version v1.0.7
- Updated node modules to patch vulnerabilities
2 parents a0cd9f7 + 69e9eed commit 9abd4a0

File tree

47 files changed

+723
-7687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+723
-7687
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
=======
99

10+
## [1.0.7] - 2024-05-13
11+
12+
### Security
13+
14+
- Updated node modules to patch vulnerabilities
15+
1016
## [1.0.6] - 2024-03-27
1117

1218
### Security

source/infrastructure/cdk.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"app": "../pre-build-jars.sh && npx ts-node --prefer-ts-exts bin/dus.ts",
33
"watch": {
4-
"include": [
5-
"**"
6-
],
4+
"include": ["**"],
75
"exclude": [
86
"README.md",
97
"cdk*.json",
@@ -19,10 +17,7 @@
1917
"context": {
2018
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
2119
"@aws-cdk/core:checkSecretUsage": true,
22-
"@aws-cdk/core:target-partitions": [
23-
"aws",
24-
"aws-cn"
25-
],
20+
"@aws-cdk/core:target-partitions": ["aws", "aws-cn"],
2621
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
2722
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
2823
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
@@ -62,10 +57,10 @@
6257
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
6358
"solution_id": "SO0281",
6459
"solution_name": "enhanced-document-understanding-on-aws",
65-
"solution_version": "v1.0.6",
60+
"solution_version": "v1.0.7",
6661
"app_namespace": "app.idp",
6762
"app_registry_name": "enhanced-document-understanding",
6863
"application_type": "AWS-Solutions",
6964
"application_trademark_name": "Enhanced Document Understanding on AWS"
7065
}
71-
}
66+
}

source/infrastructure/lib/api/rest-endpoint.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export class RestEndpoint extends Construct {
253253
// case creation
254254
caseResource.addCorsPreflight({
255255
allowOrigins: ['*'],
256-
allowHeaders: ['*'],
256+
allowHeaders: ['Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization'],
257257
allowMethods: ['POST']
258258
});
259259
caseResource.addMethod('POST', postRequestLambdaIntegration, {
@@ -293,7 +293,7 @@ export class RestEndpoint extends Construct {
293293
const caseCaseIdResource = caseResource.addResource('{caseId}');
294294
caseCaseIdResource.addCorsPreflight({
295295
allowOrigins: ['*'],
296-
allowHeaders: ['*'],
296+
allowHeaders: ['Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization'],
297297
allowMethods: ['GET']
298298
});
299299

@@ -326,7 +326,7 @@ export class RestEndpoint extends Construct {
326326
const casesResource = apiRoot.addResource('cases');
327327
casesResource.addCorsPreflight({
328328
allowOrigins: ['*'],
329-
allowHeaders: ['*'],
329+
allowHeaders: ['Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization'],
330330
allowMethods: ['GET']
331331
});
332332
casesResource.addMethod('GET', getRequestLambdaIntegration, {
@@ -352,7 +352,7 @@ export class RestEndpoint extends Construct {
352352
// Upload a document to a case
353353
documentResource.addCorsPreflight({
354354
allowOrigins: ['*'],
355-
allowHeaders: ['*'],
355+
allowHeaders: ['Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization'],
356356
allowMethods: ['POST']
357357
});
358358
documentResource.addMethod('POST', postRequestLambdaIntegration, {
@@ -383,7 +383,7 @@ export class RestEndpoint extends Construct {
383383
const documentCaseIdDocIdResource = documentResource.addResource('{caseId}').addResource('{documentId}');
384384
documentCaseIdDocIdResource.addCorsPreflight({
385385
allowOrigins: ['*'],
386-
allowHeaders: ['*'],
386+
allowHeaders: ['Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization'],
387387
allowMethods: ['GET']
388388
});
389389
documentCaseIdDocIdResource.addMethod('GET', getRequestLambdaIntegration, {
@@ -415,7 +415,10 @@ export class RestEndpoint extends Construct {
415415
const documentDownloadResource = documentResource.addResource('download');
416416
documentDownloadResource.addCorsPreflight({
417417
allowOrigins: ['*'],
418-
allowHeaders: ['*'],
418+
allowHeaders: [
419+
'Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization',
420+
'Access-Control-Allow-Origin'
421+
],
419422
allowMethods: ['GET']
420423
});
421424
documentDownloadResource.addMethod('GET', getDocumentLambdaIntegration, {
@@ -450,7 +453,10 @@ export class RestEndpoint extends Construct {
450453
.addResource('{documentId}');
451454
inferencesResource.addCorsPreflight({
452455
allowOrigins: ['*'],
453-
allowHeaders: ['*'],
456+
allowHeaders: [
457+
'Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization',
458+
'Access-Control-Allow-Origin'
459+
],
454460
allowMethods: ['GET']
455461
});
456462
inferencesResource.addMethod('GET', getInferenceLambdaIntegration, {
@@ -466,7 +472,10 @@ export class RestEndpoint extends Construct {
466472
const inferenceResource = inferencesResource.addResource('{inferenceType}');
467473
inferenceResource.addCorsPreflight({
468474
allowOrigins: ['*'],
469-
allowHeaders: ['*'],
475+
allowHeaders: [
476+
'Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization',
477+
'Access-Control-Allow-Origin'
478+
],
470479
allowMethods: ['GET']
471480
});
472481
inferenceResource.addMethod('GET', getInferenceLambdaIntegration, {
@@ -487,7 +496,10 @@ export class RestEndpoint extends Construct {
487496
const redactResource = apiRoot.addResource('redact').addResource('{caseId}').addResource('{documentId}');
488497
redactResource.addCorsPreflight({
489498
allowOrigins: ['*'],
490-
allowHeaders: ['*'],
499+
allowHeaders: [
500+
'Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization',
501+
'Access-Control-Allow-Origin'
502+
],
491503
allowMethods: ['POST']
492504
});
493505
redactResource.addMethod('POST', postRedactLambdaIntegration, {

source/infrastructure/lib/s3web/static-site.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ export class StaticWebsite extends Construct {
8181
iam.Role.fromRoleArn(this, 'BucketPolicyLambdaRole', props.customResourceRoleArn)
8282
);
8383

84+
const cspResponseHeadersPolicy = new cloudfront.ResponseHeadersPolicy(this, 'CSPResponseHeadersPolicy', {
85+
responseHeadersPolicyName: `eDU-CSPResponseHeadersPolicy-${cdk.Aws.STACK_NAME}-${cdk.Aws.REGION}`,
86+
comment: 'CSP Response Headers Policy',
87+
securityHeadersBehavior: {
88+
contentSecurityPolicy: {
89+
contentSecurityPolicy:
90+
"default-src 'self' data: https://*.amazonaws.com; img-src 'self' data: https://*.cloudfront.net https://*.amazonaws.com; script-src 'self' http://*.cloudfront.net https://*.amazonaws.com; style-src 'self' 'unsafe-inline' https://*.amazonaws.com; object-src 'self' https://*.amazonaws.com; worker-src 'self' blob:",
91+
override: true
92+
},
93+
frameOptions: { frameOption: cloudfront.HeadersFrameOption.DENY, override: true }
94+
}
95+
});
96+
8497
const cloudfrontToS3 = new CloudFrontToS3(this, 'UI', {
8598
existingBucketObj: this.webS3Bucket,
8699
cloudFrontDistributionProps: {
@@ -91,7 +104,10 @@ export class StaticWebsite extends Construct {
91104
],
92105
logFilePrefix: 'cloudfront/',
93106
minimumProtocolVersion: cloudfront.SecurityPolicyProtocol.TLS_V1_2_2019,
94-
defaultRootObject: 'login.html'
107+
defaultRootObject: 'login.html',
108+
defaultBehavior: {
109+
responseHeadersPolicy: cspResponseHeadersPolicy
110+
}
95111
}
96112
});
97113

source/infrastructure/lib/search/indexed-storage.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ export class IndexedStorage extends Construct {
128128
.addResource('{query}');
129129
kendraSearchResource.addCorsPreflight({
130130
allowOrigins: ['*'],
131-
allowHeaders: ['*'],
131+
allowHeaders: [
132+
'Content-Type, Access-Control-Allow-Headers, X-Requested-With, Authorization',
133+
'Access-Control-Allow-Origin'
134+
],
132135
allowMethods: ['GET']
133136
});
134137

source/infrastructure/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/infrastructure/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "enhanced-document-understanding-on-aws-infrastructure",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"bin": {
55
"infrastructure": "bin/dus.js"
66
},
@@ -60,9 +60,6 @@
6060
"source-map-support": "^0.5.21",
6161
"uuid": "^9.0.1"
6262
},
63-
"overrides": {
64-
"@babel/traverse": "^7.23.2"
65-
},
6663
"exclude": [
6764
"node_modules",
6865
"cdk.out"

source/infrastructure/test/mock-lambda-func/java-lambda/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>example</groupId>
88
<artifactId>java-lambda</artifactId>
9-
<version>1.0.6</version>
9+
<version>1.0.7</version>
1010

1111
<name>mock-java-lambda</name>
1212

@@ -20,7 +20,7 @@
2020
<dependency>
2121
<groupId>software.amazon.awssdk</groupId>
2222
<artifactId>bom</artifactId>
23-
<version>2.22.10</version>
23+
<version>2.25.50</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>
@@ -54,7 +54,7 @@
5454
<dependency>
5555
<groupId>com.amazonaws</groupId>
5656
<artifactId>aws-lambda-java-events</artifactId>
57-
<version>3.11.4</version>
57+
<version>3.11.5</version>
5858
</dependency>
5959
</dependencies>
6060
<build>
@@ -88,7 +88,7 @@
8888
<dependency>
8989
<groupId>com.puppycrawl.tools</groupId>
9090
<artifactId>checkstyle</artifactId>
91-
<version>10.12.7</version>
91+
<version>10.16.0</version>
9292
</dependency>
9393
<dependency>
9494
<groupId>org.apache.maven.shared</groupId>

source/infrastructure/test/mock-lambda-func/node-lambda/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/infrastructure/test/mock-lambda-func/node-lambda/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-lambda",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "A mock lambda implementation for CDK infrastructure unit",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)