1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-06 04:13:55 +02:00
Commit Graph

895 Commits

Author SHA1 Message Date
Daria Kuznetsova
df0b288ecb
refactor codeqlExecuteScan (#4888)
* refactored codeql step

* fixed tests

* fixed reports output dir

* refactored

* fixed returning error

* fixed tests

---------

Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2024-04-16 11:35:56 +03:00
Vyacheslav Starostin
b0ecbf68ad
feat(artifactPrepareVersion): Introduce build tool CAP (#4890)
* feat(artifactPrepareVersion): Introduce build tool CAP

* feat(artifactPrepareVersion): Introduce build tool CAP

* Add CAPVersioningPreference to versioning.Options

* Include CAP to allowed build tool list

* Update go.mod

* Include CAP to allowed build tool list

* Delete CAP from additionalTargetTools

* Delete CAP from additionalTargetTools

* Fix test

* Update comment

* Update comment

* Add param description

* Add param description
2024-04-10 13:45:21 +05:00
thtri
3ae51e2661
fix(cxone): new endpoint for project creation (#4889)
* Initial in progress

* compiling but not yet functional

* Missed file

* updated checkmarxone step

* Working up to fetching a project then breaks

* Missed file

* Breaks when retrieving projects+proxy set

* Create project & run scan working, now polling

* Fixed polling

* added back the zipfile remove command

* Fixed polling again

* Generates and downloads PDF report

* Updated and working, prep for refactor

* Added compliance steps

* Cleanup, reporting, added groovy connector

* fixed groovy file

* checkmarxone to checkmarxOne

* checkmarxone to checkmarxOne

* split credentials (id+secret, apikey), renamed pullrequestname to branch, groovy fix

* Fixed filenames & yaml

* missed the metadata_generated.go

* added json to sarif conversion

* fix:type in new checkmarxone package

* fix:type in new checkmarxone package

* removed test logs, added temp error log for creds

* extra debugging to fix crash

* improved auth logging, fixed query parse issue

* fixed bug with group fetch when using oauth user

* CWE can be -1 if not defined, can't be uint

* Query also had CweID

* Disabled predicates-fetch in sarif generation

* Removing leftover info log message

* Better error handling

* fixed default preset configuration

* removing .bat files - sorry

* Cleanup per initial review

* refactoring per Gist, fixed project find, add apps

* small fix - sorry for commit noise while testing

* Fixing issues with incremental scans.

* removing maxretries

* Updated per PR feedback, further changes todo toda

* JSON Report changes and reporting cleanup

* removing .bat (again?)

* adding docs, groovy unit test, linter fixes

* Started adding tests maybe 15% covered

* fix(checkmarxOne): test cases for pkg and reporting

* fix(checkmarxOne):fix formatting

* feat(checkmarxone): update interface with missing method

* feat(checkmarxone):change runStep signature to be able to inject dependency

* feat(checkmarxone): add tests for step (wip)

* Adding a bit more coverage

* feat(checkmarxOne): fix code review

* feat(checkmarxOne): fix code review

* feat(checkmarxOne): fix code review

* feat(checkmarxOne): fix integration test PR

* adding scan-summary bug workaround, reportgen fail

* enforceThresholds fix when no results passed in

* fixed gap when preset empty in yaml & project conf

* fixed another gap in preset selection

* fix 0-result panic

* fail when no preset is set anywhere

* removed comment

* initial project-under-app support

* fixing sarif reportgen

* some cleanup of error messages

* post-merge test fixes

* revert previous upstream merge

* adding "incremental" to "full" triggers

* wrong boolean

* project-in-application api change prep

* Fixing SARIF report without preset access

* fix sarif deeplink

* removing comments

* fix(cxone):formatting

* fix(cxone):formatting

* fix(cxone):new endpoint for project creation

---------

Co-authored-by: michael kubiaczyk <michael.kubiaczyk@checkmarx.com>
Co-authored-by: michaelkubiaczyk <48311127+michaelkubiaczyk@users.noreply.github.com>
2024-04-05 14:08:43 +02:00
Jordi van Liempt
a129cc4dde
fix(maven): Add proper error handling for invalid settings.xml when publishing (#4884)
Co-authored-by: jliempt <>
2024-04-04 09:45:33 +02:00
Daria Kuznetsova
bf59a28aba
feat(codeqlExecuteScan): added open configs for codeql database creation and analysis (#4869)
Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2024-04-02 10:18:17 +05:30
Ralf Pannemans
70dac23c73
Revert "feat(cnbBuild): validate docker credentials (#4840)" (#4872)
Apparently this pr caused some regression.

This reverts commit df2e976eaa.
2024-03-25 10:43:23 +01:00
Daria Kuznetsova
2d2d357599
feat(contrastExecuteScan): new step contrastExecuteScan (#4818) 2024-03-21 10:13:59 +05:30
Akramdzhon Azamov
18bc753233
Removed the enforcement for gradle.aggregateModules parameter whitesource step (#4747)
Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2024-03-20 14:57:14 +05:30
Johannes Dillmann
df2e976eaa
feat(cnbBuild): validate docker credentials (#4840) 2024-03-15 10:44:14 +01:00
Daniel Mieg
6e9f52e274
Adapt request body for SAP_COM_0948 (#4865)
* Adapt request body for SAP_COM_0948

* Adapt tests

* Readd tags
2024-03-14 16:30:19 +01:00
Pavel Busko
4d86308433
chore(cnbBuild): simplify telemetry data (#4864)
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2024-03-14 15:39:30 +01:00
tiloKo
1259a32de1
Enable logon to AAKaaS via Certificate (mTLS) (#4860)
* originHash

* analysis output

* first shot

* add cert logon to piper http client

* allow initial user/pw for certificate logon

* credentials -> parameters

* encode user cert in pem

* key as well

* fix unit tests after merge

* other aakaas steps

* 2nd conn in register packages
2024-03-12 14:27:00 +01:00
tiloKo
2330993615
login via certificates (#4857)
* login via certificates
2024-03-11 15:12:32 +01:00
tiloKo
c0e56d26e0
AAKaaS originHash (#4843)
* originHash

* analysis output

* unit tests
2024-03-05 15:21:34 +01:00
Oliver Nocon
69a01b935a
fix(npm): don't consider dev dependencies for sbom (#4690)
* fix(npm): don't consider dev dependencies for sbom

* chore: update test

* fiy typo

---------

Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2024-02-28 16:05:13 +01:00
Vijayan T
06e81ea87d
Display workspace content for debugging (#4839)
* display workspace content for debugging

* adding verbose check

* renaming function
2024-02-22 12:21:13 +03:00
Vyacheslav Starostin
a1908a67e0
telemetry: extend custom data (#4836) 2024-02-20 23:34:25 +06:00
Vyacheslav Starostin
b644bf7e15
Use Pendo as analytics tool (#4828)
* Try pendo

* Try pendo

* Fix typo

* Optimize data struct

* Adjust kaniko and kubernetes to try pendo

* Include golangBuild

* Update generator helper

* go generate

* Delete token param from some steps && go generate

* Add checking on ExportPrefix

* Update telemetry struct

* Try pipelineID for artifactPrepVersion

* Try pipelineID as a CPE value

* Update

* Try CF

* Read pipelineID from CPE

* Enable telemetry

* Fix name

* Do not show token in header

* Read pipelineID from CPE

* Clean up

* Clean up

* Update template

* go generate

* Update template

* Try Cribl

* HTTPS

* Update

* Clean-up

* Fix tests

* Update
2024-02-20 17:17:20 +06:00
Googlom
150560db9e
feature(httpReadFile): Add headers to download from github release assets (#4826) 2024-02-20 09:35:41 +01:00
Ralf Pannemans
49b8080461
feat(detectExecuteScan): Also scan images that are in the CPE (#4678)
feat(detectExecuteScan): Also scan images that are in the cpe

Signed-off-by: Ralf Pannemans <ralf.pannemans@sap.com>
Signed-off-by: Johannes Dillmann <j.dillmann@sap.com>
Signed-off-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
2024-02-12 08:56:40 +01:00
Daniel Mieg
f51fbc3e4e
Only print logs if error occurred (#4823) 2024-02-09 10:20:27 +01:00
Vyacheslav Starostin
4e3fa38dd3
Clean-up checkIfStepActive (#4814)
* Clean-up checkIfStepActive

* Mark --useV1 deprecated

* Clean up tests

* Update test

* Add warning message

* Update warning msg
2024-02-08 15:43:26 +06:00
Anil Keshav
c2343b19b8
including conditions when starting side cars docker containers (#4815)
* including conditions for side cars and also default context

* docu typo error
2024-02-06 14:54:49 +01:00
Googlom
b4863fee45
fix(gitopsUpdateDeployment): take into account branch name when clonning (#4811)
* use branch when clonning a repo

* fix unit test mocks
2024-02-06 13:33:30 +05:00
Daniel Mieg
7575539c5a
top (#4787) 2024-02-02 19:07:31 +00:00
Akramdzhon Azamov
689c79e388
Fixed issue with empty project tokens after scanning (#4808)
* Fixed issue with empty project tokens after scanning
2024-01-29 16:15:32 +01:00
Googlom
ab62827a3e
Update buildpacks/lifecycle dependency (#4801)
* update lib version and fix code

* remove outdated replace statement

* update helm.sh/helm/v3

---------

Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
2024-01-29 10:45:25 +05:00
Googlom
33b8c489f9
fix dependencies with security issues (#4790)
* remove vault interaction from unit tests

* go mod tidy

* update some dependency minor versions

* update github.com/getsentry/sentry-go

* fix vault dependency

* update google.golang.org/api and cloud.google.com/go/storage

* fix unit test

---------

Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
2024-01-24 15:19:23 +05:00
renovate[bot]
0764534edb
fix(deps): update module github.com/influxdata/influxdb-client-go/v2 to v2.13.0 (#4737)
* fix(deps): update module github.com/influxdata/influxdb-client-go/v2 to v2.13.0

* go mod tidy

* add new APIClient method to mock

* go mod tdiy

* go mod tidy again

* remove mocks

* update mockery and regenerate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jliempt <>
Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
Co-authored-by: Googlom <36107508+Googlom@users.noreply.github.com>
2024-01-22 14:54:34 +05:00
Googlom
0117942d25
update golang to 1.20 (#4783)
* update golang to 1.20

* update version in another places

* fix failing unit tests and lint

---------

Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
2024-01-22 10:18:32 +05:00
Daniel Mieg
d115858ead
Fix initial request (#4785) 2024-01-18 20:28:24 +01:00
Daria Kuznetsova
6920cad511
feat(codeqlExecuteScan): adding data to InfluxDB (#4780)
* added influxdb to params, added log for testing

* changed fields for codeql influx db

* added setting codeql findings to influx

* refactored

* fixed typo

* added tests
2024-01-17 11:38:16 +03:00
Googlom
9074822e57
allow reconfiguration of provider (#4776)
Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
2024-01-15 17:51:32 +05:00
Dmitrii Pavlukhin
86a59eb412
Mend fix for the config path calculation (#4766)
* fix-for-the-scan-path-in-custom-pipelines

* amended-scan-path-logic

* minor-changes

* returned-old-way-of handling-config

* returned-old-way

* removed-comments
2024-01-15 10:30:19 +03:00
Jk1484
5b68fc6095
throw a warning if value of a config is of the wrong type (#4700) 2024-01-10 15:02:11 +05:00
Googlom
ac5cf17317
refactor(orchestrator): Use singleton in orchestrator package and rename methods (#4639)
* rename interface, types and methods.
some type changes and refactor

* update dependent methods and variables

* fix unit tests

* a bit more refactor and fix

* concurrent safe singleton

* return old Options struct

* refactor creating config provider and fix nil pointer derefernce

* fix unit test and linter errors

* introduce resetting config provider (for unit tests)

* fix annoying error message when config provider is not configured

---------

Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
Co-authored-by: Muhammadali Nazarov <muhammadalinazarov@gmail.com>
2024-01-09 16:01:15 +05:00
Adam Horacek
a5ea24dfb0
feat(configs): vaultCredentialEnvPrefix to support several prefixes (#4745)
* feat(configs): vaultCredentialEnvPrefix to support several prefixes

* minor refactoring

* docs

---------

Co-authored-by: Muhammadali Nazarov <muhammadalinazarov@gmail.com>
2024-01-09 13:07:53 +05:00
Dmitrii Pavlukhin
6cc6a4e80a
Feature - whitesourceExecuteScan - adding ability to scan multiple docker images (#4755)
* added-multiple-images-scan-logic

* amended-description

* added-reference-to-common-pipeline-env
2024-01-05 18:23:55 +03:00
tiloKo
c7ac43595f
Update targetVector.go (#4736)
missing space
2023-12-22 13:15:35 +01:00
Daria Kuznetsova
439a7ad82e
fix(codeqlExecuteScan): init empty GitHub repo before mirroring code (#4714)
* added initializing empty repo

* updated go.mod

* updated go.mod

* updated go.sum

* updated go.mod

* updated go.mod

* updated go.mod

---------

Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2023-12-21 11:20:44 +03:00
Daniel Mieg
dbc3d41b37
SAP_COM_0948 (#4715)
* SAP_COM_0948 clone, pull & checkout

* Fix log output

* Enable compatibility for old tests

* Fix tests

* Add tests for SAP_COM_0948

* Change message

* Add tags for test

* add retry for error code 501

---------

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2023-12-19 15:16:48 +01:00
Jordi van Liempt
0b585ed932
Revert "Fix sidecar conditionals (#4672)" (#4727)
This reverts commit cd8c93ea6c.
2023-12-18 16:01:33 +01:00
Ralf Pannemans
cd8c93ea6c
Fix sidecar conditionals (#4672)
* fix sidecar conditionals

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>

* Fix unit tests

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>

* Consider parameter used in conditions of sidecars

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>

---------

Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
2023-12-18 16:03:58 +04:00
Oliver Nocon
6587808062
fix(npm): don't publish sboms in npm package (#4692)
Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2023-12-13 23:06:59 +05:30
Daria Kuznetsova
405e42a1c3
fix(codeqlExecuteScan): filter quality issues for SAST to pass/fail (#4703)
* added filtering issues by tag

* added optional group of issues

* fixed tests

---------

Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2023-12-13 10:43:04 +03:00
michaelkubiaczyk
f39dec68a5
Cxone updated release (#4723)
* Initial in progress

* compiling but not yet functional

* Missed file

* updated checkmarxone step

* Working up to fetching a project then breaks

* Missed file

* Breaks when retrieving projects+proxy set

* Create project & run scan working, now polling

* Fixed polling

* added back the zipfile remove command

* Fixed polling again

* Generates and downloads PDF report

* Updated and working, prep for refactor

* Added compliance steps

* Cleanup, reporting, added groovy connector

* fixed groovy file

* checkmarxone to checkmarxOne

* checkmarxone to checkmarxOne

* split credentials (id+secret, apikey), renamed pullrequestname to branch, groovy fix

* Fixed filenames & yaml

* missed the metadata_generated.go

* added json to sarif conversion

* fix:type in new checkmarxone package

* fix:type in new checkmarxone package

* removed test logs, added temp error log for creds

* extra debugging to fix crash

* improved auth logging, fixed query parse issue

* fixed bug with group fetch when using oauth user

* CWE can be -1 if not defined, can't be uint

* Query also had CweID

* Disabled predicates-fetch in sarif generation

* Removing leftover info log message

* Better error handling

* fixed default preset configuration

* removing .bat files - sorry

* Cleanup per initial review

* refactoring per Gist, fixed project find, add apps

* small fix - sorry for commit noise while testing

* Fixing issues with incremental scans.

* removing maxretries

* Updated per PR feedback, further changes todo toda

* JSON Report changes and reporting cleanup

* removing .bat (again?)

* adding docs, groovy unit test, linter fixes

* Started adding tests maybe 15% covered

* fix(checkmarxOne): test cases for pkg and reporting

* fix(checkmarxOne):fix formatting

* feat(checkmarxone): update interface with missing method

* feat(checkmarxone):change runStep signature to be able to inject dependency

* feat(checkmarxone): add tests for step (wip)

* Adding a bit more coverage

* feat(checkmarxOne): fix code review

* feat(checkmarxOne): fix code review

* feat(checkmarxOne): fix code review

* feat(checkmarxOne): fix integration test PR

* adding scan-summary bug workaround, reportgen fail

* enforceThresholds fix when no results passed in

* fixed gap when preset empty in yaml & project conf

* fixed another gap in preset selection

* fix 0-result panic

* fail when no preset is set anywhere

* removed comment

* initial project-under-app support

* fixing sarif reportgen

* some cleanup of error messages

* post-merge test fixes

* revert previous upstream merge

* adding "incremental" to "full" triggers

* wrong boolean

* project-in-application api change prep

* Fixing SARIF report without preset access

* fix sarif deeplink

* removing comments

* fix(cxone):formatting

* fix(cxone):formatting

---------

Co-authored-by: thtri <trinhthanhhai@gmail.com>
Co-authored-by: Thanh-Hai Trinh <thanh.hai.trinh@sap.com>
2023-12-12 20:24:03 +01:00
Ralf Pannemans
6efb21b30b
Add support for volume mounts (#4673)
* Add support for volume mounts

* Adatpt unit test to include VolumeMounts

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>

* Only accept volumeMounts with the name volume

---------

Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2023-12-01 13:33:08 +01:00
Anil Keshav
8dc2a1bfb4
feat: Add imagePushToRegistry step (#4609)
* imagePushToRegistry new step

* adding copy and push functionality

* including only copy correctly

* groovy step for imagePushToRegistry

* create .docker folder

* imagePushToRegistry new step

* adding copy and push functionality

* including only copy correctly

* groovy step for imagePushToRegistry

* create .docker folder

* fix CopyImage

* test

* test

* Correct docker config path

* Update

* Update

* Update

* Update

* Update

* Use creds from Vault

* Use creds from Vault

* Use creds from Vault

* Use creds from Vault

* Test

* Comment some logic

* Test: move regexp logic

* Test

* Update

* Update

* Clean up

* Update

* Update

* Update interface

* Rename function

* imagePushToRegistry: small refactoring (#4688)

* imagePushToRegistry new step

* adding copy and push functionality

* including only copy correctly

* groovy step for imagePushToRegistry

* create .docker folder

* Correct docker config path

* Update

* Update

* Update

* Update

* Update

* Use creds from Vault

* Use creds from Vault

* Use creds from Vault

* Use creds from Vault

* Test

* Comment some logic

* Test: move regexp logic

* Test

* Update

* Update

* Clean up

* Update

* Update

---------

Co-authored-by: Keshav <anil.keshav@sap.com>
Co-authored-by: Muhammadali Nazarov <muhammadalinazarov@gmail.com>

* Update step yaml file

* Update interface

* Rename func

* Update tests

* Update interface, create mock methods, update tests

* Update mock

* Add md file

* Fix groovy doc, unit test, go unit test

* Update

* Add unit tests

* Support tagLatest param

* Fetch source creds from Vault

* Update yaml file

* Support multiple images

* Update test

* Support copy images in parallel

* Update yaml

* Clean up

* Return err if no creds provided

* Fix tests

* Add err msg

* Add debug log

* Do not use CPE for targetImages

* Support platform

* Delete Jenkins specific creds

* Update groovy: do not handle Jenkins creds

* Delete unused code

* Fix: Support platform

* Fix: Support platform

* Apply suggestion from code review

Co-authored-by: Egor Balakin <14162703+m1ron0xFF@users.noreply.github.com>

* Apply suggestion from code review

Co-authored-by: Egor Balakin <14162703+m1ron0xFF@users.noreply.github.com>

* Add tests for parseDockerImageName

* Add comment that tagArtifactVersion is not supported yet

* Set limit of running goroutines

* Fix: Set limit of running goroutines

* The tagArtifactVersion is not supported yet

---------

Co-authored-by: Muhammadali Nazarov <muhammadalinazarov@gmail.com>
Co-authored-by: Egor Balakin <egor.balakin@sap.com>
Co-authored-by: Vyacheslav Starostin <vyacheslav.starostin@sap.com>
Co-authored-by: Vyacheslav Starostin <32613074+vstarostin@users.noreply.github.com>
Co-authored-by: Egor Balakin <14162703+m1ron0xFF@users.noreply.github.com>
2023-11-30 15:06:31 +06:00
Daniel Mieg
0a738e882c
[ABAP] Refactor steps to allow API migration (#4687)
* Initial API Manager

* Intermediate part

* Intermediate step

* Fix utils tests

* Adapt pull

* Migrate Checkout

* Refactor createTags

* Refactoring

* Setup tests for SAP_COM_0510

* Add tests

* Refactor parsing

* Add retry to clone

* refactor

* Refactor and tests

* Fix function call

* Adapt create tag tests

* Adapt tests

* Add tests

* Fix tests

* Fix test

* Fix client mock

* Add unit test comments

* Add missing parameters

* Branch not mandatory for clone

* Improve switch branch trigger

---------

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2023-11-28 13:26:31 +01:00
Oliver Feldmann
17de9ed34c
Allow cALM service key for cTMS steps (#4661)
* Allow cALM service keys

* Fix typo

Co-authored-by: Srinikitha Kondreddy <srinikitha.kondreddy@sap.com>

* fix typo

Co-authored-by: Srinikitha Kondreddy <srinikitha.kondreddy@sap.com>

* Hardcode tms endpoint in calm test case

* Add new serviceKey parameter

* Use new serviceKey parameter

With deprecation warning if old tmsServiceKey parameter is used

* Add unit tests and optimise

* Remove tms from service key log message

* Apply suggestions from code review

Co-authored-by: Artem Bannikov <62880541+artembannikov@users.noreply.github.com>

* Remove unused json fields mapping

* Apply review suggestion

* Apply further review suggestions

* Use new parameter name in groovy

* Generate again

* Fix groovy test

---------

Co-authored-by: Srinikitha Kondreddy <srinikitha.kondreddy@sap.com>
Co-authored-by: Artem Bannikov <62880541+artembannikov@users.noreply.github.com>
2023-11-27 14:28:18 +01:00