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

aws-lambda-nodejs: CDK Lambda/Inspector incompatibility #31493

Open
2 tasks
rtejwani1309 opened this issue Sep 19, 2024 · 1 comment
Open
2 tasks

aws-lambda-nodejs: CDK Lambda/Inspector incompatibility #31493

rtejwani1309 opened this issue Sep 19, 2024 · 1 comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda @aws-cdk/aws-lambda-nodejs effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@rtejwani1309
Copy link

Describe the feature

NodejsFunction construct in CDK for provisioning Lambdas uses esbuild to bundle the source code. This is a pattern that many follow which is in accordance with AWS guidance/documentation.

The Inspector service can not get successful scans for these functions as its SBOM generator tool is expecting a node_modules directory to determine the dependencies for the function. This results in an empty 'components' array in the SBOM file (CycloneDX format) and thus Inspector reports no vulnerabilities for the function.

Although it is possible to use a command hook to re-create the required node_modules directory structure, this shouldn't be a requirement for teams to handle by themselves.

Use Case

The feature request is to improve the compatibility between Lambdas that are provisioned by CDK and the Inspector service. This should have the effect that Inspector can successfully find dependencies for these functions and therefore provide accurate vulnerability information.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.158.0

Environment details (OS name and version, etc.)

MacOs

@rtejwani1309 rtejwani1309 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 19, 2024
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Sep 19, 2024
@pahud pahud added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Sep 19, 2024
@pahud
Copy link
Contributor

pahud commented Sep 19, 2024

Thank you for the use case and workaround sharing. I'm making it a p2. Please help us prioritize with 👍 .

@pahud pahud added the effort/medium Medium work item – several days of effort label Sep 19, 2024
@pahud pahud changed the title (CDK Lambda): (CDK Lambda/Inspector incompatibility) aws-lambda-nodejs: CDK Lambda/Inspector incompatibility Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda @aws-cdk/aws-lambda-nodejs effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants