-
Notifications
You must be signed in to change notification settings - Fork 554
feat: Plugin for image scanning in Pre/Post step #4021
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 40 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
f6be749
image scanning plugin
Ashish-devtron 7418f2b
check for active ci_pipeline_material
Ashish-devtron 78b844f
t checkout ci-pipeMerge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 2b0ca95
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron d2596ae
Merge branch 'main' into image-scanning-plugin
Ashish-devtron 647bf1d
sql script number change
Ashish-devtron cf95eaa
sql script number change
Ashish-devtron f7ce0ff
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 7a9a8a9
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 3b0ac36
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 804ee25
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 31cd8ff
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 29a213b
image scanning plugin check
Ashish-devtron 46f76d6
image scanning plugin check
Ashish-devtron 6211df2
check for err
Ashish-devtron 84bc2c7
abort print response
Ashish-devtron 1ad0605
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 6018be6
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 7156314
Merge branch 'main' into image-scanning-plugin
Ashish-devtron 81166be
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron f76e2bd
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 628a7ed
add dockerregistryId
Ashish-devtron aefbaea
script number update
Ashish-devtron f759a91
image scanning plugin name
Ashish-devtron 17b7f23
Image scanner endpoint for both CiCd
Ashish-devtron 9311fd3
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 8750cdc
Main merge
Ashish-devtron 88ecb8f
revert postgres port
Ashish-devtron 1f7378b
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron b35bbab
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 38158cb
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron fa2e0db
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 5911c2e
Main merge
Ashish-devtron f04551c
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 727da5d
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 68d923d
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron e708076
Main merge
Ashish-devtron 8af751a
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 8c055cf
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 1fb0f61
Merge branch 'main' into image-scanning-plugin
Ashish-devtron 8824445
Merge branch 'main' of github.com:devtron-labs/devtron
Ashish-devtron 87a944f
Merge branch 'main' into image-scanning-plugin
Ashish-devtron b49cd8e
Code review changes
Ashish-devtron 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| DELETE FROM plugin_step_variable WHERE plugin_step_id =(SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Vulnerability Scanning' and ps."index"=1 and ps.deleted=false); | ||
| DELETE FROM plugin_stage_mapping WHERE plugin_id =(SELECT id FROM plugin_metadata WHERE name='Vulnerability Scanning'); | ||
| DELETE FROM pipeline_stage_step_variable WHERE pipeline_stage_step_id in (SELECT id FROM pipeline_stage_step where ref_plugin_id =(SELECT id from plugin_metadata WHERE name ='Vulnerability Scanning')); | ||
| DELETE FROM pipeline_stage_step where ref_plugin_id in (SELECT id from plugin_metadata WHERE name ='Vulnerability Scanning'); | ||
| DELETE FROM plugin_metadata WHERE name ='Vulnerability Scanning'; |
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,39 @@ | ||
| INSERT INTO "plugin_metadata" ("id", "name", "description","type","icon","deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
| VALUES (nextval('id_seq_plugin_metadata'), 'Vulnerability Scanning','Scan a image','PRESET','https://raw.githubusercontent.com/devtron-labs/devtron/main/assets/ic-plugin-vulnerability-scan.png','f', 'now()', 1, 'now()', 1); | ||
|
|
||
| INSERT INTO "plugin_stage_mapping" ("plugin_id","stage_type","created_on", "created_by", "updated_on", "updated_by") | ||
| VALUES ((SELECT id FROM plugin_metadata WHERE name='Vulnerability Scanning'),0,'now()', 1, 'now()', 1); | ||
|
|
||
| INSERT INTO "plugin_pipeline_script" ("id", "script", "type","deleted","created_on", "created_by", "updated_on", "updated_by") | ||
| VALUES (nextval('id_seq_plugin_pipeline_script'), | ||
| '#!/bin/sh | ||
| echo "IMAGE SCAN" | ||
| curl -X POST $IMAGE_SCANNER_ENDPOINT/scanner/image -H "Content-Type: application/json" -d "{\"image\": \"$DEST\", \"imageDigest\": \"$DIGEST\", \"pipelineId\" : $PIPELINE_ID, \"userId\": | ||
| $TRIGGERED_BY, \"dockerRegistryId\": \"$DOCKER_REGISTRY_ID\" }" >/dev/null 2>&1 | ||
| if [ $? != 0 ] | ||
| then | ||
| echo -e "\033[1m======== Vulnerability Scanning request failed ========" | ||
| exit 1 | ||
| fi', | ||
| 'SHELL', | ||
| 'f', | ||
| 'now()', | ||
| 1, | ||
| 'now()', | ||
| 1); | ||
|
|
||
|
|
||
|
|
||
|
|
||
| INSERT INTO "plugin_step" ("id", "plugin_id","name","description","index","step_type","script_id","deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
| VALUES (nextval('id_seq_plugin_step'), (SELECT id FROM plugin_metadata WHERE name='Vulnerability Scanning'),'Step 1','Step 1 - Vulnerability Scanning','1','INLINE',(SELECT last_value FROM id_seq_plugin_pipeline_script),'f','now()', 1, 'now()', 1); | ||
|
|
||
|
|
||
| INSERT INTO "plugin_step_variable" ("id", "plugin_step_id", "name", "format", "description", "is_exposed", "allow_empty_value","variable_type", "value_type", "variable_step_index",reference_variable_name, "deleted", "created_on", "created_by", "updated_on", "updated_by") VALUES | ||
Ashish-devtron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Vulnerability Scanning' and ps."index"=1 and ps.deleted=false), 'DEST','STRING','image dest',false,true,'INPUT','GLOBAL',1 ,'DEST','f','now()', 1, 'now()', 1), | ||
| (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Vulnerability Scanning' and ps."index"=1 and ps.deleted=false), 'DIGEST','STRING','Image Digest',false,true,'INPUT','GLOBAL',1 ,'DIGEST','f','now()', 1, 'now()', 1), | ||
| (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Vulnerability Scanning' and ps."index"=1 and ps.deleted=false), 'PIPELINE_ID','STRING','Pipeline id',false,true,'INPUT','GLOBAL',1 ,'PIPELINE_ID','f','now()', 1, 'now()', 1), | ||
| (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Vulnerability Scanning' and ps."index"=1 and ps.deleted=false), 'TRIGGERED_BY','STRING','triggered by user',false,true,'INPUT','GLOBAL',1 ,'TRIGGERED_BY','f','now()', 1, 'now()', 1), | ||
| (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Vulnerability Scanning' and ps."index"=1 and ps.deleted=false), 'DOCKER_REGISTRY_ID','STRING','docker registry id',false,true,'INPUT','GLOBAL',1 ,'DOCKER_REGISTRY_ID','f','now()', 1, 'now()', 1), | ||
| (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Vulnerability Scanning' and ps."index"=1 and ps.deleted=false), 'IMAGE_SCANNER_ENDPOINT','STRING','image scanner endpoint',false,true,'INPUT','GLOBAL',1 ,'IMAGE_SCANNER_ENDPOINT','f','now()', 1, 'now()', 1); | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.