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

feat: additional metadata from manifest file #638

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nata7che
Copy link

@nata7che nata7che commented Jan 7, 2025

  • Ready for review
  • Follows CONTRIBUTING rules
  • Reviewed by Snyk internal team

What does this PR do?

When collecting ApplicationFiles, this PR adds additional data for manifest files in nodejs (e.g. package.json).
This PR is an addition to #629.

Where should the reviewer start?

Following the logical flow starting from lib/analyzer/static-analyzer.ts will be easier to follow.

How should this be manually tested?

Using the Docker registry agent(DRA) (https://github.com/snyk/docker-registry-agent) update the installed Snyk docker plugin version (in the package.json) to be based on the current branch:
"snyk-docker-plugin": "github:snyk/snyk-docker-plugin#collect_application_files".
Run npm install.
Run the DRA locally and from a different terminal execute the following command:

curl --location 'http://localhost:17500/scan' \
--header 'snyk-source-credentials: <<CREDENTIALS_FOR_CR>>' \
--header 'Content-Type: application/json' \
--data '{
    "target": {
        "name": "<<IMAGE_ON_CR>>"
    },
    "options": {
        "appScan": true,
        "collectApplicationFiles": true
    },
    "callbacks": {
        "resultUrl": "<<RESULT_URL>>",                                   
        "doneUrl": "<<DONE_URL>>",
        "token": "00000000-0000-0000-0000-000000000000"
    }   
}' 

The expected output of the given RESULT_URL endpoint should contain the fact type "applicationFiles" as part of the data.
Each manifest file should include the type: 'manifest' and metadata with the extracted moduleName.
The image should be NodeJS.

What are the relevant tickets?

https://snyksec.atlassian.net/browse/RNTM-744
https://snyksec.atlassian.net/browse/RNTM-852

feat: extract repoUrl from nodejs manifest
@nata7che nata7che force-pushed the RMTN-852_additional_metadata_from_manifest_file branch from c48d7ad to 99d8b79 Compare January 8, 2025 07:03
@nata7che nata7che requested a review from nozik January 8, 2025 10:45
@nata7che nata7che requested a review from nozik January 8, 2025 11:07
@nata7che nata7che marked this pull request as ready for review January 9, 2025 06:38
@nata7che nata7che requested a review from a team as a code owner January 9, 2025 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants