3
3
push :
4
4
branches :
5
5
- " feature/auto_policy_testing"
6
+ - " defender_separate"
6
7
7
8
# Allows you to run this workflow manually from the Actions tab
8
9
workflow_dispatch :
24
25
AZURE_TENANT_ID : ${{ secrets.AZURE_TENANT_ID }}
25
26
AZURE_SUBSCRIPTION_ID : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
26
27
AZURE_SECRET_VALUE : ${{ secrets.AZURE_SECRET_VALUE }}
27
- default_resource_priority_list : ' ["storage", "webapp", "vnet", "network", "vm", "synapse", " sql", "mysql", "subscription", "disk", "postgresql", "cosmosdb", "signalr", "spring", "search", "service-fabric", "stream", "redis", "servicebus", "role", "monitor", "machine-learning", "logic", "kusto", "aks", "keyvault", "iothub", "front-door", "event", "data", " defender", "container", "cognitiveservice", "batch", "automation", "application", "app-configuration", "api", "alert "]'
28
+ default_resource_priority_list : ' ["storage", "sql", "defender"]'
28
29
# default_resource_priority_list: '["storage", "webapp", "vnet", "network", "vm", "synapse", "sql", "mysql", "subscription", "disk", "postgresql", "cosmosdb", "signalr", "spring", "search", "service-fabric", "stream", "redis", "servicebus", "role", "monitor", "machine-learning", "logic", "kusto", "aks", "keyvault", "iothub", "front-door", "event", "data", "defender", "container", "cognitiveservice", "batch", "automation", "application", "app-configuration", "api", "alert"]'
29
30
TF_VAR_project : ${{ secrets.TF_VAR_project }}
30
31
TF_VAR_region : ${{ secrets.AWS_REGION }}
33
34
TF_CLI_ARGS : " -no-color"
34
35
AWS_DEFAULT_REGION : ${{ secrets.AWS_REGION }}
35
36
RED : ' \033[0;31m'
36
- ACTIONS_REPO_BRANCH : " main "
37
+ ACTIONS_REPO_BRANCH : " auto_test_ci "
37
38
38
39
39
40
permissions :
@@ -107,6 +108,7 @@ jobs:
107
108
parallel_resources_list : ${{ steps.prepare-resource-matrix.outputs.parallel_resources_to_scan }}
108
109
not_parallel_resources_list : ${{ steps.prepare-resource-matrix.outputs.not_parallel_resources_to_scan }}
109
110
sequential_resources_list : ${{ steps.prepare-resource-matrix.outputs.sequential_resources_to_scan }}
111
+ isolated_resources_list : ${{ steps.prepare-resource-matrix.outputs.isolated_resources_to_scan }}
110
112
sequential_resources_length : ${{ steps.prepare-resource-matrix.outputs.sequential_resources_length }}
111
113
steps :
112
114
- name : Git clone the repository
@@ -122,10 +124,43 @@ jobs:
122
124
id : prepare-resource-matrix
123
125
uses : ./ecc-actions/auto-test-actions/prepare-resource-matrix
124
126
127
+ deploy_and_scan_isolated_resources :
128
+ name : Scan I N/P
129
+ runs-on : ubuntu-22.04
130
+ needs : [ deploy_common_resources, prepare_resource_matrix ]
131
+ if : ${{ needs.prepare_resource_matrix.outputs.isolated_resources_list != '[]' }}
132
+ strategy :
133
+ max-parallel : 1
134
+ fail-fast : false
135
+ matrix :
136
+ compliance : ['green', 'red']
137
+ resource : ${{fromJson(needs.prepare_resource_matrix.outputs.isolated_resources_list)}}
138
+ env :
139
+ COMPLINCE : ${{ matrix.compliance }}
140
+ RESOURCE : ${{ matrix.resource }}
141
+
142
+ steps :
143
+ - name : Git clone the repository
144
+ uses : actions/checkout@v4
145
+
146
+ - name : Checkout ecc-actions
147
+ run :
git clone -b $ACTIONS_REPO_BRANCH "https://git:[email protected] /epmc-sec/cloudlab/cloud_custodian/ecc-actions.git" ecc-actions
148
+ env :
149
+ PROJECT_TOKEN : ${{ secrets.ECC_CHANGELOG_ACTION }}
150
+ ACTIONS_REPO_BRANCH : ${{ env.ACTIONS_REPO_BRANCH }}
151
+
152
+ - name : Deploy and scan parallel resources
153
+ uses : ./ecc-actions/auto-test-actions/deploy-and-scan-resources
154
+ with :
155
+ CI_ASSUME_ROLE : ${{ secrets.CI_ASSUME_ROLE }}
156
+ AZURE_CREDENTIALS : ${{ secrets.AZURE_CREDENTIALS }}
157
+ COMPLIANCE : ${{ matrix.compliance }}
158
+ PROJECT_TOKEN : ${{ secrets.CLOUDCUSTODIAN_CORE }}
159
+
125
160
deploy_and_scan_parallel_resources :
126
161
name : Scan P
127
162
runs-on : ubuntu-22.04
128
- needs : [ deploy_common_resources, prepare_resource_matrix ]
163
+ needs : [ deploy_common_resources, prepare_resource_matrix, deploy_and_scan_isolated_resources ]
129
164
if : ${{ needs.prepare_resource_matrix.outputs.parallel_resources_list != '[]' }}
130
165
strategy :
131
166
max-parallel : 10
@@ -159,7 +194,7 @@ jobs:
159
194
deploy_and_scan_not_parallel_resources :
160
195
name : Scan N/P
161
196
runs-on : ubuntu-22.04
162
- needs : [ deploy_common_resources, prepare_resource_matrix]
197
+ needs : [ deploy_common_resources, prepare_resource_matrix, deploy_and_scan_isolated_resources ]
163
198
if : ${{ needs.prepare_resource_matrix.outputs.not_parallel_resources_list != '[]' }}
164
199
strategy :
165
200
max-parallel : 1
@@ -192,9 +227,10 @@ jobs:
192
227
deploy_and_scan_sequential_resources :
193
228
name : Scan S
194
229
runs-on : ubuntu-22.04
195
- needs : [deploy_common_resources, prepare_resource_matrix]
230
+ needs : [deploy_common_resources, prepare_resource_matrix, deploy_and_scan_isolated_resources ]
196
231
if : ${{ needs.prepare_resource_matrix.outputs.sequential_resources_list != '[]' }}
197
232
strategy :
233
+ max-parallel : 7
198
234
fail-fast : false
199
235
matrix :
200
236
resource : ${{fromJson(needs.prepare_resource_matrix.outputs.sequential_resources_list)}}
0 commit comments