Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.

Commit 9366835

Browse files
authored
add mend scans (#75)
* add mend scans * Update mend_scan.yaml
1 parent 32c8ff7 commit 9366835

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed

.github/workflows/mend.config

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
####################################################################
2+
# WhiteSource Unified-Agent configuration file for GO
3+
# GENERAL SCAN MODE: Package Managers only
4+
####################################################################
5+
6+
# !!! Important for WhiteSource "DIST - *" Products:
7+
# Please set
8+
# checkPolicies=false
9+
# forceCheckAllDependencies=false
10+
# since Policy checks are not applicable for Security scans and also
11+
# not suitable for DIST category. CheckPolicies just cover IP scan
12+
# related license checks for SAP hosted cloud products only ("SHC - *").
13+
checkPolicies=true
14+
forceCheckAllDependencies=true
15+
16+
# forceUpdate is important and need to be true
17+
forceUpdate=true
18+
# In some cases it could happen that Unified Agent is reporting SUCCESS but scan is incomplete or
19+
# did not work at all. So parameter failErrorLevel=ALL needs to be set to break the scan if there are issues.
20+
failErrorLevel=ALL
21+
# failBuildOnPolicyViolation:
22+
# If the flag is true, the Unified Agent exit code will be the result of the policy check.
23+
# If the flag is false, the Unified Agent exit code will be the result of the scan.
24+
forceUpdate.failBuildOnPolicyViolation=false
25+
# offline parameter is important and need to be false
26+
offline=false
27+
28+
# ignoreSourceFiles parameter is important and need to be true
29+
# IMPORTANT: This parameter is going to be deprecated in future
30+
# and will be replaced by a new parameter, fileSystemScan.
31+
ignoreSourceFiles=true
32+
# fileSystemScan parameter is important and need to be false as a
33+
# replacement for ignoreSourceFiles=true and overrides the
34+
# soon-to-be-deprecated ignoreSourceFiles.
35+
fileSystemScan=false
36+
# resolveAllDependencies is important and need to be false
37+
resolveAllDependencies=false
38+
39+
#wss.connectionTimeoutMinutes=60
40+
# URL to your WhiteSource server.
41+
# wss.url=https://sap.whitesourcesoftware.com/agent
42+
43+
# resolveDependencies parameter is important and need to be true
44+
#if you are using 'modules' as a dependency manager, then the go.resolveDependencies is set to false.
45+
#For any other dependency manager, this value is set to true.
46+
47+
go.resolveDependencies=true
48+
#defaut value for ignoreSourceFiles is set to false
49+
# ignoreSourceFiles parameter is important and need to be true
50+
go.ignoreSourceFiles=true
51+
go.collectDependenciesAtRuntime=false
52+
# dependencyManager: Determines the Go dependency manager to use when scanning a Go project.
53+
# Valid values are 'dep', 'godep', 'vndr', 'gogradle', 'glide', 'govendor', 'gopm' and 'vgo'
54+
# If empty, then the Unified Agent will try to resolve the dependencies using each one
55+
# of the package managers above.
56+
#go.dependencyManager=
57+
#go.glide.ignoreTestPackages=false
58+
#go.gogradle.enableTaskAlias=true
59+
60+
#The below configuration is for the 'modules' dependency manager.
61+
#Please comment these below 4 lines that has 'go.modules' prefix if you are not using the 'modules' dependency manager.
62+
# Default value is true. If set to true, it resolves Go Modules dependencies.
63+
go.modules.resolveDependencies=true
64+
#default value is true. If set to true, this will ignore Go source files during the scan.
65+
#go.modules.ignoreSourceFiles=true
66+
#default value is true. If set to true, removes duplicate dependencies during Go Modules dependency resolution.
67+
#go.modules.removeDuplicateDependencies=false
68+
#default value is false. if set to true, scans Go Modules project test dependencies.
69+
#go.modules.includeTestDependencies=true
70+
######################
71+
72+
73+
##################################
74+
# Organization tokens:
75+
##################################
76+
# ! In case of PIPER, apiKey may not be used in this configuration,
77+
# but set in configuration of piper.
78+
# Please look at PIPER documentation for more information.
79+
# ! For CoDePipes you may look at CoDePipes for more information.
80+
# apiKey=
81+
82+
# userKey is required if WhiteSource administrator has enabled "Enforce user level access" option.
83+
# ! In case of PIPER, apiKey may not be used in this configuration,
84+
# but set in configuration of piper.
85+
# Please look at PIPER documentation for more information.
86+
# ! For CoDePipes you may look at CoDePipes for more information.
87+
# userKey=
88+
89+
projectName=git-controller
90+
# projectVersion=
91+
# projectToken=
92+
93+
productName=shc-open-component-model
94+
# productVersion=
95+
# productToken
96+
#updateType=APPEND
97+
98+
99+
#########################################################################################
100+
# Includes/Excludes Glob patterns - PLEASE USE ONLY ONE EXCLUDE LINE AND ONE INCLUDE LINE
101+
#########################################################################################
102+
103+
includes=**/*.lock
104+
105+
## Exclude file extensions or specific directories by adding **/*.<extension> or **<excluded_dir>/**
106+
excludes=**/*sources.jar **/*javadoc.jar
107+
108+
case.sensitive.glob=false
109+
followSymbolicLinks=true

.github/workflows/mend_scan.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Mend Security Scan
2+
3+
on:
4+
schedule:
5+
- cron: '10 0 * * 0'
6+
7+
jobs:
8+
mend-scan:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Java 17
16+
uses: actions/setup-java@v3
17+
with:
18+
java-version: '17'
19+
distribution: 'temurin'
20+
21+
- name: Setup Go
22+
uses: actions/setup-go@v4
23+
with:
24+
go-version-file: '${{ github.workspace }}/go.mod'
25+
26+
- name: Download Mend Universal Agent
27+
run: curl https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar -o ./wss-unified-agent.jar
28+
29+
- name: Run Mend Scan
30+
run: java -jar ./wss-unified-agent.jar -c $CONFIG_FILE -wss.url $WSS_URL -apiKey $API_KEY -userKey $USER_KEY -productToken $PRODUCT_TOKEN
31+
env:
32+
USER_KEY: ${{ secrets.MEND_USER_KEY }}
33+
PRODUCT_TOKEN: ${{ secrets.MEND_SHC_PRODUCT_TOKEN }}
34+
WSS_URL: ${{ secrets.MEND_URL }}
35+
API_KEY: ${{ secrets.MEND_API_TOKEN }}
36+
CONFIG_FILE: './.github/workflows/mend.config'
37+

0 commit comments

Comments
 (0)