Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/en/ide_plugins/vscode/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The extension includes these features:

- [**View in IDE**](#view-in-ide): Jump directly from code references in Datadog to your source files.

- [**Code Security**](#code-security): Detect and fix security issues before you commit changes.
- [**Code Security**](#code-security): Detect and fix security issues before you commit, and write custom rules.

- [**Exception Replay**](#exception-replay): Debug your production code.

Expand Down
16 changes: 16 additions & 0 deletions content/en/ide_plugins/vscode/code_security.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,26 @@ To analyze an entire folder or workspace, right-click a folder in the file explo

<div class="alert alert-info">Static Code Analysis does not require a Datadog account, as source files are analyzed locally.</div>

### Rule editor

Write and test [custom Static Code Analysis rules][4] without leaving your IDE. Use the rule editor to design detection logic for internal standards, security patterns, or maintainability checks specific to your codebase.

{{< img src="/ide_plugins/vscode/static-analysis-rule-editor.png" alt="SAST rule editor in the Datadog extension for VS Code" style="width:100%;" >}}

The rule editor provides the following panels.

- A **Tree-sitter query editor** for pattern matching against the abstract syntax tree.
- A **JavaScript rule panel** for expressing detection logic and reporting violations.
- **Compliant and non-compliant test files** that run against the rule as you edit, with expected and actual match counts shown in real time.
- An **AST tree view** showing how the parser represents your test code.

Import an existing rule from disk, or export a finished rule and upload it to Datadog.

## Further reading

{{< partial name="whats-next/whats-next.html" >}}

[1]: /security/code_security/static_analysis/
[2]: /security/code_security/static_analysis/static_analysis_rules/
[3]: https://github.com/DataDog/datadog-static-analyzer/blob/main/doc/legacy_config.md
[4]: /security/code_security/static_analysis/custom_rules/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading