Skip to content

Org-wide asset register roll-up, scheduled daily (#116) - #166

Open
ms280690 wants to merge 2 commits into
issue-115-asset-inventoryfrom
issue-116-asset-register
Open

ms280690 wants to merge 2 commits into
issue-115-asset-inventoryfrom
issue-116-asset-register

Conversation

@ms280690

Copy link
Copy Markdown
Collaborator

Closes #116. Stacked on #165 (issue-115-asset-inventory) for the inventory schema and DOT renderer; retarget once that merges.

What

  • .github/actions/asset-register/rollup.py (stdlib; imports the grouping and DOT code from the sibling asset-inventory/inventory.py): merges one inventory.json per repository into assets.json (per-repo rows with generated_at, stack_kind, counts, age_days, stale; every resource record with repo and unowned_reason), owners.md, unowned.md (tag violations, or a team-* owner not in policies/tags/teams.yml; @sparkgeo.com owners pass), data-classes.md (confidential and restricted only), register.dot/register.svg (nodes labelled with their repo), summary.md and SHA256SUMS. Unreadable inventories are skipped with a warning. Outputs repo-count, unowned-count, stale-count, summary-path; exit 0 always.
  • policies/tags/teams.yml: starts as teams: [], which accepts any team-* owner; fill in the real team names after merge so unknown teams surface in unowned.md.
  • Composite asset-register (installs graphviz if missing, uses the bundled team list by default).
  • asset-register-rollup.yml: daily plus workflow_dispatch, this repo only, contents: write and issues: write. Mints a read-only token with actions/create-github-app-token (contents: read, metadata: read) from ASSET_REGISTER_APP_ID and ASSET_REGISTER_APP_PRIVATE_KEY, falling back to GITHUB_TOKEN with a warning (public repos only). Lists non-archived org repos, downloads inventory.json and SHA256SUMS from each asset-inventory-latest release, verifies with sha256sum -c --ignore-missing, runs the composite, publishes asset-register-latest and asset-register-YYYY-MM-DD (same recreate-and-prune shell as the threat-feeds mirror, 90 kept), and opens or comments on "Asset register: unowned or stale assets" while anything is unowned or stale, closing it on a clean run. zizmor's github-app audit is ignored on the owner: line with the reason: the register has to read every repository, and the token is read-only with the minimum two permissions.
  • Docs: register format, auditor retrieval of a dated snapshot, and the App setup (org-admin item) in docs/asset-inventory.md; actions/create-github-app-token row in docs/approved-actions.md; README rows and section.
  • CI Asset Register job: fixture suite plus the composite on the fixtures with output, SVG and checksum assertions.

Tests

tests/asset-register/run.sh: three fixture repositories (fresh and clean; fresh with a violation; 22 days old with an owner outside the team list and an email owner), merged counts and ordering, unowned reasons, stale warning, owners.md, unowned.md and data-classes.md rows, summary heading, DOT snapshot, SHA256SUMS round-trip, no team list, --stale-days 30, empty input, and a broken inventory.json.

Deferred

🤖 Generated with Claude Code

https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF

rollup.py merges the inventory.json published by every repository's
asset-inventory-latest release into one register: assets.json with the
repo attached to each record, owners.md (assets per owner, project and
environment), unowned.md (tag violations or a team-* owner missing from
policies/tags/teams.yml), data-classes.md (confidential and restricted),
the org diagram through the asset-inventory renderer, summary.md and
SHA256SUMS. Inventories older than stale-days are flagged.

asset-register-rollup.yml runs daily: a read-only GitHub App token (falling
back to GITHUB_TOKEN for public repositories) lists the org's repositories,
downloads and checksum-verifies each inventory, runs the composite,
publishes asset-register-latest plus a dated tag with 90 retained, and
opens, updates or closes the "Asset register: unowned or stale assets"
issue. Nothing in the run can write to a consuming repository.

policies/tags/teams.yml starts empty, which accepts any team-* owner until
the real team names are filled in.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
@ms280690 ms280690 self-assigned this Oct 12, 2026
Comment thread tests/asset-register/run.sh Fixed
Comment thread tests/asset-register/run.sh Fixed
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