Skip to content

Commit 89be5a2

Browse files
[FR] Update Docs to add references for new DaC Features (#29)
1 parent 6ab826e commit 89be5a2

File tree

3 files changed

+21
-30
lines changed

3 files changed

+21
-30
lines changed

docs/core_component_syncing_rules_and_data_from_vcs_to_elastic_security.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Commands:
113113
...
114114
```
115115

116-
💡 Note: For stacks with a version prior to 9.0, one can use the `kibana upload-rule` command. However, this is not recommended and one should use the `kibana import-rules` in its place.
116+
💡 Note: For stacks with a version prior to 9.0, one can use the `kibana upload-rule` command. However, this is not recommended and one should use the `kibana import-rules` in its place. See the [CLI.md](https://github.com/elastic/detection-rules/blob/main/CLI.md) for more details.
117117

118118
```bash
119119
█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄ ▄ █▀▀▄ ▄ ▄ ▄ ▄▄▄ ▄▄▄
@@ -126,17 +126,7 @@ Usage: detection_rules kibana [OPTIONS] COMMAND [ARGS]...
126126

127127
Options:
128128
--ignore-ssl-errors TEXT
129-
--space TEXT Kibana space
130-
--kibana-url TEXT
131-
--api-key TEXT [required]
132-
--cloud-id TEXT ID of the cloud instance.
133-
-h, --help Show this message and exit.
134-
135-
Commands:
136-
export-rules Export custom rules from Kibana.
137-
import-rules Import custom rules into Kibana.
138-
search-alerts Search detection engine alerts with KQL.
139-
upload-rule [Deprecated] Upload a list of rule .toml files to Kibana.
129+
...
140130
```
141131

142132
### Testing

docs/internals_of_the_detection_rules_repo.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,27 +170,28 @@ The repository extensively utilizes schemas sourced from upstream (e.g., Beats,
170170
1. Explore the [rule dataclasses](https://github.com/elastic/detection-rules/blob/main/detection_rules/rule.py) detailed in the repository to understand the expected format for rule definitions. These are periodically updated to reflect new capabilities within the Kibana features set.
171171
172172
```python
173-
@dataclass(frozen=True)
173+
@dataclass(frozen=True, kw_only=True)
174174
class RuleMeta(MarshmallowDataclassMixin):
175175
"""Data stored in a rule's [metadata] section of TOML."""
176+
176177
creation_date: definitions.Date
177178
updated_date: definitions.Date
178-
deprecation_date: Optional[definitions.Date]
179+
deprecation_date: definitions.Date | None = None
179180
180181
# Optional fields
181-
bypass_bbr_timing: Optional[bool]
182-
comments: Optional[str]
183-
integration: Optional[Union[str, List[str]]]
184-
maturity: Optional[definitions.Maturity]
185-
min_stack_version: Optional[definitions.SemVer]
186-
min_stack_comments: Optional[str]
187-
os_type_list: Optional[List[definitions.OSType]]
188-
query_schema_validation: Optional[bool]
189-
related_endpoint_rules: Optional[List[str]]
190-
promotion: Optional[bool]
182+
bypass_bbr_timing: bool | None = None
183+
comments: str | None = None
184+
integration: str | list[str] | None = None
185+
maturity: definitions.Maturity | None = None
186+
min_stack_version: definitions.SemVer | None = None
187+
min_stack_comments: str | None = None
188+
os_type_list: list[definitions.OSType] | None = None
189+
query_schema_validation: bool | None = None
190+
related_endpoint_rules: list[str] | None = None
191+
promotion: bool | None = None
191192
192193
# Extended information as an arbitrary dictionary
193-
extended: Optional[Dict[str, Any]]
194+
extended: dict[str, Any] | None = None
194195
```
195196
196197
2. Visit the etc/ directory within the repository to review additional resources, including validation schemas and configuration files required for rule management and development.

docs/known_limitations.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515

1616
## No Direct Support
1717

18-
- Managing prebuilt rules via DaC workflows is not supported at the moment (this is being addressed).
1918
- Rule loading
2019
- Core repo (loading Rule object)
21-
- Officially supports from TOML to Rule object
22-
- Support for json yaml will exist but will remain in a dict format
20+
- Officially supports loading from TOML to Rule object
21+
- Support for json and yaml exists but will remain in a dict format (as opposed to the nested TOML format)
2322
- This is only a convenience utility and will only be supported across minimal components, since all functionality depends on the validated object (and related pieces)
2423
- Kibana module does support raw dict's
2524
- We added a RawDictLoader as a util, but this will only serve to load rules to dicts, bypassing most of the value of the core repo
@@ -32,6 +31,7 @@
3231
## Potential Upcoming Enhancements
3332

3433
- Support for customizable folder structure:
35-
- There currently is no support for customizing the folder structure which decides how rules are stored on disk when downloaded from kibana (however, this can also be reconciled post download in whatever manner desired).
34+
- There currently is not full support for customizing the folder structure which decides how rules are stored on disk.
3635
- This means that users have to manually move rules to specific organized folders.
37-
- This is tracked in: [#3625](https://github.com/elastic/detection-rules/issues/3625)
36+
- This is tracked in: [#3625](https://github.com/elastic/detection-rules/issues/3625)
37+
- However, there is support for using an existing folder structure when importing rules from a Kibana export. This is done by using the `--load-rule-loading / -lr` option in the `kibana export-rules` and `import-rules-to-repo` commands. See [#4891](https://github.com/elastic/detection-rules/issues/4891) and its associated PR for more details.

0 commit comments

Comments
 (0)