Skip to content

AKS, Redis and custom role fetchers: an unread list gives null counts, not 0 - #367

Merged
bruceweygandt merged 5 commits into
mainfrom
fde-1200
Nov 16, 2026
Merged

bruceweygandt merged 5 commits into
mainfrom
fde-1200

Conversation

@Controgon

Copy link
Copy Markdown
Contributor

Fixes FDE-1200
Part of FDE-1190

Summary

When a fetcher can't read a list (a 403, throttling, a timeout), every total, count and percentage built from it is now null, never 0. Partial failure is still set as before (exit 1). Same rule and pattern as #335, #336 and #339.

  • azure_aks_cluster_configuration 0.5.0: all summary counts, percentages and lists (kubernetes_versions, node_image_versions) are null when the cluster list could not be read. Before, total_clusters and every count read 0 and the lists were empty.
  • azure_redis_cache_configuration 0.3.0: all summary counts, caches_by_sku, caches_by_redis_version and exceptions are null when the cache list could not be read. Counts built from a per-cache read (access_policy_assignments, firewall_allows_all_ips_caches, audit_logging_enabled_caches, maintenance_window_caches, geo_replicated_caches) are null while any cache's read failed; before, that cache was left out of the count.
  • azure_managed_redis_configuration 0.3.0: all summary counts are null when the cluster list could not be read. The database counts, tls_only_clusters and tls_only_percentage are null while any cluster's database list could not be read.
  • azure_rbac_custom_roles 0.3.0: all summary counts (total_role_definitions, builtin_role_definitions, custom_role_definitions and every count below) and custom_roles_with_escalation_names are null when the role definition list could not be read.

A list that was read and is empty still gives 0 (or []). The plain-text instructions in each fetcher.yaml now say which counts are null and when. CHANGELOG entry under Unreleased > Fixed.

Tests

tests/test_azure_unread_lists_null_counts.py (synthetic data only):

  • Each fetcher's main() run with its top-level list refused: every summary count is null (the exclusion fields are covered by existing tests) and the run exits 1.
  • Redis cache: one parametrized case per per-cache read (firewall rules, access policy assignments, patch schedule, linked servers, diagnostic settings) refused for one of two caches: the matching count is null, the others stay numbers.
  • Managed Redis: one cluster's database list refused: database counts and TLS-only counts are null.
  • Read-but-empty lists still give numbers.

The new tests fail on origin/main's fetcher code (10 of 11 fail; verified with a temporary revert commit) and pass with the fix. Also run: test_contracts.py, test_azure_aks_node_security.py, test_azure_resource_exclusions_{compute,databases,references}.py, test_azure_sdk_surface.py (1608 passed), including the assert_summary_documented checks.

Validator check

No validator on main reads these fetchers. On added-validators, nine do:

  • azure_rbac_custom_roles_no_all_actions_or_root_scope, azure_rbac_custom_roles_no_privilege_escalation, azure_redis_all_clusters_private_only, azure_redis_all_clusters_tls_only: each regex needs a digit in the summary field (and partial_failure false, or a total of 1 or more), so a null value does not match, as 0 did not before. Verdict unchanged, checked with each regex in Node against null and 0 summaries.
  • azure_redis_all_clusters_zone_redundant, azure_redis_client_protocol_present, azure_redis_geo_replication_field_present, azure_redis_no_plaintext_databases, azure_redis_redundancy_fields_present: read per-cluster or per-database fields under results, not the summary. Unaffected.

🤖 Generated with Claude Code

Controgon and others added 3 commits November 13, 2026 14:51
…be read

A cluster, cache or role definition list that could not be read left every
summary count at 0 or empty. Each count built from it is now null, as is each
count built from a per-cache or per-cluster read that failed. The run still
fails as before.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

# Conflicts:
#	CHANGELOG.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Controgon and others added 2 commits November 16, 2026 10:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CHANGELOG.md: keep both Fixed entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@bruceweygandt bruceweygandt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. An unread cluster, cache or role list now nulls every summary field, and a failed per-cache or per-cluster read nulls the counts built from it. Text, versions and CHANGELOG match the code. I merged main (CHANGELOG conflict with #366: both entries kept); the full suite passes.

@bruceweygandt
bruceweygandt merged commit f6271f4 into main Nov 16, 2026
16 checks passed
@bruceweygandt
bruceweygandt deleted the fde-1200 branch November 16, 2026 19:04
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