@@ -28,14 +28,29 @@ aliases:
28
28
$filePathWithQuotes = '"{0}"' -f $filePath
29
29
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\signtool.exe" sign /a /sm /n "Redis Labs Inc." /fd sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /v $FilePathWithQuotes
30
30
shell : powershell.exe
31
- scan : &scan
31
+ fileScan : &fileScan
32
32
run :
33
- name : Virustotal scan
34
- command : &virusscan |
33
+ name : Virustotal file scan
34
+ command : &virusfilescan |
35
35
uploadUrl=$(curl -sq -XGET https://www.virustotal.com/api/v3/files/upload_url -H "x-apikey : $VIRUSTOTAL_API_KEY" | jq -r '.data')
36
36
uploadFile=$("/usr/bin/find" /tmp/release -name ${FILE_NAME})
37
37
echo "File to upload : ${uploadFile}"
38
38
analysedId=$(curl -sq -XPOST "${uploadUrl}" -H "x-apikey : $VIRUSTOTAL_API_KEY" --form file=@"${uploadFile}" | jq -r '.data.id')
39
+ if [ $analysedId == "null" ]; then
40
+ echo 'Status is null, something went wrong'; exit 1;
41
+ fi
42
+ echo "export ANALYZED_ID=${analysedId}" >> $BASH_ENV
43
+ echo "Virustotal Analyzed id : ${analysedId}"
44
+ sleep 10
45
+ shell : /bin/bash
46
+ urlScan : &urlScan
47
+ run :
48
+ name : Virustotal url scan
49
+ command : &virusurlscan |
50
+ echo "Url to check : ${URL}"
51
+
52
+ analysedId=$(curl -sq -XPOST https://www.virustotal.com/api/v3/urls -H "x-apikey : $VIRUSTOTAL_API_KEY" --form url=${URL} | jq -r '.data.id')
53
+
39
54
if [ $analysedId == "null" ]; then
40
55
echo 'Status is null, something went wrong'; exit 1;
41
56
fi
@@ -76,13 +91,32 @@ aliases:
76
91
echo "Results:"
77
92
echo "analazedHarmless : ${analazedHarmless}, analazedMalicious: ${analazedMalicious}, analazedSuspicious: ${analazedSuspicious}"
78
93
79
- if [ "$analazedHarmless" != "0" ] || [ "$analazedMalicious" != "0" ] || [ "$analazedSuspicious" != "0" ]; then
80
- echo 'Found dangers'; exit 1;
94
+ if [ "$analazedMalicious" != "0" ] || [ "$analazedSuspicious" != "0" ]; then
95
+ echo "export VIRUS_CHECK_FAILED=true" >> $BASH_ENV
96
+ echo 'Found dangers'; exit 0;
81
97
fi
82
98
99
+ echo "export VIRUS_CHECK_FAILED=false" >> $BASH_ENV
100
+ echo "export SKIP_VIRUSTOTAL_REPORT=true" >> $BASH_ENV
83
101
echo 'Passed';
84
102
shell : /bin/bash
85
103
no_output_timeout : 15m
104
+ virustotalReport : &virustotalReport
105
+ run :
106
+ name : Virustotal slack report
107
+ command : &virusreport |
108
+ if [ "$SKIP_VIRUSTOTAL_REPORT" == "true" ]; then
109
+ exit 0;
110
+ fi
111
+
112
+ FILE_NAME=virustotal.report.json
113
+ BUILD_NAME=$BUILD_NAME FILE_NAME=$FILE_NAME VIRUS_CHECK_FAILED=$VIRUS_CHECK_FAILED node .circleci/virustotal-report.js &&
114
+ curl -H "Content-type : application/json" --data @$FILE_NAME -H "Authorization: Bearer ${SLACK_TEST_REPORT_KEY}" -X POST https://slack.com/api/chat.postMessage
115
+
116
+ if [ "$VIRUS_CHECK_FAILED" == "true" ]; then
117
+ echo 'Found dangers'; exit 1;
118
+ fi
119
+ shell : /bin/bash
86
120
iTestsNames : &iTestsNames
87
121
- oss-st-5 # OSS Standalone v5
88
122
- oss-st-5-pass # OSS Standalone v5 with admin pass required
@@ -612,6 +646,7 @@ jobs:
612
646
613
647
UPGRADES_LINK='' SEGMENT_WRITE_KEY='' yarn package:stage && yarn package:mas
614
648
rm -rf release/mac
649
+ mv release/mas-universal/RedisInsight-mac-universal-mas.pkg release/RedisInsight-mac-universal-mas.pkg
615
650
no_output_timeout : 60m
616
651
617
652
- run :
@@ -625,7 +660,7 @@ jobs:
625
660
- release/RedisInsight*.zip
626
661
- release/RedisInsight*.dmg
627
662
- release/RedisInsight*.dmg.blockmap
628
- - release/**/ *.pkg
663
+ - release/RedisInsight *.pkg
629
664
- release/*-mac.yml
630
665
- release/redisstack
631
666
windows :
@@ -674,7 +709,7 @@ jobs:
674
709
- release/RedisInsight*.exe
675
710
- release/RedisInsight*.exe.blockmap
676
711
- release/*.yml
677
- virustotal :
712
+ virustotal-file :
678
713
executor : linux-executor
679
714
parameters :
680
715
ext :
@@ -688,8 +723,35 @@ jobs:
688
723
name : export FILE_NAME environment variable
689
724
command : |
690
725
echo 'export FILE_NAME="RedisInsight*<< parameters.ext >>"' >> $BASH_ENV
691
- - << : *scan
726
+ - << : *fileScan
692
727
- << : *validate
728
+ virustotal-url :
729
+ executor : linux-executor
730
+ parameters :
731
+ fileName :
732
+ description : File name
733
+ type : string
734
+ steps :
735
+ - checkout
736
+ - run :
737
+ name : export URL environment variable
738
+ command : |
739
+ echo 'export URL="https://download.redisinsight.redis.com/latest/<< parameters.fileName >>"' >> $BASH_ENV
740
+ echo 'export BUILD_NAME="<< parameters.fileName >>"' >> $BASH_ENV
741
+ - << : *urlScan
742
+ - << : *validate
743
+ - << : *virustotalReport
744
+
745
+ virustotal-report :
746
+ executor : linux-executor
747
+ steps :
748
+ - checkout
749
+ - run :
750
+ name : Send virustotal passed report
751
+ command : |
752
+ echo 'export VIRUS_CHECK_FAILED=0' >> $BASH_ENV
753
+ echo 'export SKIP_VIRUSTOTAL_REPORT=false' >> $BASH_ENV
754
+ - << : *virustotalReport
693
755
docker :
694
756
executor : linux-executor
695
757
parameters :
@@ -1159,42 +1221,42 @@ workflows:
1159
1221
env : prod
1160
1222
requires : *prodElectronBuildRequires
1161
1223
# virus check all electron apps (prod)
1162
- - virustotal :
1224
+ - virustotal-file :
1163
1225
name : Virus check - AppImage (prod)
1164
1226
ext : .AppImage
1165
1227
requires :
1166
1228
- Build app - Linux (prod)
1167
- - virustotal :
1229
+ - virustotal-file :
1168
1230
name : Virus check - deb (prod)
1169
1231
ext : .deb
1170
1232
requires :
1171
1233
- Build app - Linux (prod)
1172
- - virustotal :
1234
+ - virustotal-file :
1173
1235
name : Virus check - rpm (prod)
1174
1236
ext : .rpm
1175
1237
requires :
1176
1238
- Build app - Linux (prod)
1177
- - virustotal :
1239
+ - virustotal-file :
1178
1240
name : Virus check - snap (prod)
1179
1241
ext : .snap
1180
1242
requires :
1181
1243
- Build app - Linux (prod)
1182
- - virustotal :
1244
+ - virustotal-file :
1183
1245
name : Virus check x64 - dmg (prod)
1184
1246
ext : -x64.dmg
1185
1247
requires :
1186
1248
- Build app - MacOS (prod)
1187
- - virustotal :
1249
+ - virustotal-file :
1188
1250
name : Virus check arm64 - dmg (prod)
1189
1251
ext : -arm64.dmg
1190
1252
requires :
1191
1253
- Build app - MacOS (prod)
1192
- - virustotal :
1254
+ - virustotal-file :
1193
1255
name : Virus check MAS - pkg (prod)
1194
1256
ext : -mas.pkg
1195
1257
requires :
1196
1258
- Build app - MacOS (prod)
1197
- - virustotal :
1259
+ - virustotal-file :
1198
1260
name : Virus check - exe (prod)
1199
1261
ext : .exe
1200
1262
requires :
@@ -1278,6 +1340,43 @@ workflows:
1278
1340
report : true
1279
1341
requires :
1280
1342
- Build app - Linux (stage)
1343
+
1344
+ - virustotal-url :
1345
+ name : Virus check - AppImage (nightly)
1346
+ fileName : RedisInsight-v2-linux-x86_64.AppImage
1347
+ - virustotal-url :
1348
+ name : Virus check - deb (nightly)
1349
+ fileName : RedisInsight-v2-linux-amd64.deb
1350
+ - virustotal-url :
1351
+ name : Virus check - rpm (nightly)
1352
+ fileName : RedisInsight-v2-linux-x86_64.rpm
1353
+ - virustotal-url :
1354
+ name : Virus check - snap (nightly)
1355
+ fileName : RedisInsight-v2-linux-amd64.snap
1356
+ - virustotal-url :
1357
+ name : Virus check x64 - dmg (nightly)
1358
+ fileName : RedisInsight-v2-mac-x64.dmg
1359
+ - virustotal-url :
1360
+ name : Virus check arm64 - dmg (nightly)
1361
+ fileName : RedisInsight-v2-mac-arm64.dmg
1362
+ - virustotal-url :
1363
+ name : Virus check MAS - pkg (nightly)
1364
+ fileName : RedisInsight-mac-universal-mas.pkg
1365
+ - virustotal-url :
1366
+ name : Virus check - exe (nightly)
1367
+ fileName : RedisInsight-v2-win-installer.exe
1368
+ - virustotal-report :
1369
+ name : Virus check report (prod)
1370
+ requires :
1371
+ - Virus check - AppImage (nightly)
1372
+ - Virus check - deb (nightly)
1373
+ - Virus check - rpm (nightly)
1374
+ - Virus check - snap (nightly)
1375
+ - Virus check x64 - dmg (nightly)
1376
+ - Virus check arm64 - dmg (nightly)
1377
+ - Virus check MAS - pkg (nightly)
1378
+ - Virus check - exe (nightly)
1379
+
1281
1380
# # e2e desktop tests on exe build
1282
1381
# - e2e-exe:
1283
1382
# name: E2ETest (exe) - Nightly
0 commit comments