Skip to content

Conversation

@devhhu
Copy link

@devhhu devhhu commented Jul 18, 2025

Summary

Adds YAML schema and autocomplete snippets to simplify detection authoring and remove reliance on the baked in contentctl templates found when you run contentctl new.

Changes Included

  • Added detection.schema.json for detection rule validation.
  • Added detection-snippets.code-snippets to provide VSCode autocomplete.
  • Added settings.json for built-in YAML extension integration.
  • Added basic README guidance on enabling schema validation.

Why

  • Helps detection authors working in non-Windows environments (e.g., GCP, macOS) avoid contentctl hardcoding issues, which are found when you attempt to create a detection using contentctl new.
  • Reduces friction by providing in-editor autocomplete suggestions.

Notes

  • Files are under /docs/yaml-spec/schema.

…ment

-  .vscode/schemas/detection.schema.json for custom detection schema
- .vscode/settings.json for YAML schema validation
- Included detection-snippets.code-snippets for quick detection templates
- Improves consistency and ease of detection rule authoring within the repo
@devhhu devhhu changed the title feat: add YAML schema and autocomplete snippet for development add YAML schema and autocomplete snippet for development Jul 19, 2025
@devhhu devhhu changed the title add YAML schema and autocomplete snippet for development add YAML schema and autocomplete snippet for detections Jul 19, 2025
@devhhu
Copy link
Author

devhhu commented Jul 24, 2025

Hey team! Just a quick note:

This PR doesn’t change anything in the core content - it just adds some optional docs and some editor tips (YAML schema + VSCode autocomplete). We’ve started using it internally and found it super helpful for making detections more easily, especially outside the default workflow.

@patel-bhavin
Copy link
Contributor

Hello @devhhu - First of all thank you for submitting this enhancement! As of right now, this schema is incomplete and needs frequent maintenance as the schema of these yamls evolve and change.

We encourage you to maintain this in your fork and are considering add official VS code schemas to help with this task!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants