You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md
+89-82Lines changed: 89 additions & 82 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,8 @@
9
9
10
10
This is a test plan for the workflows of:
11
11
12
-
- exporting single prebuilt rules from the Rule Details page
13
-
- exporting single prebuilt rules one-by-one from the Rule Management page
12
+
- exporting a single prebuilt rule from the Rule Details page
13
+
- exporting a single prebuilt rule from the Rule Management page
14
14
- exporting multiple prebuilt rules in bulk from the Rule Management page
15
15
- exporting a mixture of prebuilt and custom rules from the Rule Management page
-[Scenario: Exporting prebuilt rule individually from rule details page](#scenario-exporting-prebuilt-rule-individually-from-rule-details-page)
39
-
-[Scenario: Exporting custom rule individually from rule details page](#scenario-exporting-custom-rule-individually-from-rule-details-page)
40
-
-[Scenario: Exporting prebuilt rule individually from rules management table](#scenario-exporting-prebuilt-rule-individually-from-rules-management-table)
41
-
-[Scenario: Exporting custom rule individually from rules management table](#scenario-exporting-custom-rule-individually-from-rules-management-table)
42
-
-[Scenario: Exporting prebuilt rules in bulk](#scenario-exporting-prebuilt-rules-in-bulk)
43
-
-[Scenario: Exporting custom rules in bulk](#scenario-exporting-custom-rules-in-bulk)
44
-
-[Scenario: Exporting both prebuilt and custom rules in bulk](#scenario-exporting-both-prebuilt-and-custom-rules-in-bulk)
38
+
-[**Scenario: Exporting prebuilt rule individually from rule details page**](#scenario-exporting-prebuilt-rule-individually-from-rule-details-page)
39
+
-[**Scenario: Exporting custom rule individually from rule details page**](#scenario-exporting-custom-rule-individually-from-rule-details-page)
40
+
-[**Scenario: Exporting prebuilt rule individually from rules management table**](#scenario-exporting-prebuilt-rule-individually-from-rules-management-table)
41
+
-[**Scenario: Exporting custom rule individually from rules management table**](#scenario-exporting-custom-rule-individually-from-rules-management-table)
42
+
-[**Scenario: Exporting prebuilt rules in bulk**](#scenario-exporting-prebuilt-rules-in-bulk)
43
+
-[**Scenario: Exporting custom rules in bulk**](#scenario-exporting-custom-rules-in-bulk)
44
+
-[**Scenario: Exporting both prebuilt and custom rules in bulk**](#scenario-exporting-both-prebuilt-and-custom-rules-in-bulk)
45
45
-[Error Handling](#error-handling)
46
-
-[Scenario: Exporting beyond the export limit](#scenario-exporting-beyond-the-export-limit)
46
+
-[**Scenario: Exporting beyond the export limit**](#scenario-exporting-beyond-the-export-limit)
47
47
-[Licensing](#licensing)
48
-
-[Scenario: Exporting a mixture of prebuilt and custom rules via export API under insufficient license\*\*](#scenario-exporting-a-mixture-of-prebuilt-and-custom-rules-via-export-api-under-insufficient-license)
49
-
-[Scenario: Exporting a mixture of prebuilt and custom rules via bulk action under insufficient license\*\*](#scenario-exporting-a-mixture-of-prebuilt-and-custom-rules-via-bulk-action-under-insufficient-license)
48
+
-[**Scenario: Exporting a mixture of prebuilt and custom rules via export API under insufficient license**](#scenario-exporting-a-mixture-of-prebuilt-and-custom-rules-via-export-api-under-insufficient-license)
49
+
-[**Scenario: Exporting a mixture of prebuilt and custom rules via bulk action under insufficient license**](#scenario-exporting-a-mixture-of-prebuilt-and-custom-rules-via-bulk-action-under-insufficient-license)
50
50
51
51
## Useful information
52
52
@@ -96,145 +96,152 @@ User stories:
96
96
97
97
### Core Functionality
98
98
99
-
#### Scenario: Exporting prebuilt rule individually from rule details page
99
+
#### **Scenario: Exporting prebuilt rule individually from rule details page**
100
100
101
101
**Automation**: 2 cypress tests.
102
102
103
103
```Gherkin
104
-
Given a space with a <rule_type> rule installed
105
-
When the user selects "Export rule" from the "All actions" dropdown on the rule's detail page
104
+
Given a <customized_state> prebuilt rule
105
+
When user exports the rule from the rule's detail page
106
106
Then the rule should be exported as an NDJSON file
107
-
And it should include an "immutable" field with a value of true
108
-
And its "ruleSource" "type" should be "external"
109
-
And its "ruleSource" "isCustomized" value should be <is_customized>
110
-
111
-
Examples:
112
-
| rule_type | is_customized |
113
-
| prebuilt customized | true |
114
-
| prebuilt non-customized | false |
107
+
And it should include an "immutable" field having true value
108
+
And "rule_source.type" should be "external"
109
+
And "rule_source.is_customized" should be <is_customized>
115
110
```
116
111
117
-
#### Scenario: Exporting custom rule individually from rule details page
112
+
**Examples:**
113
+
114
+
|`<customized_state>`|`<is_customized>`|
115
+
| -------------------- | ----------------- |
116
+
| customized | true |
117
+
| non-customized | false |
118
+
119
+
#### **Scenario: Exporting custom rule individually from rule details page**
118
120
119
121
**Automation**: 1 cypress test.
120
122
121
123
```Gherkin
122
-
Given a space with a custom rule installed
123
-
When the user selects "Export rule" from the "All actions" dropdown on the rule's detail page
124
+
Given a custom rule
125
+
When user exports the rule from the rule's detail page
124
126
Then the rule should be exported as an NDJSON file
125
-
And it should include an "immutable" field with a value of false
126
-
And its "ruleSource" "type" should be "internal"
127
+
And it should include an "immutable" field having false value
128
+
And "rule_source.type" should be "internal"
127
129
```
128
130
129
-
#### Scenario: Exporting prebuilt rule individually from rules management table
131
+
#### **Scenario: Exporting prebuilt rule individually from rules management table**
130
132
131
133
**Automation**: 2 cypress tests.
132
134
133
135
```Gherkin
134
-
Given a space with a <rule_type> rule installed
135
-
When the user selects "Export rule" from the rule's overflow dropdown on the rules management page
136
+
Given a <customized_state> prebuilt rule
137
+
When user export the rule via rule management table row actions
136
138
Then the rule should be exported as an NDJSON file
137
-
And it should include an "immutable" field with a value of true
138
-
And its "ruleSource" "type" should be "external"
139
-
And its "ruleSource" "isCustomized" value should be <is_customized>
140
-
141
-
Examples:
142
-
| rule_type | is_customized |
143
-
| prebuilt customized | true |
144
-
| prebuilt non-customized | false |
139
+
And it should include an "immutable" field having true value
140
+
And "rule_source.type" should be "external"
141
+
And "rule_source.is_customized" should be <is_customized>
145
142
```
146
143
147
-
#### Scenario: Exporting custom rule individually from rules management table
144
+
**Examples:**
145
+
146
+
|`<customized_state>`|`<is_customized>`|
147
+
| -------------------- | ----------------- |
148
+
| customized | true |
149
+
| non-customized | false |
150
+
151
+
#### **Scenario: Exporting custom rule individually from rules management table**
148
152
149
153
**Automation**: 1 cypress test.
150
154
151
155
```Gherkin
152
-
Given a space with a custom rule installed
153
-
When the user selects "Export rule" from the rule's overflow dropdown on the rules management page
156
+
Given a custom rule
157
+
When user export the rule via rule management table row actions
154
158
Then the rule should be exported as an NDJSON file
155
-
And it should include an "immutable" field with a value of false
156
-
And its "ruleSource" "type" should be "internal"
159
+
And it should include an "immutable" field having false value
160
+
And "rule_source.type" should be "internal"
157
161
```
158
162
159
-
#### Scenario: Exporting prebuilt rules in bulk
163
+
#### **Scenario: Exporting prebuilt rules in bulk**
160
164
161
165
**Automation**: 2 cypress tests.
162
166
163
167
```Gherkin
164
-
Given a space with multiple <rule_type> rules installed
165
-
When the user selects rules in the rules table
166
-
And chooses "Export" from bulk actions
168
+
Given multiple <customized_state> prebuilt rules
169
+
When user selects some prebuilt rules in the rule management table
170
+
And bulk exports them
167
171
Then the selected rules should be exported as an NDJSON file
168
-
And they should include an "immutable" field with a value of true
169
-
And their "ruleSource" "type" should be "external"
170
-
And their "ruleSource" "isCustomized" should depend be <is_customized>
171
-
172
-
Examples:
173
-
| rule_type | is_customized |
174
-
| prebuilt customized | true |
175
-
| prebuilt non-customized | false |
172
+
And each rule in NDJSON should include an "immutable" field having true value
173
+
And each rule in NDJSON should have "rule_source.type" equal to "external"
174
+
And each rule in NDJSON should have "rule_source.is_customized" equal to <is_customized>
176
175
```
177
176
178
-
#### Scenario: Exporting custom rules in bulk
177
+
**Examples:**
178
+
179
+
|`<customized_state>`|`<is_customized>`|
180
+
| -------------------- | ----------------- |
181
+
| customized | true |
182
+
| non-customized | false |
183
+
184
+
#### **Scenario: Exporting custom rules in bulk**
179
185
180
186
**Automation**: 1 cypress test.
181
187
182
188
```Gherkin
183
-
Given a space with multiple custom rules installed
184
-
When the user selects rules in the rules table
185
-
And chooses "Export" from bulk actions
189
+
Given multiple custom rules
190
+
When user selects some of the rules in the rule management table
191
+
And bulk exports them
186
192
Then the selected rules should be exported as an NDJSON file
187
-
And they should include an "immutable" field with a value of false
188
-
And their "ruleSource" "type" should be "internal"
193
+
And each rule in NDJSON should include an "immutable" field having false value
194
+
And each rule in NDJSON should have "rule_source.type" equal to "internal"
189
195
```
190
196
191
-
#### Scenario: Exporting both prebuilt and custom rules in bulk
197
+
#### **Scenario: Exporting both prebuilt and custom rules in bulk**
192
198
193
199
**Automation**: 1 cypress test.
194
200
195
201
```Gherkin
196
-
Given a space with customized prebuilt, non-customized prebuilt and custom rules installed
197
-
When the user selects rules from each type in the rules table
198
-
And chooses "Export" from bulk actions
202
+
Given a mix of customized prebuilt, non-customized prebuilt and custom rules
203
+
When user selects some rules of each type in the rule management table
204
+
And bulk exports them
199
205
Then the selected rules should be exported as an NDJSON file
200
-
And the prebuilt rules should include an "immutable" field with a value of true
201
-
And the custom rules should include an "immutable" field with a value of false
202
-
And the prebuilt rules' "ruleSource" "type" should be "external"
203
-
And the custom rules' "ruleSource" "type" should be "internal"
204
-
And the customized prebuilt rules' "isCustomized" value should be true
206
+
And the exported prebuilt rules should include an "immutable" field having true value
207
+
And the exported prebuilt rules "ruleSource.type" should be "external"
208
+
And the exported non-customized prebuilt rules "ruleSource.is_customized" should be false
209
+
And the exported customized prebuilt rules "ruleSource.is_customized" should be true
210
+
And the exported custom rules should include an "immutable" field having false value
211
+
And the exported custom rules "ruleSource.type" should be "internal"
205
212
```
206
213
207
214
### Error Handling
208
215
209
-
#### Scenario: Exporting beyond the export limit
216
+
#### **Scenario: Exporting beyond the export limit**
210
217
211
218
```Gherkin
212
-
Given a space with prebuilt and custom rules installed
219
+
Given prebuilt and custom rules
213
220
And the number of rules is greater than the export limit (defaults to 10_000)
214
221
Then the request should be rejected as a bad request
215
222
```
216
223
217
224
### Licensing
218
225
219
-
#### Scenario: Exporting a mixture of prebuilt and custom rules via export API under insufficient license**
226
+
#### **Scenario: Exporting a mixture of prebuilt and custom rules via export API under insufficient license**
220
227
221
228
**Automation**: 1 API integration test.
222
229
223
230
```Gherkin
224
231
Given a Kibana instance running under an insufficient license
225
-
And a space with prebuilt customized, prebuilt non-customized and custom rules installed
226
-
When the user exports all rules via the export API
232
+
And prebuilt customized, prebuilt non-customized and custom rules
233
+
When user exports all rules via the export API
227
234
Then all rules should be successfully exported as an NDJSON file
228
235
```
229
236
230
-
#### Scenario: Exporting a mixture of prebuilt and custom rules via bulk action under insufficient license**
237
+
#### **Scenario: Exporting a mixture of prebuilt and custom rules via bulk action under insufficient license**
231
238
232
239
**Automation**: 1 API integration test, 1 e2e test.
233
240
234
241
```Gherkin
235
242
Given a Kibana instance running under an insufficient license
236
-
And a space with prebuilt customized, prebuilt non-customized and custom rules installed
237
-
When the user selects rules of each type in the rules table
238
-
And chooses "Export" from bulk actions
239
-
Then all selected rules should be successfully exported as an NDJSON file
240
-
```
243
+
And prebuilt customized, prebuilt non-customized and custom rules
244
+
When user selects some rules of each type in the rule management table
245
+
And bulk exports them
246
+
Then all the selected rules should be successfully exported as an NDJSON file
0 commit comments