Skip to content

Commit 613bbcd

Browse files
yucohenxsoar-bot
authored andcommitted
Security scans (demisto#25915)
* added as a new build flow * reverted gitlab * changed ref to master
1 parent 92f4bf7 commit 613bbcd

File tree

4 files changed

+54
-1
lines changed

4 files changed

+54
-1
lines changed

Diff for: .gitlab/ci/.gitlab-ci.on-push.yml

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ run-unittests-and-lint:
6969
rules:
7070
- if: '$BUCKET_UPLOAD == "true"'
7171
when: never
72+
- if: '$SECURITY_SCANS == "true"'
73+
when: never
7274
- if: '$FORCE_BUCKET_UPLOAD == "true"'
7375
when: never
7476
- if: '$DEMISTO_TEST_NATIVE_CANDIDATE == "true"'

Diff for: .gitlab/ci/.gitlab-ci.security-scans.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.auto-secure-cicd-rule:
2+
rules:
3+
- if: '$SECURITY_SCANS == "true"'
4+
5+
.auto-secure-cicd-rule-always:
6+
rules:
7+
- if: '$SECURITY_SCANS == "true"'
8+
when: always
9+
10+
stages:
11+
- security
12+
13+
auto secure cicd:
14+
stage: security
15+
variables:
16+
PYTHONPATH: "/root/prodsec_tools/"
17+
trigger:
18+
include:
19+
- file: "/.gitlab/ci/security-scans.yml"
20+
ref: master
21+
project: "xsoar/infra"
22+
strategy: depend
23+
extends:
24+
.auto-secure-cicd-rule
25+
26+
fan-in-security-scans:
27+
tags:
28+
- gke
29+
stage: fan-in
30+
extends:
31+
- .auto-secure-cicd-rule-always
32+
script:
33+
- echo "fan in"
34+
35+
36+
slack-notify-security-scans:
37+
variables:
38+
PIPELINE_TO_QUERY: $CI_PIPELINE_ID
39+
WORKFLOW: 'Security Scans'
40+
JOB_NAME: 'fan-in-security-scans'
41+
# Passes the environment variable from the parent pipeline to the child which can be useful for cases
42+
# when triggering pipeline with alternate env variable value passed in the API call
43+
SLACK_CHANNEL: $SLACK_CHANNEL
44+
SLACK_JOB: 'true'
45+
extends:
46+
- .trigger-slack-notification
47+
- .auto-secure-cicd-rule-always
48+

Diff for: .gitlab/ci/.gitlab-ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ default:
99
when: always
1010

1111
stages:
12+
- security
1213
- unittests-and-validations
1314
- prepare-testing-bucket
1415
- run-instances
@@ -68,3 +69,4 @@ include:
6869
- local: .gitlab/ci/.gitlab-ci.sdk-nightly.yml
6970
- local: .gitlab/ci/.gitlab-ci.miscellaneous.yml
7071
- local: .gitlab/ci/.gitlab-ci.test-native-candidate.yml
72+
- local: .gitlab/ci/.gitlab-ci.security-scans.yml

Diff for: Tests/scripts/gitlab_slack_notifier.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
SDK_NIGHTLY = 'Demisto SDK Nightly'
2727
PRIVATE_NIGHTLY = 'Private Nightly'
2828
TEST_NATIVE_CANDIDATE = 'Test Native Candidate'
29-
WORKFLOW_TYPES = {CONTENT_NIGHTLY, SDK_NIGHTLY, BUCKET_UPLOAD, PRIVATE_NIGHTLY, TEST_NATIVE_CANDIDATE}
29+
SECURITY_SCANS = 'Security Scans'
30+
WORKFLOW_TYPES = {CONTENT_NIGHTLY, SDK_NIGHTLY, BUCKET_UPLOAD, PRIVATE_NIGHTLY, TEST_NATIVE_CANDIDATE, SECURITY_SCANS}
3031
SLACK_USERNAME = 'Content GitlabCI'
3132

3233

0 commit comments

Comments
 (0)