Skip to content

[New] DaC VCS Sync Workflow - #29

Closed
eric-forte-elastic wants to merge 2 commits into
elastic:mainfrom
eric-forte-elastic:dac_promotion_workflow
Closed

eric-forte-elastic wants to merge 2 commits into
elastic:mainfrom
eric-forte-elastic:dac_promotion_workflow

Conversation

@eric-forte-elastic

@eric-forte-elastic eric-forte-elastic commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a new workflow called dac-vcs-rule-sync, Detection-as-Code sync to version control. With this enabled, rules tagged with vcs in a configurable space, defaulting to dev are exported through a detection-rules fork and opened as pull requests against main, with unit tests reported on the PR.

This would be used in a Kibana as authoritative or a dual sync governance model.

Given the added complexity and requirements of having a fork of detection rules with a custom rules config setup, a direct setup guide is added in the file examples/security/detection/dac-vcs-rule-sync/DEPLOY_AND_TEST.md

See example PRs generated from this workflow:

image image

Note

DaC workflows in general are somewhat restricted in that they cannot interact with Github Action workflows directly as these are not present in the current version of the Github Connector. If support for these are added, the workflow can be notably simpler with a similar result.

@eric-forte-elastic
eric-forte-elastic requested a review from a team as a code owner July 28, 2026 12:45
@semd

semd commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for this — the workflow itself is well put together, and DEPLOY_AND_TEST.md is genuinely useful for something with this much setup. A few things before it can land.
Needs a rebase. The branch conflicts with main: examples/security/detection/README.md has moved since you opened this.
The companion GitHub Actions file will break example validation. examples/security/detection/dac-vcs-rule-sync/github/dac-vcs-rule-sync.yml is a GitHub Actions workflow, not an Elastic workflow, but it lives under examples/. We're about to land workflow validation in CI (#47), and its file discovery walks examples/ recursively picking up every .yml/.yaml, with no exclusion mechanism — so this file would be validated against the Elastic workflow schema and fail the build. Options, in rough order of preference:

  • Inline it as a fenced block in the README (it's documentation for the user's own fork, not something we execute).
  • Rename it to a non-YAML extension, e.g. dac-vcs-rule-sync.yml.example.
  • Move it outside examples/.
    Happy for you to pick — the only hard constraint is that it must not be discoverable as a workflow YAML. I'll raise the general gap on [chore] Add workflow validation step in CI #47 as well, since this is the first non-workflow YAML under examples/ and won't be the last.
    github.callTool usage is fine. I checked the connector spec: the GitHub connector's actions are all read-oriented (searchPullRequests, pullRequestRead, getFileContents, listCommits, …) with callTool as the only write escape hatch, so there's no dedicated step you should be using instead. Your note about GitHub Actions not being reachable is accurate. It's worth filing a connector feature request for the write actions this needs (create branch, commit file, open PR) so the workflow can be simplified later.
    Directory layout, minor. examples/security/detection/ is otherwise flat, and this introduces a nested directory plus a github/ subdirectory. I think it's justified given the two companion docs, and there's precedent for flat companion markdown (siem-rule-tuning-agent.md), but flagging it so we make that call deliberately rather than by accident.

@talboren

Copy link
Copy Markdown
Contributor

@eric-forte-elastic this looks quite old and I'm not sure if it's still relevant? if it is - do you mind resolving the conflicts and re-opening?

@talboren talboren closed this Oct 15, 2026
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.

3 participants