Skip to content

Commit cbbb2d1

Browse files
committed
rectify rule export test plan
1 parent 0b3a675 commit cbbb2d1

1 file changed

Lines changed: 89 additions & 82 deletions

File tree

  • x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules

x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md

Lines changed: 89 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
This is a test plan for the workflows of:
1111

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
1414
- exporting multiple prebuilt rules in bulk from the Rule Management page
1515
- exporting a mixture of prebuilt and custom rules from the Rule Management page
1616

@@ -35,18 +35,18 @@ https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
3535
- [Product requirements](#product-requirements)
3636
- [Scenarios](#scenarios)
3737
- [Core Functionality](#core-functionality)
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)
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)
4545
- [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)
4747
- [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)
5050

5151
## Useful information
5252

@@ -96,145 +96,152 @@ User stories:
9696

9797
### Core Functionality
9898

99-
#### Scenario: Exporting prebuilt rule individually from rule details page
99+
#### **Scenario: Exporting prebuilt rule individually from rule details page**
100100

101101
**Automation**: 2 cypress tests.
102102

103103
```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
106106
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>
115110
```
116111

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**
118120

119121
**Automation**: 1 cypress test.
120122

121123
```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
124126
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"
127129
```
128130

129-
#### Scenario: Exporting prebuilt rule individually from rules management table
131+
#### **Scenario: Exporting prebuilt rule individually from rules management table**
130132

131133
**Automation**: 2 cypress tests.
132134

133135
```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
136138
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>
145142
```
146143

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**
148152

149153
**Automation**: 1 cypress test.
150154

151155
```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
154158
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"
157161
```
158162

159-
#### Scenario: Exporting prebuilt rules in bulk
163+
#### **Scenario: Exporting prebuilt rules in bulk**
160164

161165
**Automation**: 2 cypress tests.
162166

163167
```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
167171
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>
176175
```
177176

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**
179185

180186
**Automation**: 1 cypress test.
181187

182188
```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
186192
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"
189195
```
190196

191-
#### Scenario: Exporting both prebuilt and custom rules in bulk
197+
#### **Scenario: Exporting both prebuilt and custom rules in bulk**
192198

193199
**Automation**: 1 cypress test.
194200

195201
```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
199205
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"
205212
```
206213

207214
### Error Handling
208215

209-
#### Scenario: Exporting beyond the export limit
216+
#### **Scenario: Exporting beyond the export limit**
210217

211218
```Gherkin
212-
Given a space with prebuilt and custom rules installed
219+
Given prebuilt and custom rules
213220
And the number of rules is greater than the export limit (defaults to 10_000)
214221
Then the request should be rejected as a bad request
215222
```
216223

217224
### Licensing
218225

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**
220227

221228
**Automation**: 1 API integration test.
222229

223230
```Gherkin
224231
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
227234
Then all rules should be successfully exported as an NDJSON file
228235
```
229236

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**
231238

232239
**Automation**: 1 API integration test, 1 e2e test.
233240

234241
```Gherkin
235242
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
247+
```

0 commit comments

Comments
 (0)