Repository navigation
Conversation
… templates
- playbooks/README.md: how to contribute a template (build and run it in Sekoia,
export it with the API, complete it, check it, open a pull request), what makes
a good template, what the check verifies.
- playbooks/tools/check_templates.py: checks every template against the
production branch of automation-library. Errors are what the platform refuses
when it loads a template, or what makes every run fail; on a pull request only
the files it touches can block it.
- playbooks/tools/export_template.py: turns a playbook into a template file
through the public API (GET /v1/symphony/playbooks/{uuid}), without the
accounts of the community.
- .github: workflow running the check on pull requests, on main and weekly;
pull request template; issue forms for template ideas and broken templates.
- Remove playbooks/templates/playbooks.json: the platform has listed templates
from its own API since July 2024 and skips this file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tag check warned on every template using the usual spelling as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problems already on main in other files are summed up in one line and are no longer annotated, so a contributor only sees what is theirs to fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Every template merged on
mainis published in the playbook editor for all customers, at the next release of the playbook service. Until now nothing checked a template before that: the platform skips a template it refuses (and removes it if it was already published), and a reference to a node that does not exist makes every run fail. Contributors also had no guide beyond three lines in the README.What this adds
playbooks/README.md: how to contribute a template (build and run it in Sekoia, export it, complete it, check it, open a pull request), what makes a good template, what the check verifies.playbooks/tools/check_templates.py: checks every template against theproductionbranch of automation-library.uuid, account (module or trigger configuration) left in a node, node ids that are not numbers, outputs to missing nodes, unknown action or trigger or wrong module, arguments that do not match the action (required ones included, Jinja values accepted), malformed operators, invalid Jinja,node.Nthat does not exist.playbooks/tools/export_template.py: turns a playbook into a template file through the public API (GET /v1/symphony/playbooks/{uuid}, "View playbooks" permission), removes the accounts of the community and sets a newuuid. Standard library only..github: workflow running the check on pull requests, onmainand every Monday (an action can change in automation-library after a template is merged); pull request template; issue forms for template ideas and broken templates.playbooks/templates/playbooks.json: the editor has listed templates from the platform API since July 2024 and the platform skips this file. It had drifted (16 of 41 entries differed from their template) and caused most merge conflicts.Tested
export_template.pyexported a real playbook from FRA1; the file had no account left and passed both the check and the platform validation (the test file was not added).Before and after merging
main, the check still reports one error until Update Enrich_alerts_with_AbuseIPDB.json #166 (AbuseIPDB,node.9does not exist) is rebased and merged. On this pull request it is shown as a warning, as the file is not touched here.playbooks.json.🤖 Generated with Claude Code