Skip to content

Commit f659187

Browse files
authored
chore: enable fortify in v1 branch (#2773)
* chore: enable fortify scan in v1 branch * chore: update circleci config
1 parent 08d7313 commit f659187

File tree

1 file changed

+58
-11
lines changed

1 file changed

+58
-11
lines changed

.circleci/config.yml

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
version: 2.1
44

55
orbs:
6+
aws-cli: circleci/[email protected]
67
# Using inline orb for now
78
getting-started-smoke-test:
89
orbs:
@@ -325,6 +326,46 @@ jobs:
325326
command: bundle exec fastlane << parameters.lane >>
326327
no_output_timeout: 60m
327328

329+
fortify_scan:
330+
<<: *defaults
331+
steps:
332+
- *restore_repo
333+
- run:
334+
name: Make source directory
335+
command: |
336+
mkdir source
337+
cp -r Amplify source
338+
cp -r AmplifyPlugins source
339+
- aws-cli/setup:
340+
role-arn: 'arn:aws:iam::971028514469:role/CircleCiOIDC'
341+
role-session-name: 'aws-s3-session'
342+
- run:
343+
name: Download License
344+
command: |
345+
aws s3 cp s3://amplify-swift-fortify-prod/fortify.license fortify.license
346+
- run:
347+
name: Download Installer
348+
command: |
349+
aws s3 cp s3://amplify-swift-fortify-prod/Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz
350+
tar -xvf Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz
351+
unzip Fortify_SCA_and_Apps_22.1.1_osx_x64.app.zip
352+
- run:
353+
name: Download Scripts
354+
command: |
355+
aws s3 cp s3://amplify-swift-fortify-prod/amplify_swift_fortify_scan.sh fortify_scan.sh
356+
- run:
357+
name: Run Installer
358+
command: |
359+
Fortify_SCA_and_Apps_22.1.1_osx_x64.app/Contents/MacOS/installbuilder.sh --mode unattended --installdir Fortify --InstallSamples 0 --fortify_license_path fortify.license --MigrateSCA 0
360+
export PATH=~/amplify-swift/Fortify/bin:$PATH
361+
echo "export PATH=~/amplify-swift/Fortify/bin:\$PATH" >> "$BASH_ENV"
362+
fortifyupdate -acceptKey
363+
sourceanalyzer -version
364+
- run:
365+
name: Run Scan
366+
command: |
367+
sh ./fortify_scan.sh source
368+
328369
deploy_requires: &deploy_requires
329370
requires:
330371
- build_test_amplify
@@ -338,6 +379,7 @@ deploy_requires: &deploy_requires
338379
- unit_test_geo
339380
- unit_test_predictions
340381
- unit_test_storage
382+
- fortify_scan
341383

342384
workflows:
343385
build_test_deploy:
@@ -349,71 +391,76 @@ workflows:
349391
- install_gems:
350392
requires:
351393
- checkout_code
352-
- build_test_amplify:
394+
- fortify_scan:
395+
context:
396+
- amplify-swift-aws-s3-download
353397
requires:
354398
- install_gems
399+
- build_test_amplify:
400+
requires:
401+
- fortify_scan
355402
- build_test_aws_plugins_core:
356403
requires:
357-
- install_gems
404+
- fortify_scan
358405
- build_amplify_spm:
359406
requires:
360-
- install_gems
407+
- fortify_scan
361408
- plugin_unit_test:
362409
name: unit_test_analytics
363410
path: Analytics
364411
workspace: AnalyticsCategoryPlugin
365412
scheme: AWSPinpointAnalyticsPlugin
366413
requires:
367-
- install_gems
414+
- fortify_scan
368415
- plugin_unit_test:
369416
name: unit_test_api
370417
path: API
371418
workspace: APICategoryPlugin
372419
scheme: AWSAPICategoryPlugin
373420
requires:
374-
- install_gems
421+
- fortify_scan
375422
- plugin_unit_test:
376423
name: unit_test_auth
377424
path: Auth
378425
workspace: AWSCognitoAuthPlugin
379426
scheme: AWSCognitoAuthPlugin
380427
requires:
381-
- install_gems
428+
- fortify_scan
382429
- plugin_unit_test:
383430
name: unit_test_datastore
384431
path: DataStore
385432
workspace: DataStoreCategoryPlugin
386433
scheme: AWSDataStoreCategoryPlugin
387434
requires:
388-
- install_gems
435+
- fortify_scan
389436
- plugin_unit_test:
390437
name: unit_test_geo
391438
path: Geo
392439
workspace: GeoCategoryPlugin
393440
scheme: AWSLocationGeoPlugin
394441
requires:
395-
- install_gems
442+
- fortify_scan
396443
- plugin_unit_test:
397444
name: unit_test_core_ml
398445
path: Predictions
399446
workspace: PredictionsCategoryPlugin
400447
scheme: CoreMLPredictionsPlugin
401448
requires:
402-
- install_gems
449+
- fortify_scan
403450
- plugin_unit_test:
404451
name: unit_test_predictions
405452
path: Predictions
406453
workspace: PredictionsCategoryPlugin
407454
scheme: AWSPredictionsPlugin
408455
requires:
409-
- install_gems
456+
- fortify_scan
410457
- plugin_unit_test:
411458
name: unit_test_storage
412459
path: Storage
413460
workspace: StoragePlugin
414461
scheme: AWSS3StoragePlugin
415462
requires:
416-
- install_gems
463+
- fortify_scan
417464
- deploy:
418465
name: deploy unstable
419466
<<: *deploy_requires

0 commit comments

Comments
 (0)