-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(lambda): code signing config #12656
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
88b28d8
feat(lambda-code-signing): create draft code
747a414
create base of Signer Profile
b2b3263
modify lambda code signing config
b1b3f40
modify @Attribute => @attribute
4c88f71
modify README using pkglint
a943ba8
modify ci errors
665df39
add module export to aws-signer/lib/index
0aee381
add construct to dependancy
f10b46f
make signingProfiles to list
278c0ef
fix: build errors
5a799db
add test
54217e0
fix aws-lambda build errors
dbbbd21
add test of lambda code-signing-config
befb9dd
modify signingProfile.fromSignginProfileAttributes
d090353
Update packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts
acaf8c2
Update packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts
30c6479
Update packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts
02d57b3
Update packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts
7c2117e
Update packages/@aws-cdk/aws-signer/lib/signing-profile.ts
d254142
So physical name is not configurable, deleted codeSigningConfigName f…
45df283
Merge branch 'aws-lambda-code-signing' of https://github.com/hedrall/…
21c7383
add readme of signing profile
342c5fc
add readme of lambda code signing cconfig
ce82641
modify test of signing profile
b43dc02
add test of lambda with code signing config
b7fc4d2
t pMerge branch 'master' of https://github.com/hedrall/aws-cdk into a…
225c05a
Update packages/@aws-cdk/aws-lambda/README.md
1c3ce91
Update packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts
7b6202a
Update packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts
4fe3cbe
Update packages/@aws-cdk/aws-lambda/test/code-signing-config.test.ts
55e69a7
change platformId to platform enum like class
hedrall 11aaf43
Merge branch 'master' of git://github.com/aws/aws-cdk into aws-lambda…
hedrall 53240ee
delete code not need
hedrall d22f21c
Merge branch 'master' of git://github.com/aws/aws-cdk into aws-lambda…
hedrall b033424
Update packages/@aws-cdk/aws-lambda/lib/code-signing-config.ts
7351a7e
Update packages/@aws-cdk/aws-lambda/test/code-signing-config.test.ts
817225d
Update packages/@aws-cdk/aws-lambda/test/code-signing-config.test.ts
2bf5cdc
Update packages/@aws-cdk/aws-lambda/test/code-signing-config.test.ts
6a90c8e
Update packages/@aws-cdk/aws-lambda/test/function.test.ts
afc9cdc
Update packages/@aws-cdk/aws-signer/README.md
fa08a95
Update packages/@aws-cdk/aws-signer/lib/signing-profile.ts
f646726
Update packages/@aws-cdk/aws-signer/lib/signing-profile.ts
fa40904
Update packages/@aws-cdk/aws-lambda/README.md
7573c5e
Fixed name inconsistencies of signer profile due to changes
hedrall a2b0e3f
Fixed name inconsistencies of code signing config due to changes
hedrall e7be9b8
Fixed remaining name mismatches.
hedrall dbac380
change name of propertiy signatureValidityPeriod to signatureValidity
hedrall 07247d2
apply suggested readme change of signing profile
hedrall 5fff48c
fix the linter violation
3427ea1
Apply suggestions from code review
8dbf3ca
Merge branch 'master' into aws-lambda-code-signing
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,54 @@ | ||
| import { IResource, Resource } from '@aws-cdk/core'; | ||
| import { Construct } from 'constructs'; | ||
| import { CfnCodeSigningConfig } from './lambda.generated'; | ||
| import { SigningProfile } from '@aws-cdk/aws-signer'; | ||
|
|
||
| export enum UntrustedArtifactOnDeployment { | ||
| ENFORCE = 'enforce', | ||
| WARN = 'warn', | ||
| } | ||
|
|
||
| export interface ICodeSigningConfig extends IResource { | ||
| /** | ||
| * The ARN of Code Signing Config | ||
| * @attribute CodeSigningConfigArn | ||
hedrall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| */ | ||
| readonly codeSigningConfigArn: string; | ||
|
|
||
| /** | ||
| * The id of Code Signing Config | ||
| * @attribute CodeSigningConfigId | ||
hedrall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| */ | ||
| readonly codeSigningConfigId: string; | ||
| } | ||
|
|
||
| export interface CodeSigningConfigProps { | ||
| signingProfile: SigningProfile, | ||
hedrall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| untrustedArtifactOnDeployment?: UntrustedArtifactOnDeployment, | ||
| description?: string | ||
| } | ||
|
|
||
| export class CodeSigningConfig extends Resource implements ICodeSigningConfig{ | ||
| readonly codeSigningConfigArn: string; | ||
| readonly codeSigningConfigId: string; | ||
hedrall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| constructor(scope: Construct, id: string, props: CodeSigningConfigProps) { | ||
| super(scope, id); | ||
|
|
||
| if (props.signingProfile.length > 20) { | ||
| throw new Error('Signing profile version arn is up to 20'); | ||
| } | ||
nija-at marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| const resource: CfnCodeSigningConfig = new CfnCodeSigningConfig(this, 'Resource', { | ||
| allowedPublishers: { | ||
| signingProfileVersionArns: props.signingProfile.signingProfileVersionArn, | ||
nija-at marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
| codeSigningPolicies: { | ||
| untrustedArtifactOnDeployment: props.untrustedArtifactOnDeployment | ||
| }, | ||
| description: props.description | ||
| }); | ||
| this.codeSigningConfigArn = resource.attrCodeSigningConfigArn; | ||
| this.codeSigningConfigId = resource.attrCodeSigningConfigId; | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| // AWS::Signer CloudFormation Resources: | ||
| export * from './signer.generated'; | ||
| export * from './signer-profile'; |
This file contains hidden or 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,78 @@ | ||
| import { Construct, IResource, Resource } from '@aws-cdk/core'; | ||
| import { CfnSigningProfile } from './signer.generated'; | ||
|
|
||
| export interface ISigningProfile extends IResource { | ||
| /** | ||
| * The ARN of the signing profile. | ||
| * @attribute | ||
| */ | ||
| readonly signingProfileArn: string; | ||
|
|
||
| /** | ||
| * The name of signing profile. | ||
| * @attribute | ||
| */ | ||
| readonly signingProfileName: string; | ||
|
|
||
| /** | ||
| * The version of signing profile. | ||
| * @attribute | ||
| */ | ||
| readonly signingProfileVersion: string; | ||
|
|
||
| /** | ||
| * The ARN of signing profile version. | ||
| * @attribute | ||
| */ | ||
| readonly signingProfileVersionArn: string; | ||
| } | ||
|
|
||
| export enum SignatureValidityPeriodTypes { | ||
| DAYS = 'DAYS', | ||
| MONTHS = 'MONTHS', | ||
| YEARS = 'YEARS', | ||
| } | ||
|
|
||
| class SignatureValidityPeriodProperty { | ||
| readonly type: SignatureValidityPeriodTypes; | ||
| readonly value: number; | ||
|
|
||
| constructor(type: SignatureValidityPeriodTypes, value: number) { | ||
| this.type = type; | ||
| this.value = value; | ||
| } | ||
| } | ||
|
|
||
| export interface SigningProfileProps { | ||
| /* | ||
| * The ID of a platform that is available for use by a signing profile. | ||
| */ | ||
| readonly platformId: string; | ||
|
|
||
| /* | ||
| * The validity period override for any signature generated using | ||
| * this signing profile. If unspecified, the default is 135 months. | ||
| */ | ||
| readonly signatureValidityPeriod?: SignatureValidityPeriodProperty; | ||
nija-at marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| export class SigningProfile extends Resource implements ISigningProfile { | ||
| public readonly signingProfileArn: string; | ||
| public readonly signingProfileName: string; | ||
| public readonly signingProfileVersion: string; | ||
| public readonly signingProfileVersionArn: string; | ||
|
|
||
| constructor(scope: Construct, id: string, props: SigningProfileProps) { | ||
| super(scope, id); | ||
|
|
||
| const resource = new CfnSigningProfile( this, 'Resource', { | ||
| platformId: props.platformId, | ||
| signatureValidityPeriod: props.signatureValidityPeriod, | ||
| } ); | ||
|
|
||
| this.signingProfileArn = resource.attrArn; | ||
| this.signingProfileName = resource.attrProfileName; | ||
| this.signingProfileVersion = resource.attrProfileVersion; | ||
| this.signingProfileVersionArn = resource.attrProfileVersionArn; | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.