talonctl 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. talonctl-0.1.0/.crowdstrike/.gitkeep +0 -0
  2. talonctl-0.1.0/.github/dependabot.yml +11 -0
  3. talonctl-0.1.0/.github/workflows/ci.yml +56 -0
  4. talonctl-0.1.0/.github/workflows/release.yml +94 -0
  5. talonctl-0.1.0/.gitignore +45 -0
  6. talonctl-0.1.0/CLAUDE.md +139 -0
  7. talonctl-0.1.0/LICENSE +21 -0
  8. talonctl-0.1.0/PKG-INFO +170 -0
  9. talonctl-0.1.0/README.md +145 -0
  10. talonctl-0.1.0/docs/handoffs/.gitkeep +0 -0
  11. talonctl-0.1.0/docs/hunts/.gitkeep +0 -0
  12. talonctl-0.1.0/docs/investigations/README.md +26 -0
  13. talonctl-0.1.0/docs/investigations/TEMPLATE.md +51 -0
  14. talonctl-0.1.0/examples/resources/README.md +30 -0
  15. talonctl-0.1.0/examples/resources/detection.yaml +69 -0
  16. talonctl-0.1.0/examples/resources/lookup_file.yaml +16 -0
  17. talonctl-0.1.0/examples/resources/rtr_put_file.yaml +13 -0
  18. talonctl-0.1.0/examples/resources/rtr_script.yaml +13 -0
  19. talonctl-0.1.0/examples/resources/saved_search_function.yaml +100 -0
  20. talonctl-0.1.0/examples/resources/saved_search_hunting.yaml +22 -0
  21. talonctl-0.1.0/examples/resources/workflow.yaml +29 -0
  22. talonctl-0.1.0/pyproject.toml +59 -0
  23. talonctl-0.1.0/src/talonctl/__init__.py +12 -0
  24. talonctl-0.1.0/src/talonctl/_version.py +24 -0
  25. talonctl-0.1.0/src/talonctl/cli.py +66 -0
  26. talonctl-0.1.0/src/talonctl/commands/__init__.py +1 -0
  27. talonctl-0.1.0/src/talonctl/commands/_common.py +107 -0
  28. talonctl-0.1.0/src/talonctl/commands/apply.py +105 -0
  29. talonctl-0.1.0/src/talonctl/commands/auth.py +134 -0
  30. talonctl-0.1.0/src/talonctl/commands/backup.py +309 -0
  31. talonctl-0.1.0/src/talonctl/commands/destroy.py +14 -0
  32. talonctl-0.1.0/src/talonctl/commands/discover.py +16 -0
  33. talonctl-0.1.0/src/talonctl/commands/drift.py +47 -0
  34. talonctl-0.1.0/src/talonctl/commands/health.py +297 -0
  35. talonctl-0.1.0/src/talonctl/commands/import_cmd.py +82 -0
  36. talonctl-0.1.0/src/talonctl/commands/init.py +77 -0
  37. talonctl-0.1.0/src/talonctl/commands/metrics.py +309 -0
  38. talonctl-0.1.0/src/talonctl/commands/plan.py +68 -0
  39. talonctl-0.1.0/src/talonctl/commands/publish.py +89 -0
  40. talonctl-0.1.0/src/talonctl/commands/show.py +66 -0
  41. talonctl-0.1.0/src/talonctl/commands/sync.py +82 -0
  42. talonctl-0.1.0/src/talonctl/commands/validate.py +43 -0
  43. talonctl-0.1.0/src/talonctl/commands/validate_query.py +75 -0
  44. talonctl-0.1.0/src/talonctl/core/README.md +251 -0
  45. talonctl-0.1.0/src/talonctl/core/__init__.py +62 -0
  46. talonctl-0.1.0/src/talonctl/core/base_provider.py +330 -0
  47. talonctl-0.1.0/src/talonctl/core/dependency_validator.py +142 -0
  48. talonctl-0.1.0/src/talonctl/core/deploy_lock.py +92 -0
  49. talonctl-0.1.0/src/talonctl/core/deployment_orchestrator.py +1389 -0
  50. talonctl-0.1.0/src/talonctl/core/deployment_strategies.py +408 -0
  51. talonctl-0.1.0/src/talonctl/core/drift_detector.py +425 -0
  52. talonctl-0.1.0/src/talonctl/core/plan_formatter.py +590 -0
  53. talonctl-0.1.0/src/talonctl/core/provider_adapter.py +792 -0
  54. talonctl-0.1.0/src/talonctl/core/provider_registry.py +189 -0
  55. talonctl-0.1.0/src/talonctl/core/resource_graph.py +288 -0
  56. talonctl-0.1.0/src/talonctl/core/state_manager.py +659 -0
  57. talonctl-0.1.0/src/talonctl/core/state_synchronizer.py +380 -0
  58. talonctl-0.1.0/src/talonctl/core/template_discovery.py +348 -0
  59. talonctl-0.1.0/src/talonctl/core/template_library.py +993 -0
  60. talonctl-0.1.0/src/talonctl/project.py +29 -0
  61. talonctl-0.1.0/src/talonctl/providers/README.md +790 -0
  62. talonctl-0.1.0/src/talonctl/providers/__init__.py +31 -0
  63. talonctl-0.1.0/src/talonctl/providers/dashboard_provider.py +499 -0
  64. talonctl-0.1.0/src/talonctl/providers/detection_provider.py +1116 -0
  65. talonctl-0.1.0/src/talonctl/providers/lookup_file_provider.py +637 -0
  66. talonctl-0.1.0/src/talonctl/providers/rtr_put_file_provider.py +583 -0
  67. talonctl-0.1.0/src/talonctl/providers/rtr_script_provider.py +688 -0
  68. talonctl-0.1.0/src/talonctl/providers/saved_search_provider.py +766 -0
  69. talonctl-0.1.0/src/talonctl/providers/workflow_provider.py +510 -0
  70. talonctl-0.1.0/src/talonctl/templates/init/gitignore +34 -0
  71. talonctl-0.1.0/src/talonctl/templates/init/knowledge/INDEX.md +19 -0
  72. talonctl-0.1.0/src/talonctl/templates/init/knowledge/context/environmental-context.md +18 -0
  73. talonctl-0.1.0/src/talonctl/templates/init/knowledge/ideas/detection-ideas.md +12 -0
  74. talonctl-0.1.0/src/talonctl/templates/init/knowledge/metrics/detection-metrics.jsonl +0 -0
  75. talonctl-0.1.0/src/talonctl/templates/init/knowledge/techniques/investigation-techniques.md +15 -0
  76. talonctl-0.1.0/src/talonctl/templates/init/knowledge/tuning/tuning-backlog.md +12 -0
  77. talonctl-0.1.0/src/talonctl/templates/init/knowledge/tuning/tuning-log.md +11 -0
  78. talonctl-0.1.0/src/talonctl/utils/__init__.py +0 -0
  79. talonctl-0.1.0/src/talonctl/utils/auth.py +67 -0
  80. talonctl-0.1.0/src/talonctl/utils/find_duplicate_rules.py +379 -0
  81. talonctl-0.1.0/src/talonctl/utils/mitre_processor.py +263 -0
  82. talonctl-0.1.0/src/talonctl/utils/ngsiem_client.py +488 -0
  83. talonctl-0.1.0/src/talonctl/utils/ngsiem_files.py +311 -0
  84. talonctl-0.1.0/src/talonctl/utils/template_matcher.py +318 -0
  85. talonctl-0.1.0/tests/__init__.py +3 -0
  86. talonctl-0.1.0/tests/conftest.py +1 -0
  87. talonctl-0.1.0/tests/test_dashboard_provider.py +548 -0
  88. talonctl-0.1.0/tests/unit/__init__.py +3 -0
  89. talonctl-0.1.0/tests/unit/test_auth_command.py +52 -0
  90. talonctl-0.1.0/tests/unit/test_backup_command.py +43 -0
  91. talonctl-0.1.0/tests/unit/test_dependency_validator.py +119 -0
  92. talonctl-0.1.0/tests/unit/test_deploy_lock.py +84 -0
  93. talonctl-0.1.0/tests/unit/test_deployment_orchestrator.py +915 -0
  94. talonctl-0.1.0/tests/unit/test_detection_health.py +222 -0
  95. talonctl-0.1.0/tests/unit/test_detection_provider.py +519 -0
  96. talonctl-0.1.0/tests/unit/test_health_command.py +65 -0
  97. talonctl-0.1.0/tests/unit/test_init_command.py +61 -0
  98. talonctl-0.1.0/tests/unit/test_lookup_file_provider.py +352 -0
  99. talonctl-0.1.0/tests/unit/test_metrics_command.py +56 -0
  100. talonctl-0.1.0/tests/unit/test_project.py +31 -0
  101. talonctl-0.1.0/tests/unit/test_provider_adapter.py +221 -0
  102. talonctl-0.1.0/tests/unit/test_resource_graph.py +213 -0
  103. talonctl-0.1.0/tests/unit/test_rtr_put_file_provider.py +409 -0
  104. talonctl-0.1.0/tests/unit/test_rtr_script_provider.py +545 -0
  105. talonctl-0.1.0/tests/unit/test_saved_search_provider.py +448 -0
  106. talonctl-0.1.0/tests/unit/test_soc_metrics.py +97 -0
  107. talonctl-0.1.0/tests/unit/test_state_manager.py +232 -0
  108. talonctl-0.1.0/tests/unit/test_state_synchronizer.py +172 -0
  109. talonctl-0.1.0/tests/unit/test_template_discovery.py +363 -0
  110. talonctl-0.1.0/tests/unit/test_version.py +21 -0
  111. talonctl-0.1.0/tests/unit/test_workflow_provider.py +320 -0
File without changes
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,56 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ lint:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.11"
20
+ - name: Install dependencies
21
+ run: pip install -e .[dev]
22
+ - name: Check linting
23
+ run: ruff check src/ tests/ --exclude src/talonctl/_version.py
24
+ - name: Check formatting
25
+ run: ruff format --check src/ tests/ --exclude src/talonctl/_version.py
26
+
27
+ test:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: "3.11"
34
+ - name: Install dependencies
35
+ run: pip install -e .[dev]
36
+ - name: Run tests
37
+ run: pytest tests/ -v --tb=short
38
+
39
+ smoke:
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ - uses: actions/setup-python@v5
44
+ with:
45
+ python-version: "3.11"
46
+ - name: Install package
47
+ run: pip install -e .
48
+ - name: Smoke test — CLI help
49
+ run: talonctl --help
50
+ - name: Smoke test — version
51
+ run: talonctl --version
52
+ - name: Smoke test — init and validate
53
+ run: |
54
+ talonctl init /tmp/smoke-test
55
+ cd /tmp/smoke-test
56
+ talonctl validate
@@ -0,0 +1,94 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ lint:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+ - name: Install dependencies
21
+ run: pip install -e .[dev]
22
+ - name: Check linting
23
+ run: ruff check src/ tests/ --exclude src/talonctl/_version.py
24
+ - name: Check formatting
25
+ run: ruff format --check src/ tests/ --exclude src/talonctl/_version.py
26
+
27
+ test:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 0
33
+ - uses: actions/setup-python@v5
34
+ with:
35
+ python-version: "3.12"
36
+ - name: Install dependencies
37
+ run: pip install -e .[dev]
38
+ - name: Run tests
39
+ run: pytest tests/ -v --tb=short
40
+
41
+ build:
42
+ needs: [lint, test]
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ with:
47
+ fetch-depth: 0
48
+ - uses: actions/setup-python@v5
49
+ with:
50
+ python-version: "3.12"
51
+ - name: Install build tools
52
+ run: pip install build
53
+ - name: Build sdist and wheel
54
+ run: python -m build
55
+ - name: Verify package version matches tag
56
+ run: |
57
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
58
+ PKG_VERSION=$(python -c "
59
+ import pathlib
60
+ whl = next(pathlib.Path('dist').glob('*.whl'))
61
+ print(whl.name.split('-')[1])
62
+ ")
63
+ if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
64
+ echo "::error::Version mismatch: built package is '$PKG_VERSION' but tag is 'v$TAG_VERSION'"
65
+ exit 1
66
+ fi
67
+ echo "Version verified: $TAG_VERSION"
68
+ - uses: actions/upload-artifact@v4
69
+ with:
70
+ name: dist
71
+ path: dist/
72
+
73
+ publish-pypi:
74
+ needs: [build]
75
+ runs-on: ubuntu-latest
76
+ environment: pypi
77
+ permissions:
78
+ id-token: write
79
+ steps:
80
+ - uses: actions/download-artifact@v4
81
+ with:
82
+ name: dist
83
+ path: dist/
84
+ - uses: pypa/gh-action-pypi-publish@release/v1
85
+
86
+ release:
87
+ needs: [build]
88
+ runs-on: ubuntu-latest
89
+ steps:
90
+ - uses: actions/checkout@v4
91
+ - name: Create GitHub Release
92
+ run: gh release create "$GITHUB_REF_NAME" --generate-notes
93
+ env:
94
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,45 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ *.egg
9
+ venv/
10
+ .venv/
11
+
12
+ # IDE
13
+ .vscode/
14
+ .idea/
15
+ *.swp
16
+ *.swo
17
+
18
+ # WSL artifacts
19
+ *:Zone.Identifier
20
+
21
+ # Project state (user-specific, created by setup/import)
22
+ .crowdstrike/deployed_state.json
23
+ .crowdstrike/backups/
24
+ data/
25
+ discovery_results.json
26
+
27
+ # Credentials (NEVER commit)
28
+ credentials.json
29
+
30
+ # Superpowers plans and specs (local working docs)
31
+ docs/superpowers/plans/
32
+ docs/superpowers/specs/
33
+
34
+ # OS
35
+ .DS_Store
36
+ Thumbs.db
37
+
38
+ # docs/superpowers (specs, plans — working documents, not committed)
39
+ docs/superpowers/
40
+ # Handoff docs (ephemeral working artifacts between skills)
41
+ docs/handoffs/
42
+ !docs/handoffs/.gitkeep
43
+
44
+ # hatch-vcs generated version file
45
+ src/talonctl/_version.py
@@ -0,0 +1,139 @@
1
+ # talonctl -- Project Instructions
2
+
3
+ Pip-installable CLI tool for CrowdStrike NGSIEM infrastructure as code. Terraform-like plan/apply for detection rules, saved searches, dashboards, workflows, lookup files, and RTR resources.
4
+
5
+ ## Project Overview
6
+
7
+ This repo is the **tool** -- a pip-installable Python package. It does not contain detection templates, knowledge bases, or project-specific content. Those live in user projects (e.g., [talonctl-demo](https://github.com/willwebster5/talonctl-demo)).
8
+
9
+ - **Seven resource types** -- detections, saved searches, dashboards, workflows, lookup files, RTR scripts, RTR put files
10
+ - **Terraform-like lifecycle** -- validate, plan, apply, import, sync, drift
11
+ - **State management** -- tracks deployed resources and their CrowdStrike API IDs
12
+ - **Scaffolding** -- `talonctl init` creates new projects with the correct directory structure
13
+
14
+ ## Package Structure
15
+
16
+ ```
17
+ talonctl/
18
+ ├── pyproject.toml # Package configuration (pip install -e .[dev])
19
+ ├── src/talonctl/ # Package source
20
+ │ ├── __init__.py # Version
21
+ │ ├── cli.py # Click CLI entry point
22
+ │ ├── project.py # Project root finder
23
+ │ ├── commands/ # CLI command modules
24
+ │ │ ├── auth.py # talonctl auth (setup + check)
25
+ │ │ ├── health.py # talonctl health (detection health check)
26
+ │ │ ├── metrics.py # talonctl metrics (update-detections + update-kpis)
27
+ │ │ ├── backup.py # talonctl backup (create, list, restore)
28
+ │ │ ├── validate.py # talonctl validate
29
+ │ │ ├── plan.py # talonctl plan
30
+ │ │ ├── apply.py # talonctl apply
31
+ │ │ ├── show.py # talonctl show
32
+ │ │ ├── sync.py # talonctl sync
33
+ │ │ ├── drift.py # talonctl drift
34
+ │ │ ├── destroy.py # talonctl destroy
35
+ │ │ ├── import_cmd.py # talonctl import
36
+ │ │ ├── publish.py # talonctl publish
37
+ │ │ ├── validate_query.py # talonctl validate-query
38
+ │ │ ├── init.py # talonctl init
39
+ │ │ ├── discover.py # talonctl discover
40
+ │ │ └── _common.py # Shared CLI helpers
41
+ │ ├── core/ # Orchestrator, state, plan, drift, template discovery
42
+ │ ├── providers/ # Per-resource-type API adapters
43
+ │ ├── utils/ # Auth, NGSIEM client, MITRE processor
44
+ │ └── templates/ # Scaffolding templates for `talonctl init`
45
+ ├── .crowdstrike/ # Empty state placeholder (for development)
46
+ ├── examples/resources/ # Format reference templates (7 YAML + README)
47
+ └── tests/ # Unit tests (pytest)
48
+ ```
49
+
50
+ ## CLI Command Reference
51
+
52
+ ```bash
53
+ # IaC lifecycle
54
+ talonctl validate # Validate all templates (no API calls)
55
+ talonctl plan # Preview what would change
56
+ talonctl apply # Deploy changes
57
+ talonctl import --plan # Preview importing existing resources
58
+ talonctl sync # Reconcile state with live tenant
59
+ talonctl drift # Detect manual console changes
60
+ talonctl show # Show current state
61
+ talonctl destroy # Destroy managed resources
62
+
63
+ # Credential management
64
+ talonctl auth setup # Interactive credential setup wizard
65
+ talonctl auth check # Verify stored credentials
66
+
67
+ # Operational
68
+ talonctl health # Detection health check
69
+ talonctl health --format json -o r.json # Export health report
70
+ talonctl metrics update-detections --report r.json # Update detection metrics CSV
71
+ talonctl metrics update-kpis --report r.json # Update KPI CSV
72
+ talonctl backup create # Create state backup (GitHub Release)
73
+ talonctl backup list # List available backups
74
+ talonctl backup restore <tag> # Restore from backup
75
+
76
+ # Scaffolding
77
+ talonctl init myproject # Create a new project
78
+ talonctl discover # Find new detection templates
79
+ ```
80
+
81
+ ## Development
82
+
83
+ ### Running Tests
84
+
85
+ ```bash
86
+ python3 -m venv .venv
87
+ source .venv/bin/activate
88
+ pip install -e .[dev]
89
+ pytest tests/ -v
90
+ ```
91
+
92
+ ### Adding a New CLI Command
93
+
94
+ 1. Create `src/talonctl/commands/mycommand.py` with a Click command or group
95
+ 2. Import the shared `console` from `talonctl.commands._common`
96
+ 3. Register in `src/talonctl/cli.py`: import and `cli.add_command()`
97
+ 4. Add tests in `tests/unit/test_mycommand.py` using `click.testing.CliRunner`
98
+ 5. Run `pytest tests/unit/test_mycommand.py -v`
99
+
100
+ ### Adding a New Resource Type
101
+
102
+ 1. Create a provider in `src/talonctl/providers/` implementing the `ProviderAdapter` interface
103
+ 2. Register the provider in `src/talonctl/core/__init__.py`
104
+ 3. Add a format reference template in `examples/resources/`
105
+ 4. Add the resource type to `talonctl init` scaffolding templates
106
+
107
+ ### Format Reference Templates
108
+
109
+ `examples/resources/` contains annotated YAML examples for every resource type. These serve as documentation for template authors -- they are NOT deployed. Each example shows all supported fields with comments.
110
+
111
+ ### Init Template Scaffolding
112
+
113
+ `src/talonctl/templates/init/` contains the directory structure and files created by `talonctl init`. Changes here affect all new projects.
114
+
115
+ ## Critical Concepts
116
+
117
+ ### resource_id vs name
118
+
119
+ - **`resource_id`** -- stable key in the state file. Once deployed, **never change this**. Changing it = destroy + recreate.
120
+ - **`name`** -- display name in the Falcon console. Can be updated freely.
121
+
122
+ ### State File
123
+
124
+ - Location: `.crowdstrike/deployed_state.json` (in user projects)
125
+ - Format version: v3.0
126
+ - Do not edit manually -- use `sync` to reconcile
127
+
128
+ ## Credentials
129
+
130
+ - **Location:** `~/.config/falcon/credentials.json`
131
+ - **Setup:** `talonctl auth setup`
132
+ - **Never commit credentials.**
133
+
134
+ ## Production Rules
135
+
136
+ 1. **Always plan before apply.** Never blind-deploy.
137
+ 2. **Never change `resource_id` after deploy.**
138
+ 3. **Saved search description limit: 2000 characters.** The API silently truncates.
139
+ 4. **Validate CQL syntax** before committing: `talonctl validate-query --template <path>`
talonctl-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Will Webster
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,170 @@
1
+ Metadata-Version: 2.4
2
+ Name: talonctl
3
+ Version: 0.1.0
4
+ Summary: Infrastructure as code for CrowdStrike NGSIEM
5
+ Author: Will Webster
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Keywords: crowdstrike,detection-as-code,ngsiem,security
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Information Technology
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Topic :: Security
15
+ Requires-Python: >=3.11
16
+ Requires-Dist: click>=8.0.0
17
+ Requires-Dist: crowdstrike-falconpy>=1.6.1
18
+ Requires-Dist: pyyaml>=6.0
19
+ Requires-Dist: requests>=2.28.0
20
+ Requires-Dist: rich>=13.0.0
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
23
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
24
+ Description-Content-Type: text/markdown
25
+
26
+ # talonctl
27
+
28
+ Infrastructure as code for CrowdStrike. Manage detections, workflows, saved searches, and more with a Terraform-like lifecycle.
29
+
30
+ ## What This Is
31
+
32
+ A pip-installable CLI tool for managing CrowdStrike NGSIEM resources as code. It started as the deployment engine behind an AI-assisted SOC project and works just as well standalone. If you use CrowdStrike NG-SIEM and want version-controlled, CI/CD-deployed resources -- this is it.
33
+
34
+ What you get:
35
+ - **Terraform-like deployment** -- plan/apply/import/drift/sync for CrowdStrike NGSIEM resources
36
+ - **Seven resource types** -- detections, saved searches, dashboards, workflows, lookup files, RTR scripts, RTR put files
37
+ - **State management** -- tracks deployed resources, content hashes, and CrowdStrike API IDs
38
+ - **Dependency resolution** -- DAG-based ordering so resources deploy in the right sequence
39
+ - **Drift detection** -- catch manual console changes that diverge from your templates
40
+ - **Project scaffolding** -- `talonctl init` creates new projects with the correct directory structure
41
+
42
+ ## Getting Started
43
+
44
+ ```bash
45
+ # Install
46
+ python3 -m venv .venv
47
+ source .venv/bin/activate
48
+ pip install talonctl
49
+
50
+ # Scaffold a new project
51
+ talonctl init myproject
52
+ cd myproject
53
+
54
+ # Configure credentials
55
+ talonctl auth setup
56
+
57
+ # Import your existing detections
58
+ talonctl import --plan # preview what would be imported
59
+ talonctl import --resources=detection # import detection rules
60
+
61
+ # Plan and deploy
62
+ talonctl plan # preview changes
63
+ talonctl apply # deploy
64
+ ```
65
+
66
+ For a working example project, see [talonctl-demo](https://github.com/willwebster5/talonctl-demo).
67
+
68
+ ## Commands
69
+
70
+ ### IaC Lifecycle
71
+
72
+ ```bash
73
+ talonctl validate # Check templates (no API calls)
74
+ talonctl plan # Preview changes
75
+ talonctl apply # Deploy changes
76
+ talonctl import # Onboard existing resources
77
+ talonctl import --plan # Preview import
78
+ talonctl sync # Reconcile state with tenant
79
+ talonctl drift # Detect manual console changes
80
+ talonctl show # Display current state
81
+ talonctl init # Scaffold a new project
82
+ talonctl validate-query # Validate CQL syntax
83
+ talonctl publish # Activate inactive detection rules
84
+ talonctl discover # Find new detection templates
85
+ ```
86
+
87
+ ### Credential Management
88
+
89
+ ```bash
90
+ talonctl auth setup # Interactive credential setup wizard
91
+ talonctl auth check # Verify stored credentials
92
+ ```
93
+
94
+ ### Operational
95
+
96
+ ```bash
97
+ talonctl health # Detection health check
98
+ talonctl health --format json -o r.json # Export health report
99
+ talonctl metrics update-detections --report r.json # Update detection metrics CSV
100
+ talonctl metrics update-kpis --report r.json # Update KPI CSV
101
+ talonctl backup create # Create state backup (GitHub Release)
102
+ talonctl backup list # List available backups
103
+ talonctl backup restore <tag> # Restore from backup
104
+ ```
105
+
106
+ ## What It Manages
107
+
108
+ | Resource Type | Template Dir | Description |
109
+ |--------------|-------------|-------------|
110
+ | Detection | `resources/detections/` | Correlation rules (CQL queries with severity, MITRE mapping) |
111
+ | Saved Search | `resources/saved_searches/` | Reusable CQL functions called with `$function_name()` |
112
+ | Dashboard | `resources/dashboards/` | LogScale dashboards with sections and widgets |
113
+ | Workflow | `resources/workflows/` | Falcon Fusion automation workflows |
114
+ | Lookup File | `resources/lookup_files/` | CSV lookup tables for enrichment |
115
+ | RTR Script | `resources/rtr_scripts/` | Real Time Response scripts |
116
+ | RTR Put File | `resources/rtr_put_files/` | Files pushed to endpoints via RTR |
117
+
118
+ ## Prerequisites
119
+
120
+ - CrowdStrike Falcon tenant with NG-SIEM (LogScale)
121
+ - Python 3.11+
122
+ - CrowdStrike API credentials (Falcon Console > Support & Resources > API Clients and Keys)
123
+
124
+ ## Required API Scopes
125
+
126
+ ### By Resource Type
127
+
128
+ | Resource Type | Read (plan/sync/drift/import) | Write (apply) |
129
+ |--------------|-------------------------------|---------------|
130
+ | Detection | `correlation-rules:read` | `correlation-rules:write` |
131
+ | Saved Search | `ngsiem:read` | `ngsiem:write` |
132
+ | Dashboard | `ngsiem:read` | `ngsiem:write` |
133
+ | Lookup File | `ngsiem:read` | `ngsiem:write` |
134
+ | Workflow | `workflow:read` | `workflow:write` |
135
+ | RTR Script | `real-time-response-admin:write` | `real-time-response-admin:write` |
136
+ | RTR Put File | `real-time-response-admin:write` | `real-time-response-admin:write` |
137
+
138
+ ### Minimum Scopes by Workflow
139
+
140
+ | Workflow | Scopes |
141
+ |----------|--------|
142
+ | **Just detections** (plan/apply) | `correlation-rules:read`, `correlation-rules:write` |
143
+ | **Detections + saved searches** | Above + `ngsiem:read`, `ngsiem:write` |
144
+ | **Full IaC** (all resource types) | All read + write scopes above |
145
+ | **Import only** (onboarding) | Read scopes for target resource types |
146
+
147
+ ## Ecosystem
148
+
149
+ talonctl was built alongside a set of AI-assisted security skills and a CrowdStrike MCP server. Together they form a detection engineering and SOC operations toolkit:
150
+
151
+ - **[talonctl-demo](https://github.com/willwebster5/talonctl-demo)** -- Working example project with saved searches, lookup files, knowledge base, and CI/CD workflows
152
+ - **[agent-skills](https://github.com/willwebster5/agent-skills)** -- Claude Code plugins for SOC triage, detection engineering, threat hunting, and more
153
+ - **[crowdstrike-mcp](https://github.com/willwebster5/crowdstrike-mcp)** -- MCP server for querying alerts, running CQL, host lookup, and case management
154
+
155
+ ## Development
156
+
157
+ ```bash
158
+ git clone https://github.com/willwebster5/talonctl.git
159
+ cd talonctl
160
+ python3 -m venv .venv
161
+ source .venv/bin/activate
162
+ pip install -e .[dev]
163
+ pytest tests/ -v
164
+ ```
165
+
166
+ Format reference templates are in `examples/resources/` -- annotated YAML examples for every resource type.
167
+
168
+ ## License
169
+
170
+ MIT -- do whatever you want, no warranty, no liability. See [LICENSE](LICENSE).
@@ -0,0 +1,145 @@
1
+ # talonctl
2
+
3
+ Infrastructure as code for CrowdStrike. Manage detections, workflows, saved searches, and more with a Terraform-like lifecycle.
4
+
5
+ ## What This Is
6
+
7
+ A pip-installable CLI tool for managing CrowdStrike NGSIEM resources as code. It started as the deployment engine behind an AI-assisted SOC project and works just as well standalone. If you use CrowdStrike NG-SIEM and want version-controlled, CI/CD-deployed resources -- this is it.
8
+
9
+ What you get:
10
+ - **Terraform-like deployment** -- plan/apply/import/drift/sync for CrowdStrike NGSIEM resources
11
+ - **Seven resource types** -- detections, saved searches, dashboards, workflows, lookup files, RTR scripts, RTR put files
12
+ - **State management** -- tracks deployed resources, content hashes, and CrowdStrike API IDs
13
+ - **Dependency resolution** -- DAG-based ordering so resources deploy in the right sequence
14
+ - **Drift detection** -- catch manual console changes that diverge from your templates
15
+ - **Project scaffolding** -- `talonctl init` creates new projects with the correct directory structure
16
+
17
+ ## Getting Started
18
+
19
+ ```bash
20
+ # Install
21
+ python3 -m venv .venv
22
+ source .venv/bin/activate
23
+ pip install talonctl
24
+
25
+ # Scaffold a new project
26
+ talonctl init myproject
27
+ cd myproject
28
+
29
+ # Configure credentials
30
+ talonctl auth setup
31
+
32
+ # Import your existing detections
33
+ talonctl import --plan # preview what would be imported
34
+ talonctl import --resources=detection # import detection rules
35
+
36
+ # Plan and deploy
37
+ talonctl plan # preview changes
38
+ talonctl apply # deploy
39
+ ```
40
+
41
+ For a working example project, see [talonctl-demo](https://github.com/willwebster5/talonctl-demo).
42
+
43
+ ## Commands
44
+
45
+ ### IaC Lifecycle
46
+
47
+ ```bash
48
+ talonctl validate # Check templates (no API calls)
49
+ talonctl plan # Preview changes
50
+ talonctl apply # Deploy changes
51
+ talonctl import # Onboard existing resources
52
+ talonctl import --plan # Preview import
53
+ talonctl sync # Reconcile state with tenant
54
+ talonctl drift # Detect manual console changes
55
+ talonctl show # Display current state
56
+ talonctl init # Scaffold a new project
57
+ talonctl validate-query # Validate CQL syntax
58
+ talonctl publish # Activate inactive detection rules
59
+ talonctl discover # Find new detection templates
60
+ ```
61
+
62
+ ### Credential Management
63
+
64
+ ```bash
65
+ talonctl auth setup # Interactive credential setup wizard
66
+ talonctl auth check # Verify stored credentials
67
+ ```
68
+
69
+ ### Operational
70
+
71
+ ```bash
72
+ talonctl health # Detection health check
73
+ talonctl health --format json -o r.json # Export health report
74
+ talonctl metrics update-detections --report r.json # Update detection metrics CSV
75
+ talonctl metrics update-kpis --report r.json # Update KPI CSV
76
+ talonctl backup create # Create state backup (GitHub Release)
77
+ talonctl backup list # List available backups
78
+ talonctl backup restore <tag> # Restore from backup
79
+ ```
80
+
81
+ ## What It Manages
82
+
83
+ | Resource Type | Template Dir | Description |
84
+ |--------------|-------------|-------------|
85
+ | Detection | `resources/detections/` | Correlation rules (CQL queries with severity, MITRE mapping) |
86
+ | Saved Search | `resources/saved_searches/` | Reusable CQL functions called with `$function_name()` |
87
+ | Dashboard | `resources/dashboards/` | LogScale dashboards with sections and widgets |
88
+ | Workflow | `resources/workflows/` | Falcon Fusion automation workflows |
89
+ | Lookup File | `resources/lookup_files/` | CSV lookup tables for enrichment |
90
+ | RTR Script | `resources/rtr_scripts/` | Real Time Response scripts |
91
+ | RTR Put File | `resources/rtr_put_files/` | Files pushed to endpoints via RTR |
92
+
93
+ ## Prerequisites
94
+
95
+ - CrowdStrike Falcon tenant with NG-SIEM (LogScale)
96
+ - Python 3.11+
97
+ - CrowdStrike API credentials (Falcon Console > Support & Resources > API Clients and Keys)
98
+
99
+ ## Required API Scopes
100
+
101
+ ### By Resource Type
102
+
103
+ | Resource Type | Read (plan/sync/drift/import) | Write (apply) |
104
+ |--------------|-------------------------------|---------------|
105
+ | Detection | `correlation-rules:read` | `correlation-rules:write` |
106
+ | Saved Search | `ngsiem:read` | `ngsiem:write` |
107
+ | Dashboard | `ngsiem:read` | `ngsiem:write` |
108
+ | Lookup File | `ngsiem:read` | `ngsiem:write` |
109
+ | Workflow | `workflow:read` | `workflow:write` |
110
+ | RTR Script | `real-time-response-admin:write` | `real-time-response-admin:write` |
111
+ | RTR Put File | `real-time-response-admin:write` | `real-time-response-admin:write` |
112
+
113
+ ### Minimum Scopes by Workflow
114
+
115
+ | Workflow | Scopes |
116
+ |----------|--------|
117
+ | **Just detections** (plan/apply) | `correlation-rules:read`, `correlation-rules:write` |
118
+ | **Detections + saved searches** | Above + `ngsiem:read`, `ngsiem:write` |
119
+ | **Full IaC** (all resource types) | All read + write scopes above |
120
+ | **Import only** (onboarding) | Read scopes for target resource types |
121
+
122
+ ## Ecosystem
123
+
124
+ talonctl was built alongside a set of AI-assisted security skills and a CrowdStrike MCP server. Together they form a detection engineering and SOC operations toolkit:
125
+
126
+ - **[talonctl-demo](https://github.com/willwebster5/talonctl-demo)** -- Working example project with saved searches, lookup files, knowledge base, and CI/CD workflows
127
+ - **[agent-skills](https://github.com/willwebster5/agent-skills)** -- Claude Code plugins for SOC triage, detection engineering, threat hunting, and more
128
+ - **[crowdstrike-mcp](https://github.com/willwebster5/crowdstrike-mcp)** -- MCP server for querying alerts, running CQL, host lookup, and case management
129
+
130
+ ## Development
131
+
132
+ ```bash
133
+ git clone https://github.com/willwebster5/talonctl.git
134
+ cd talonctl
135
+ python3 -m venv .venv
136
+ source .venv/bin/activate
137
+ pip install -e .[dev]
138
+ pytest tests/ -v
139
+ ```
140
+
141
+ Format reference templates are in `examples/resources/` -- annotated YAML examples for every resource type.
142
+
143
+ ## License
144
+
145
+ MIT -- do whatever you want, no warranty, no liability. See [LICENSE](LICENSE).
File without changes