1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
Commit Graph

783 Commits

Author SHA1 Message Date
Vyacheslav Starostin
d256c3a604
sonarExecuteScan: fix building the URL to call sonar API (#4105)
* Fix IssueService

* Debug

* Debug

* Fix ComponentService

* Clean up

* Add comments
2022-11-07 18:10:47 +06:00
Frank Cheng
7f6fbe4bac
chore: let fortify support maven self Define parameters (#4091)
* let fortify support maven self Define parameters
2022-11-07 16:47:11 +05:30
Oliver Nocon
a2815c4567
fix(whitesourceExecuteScan): properly handle policy violations (#4089)
* fix(whitesourceExecuteScan): properly handle policy violations

* update files

* update formatting

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2022-11-07 11:16:07 +01:00
Jordan Levin
2866ef5592
feat (protecodeExecuteScan) support custom data headers in upload request (#3836)
* support custom data headers in Protecode upload API

* parse custom data properly

* better debugging

* pre-pend META- to custom data header

* prepend to key, not value

* fix debug output

* Fix debug log level

* Make custom header meta upper case key

* fix

* Update http.go

* Update protecode.go

* Update http.go

* address PR review

* Fix merge conflicts

* Update fortifyExecuteScan.yaml

* Update protecodeExecuteScan_generated.go

* Generate step

* fix generated code

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-11-03 17:53:23 +01:00
Daria Kuznetsova
e11fec77c5
fix(fortifyExecuteScan): Check empty source base path in fvdl (#4099)
* Check empty source base path in fvdl
2022-11-02 23:43:49 +05:30
Daria Kuznetsova
cfa26f7c3f
improved logging with fortify server URL (#4098)
* improved logging with fortify server URL
2022-11-02 17:18:54 +05:30
Philipp Stehle
95c8166796
fix(cnbBuild): allow setting empty env variables in project descriptor (#4084) 2022-10-25 14:35:24 +02:00
Anil Keshav
2d56e3f4dc
fix (npmExecuteScripts) pinning @cyclonedx/bom to major version 3 (#4081)
* pinning cyclone dx to major version 3

* fxing unit test

Co-authored-by: anilkeshav27 <you@example.com>
2022-10-24 13:42:11 +02:00
Philipp Stehle
4c1ecdbbba
fix(JenkinsConfigProvider): panic in GetBuildReason (#4073)
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
Co-authored-by: Sumit Kulhadia <sumit.kulhadia@sap.com>
2022-10-20 08:38:10 +02:00
Sven Merk
ea04a63412
fix(whitesourceExecuteScan): Fix processing of assessment (#4059)
* Fix potential nil reference

* Fix handling of assessed vulns

* Fix test code

* Add error detail

* Fix parsing

* Adding debug output

* Fix nil reference

* fix

* Add debug

* Update cmd/whitesourceExecuteScan.go

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>

* Update cmd/whitesourceExecuteScan.go

* Update cmd/whitesourceExecuteScan.go

* Fix fmt

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-10-13 10:34:02 +00:00
Umidjon Urunov
e9707e7638
Added user API key authentication method (#3748)
* changes to detectExec before master merge

* changes for detectExecuteScan

* self generated code added

* fix syntax errors and update docu

* added unit tests for fail and Group

* fix failOn bug

* add Groups as string array

* add Groups as string array

* tests and validation for groups, failOn

* Updated docs and added more tests

* documentation md files should not be changed

* Handle merge conflicts from PR 1845

* fix merge errors

* remove duplicate groups, merge error

* adding buildCode and buildTool as params

* switching build options

* building maven modules

* parameter correction

* parameter correction

* gnerate with new build parameter

* adding comments

* removing piper lib master and modifying goUtils to download 1.5.7 release

* first cleaning then installing

* multi module maven built

* multi module maven built removing unwanted code

* multi module maven built moving inside switch

* testing

* modifying the default use case to also call maven build

* modifying the default use case to also call maven build wih --

* corrected maven build command

* corrected maven build command with %v

* skipping test runs

* testing for MTA project with single pom

* adding absolute path to m2 path

* clean up

* adding switch for mta and maven and removing env from containers

* commiting changes for new detect step

* correting log message

* code clean up

* unit tests changes to detectExecute

* basic tests for new change

* restoring piperGoUtils to download correct piper binary

* code clean up

* code clean up

* protecodeExecuteScan -> Added authentication with user API key

* protecodeExecuteScan -> updating .yml file

* protecodeExecuteScan -> go generate fixed

* protecodeExecuteScan -> naming convention applied for UserAPIKey parameter

* protecodeExecuteScan -> extending groovy code for mapping jenkins credentials

Co-authored-by: D072410 <giridhar.shenoy@sap.com>
Co-authored-by: Keshav <anil.keshav@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-10-10 10:55:21 +02:00
Sven Merk
e8ba1b043d
Fix(detectExecuteScan): rework struct methods to meet interface requirements (#4048)
* Fixed struct methods to meet interface requirements

* Fix test and ruleID

* Small adjustments

* Readability of code

* Added testcases

* Code rework

* Fix fmt

* Mod

* Fix taxonomy

* Fix ruleIndex

* Fix taxonomies

* Fix format

* Remove name

* Fix Fortify and Checkmarx SARIF

* Fix fmt, address comments

* Addressing comments

* Fix fmt
2022-10-10 10:06:20 +02:00
Jan von Löwenstein
2843d6ae75
Remove leftover Printf (#4002)
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
2022-09-23 10:01:12 +02:00
Mayur Belur Mohan
32152be940
API Changes For Integration Artifact Deploy Command (#3992)
* API Changes For Integration Artifact Deploy Command

* CodeReview Fixes

* Change wording

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>
2022-09-15 11:01:36 +02:00
Vyacheslav Starostin
eba9890e62
helmExecute: change permissions for downloaded dependency (#3991)
* Change permissions for downloaded dependency

* Add check if charts exists
2022-09-07 02:28:07 +06:00
Christopher Fenner
0554f3cdb8
chore(protecode): reduct polling interval during tests (#3995)
* cleanup imports

* reduce wait time during tests

* cleanup imports

* cleanup imports
2022-09-02 10:07:04 +02:00
tiloKo
0ef399cd1c
Reserve package log output (#3981)
* beautify log output
2022-09-01 08:53:41 +02:00
Vyacheslav Starostin
1a07ae37b7
Versioning for helm charts (#3980)
* Replace '+' to '_' in appVersion

* Add test

* Fix test

* Update test name

Co-authored-by: Vyacheslav Starostin <vyacheslav.starostin@sap.com>
Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2022-08-31 13:39:00 +02:00
Artem Bannikov
4b257377ec
[TMS] Reimplement tmsUpload step in Go (#3399)
* Initially generated tmsUpload<...> files

* First provisioning of parameters supported by tmsUpload step

* Refer to Go step from tmsUpload.groovy

* Initial client implementation

* Reverting line delimiters in tmsUpoad.groovy back to Unix ones

* Temporarily remove when-condition for Release stage

* Define useGoStep parameter in tmsUpload.groovy

* Unstash buildResult if useGoStep is true

* No unstashing and empty credentials, when using go step

* Register TmsUploadCommand in piper.go

* Cleanup groovy-related changes - they will be temporarily implemented in a different repo

* Make getting OAuth token success

* Look through the code and cleanup it a bit

* Read service key from Jenkins credentials store

* Provide initial set of unit tests for methods in /pkg/tms/tms.go file

* Minor improvements on logging response on http call error

* Check, if positive HTTP status code is as expected

* Cleanup tms.yaml file, provide additional unit test for tms.go

* Provide unit test for the case, when request body contains spaces

* Specify nodeExtDescriptorMapping parameter as of type map in tms.yaml

* Implement client method for getting nodes

* Write tests for GetNodes method

* Add GetMtaExtDescriptor client method and cover it with unit tests

* Provide first implementation for Update- and UploadMtaExtDescriptor
client methods

* Provide first implementation for Update- and UploadMtaExtDescriptor
client methods

* Provide UploadFile and UploadFileToNode client methods

* Provide tests for Update- and UploadMtaExtDescriptor client methods

* Write tests for FileUpload and FileUploadToNode client methods

* Minor corrections

* Remove some TODO comments

* Rename some of response structures

* Revert change for line delimiters in cmd/piper.go

* Add uploadType string parameter to UploadFile and UploadRequest methods
of uploader mock to reflect the changed Uploader implementation

* Start to implement execution logic in tmsUpload.go

* Changes in tms.yaml file

- remove resources from inputs in tms.yaml and implement mtaPath
parameter settings in the yaml file the same way, as it is done in
cloudFoundryDeploy.yaml
- rename tms.yaml to tmsUpload.yaml, since some generation policy
changed meanwhile

* Rename tms.yaml to tmsUpload.yaml and do go generate

* Use provided proxy on communication with UAA and TMS

* Set proxy even before getting OAuth token

* Further implementation of tmsUpload.go

* Continuation on implementing the tmsUpload.go executor

* Get mtarFilePath and git commitId from commonPipelineEnvironment, if
they are missing in configuration file + minor changes

* Implement a happy path test for tmsUpload logic

* Cover with unit tests main happy and error paths of tmsUpload.go logic

* Extend set of unit tests for tmsUpload.go

* Eliminate some TODOs, extend unit tests for tmsUpload.go

* Delete some TODOs

* Remove a couple of more TODOs from tms_test.go file

* Provide additional unit test for error due unexpected positive http
status code on upload

* Revert back line delimiters in cmd/piper.go

* Comment out file uploading calls in tmsUpload.go

* Run go generate to update generated files

* Convert line delimiters in tmsUpload.yaml to Unix ones, as well as
provide new line character in the end of the file, plus minor fix for
logging in tmsUpload.go file (pipeline complained)

* Correct description of a parameter in tmsUpload.yaml, extend unit tests
to check for trimming a slash in the end of TMS url for client methods
that do upload

* [minor] Add a comment in the test code

* Add stashContent parameter to do unstashing in tmsUpload.groovy, remove
some of the clarified TODOs

* Uncomment uploading file calls in tmsUpload.go, declare buildResult
stash in tmsUpload.yaml

* Remove clarified TODOs from the tmsUpload.go file

* Run go fmt for jenkins-library/pkg/tms

* Do not get explicitly values from common pipeline environment - all
configurations are provided in yaml file

* Remove unused struct from tmsUpload_test.go

* Run go fmt jenkins-library\pkg\tms

* Revise descriptions of parameters provided in tmsUpload.yaml file

* Specify STAGES scope for tmsUpload parameters

* Provide STAGES scope for the tmsUpload parameters, provide default value
for stashContent parameter

* Remove trailing space from tmsUpload.yaml

* Provide unit tests for proxy-related changes in http.go file

* Improve proxy implementation in tmsUpload.go file

* Make tmsServiceKey again a mandatory parameter

* Run go generate command to make the generated files correspond the yaml
state

* Change line delimiters back to Unix ones (were switched while resolving
the conflicts)

* Remove trailing spaces from tmsUpload.yaml

* Minor change in a comment to trigger pipelines with commit

* Improve checks for zero-structs and for empty maps, as well as use
different package to read files in the tests

* Revert line endings in http.go

* Revert comments formatting changes in files that do not belong to the tmsUpload step
2022-08-30 10:16:09 +02:00
Jordi van Liempt
402c6085c9
feat(checkIfStepActive): enhance with pipelineEnvironmentFilled condition (#3975)
* add CommonPipelineEnvironmentVariableExists to StepCondition

* add CPE variable existance check to checkIfStepActive

* refactor getCPEEntry()

* condition type -> string

* rename CPE filled condition

* rename CPE condition

Co-authored-by: I557621 <jordi.van.liempt@sap.com>
Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2022-08-29 13:44:32 +02:00
tiloKo
0a2327dda8
Abap relese confirm fault tollerant (#3916)
* no error if package release fails
2022-08-23 15:33:42 +02:00
Pavel Busko
14ce92b4fb
cnbBuild: create CycloneDX SBOM file (#3959)
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2022-08-18 10:03:24 +02:00
Oliver Nocon
85b277c7c6
fix: register base64 encoded secret (#3973)
fixes #3908
2022-08-16 17:52:20 +02:00
ffeldmann
c52e42fc84
feat(orchestrator) Adds BuildReasons to Jenkins Orchestrator. (#3961)
* Adds PullRequest and ResourceTrigger as BuildReason for Jenkins
2022-08-16 08:33:23 +02:00
Vyacheslav Starostin
b31549cf7f
helmExecute: add remoteHelmChartPath CPE value (#3965)
* Add remoteHelmChartPath CPE value

* Fix tests

* Add empty line at the end of yaml file

* Fix yaml file
2022-08-16 01:41:24 +06:00
Oliver Nocon
1e2f2d93e3
feat: add commit and pipeline to GitHub reporting (#3930)
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2022-08-15 07:48:22 +02:00
sumeet patil
91eb80fc68
feat(checkmarxExecuteScan): new json report flag (#3964) 2022-08-12 18:39:28 +02:00
sumeet patil
89bc41a3d0
feat(fortifyExecuteScan): json report new flag (#3963)
- json report new flag isSpotChecksPerCategoryAudited for spotchecks

Co-authored-by: thtri <thanh.hai.trinh@sap.com>
2022-08-12 13:27:31 +02:00
Sven Merk
21416d82ed
Fix SBOM component generation (#3958)
* Further improve library types

* Fix translate

* Added debug output

* Enhance data

* Added debug output

* Fix code

* Added test

* Fix test
2022-08-12 11:59:47 +02:00
Ashly Mathew
374cdb777b
fix(checkIfStepActive): nested key logic (#3939)
* fix(checkIfStepActive): nested key logic

Co-authored-by: Raman Susla <raman_susla@epam.com>
Co-authored-by: Ashly Mathew <ashly.mathew@sap.com>
2022-08-12 09:02:15 +02:00
Sven Merk
c81e741224
Refinement of SARIF generation for BD and WS (#3942)
* Fix docs and format

* Assessment format added

* Added sample file

* Added parsing

* Added packageurl implementation

* Slight refinement

* Refactored assessment options

* Adapted sample file

* First attempt of ws sbom gen

* Reworked SBOM generation

* Fix test code

* Add assessment handling

* Update dependencies

* Added golden test

* Small fix

* feat(fortify): Added a check for fortify binary in $PATH (#3925)

* added check for fortifyupdate and sourceanalyzer bin

Co-authored-by: sumeet patil <sumeet.patil@sap.com>

* Modify SARIF

* Enhanced SARID contents

* Small refinement for hub detect

* Small adjustments

* Extend SARIF contents

* Consistency to Mend part

* Fix tests

* Fix merge

* Fix test

* Add debug log, enhance output

* Enhance meta info

* Fix libType for node

* Fix log entry

* Fix pointers and test

* Fix test

* Fix library types

* Fix test

* Extend libType mappings

Co-authored-by: Vinayak S <vinayaks439@gmail.com>
Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2022-08-11 13:12:14 +02:00
thtri
10a7b72418
fix(checkmarx): inconsistent logic in calculating Low/Info audited numbers (#3953) 2022-08-10 18:46:22 +02:00
ffeldmann
a7d43b8571
fix: complete changeSet list (#3951)
* fixes: complete changeset list

* Adds test cases for multiple changeSets

* Adds PrNumber to ChangeSet

* Changes timestamp to Timestamp
2022-08-10 14:57:21 +02:00
Oliver Nocon
924ff6552f
fix(abapAddonAssemblyKitCheckPV): report generation (#3949) 2022-08-09 18:02:57 +02:00
Anil Keshav
cc1bc02501
addig correct ws api call (#3948)
Co-authored-by: anilkeshav27 <you@example.com>
2022-08-09 17:29:23 +02:00
sumeet patil
bb85aa1d7a
fix(fortify): minor fixes (#3946)
* fix(fortify): minor fixes
2022-08-09 15:26:07 +02:00
Sven Merk
b3f37650a2
SBOM creation for Mend (#3934)
* Fix docs and format

* Assessment format added

* Added sample file

* Added parsing

* Added packageurl implementation

* Slight refinement

* Refactored assessment options

* Adapted sample file

* First attempt of ws sbom gen

* Reworked SBOM generation

* Fix test code

* Add assessment handling

* Update dependencies

* Added golden test

* Small fix

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-08-09 13:56:01 +02:00
Oliver Nocon
a46f796bcd
chore: cleanup reporting & some incorrect file usage in tests (#3943)
* chore: cleanup reporting & some incorrect file usage in tests

* cleanup interface

* chore: remove comment

* preserve error handling

* Rename FileUtils.go to fileUtils.go

* clean up formatting

* chore: address static check findings

* fix brittle test

* chore: cleanup formatting
2022-08-09 10:57:02 +02:00
Alexey Matvievsky
9f8064d733
url log permission hotfix (#3945) 2022-08-08 12:10:35 +04:00
Alexey Matvievsky
da8cda6dbe
feat: http report creation for build steps (#3888)
* URL logging feature for execution step provided
2022-08-05 15:08:19 +04:00
thtri
2536a9f598
feat(checkmarxExecuteScan): Support threshold for Low finding per Query name (#3938)
* feat(checkmarx): Support threshold for Low finding per Query name

Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2022-08-05 00:17:07 +02:00
Oliver Nocon
73f7d61743
fix: remove side-effects of #3875 (#3928)
with #3875 temp directory was created in current workspace.
This had negative side-effects: For example npm build packaged and published temporary files

Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2022-08-04 09:20:59 +02:00
Oliver Nocon
d640d72dc6
feat: improve vulnerability reporting via GitHub issues (#3924)
* feat: improve vulnerability reporting via GitHub issues

* feat: update reports

* chore: add tls cert links

* only write log on error

* chore: update formatting

* chore: update handling of direct dependencies

* chore: fix linting issue

* chore: minor updates
2022-08-02 08:26:26 +02:00
R. Kloe
3cad6ac2cd
feat: allow uploading multiple boms (#3900)
* WIP: Adapt bom names

* + WIP: Adapt bom filenames

* Upgrade cyclonedx gradle plugin and use cyclonedxBom config parameters

* Fix unit tests - use correct name in bom creation

* Fix pythonBuild bom name

* introduce and use npmBomFilename const

* Introduce and use mvnBomFilename const

* Introduce and use gradleBomFilename const

* Use build-tool names for bom suffix

* + Adapt tests (build tool suffix)

* Use BOM schema version 1.2 in gradleExecuteBuild

* Pin version of cyclonedx-maven-plugin to 2.7.1

* Adapt generated files

* Fix integration tests

* Fix integration tests

* Fix gradle build integration tests

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-08-01 13:38:49 +02:00
Jesse Awan
274c11d28f
Add transport request to GPP (#3862)
* Add TransportRequestUploadCTS step to Release

* typo comma

* test transportRequest git ID

* Update piperPipelineStageInit.groovy

* add echo

* aggressive echo

* Update piperPipelineStageInit.groovy

* remove echo + add unitTests

* fix typos and documentation syntax

* test documentation syntax

* test documentation syntax

* Switch to shell

* Documentation changes

* Add review changes

* Remove echo

* Refactor test cases

Co-authored-by: Kondreddy <srinikitha.kondreddy@sap.com>
Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
Co-authored-by: Roland Stengel <r.stengel@sap.com>
2022-07-22 15:15:53 +02:00
Christian Schneider
13744c5114
Cleanup of SBOM generation parameters (#3896)
* Cleanup of SBOM generation parameters

Adding `false` does not what is intended. If the parameters are added to the call, license texts and dev dependencies are included

* Fixed unit test
2022-07-21 14:43:09 +02:00
thtri
ef3e720464
Classify Fortify & Checkmarx findings into audit group / Common properties (#3904)
* fix(fortify): suppressed issues got "Unknown" category and state

* fix (fortify-sarif): classify findings into audit group

* fix(fortify-checkmarx-sarif): common properties bag for Fortify and Checkmarx (accepting the risk of empty value)

* fix (checkmarx-sarif): classify findings into audit group

* fix (sarif): formatting
2022-07-21 11:15:55 +02:00
thtri
604764998f
fix(fortify): suppressed issues got "Unknown" category and state (#3899) 2022-07-19 17:20:22 +02:00
Oliver Nocon
53f4ce96ae
feat(cpe): provide go templating functions (#3872)
* feat(cpe): provide go templating functions

* change type

* fix: type in test

* chore: add comment for exported function

* fix: ensure that custom returns string properly

* fix types and add tests

Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2022-07-14 16:20:11 +02:00
Raghunath Deshpande
5cc1b8f418
whitesourceExecuteScan: configuration change: ignoreSourceFiles to fileSystemScan (#3446)
* Update scanPolling.go

Changing maxWaitTime from 15 to 30 to overcome WhiteSource results reflection in the backend issue.

* Update configHelper.go

* Reset configHelper changes to fix PR 3284

 Committer: raghunathd8

* ignoreSourceFiles to fileSystemScan

* Added ignoreSourceFiles param also

* minor adjustment

* minor adjustment again

* updated unit test

* tests fixed

* fmt-ed

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: raghunathd8 <root@docker-evaluation.openstack.eu-nl-1.cloud.sap>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: ffeldmann <f.feldmann@sap.com>
2022-07-13 14:32:53 +02:00
Eng Zer Jun
0f4e30e9db
test: use T.TempDir to create temporary test directory (#3721)
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-07-12 15:19:12 +02:00
Giridhar Shenoy
e6115a54b2
detectExecuteScan : Bug fix : Dont consider ignored components (#3867)
* fix project version limiting issue

* add tests for detectExecute

* fix bug with vuln count

* adjust unit tests

* update documentation for detect versions
2022-07-11 10:50:31 +02:00
rosemarieB
000e3ab4a9
Add abap source client to generic build step (#3834)
* enable build without values

* add sap-client as option

* use function from /net/url to add parameters

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2022-07-07 08:44:51 +02:00
raman-susla-epam
6bc96faba9
Update vault.go (#3875) 2022-07-05 16:20:53 +02:00
Vyacheslav Starostin
9e4b32778f
helmExecute: Improve RunHelmLint method (#3873)
* Update RunHelmLint method

* Add test

Co-authored-by: Vyacheslav Starostin <vyacheslav.starostin@sap.com>
2022-07-05 18:22:49 +06:00
Oliver Feldmann
ebedf412e4
remove Pipeline word in subject (#3874) 2022-07-05 11:55:07 +03:00
xgoffin
e4b22deec0
fix(fortifyExecuteScan): remove unneeded parameter (project), fix rule ID in rules (#3866)
* fix(fortifyExecuteScan): remove unneeded parameter (project), fix rule ID in rules

* trigger UT
2022-06-30 17:00:29 +02:00
ffeldmann
f490900f1f
feat(orchestrator package) Adds GetChangeSet functionality to Jenkins provider (#3852)
* Adds GetChangeSet functionality to Jenkins provider
2022-06-30 12:49:21 +02:00
Daniel Mieg
6ff4143b08
Execute checkout & pull when already cloned (#3850)
* Execute checkout & pull when already cloned

* Revert

* Disallow config overload

* Add custom error handler for clone

* Implement new pull parameters

* Add tests

* Formatting

* Rename Param

* Add comment

* Add docu

* Adapt testst to merge

* Fix Unit Test
2022-06-30 10:43:33 +02:00
Daniel Mieg
8923d1e583
Add Execution Log (#3863)
* Add Execution Log

* Adapt Tests

* Remove log
2022-06-29 15:50:33 +02:00
Oliver Nocon
5da174aeb0
feat(kubernetesDeploy): add infrastructure extensibility (#3853)
* feat(kubernetesDeploy): add infrastructure extensibility

* update comment

* update error handling

* remove trailing spaces

* chore: refactor to use reuse capabilities

* chore: add tests

* fix: use proper download function

* fix: expose credentials via groovy step

* fix: test

* chore: remove comment

* chore: address CodeClimate findings
2022-06-29 12:00:37 +02:00
Siarhei Pazdniakou
ac821917d1
Fix helmExecute step (#3827)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-06-29 10:03:54 +02:00
xgoffin
51138cfb49
feat(checkmarxExecuteScan): remove some useless SARIF code, added security-severity (#3857) 2022-06-28 15:39:17 +02:00
Daniel Mieg
3184785c5e
Add parameter to pull step (#3851)
* Add parameter to pull step

* Add test for config

* Adapt docu

* Update resources/metadata/abapEnvironmentPullGitRepo.yaml

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Regenerate

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2022-06-28 11:02:15 +02:00
Vinayak S
b25f596af5
fix(fortify): project version fetch bug (#3854)
Fixed the filter for projectversion GET call
2022-06-27 14:43:57 +02:00
Oliver Feldmann
9af9a2418d
Change pipeline prefix to pipeline (#3855) 2022-06-27 11:38:33 +02:00
Martin Zuber
1cb1a203cb
Support custom general purpose vault credentials without prefix. (#3779)
Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2022-06-27 09:24:52 +02:00
sumeet patil
78cf40799e
feat(codeql): new codeql piper step (#3765)
* codeql piper step
2022-06-24 09:04:24 +02:00
Linda Siebert
acbcc5646b
[ANS] Change helper and re-generate steps (#3675)
* Add ans implementation

* Remove todo comment

* Rename test function

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>

* Better wording

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>

* Add reading of response body function

* Use http pkg ReadResponseBody

* Check read error

* Better test case description

* Fix formatting

* Create own package for read response body

* Omit empty nested resource struct

* Separate Resource struct from Event struct

* Merge and unmarshall instead of only unmarshalling

* Improve status code error message

* Remove unchangeable event fields

* Separate event parts

* Change log level setter function

* Restructure ans send test

* Revert exporting readResponseBody function

Instead the code is duplicated in the xsuaa and ans package

* Add check correct ans setup request

* Add set options function for mocking

* Review fixes

* Correct function name

* Use strict unmarshalling

* Validate event

* Move functions

* Add documentation comments

* improve test

* Validate event

* Add logrus hook for ans

* Set defaults on new hook creation

* Fix log level on error

* Don't alter entry log level

* Set severity fatal on 'fatal error' log message

* Ensure that log entries don't affect each other

* Remove unnecessary correlationID

* Use file path instead of event template string

* Improve warning messages

* Add empty log message check

* Allow configuration from file and string

* Add sourceEventId to tags

* Change resourceType to Pipeline

* Use structured config approach

* Use new log level set function

* Check correct setup and return error

* Mock http requests

* Only send log level warning or higher

* Use new function name

* One-liner ifs

* Improve test name

* Fix tests

* Prevent double firing

* Reduce Fire test size

* Add error message to test

* Reduce newANSHook test size

* Further check error

* Rename to defaultEvent in hook struct

* Reduce ifs further

* Fix set error category test

The ansHook Fire test cannot run in parallel, as it would affect the
other tests that use the error category.

* Change function name to SetServiceKey

* Validate event

* Rename to eventTemplate in hook struct

* Move copy to event.go

* Fix function mix

* Remove unnecessary cleanup

* Remove parallel test

The translation fails now and again when parallel is on.

* Remove prefix test

* Remove unused copyEvent function

* Fix ifs

* Add docu comment

* Register ans hook from pkg

* register hook and setup event template seperately

* Exclusively read eventTemplate from environment

* setupEventTemplate tests

* adjust hook levels test

* sync tests- wlill still fail

* migrate TestANSHook_registerANSHook test

* fixes

* Introduce necessary parameters

* Setup hook test

* Use file instead

* Adapt helper for ans

* Generate go files

* Add ans config to general config

* Change generator

* Regenerate steps

* Allow hook config from user config

Merges with hook config from defaults

* Remove ans flags from root command

* Get environment variables

* Generate files

* Add test when calling merge twice

* Update generator

* Regenerate steps

* Check two location for ans service key env var

* Re-generate

* Fix if

* Generate files with fix

* Duplicate config struct

* Add type casting test for ans config

* Fix helper

* Fix format

* Fix type casting of config

* Revert "Allow hook config from user config"

This reverts commit 4864499a4c497998c9ffc3e157ef491be955e68e.

* Revert "Add test when calling merge twice"

This reverts commit b82320fd07b82f5a597c5071049d918bcf62de00.

* Add ans config tests

* Improve helper code

* Re-generate commands

* Fix helper unit tests

* Change to only one argument

* Fix helper tests

* Re-generate

* Revert piper and config changes

* Re-generate missing step

* Generate new steps

* [ANS] Add servicekey credential to environment (#3684)

* Add ANS credential

* Switch to hooks and remove comments

* Add subsection for ans

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* Remove changes to piper.go

* Remove formatting

* Add test for ANS

* Define hook credential seperately from step credential

* Add test for retrieval from general section

* Add comment

* Get ans hook info from DefaultValueCache

* [ANS] Add documentation (#3704)

* Add ANS credential

* Switch to hooks and remove comments

* Add subsection for ans

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* Remove changes to piper.go

* Remove formatting

* Add test for ANS

* Define hook credential seperately from step credential

* Add test for retrieval from general section

* Add comment

* Add documentation

* Review changes

* Review comments

* Improve documentation further

* Add note of two event templates

* Add log level destinction

* Further improvements

* Improve text

* Remove unused things

* Add ANS credential

* Switch to hooks and remove comments

* Add subsection for ans

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* Remove changes to piper.go

* Remove formatting

* Add test for ANS

* Define hook credential seperately from step credential

* Add test for retrieval from general section

* Add comment

* Get ans hook info from DefaultValueCache

* Improvements

Co-authored-by: Linda Siebert <linda.siebert@sap.com>
Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* New lines

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
Co-authored-by: Roland Stengel <r.stengel@sap.com>
Co-authored-by: Thorsten Duda <thorsten.duda@sap.com>
2022-06-22 13:31:17 +02:00
xgoffin
c35d85fecc
feat(SARIF): ContextRegion is now a pointer, can be omitted. In checkmarxExecuteScan: threadflows now added, only first location saved (#3844) 2022-06-22 08:54:24 +02:00
Mayur Belur Mohan
cdea4b7713
ApiProxyList Command (#3794)
* ApiProxyList Command

* CodeReview Fixes

* CodeReview Fixes

* CodeReview FIxes

* CodeReview Fixes

* CodeReview FIxes

* CodeReview Fixes

* fixing unit test

* doc fixes

* Update documentation/docs/steps/apiProxyList.md

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* CodeReview Fixes

* CodeReview Fixes

* CodeReview Fixes

* codereview fix

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2022-06-21 13:08:00 +02:00
Oliver Feldmann
c5b83de7e1
[ANS] logrus hook (#3671)
* Add ans implementation

* Remove todo comment

* Rename test function

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>

* Better wording

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>

* Add reading of response body function

* Use http pkg ReadResponseBody

* Check read error

* Better test case description

* Fix formatting

* Create own package for read response body

* Omit empty nested resource struct

* Separate Resource struct from Event struct

* Merge and unmarshall instead of only unmarshalling

* Improve status code error message

* Remove unchangeable event fields

* Separate event parts

* Change log level setter function

* Restructure ans send test

* Revert exporting readResponseBody function

Instead the code is duplicated in the xsuaa and ans package

* Add check correct ans setup request

* Add set options function for mocking

* Review fixes

* Correct function name

* Use strict unmarshalling

* Validate event

* Move functions

* Add documentation comments

* improve test

* Validate event

* Add logrus hook for ans

* Set defaults on new hook creation

* Fix log level on error

* Don't alter entry log level

* Set severity fatal on 'fatal error' log message

* Ensure that log entries don't affect each other

* Remove unnecessary correlationID

* Use file path instead of event template string

* Improve warning messages

* Add empty log message check

* Allow configuration from file and string

* Add sourceEventId to tags

* Change resourceType to Pipeline

* Use structured config approach

* Use new log level set function

* Check correct setup and return error

* Mock http requests

* Only send log level warning or higher

* Use new function name

* One-liner ifs

* Improve test name

* Fix tests

* Prevent double firing

* Reduce Fire test size

* Add error message to test

* Reduce newANSHook test size

* Further check error

* Rename to defaultEvent in hook struct

* Reduce ifs further

* Fix set error category test

The ansHook Fire test cannot run in parallel, as it would affect the
other tests that use the error category.

* Change function name to SetServiceKey

* Validate event

* Rename to eventTemplate in hook struct

* Move copy to event.go

* Fix function mix

* Remove unnecessary cleanup

* Remove parallel test

The translation fails now and again when parallel is on.

* Remove prefix test

* Remove unused copyEvent function

* Fix ifs

* Add docu comment

* Register ans hook from pkg

* register hook and setup event template seperately

* Exclusively read eventTemplate from environment

* setupEventTemplate tests

* adjust hook levels test

* sync tests- wlill still fail

* migrate TestANSHook_registerANSHook test

* fixes

* review - cleanup, reuse poke

* Apply suggestions from code review

* Change subject

* Review fixes

* Set stepName 'n/a' if not available

* Fix fire tests

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>
Co-authored-by: Roland Stengel <r.stengel@sap.com>
2022-06-17 16:40:45 +02:00
xgoffin
0457601efd
feat(sarif): add GUID as part of properties, change ruleID (#3838) 2022-06-17 08:53:44 +02:00
xgoffin
c11110d791
feat(sarif): add a "conversion" object to SARIF files (#3837)
* feat(fortifyExecuteScan): add conversion object

* feat(checkmarxExecuteScan): add conversion object
2022-06-16 15:24:23 +02:00
Hilmar Falkenberg
e828a94c85
add FortifyReportData.URL to scanReport (#3821)
hopefully that gives users a direct link back to the original fortify project+version

Co-authored-by: xgoffin <86716549+xgoffin@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-06-15 13:45:09 +02:00
Pavel Busko
4ab32f7e7c feat(cnbBuild): generate buildSettingInfo
Co-authored-by: Sumit Kulhadia <sumit.kulhadia@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2022-06-15 12:37:21 +02:00
xgoffin
5edb0d2566
feat(fortifyExecuteScan): implement a system to limit the number of API calls upon request failures (#3818)
* feat(fortifyExecuteScan): add a max number of retries for API calls in SARIF conversion

* feat(checkmarxExecuteScan): implement max number of retries on API call for descriptions in SARIF processing

* feat(checkmarx/fortify): extra logging line when failing an API request in SARIF conversion

* fix(fortifyExecuteScan): panic if undefined projectversion in sarif

* fix(fortifyExecuteScan): logging improvement

* fix(fortifyExecuteScan): wrong if condition caused crash

* fix(fortifyExecuteScan): do not log if retries hit -1, adjust logging

* fix(SARIF): commenting API calls for Checkmarx until a solution can be found for the API issues

* feat(SARIF): add omitempty to extensions
2022-06-09 10:32:08 +02:00
Siarhei Pazdniakou
92837fde18
feat(gradleExecuteBuild, fortifyExecuteScan): gradle improvements (#3807)
* Improvements were made

* fixed tests

* fixed issues

* fix versioning

* fix Inclusive Language warnings

* gradle support to fortifyExecuteScan. Classpath resolving

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-06-07 10:24:10 +02:00
Oliver Feldmann
aecf1babd9
[ANS] Add SAP Alert Notification Service to pkg (#3654)
* Add ans implementation

* Remove todo comment

* Rename test function

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>

* Better wording

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>

* Add reading of response body function

* Use http pkg ReadResponseBody

* Check read error

* Better test case description

* Fix formatting

* Create own package for read response body

* Omit empty nested resource struct

* Separate Resource struct from Event struct

* Merge and unmarshall instead of only unmarshalling

* Improve status code error message

* Remove unchangeable event fields

* Separate event parts

* Change log level setter function

* Restructure ans send test

* Revert exporting readResponseBody function

Instead the code is duplicated in the xsuaa and ans package

* Add check correct ans setup request

* Add set options function for mocking

* Review fixes

* Correct function name

* Use strict unmarshalling

* Validate event

* Move functions

* Add documentation comments

* improve test

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>
Co-authored-by: Roland Stengel <r.stengel@sap.com>
2022-06-03 10:16:14 +02:00
xgoffin
903f273012
feat(checkmarxExecuteScan): added API to get description, incorporated to SARIF file (#3814) 2022-06-01 15:48:56 +02:00
Daniel Mieg
8ce7577a34
Handle empty http response correctly (#3805) 2022-05-25 13:57:13 +02:00
xgoffin
6a43e9f455
feat(fortifyExecuteScan): further improvements to the SARIF generation (#3799)
* feat(fortfiyExecuteScan): proper XML unescaping, added rulepacks to SARIF, added kingdom/type/subtype to tags

* feat(fortifyExecuteScan): proper handling of severity, kinds, levels in SARIF

* fix(fortifyExecuteScan): edge case when handling properties taht could lead to a crash

* fix(fortifyExecuteScan): ensure SARIF processing is done after latest FPR is processed by SSC
2022-05-24 13:40:49 +02:00
Daniel Mieg
cda6e71ab9
Add ABAP step: createTag (#3633)
* Cloud Platform -> BTP

* Initial generation of new step

* add flag

* wip

* Fix warnings

* Add command

* Added Tag Decription

* Add status check

* Improve handling

* Improve handling

* Add test for happy path

* Add test reports to gitignore

* Add second test

* Improve createTag

* Add testcase

* Adaptions

* Add test

* Update cmd/abapEnvironmentCreateTag.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Update cmd/abapEnvironmentCreateTag.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Adapt error handling

* Improve coding

* Add info

* Disallow repositories and repositoryName at the
same time

* Regenerate

* Adapt to feedback

* Update cmd/abapEnvironmentCreateTag.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Update cmd/abapEnvironmentCreateTag.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2022-05-23 15:15:22 +02:00
Philipp Stehle
17ed9468cb
replace depreacted strings.Title function (#3786) 2022-05-20 18:50:03 +02:00
thtri
4c2845b79c
fix(fortify):add SSC project identifier to ouput and JSON report (#3787) 2022-05-20 10:24:16 +02:00
Daniel Mieg
a5fcc7517b
Improve logging (#3788) 2022-05-19 16:59:37 +02:00
xgoffin
1fde2ce677
feat(checkmarxExecuteScan): improvements to SARIF file generation (#3781)
* feat(checkmarxExecuteScan): respect SARIF standard more closely

* fix(checkmarxExecuteScan): edge case where message would be empty in SARIF

* fix(checkmarxExecuteScan): better message handling to ensure field is populated

* feat(checkmarxExecuteScan): SARIF file readability

* feat(checkmarxExecuteScan): include the helpURL as part of the Help object

* fix(sarif): remove wrong structure addition

* feat(checkmarxExecuteScan): safer handling of version in SARIF file

* feat(checkmarxExecuteScan): add CWE number to tags
2022-05-19 14:57:13 +02:00
Adrien
3d48364862
Fix project config reset when preset is set (#3782) 2022-05-18 17:10:00 +02:00
Oliver Nocon
6070549704
fix(helmExecute): respect version from Chart (#3780)
* fix(helmExecute): respect version from Chart

using version from CPE can create failure situations in case format is not semver.
This is the case for maven artifacts, for example.

* chore: simplify condition

* chore: cleanup

* chore: cleanup
2022-05-18 08:58:01 +02:00
Mayur Belur Mohan
ef2db4c2b0
ApiProviderUpload Command (#3663)
* ApiProviderUpload Command

* formatting fix

* formatting fix

* formatting fix

* formatting fix

* CodeReview Changes

* CodeReview Fix

* CodeReview fix

* CodeReview Fix

* CodeReview FIx

* CodeReview FIxes

* CodeReview Fixes

* CodeReview Fixes

* CodeReview Fixes

* CodeReview Fix

* CodeReview Fix

* CodeReview Fixes

* CodeReview Fix

* Doc Fixes

* CodeReview Fix

* CodeReview Fixes

* Doc Fixes

* Update cmd/apiProviderUpload_test.go

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* CodeReview FIxes

* Update cmd/apiProviderUpload.go

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* CodeReview Fixes

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2022-05-16 11:52:04 +02:00
Anil Keshav
e6724d7f05
fix (whitesourceExecuteScan) keep tar extension for target image donwload (#3774)
* explicitly adding tar extension to project name when constructing the targetFilePath for whitesource docker image download

* comments

* correcting comment for better readability

* replace spaces in the project name with underscroe

* better comments

* passing legacy format download

* appending format to value

* keeping the download format for protecode as legacy

* improving docu

* keeping legacy format the default

* keeping tar file name same as project name to avoid duplicate names

* keeping legacy format download hard coded

Co-authored-by: anilkeshav27 <you@example.com>
2022-05-13 18:56:41 +02:00
Anil Keshav
b7cc1eb62f
parsing the entire url and not spliting it (#3775)
Co-authored-by: anilkeshav27 <you@example.com>
2022-05-13 10:02:46 +02:00
xgoffin
7d9f018529
feat(fortifyExecuteScan): SARIF generation improvements (#3769)
* feat(fpr_to_sarif & GHAS): adjustments to fit some rules

* feat(fortifyExecuteScan): fit GH ingestion rules better

* feat(fortifyExecuteScan): readability in SARIF report

* feat(fortifyExecuteScan): restore escaped chars in XML text

* feat(fortifyExecuteScan): properly replace threadflowlocations in each threadflow

* fix(fortifyExecuteScan): fixed missing threadflow in SARIF generation

* feat(fortifyExecuteScan): properly handle threadflows when a node has another node as Reason (node-in-node edge case)

* feat(fortifyExecuteScan): better sarif ruleID field

Co-authored-by: thtri <trinhthanhhai@gmail.com>
2022-05-11 17:05:51 +02:00
Ashly Mathew
823ef47db6
Golang build publish binaries and add group id (#3749)
* Add golang binaries to CPE and add groupID in coordinates

Signed-off-by: Ashly Mathew <ashly.mathew@sap.com>

* Introducing binaries as artifacts

Signed-off-by: Ashly Mathew <ashly.mathew@sap.com>
2022-05-05 12:39:59 +02:00
Giridhar Shenoy
fe9b3a796b
detectExecuteScan: fix project version limiting api call (#3754)
* fix project version limiting issue

* add tests for detectExecute
2022-05-05 09:58:43 +02:00
Anil Keshav
7ad96ee686
feat (cpe) introduce a new artifact cpe type (#3763)
* including a artifact cpe type

* removing type kind related to PR 3717

* clean up

* eliminating local path

* go formatting fix

Co-authored-by: anilkeshav27 <you@example.com>
2022-05-03 09:53:12 +02:00
Daniel Bernd
c65e569cdf
add OSL Package Tree on ObjectSet level (#3762)
Co-authored-by: Daniel Bernd <93763187+danManSAP@users.noreply.github.com>
2022-04-29 16:50:57 +02:00
Daniel Bernd
a3f1234a60
Feature: ATC & AUNIT - ObjectSetLibrary(OSL) usage (#3755)
* own OSL go File & first changes ATC step

* OSL Integration in AUnit & ATC steps 1

* OSL & Unit Tests

* Unit Tests 1

* OSL - AUnit & ATC usage

* Unittest ATC: packagetree --> package incl. subpackages

* correct spelling

* yaml & generated update

* generated Metadata

Co-authored-by: Daniel Bernd <93763187+danManSAP@users.noreply.github.com>
2022-04-27 13:30:43 +02:00
Vitalii Sidorov
9d8f3fc6ad
fix runHelmAdd (#3747)
* fix runHelmAdd

* Add tests

Co-authored-by: “Vitalii <“vitalii.sidorov@sap.com”>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-04-26 17:50:37 +02:00
tiloKo
5a252392f2
enableBuildWithoutValues (#3753) 2022-04-26 17:14:55 +02:00