Skip to content

atomic_svc: heal a missing enterprise-attack.json even when repo is up to date#68

Merged
deacon-mp merged 1 commit into
masterfrom
fix/atomic-stix-heal
May 20, 2026
Merged

atomic_svc: heal a missing enterprise-attack.json even when repo is up to date#68
deacon-mp merged 1 commit into
masterfrom
fix/atomic-stix-heal

Conversation

@deacon-mp
Copy link
Copy Markdown
Contributor

Problem

PR #67 added a startup refresh, but it only ran git reset --hard when the ART checkout was behind upstream. If enterprise-attack.json was deleted while the repo was already at the latest commit, the refresh returned early and the STIX was never restored. The plugin then fell back to importing every ability under the redcanary-unknown tactic instead of its real ATT&CK tactic.

Fix

After the fetch/update step, if atomic_red_team/enterprise-attack.json is missing, restore it with git checkout -- <path> from the local object store. This needs no network, so it also heals an offline checkout, and it covers any other deleted tracked file too.

Testing (live server)

  • Delete only enterprise-attack.json (repo present + up to date), restart:
    • before: STIX stayed gone; 1754 abilities all collapsed into redcanary-unknown (1 tactic dir).
    • after: STIX restored (45 MB) from local objects; 1754 abilities re-imported across all 15 tactics.
  • Whole-repo-missing path (clone) and behind-upstream path (reset) both still verified working.

🤖 Generated with Claude Code

…date

The startup refresh only ran 'git reset --hard' when the ART checkout was
behind upstream, so a deleted enterprise-attack.json was NOT restored when the
repo was already at the latest commit. The plugin then imported every ability
under the 'redcanary-unknown' tactic instead of its real ATT&CK tactic.

Restore the STIX (and any other deleted tracked file) via 'git checkout' from
the local object store whenever it is found missing after the fetch/update
step. This needs no network, so it also heals an offline checkout.

Verified: deleting only enterprise-attack.json (repo present, up to date) now
restores it on boot and re-imports 1754 abilities across all 15 tactics rather
than collapsing them into redcanary-unknown.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@deacon-mp deacon-mp merged commit f2e11e1 into master May 20, 2026
1 check passed
@deacon-mp deacon-mp deleted the fix/atomic-stix-heal branch May 20, 2026 14:57
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.

1 participant