Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2565,6 +2565,24 @@ schemas and the `paramify` CLI — not the internal code.
read, and `instances_in_failover_group` when any instance's failover group
membership is unknown.

- **`azure_aks_cluster_configuration` 0.5.0, `azure_redis_cache_configuration`
0.3.0, `azure_managed_redis_configuration` 0.3.0 and
`azure_rbac_custom_roles` 0.3.0: a list that could not be read gives null
counts, not 0.**
- When the cluster, cache or role definition list is not read, every count,
percentage and list built from it in the summary is null (including
`total_clusters`, `total_caches`, `total_role_definitions` and
`custom_role_definitions`). Before they read 0 or empty. The run still
exits 1 as `partial_failure`.
- `azure_redis_cache_configuration`: the 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 they
left that cache out.
- `azure_managed_redis_configuration`: the database counts and
`tls_only_clusters` (and its percentage) are null while any cluster's
database list could not be read. Before they left that cluster out.

- **`paramify upload` no longer sends an inventory direct when its channel has
no artifact request.** A Paramify inventory pipeline runs only on a file in an
approved batch, so a direct upload was stored and built nothing. The file now
Expand Down
11 changes: 8 additions & 3 deletions fetchers/azure/aks_cluster_configuration/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,13 @@ def cluster_record(cluster: dict) -> dict:
}


def summarize(clusters: list[dict]) -> dict:
"""Coverage counts across the cluster estate, one per Prowler AKS check."""
def summarize(clusters: list[dict] | None) -> dict:
"""Coverage counts across the cluster estate, one per Prowler AKS check.

`clusters` None means the list could not be read: every count is null, never 0.
"""
if clusters is None:
return dict.fromkeys(summarize([]))
total = len(clusters)
private = sum(1 for c in clusters if c["private_cluster"])
restricted = sum(1 for c in clusters if c["api_server_access_restricted"])
Expand Down Expand Up @@ -419,7 +424,7 @@ def main() -> int:
"excluded": excluded,
},
summary={
**summarize(clusters),
**summarize(clusters if listed else None),
"provider_registration_status": registration,
**exclusions.summary(excluded, KINDS, {"clusters": len(clusters) if listed else None}),
},
Expand Down
12 changes: 6 additions & 6 deletions fetchers/azure/aks_cluster_configuration/fetcher.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: azure_aks_cluster_configuration
version: 0.4.0
version: 0.5.0
description: >-
Shows whether each AKS cluster's API server is private or IP-restricted, who can sign in, and whether it has network policy, auto-upgrade, Defender and Azure Monitor.
category: azure
Expand Down Expand Up @@ -88,9 +88,9 @@ evidence_set:
- in_scope_clusters — Number of clusters read and in scope; 0 means there are none or the patterns took out every cluster; null when the cluster list could not be read

Which clusters and node pools were checked?
- total_clusters — Number of in-scope AKS clusters, including clusters still provisioning or in a failed state; every count below about clusters is out of this total; reads 0, not null, when the cluster list could not be read, so read it together with in_scope_clusters
- total_agent_pools — Number of node pools (agent pools) across the in-scope clusters; 0 when the cluster list could not be read
- kubernetes_versions — List of the distinct Kubernetes versions the clusters are set to run (the requested version, which an upgrade in progress may not have reached yet), sorted
- total_clusters — Number of in-scope AKS clusters, including clusters still provisioning or in a failed state; every count below about clusters is out of this total; null when the cluster list could not be read, as is every count below
- total_agent_pools — Number of node pools (agent pools) across the in-scope clusters; null when the cluster list could not be read
- kubernetes_versions — List of the distinct Kubernetes versions the clusters are set to run (the requested version, which an upgrade in progress may not have reached yet), sorted; null when the cluster list could not be read
- provider_registration_status — Whether the AKS provider (Microsoft.ContainerService) is registered on the subscription: registered, not_registered or unknown

Is the API server kept off the internet?
Expand Down Expand Up @@ -121,11 +121,11 @@ evidence_set:
- fips_enabled_agent_pools — Number of node pools running the FIPS-enabled node image
- fips_disabled_agent_pools — Number of node pools Azure reports as not running the FIPS-enabled node image
- fips_unknown_agent_pools — Number of node pools whose FIPS setting Azure did not return; counted apart, never as FIPS-disabled
- all_agent_pools_fips — True if every node pool runs the FIPS image; false if any pool is FIPS-disabled and none is unknown; null if any pool's FIPS setting is unknown, or there are no node pools
- all_agent_pools_fips — True if every node pool runs the FIPS image; false if any pool is FIPS-disabled and none is unknown; null if any pool's FIPS setting is unknown, there are no node pools, or the cluster list could not be read
- secure_boot_enabled_agent_pools — Number of node pools with Trusted Launch secure boot turned on
- vtpm_enabled_agent_pools — Number of node pools with a virtual TPM (vTPM) turned on
- trusted_launch_unknown_agent_pools — Number of node pools for which Azure returned neither the secure boot nor the vTPM setting
- ssh_disabled_agent_pools — Number of node pools with SSH access to the nodes disabled
- ssh_local_user_agent_pools — Number of node pools whose nodes allow SSH as a local user
- ssh_access_unknown_agent_pools — Number of node pools whose SSH access setting Azure did not return
- node_image_versions — List of the distinct node image builds across all node pools, sorted; several builds mean some pools run older images
- node_image_versions — List of the distinct node image builds across all node pools, sorted; several builds mean some pools run older images; null when the cluster list could not be read
35 changes: 21 additions & 14 deletions fetchers/azure/managed_redis_configuration/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,23 @@ def cluster_record(cluster: dict, databases) -> dict:
}


def summarize(clusters: list[dict]) -> dict:
"""Counts per posture property; databases are counted across every cluster."""
def summarize(clusters: list[dict] | None) -> dict:
"""Counts per posture property; databases are counted across every cluster.

`clusters` None means the list could not be read: every count is null, never 0. A count built
from the databases is null while any cluster's database list could not be read.
"""
if clusters is None:
return dict.fromkeys(summarize([]))
all_read = all(c["databases_read"] for c in clusters)
total = len(clusters)
dbs = [d for c in clusters for d in c["databases"]]
tls_only = sum(1 for c in clusters if c["tls_only"] is True)
return {
"total_clusters": total,
"total_databases": len(dbs),
"tls_only_clusters": tls_only,
"tls_only_percentage": coverage_percentage(tls_only, total),
"total_databases": len(dbs) if all_read else None,
"tls_only_clusters": tls_only if all_read else None,
"tls_only_percentage": coverage_percentage(tls_only, total) if all_read else None,
"recommended_minimum_tls_clusters": sum(
1 for c in clusters if c["minimum_tls_version_recommended"]
),
Expand All @@ -163,14 +170,14 @@ def summarize(clusters: list[dict]) -> dict:
"public_network_access_unset_clusters": sum(
1 for c in clusters if c.get("public_network_access") is None
),
"encrypted_protocol_databases": sum(1 for d in dbs if d["client_protocol_encrypted"]),
"plaintext_protocol_databases": sum(1 for d in dbs if not d["client_protocol_encrypted"]),
"access_keys_disabled_databases": sum(
1 for d in dbs if d["access_keys_authentication_disabled"]
),
"access_keys_enabled_databases": sum(
1 for d in dbs if not d["access_keys_authentication_disabled"]
),
"encrypted_protocol_databases": (
sum(1 for d in dbs if d["client_protocol_encrypted"]) if all_read else None),
"plaintext_protocol_databases": (
sum(1 for d in dbs if not d["client_protocol_encrypted"]) if all_read else None),
"access_keys_disabled_databases": (
sum(1 for d in dbs if d["access_keys_authentication_disabled"]) if all_read else None),
"access_keys_enabled_databases": (
sum(1 for d in dbs if not d["access_keys_authentication_disabled"]) if all_read else None),
}


Expand Down Expand Up @@ -267,7 +274,7 @@ def main() -> int:
collector=collector,
results={"redis_clusters": clusters, "provider_registration_status": registration, "excluded": excluded},
summary={
**summarize(clusters),
**summarize(clusters if listed else None),
"provider_registration_status": registration,
**exclusions.summary(excluded, ("redis_cluster",), {"redis_clusters": len(clusters) if listed else None}),
},
Expand Down
18 changes: 9 additions & 9 deletions fetchers/azure/managed_redis_configuration/fetcher.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: azure_managed_redis_configuration
version: 0.2.1
version: 0.3.0
description: >-
Shows each Azure Managed Redis cluster's transport and access posture: minimum TLS version, public network access, private endpoints, customer-managed-key encryption, and per database the client protocol and key authentication.
category: azure
Expand Down Expand Up @@ -88,17 +88,17 @@ evidence_set:
- in_scope_redis_clusters — Number of clusters read and in scope; null when the cluster list could not be read; 0 means there are none or the patterns took out every cluster, which a check can catch by requiring more than 0

Which clusters and databases exist?
- total_clusters — Number of in-scope clusters; every cluster count below is out of this total; reads 0, not null, when the cluster list could not be read, so read it together with in_scope_redis_clusters
- total_databases — Number of databases read across the in-scope clusters; clusters whose database list could not be read add none
- total_clusters — Number of in-scope clusters; every cluster count below is out of this total; null when the cluster list could not be read, as is every count below
- total_databases — Number of databases read across the in-scope clusters; null when the cluster list, or any cluster's database list, could not be read
- provider_registration_status — Whether the Redis provider (Microsoft.Cache) is registered on the subscription: registered, not_registered or unknown
- databases_unread_clusters — Number of clusters whose database list could not be read, so both per-cluster verdicts are null: tls_only (minimum TLS 1.2 or higher, at least one database, and every database Encrypted) and entra_only (at least one database, and every database with access-key authentication Disabled)

Is traffic encrypted?
- tls_only_clusters — Number of clusters with a minimum TLS version of 1.2 or higher, at least one database, and every database accepting only encrypted client connections; clusters whose database list could not be read are not counted
- tls_only_percentage — Percentage of clusters that are TLS-only = tls_only_clusters / total_clusters × 100 (a whole number, rounded down; reads 0 when total_clusters is 0); clusters whose database list could not be read count in the total but never as TLS-only
- tls_only_clusters — Number of clusters with a minimum TLS version of 1.2 or higher, at least one database, and every database accepting only encrypted client connections; null when the cluster list, or any cluster's database list, could not be read
- tls_only_percentage — Percentage of clusters that are TLS-only = tls_only_clusters / total_clusters × 100 (a whole number, rounded down; reads 0 when total_clusters is 0); null when the cluster list, or any cluster's database list, could not be read
- recommended_minimum_tls_clusters — Number of clusters whose minimum TLS version is 1.2 or 1.3; a cluster with no minimum version is not counted
- encrypted_protocol_databases — Number of databases whose client protocol is Encrypted (TLS only)
- plaintext_protocol_databases — Number of databases that do not require an encrypted client protocol (Plaintext, which accepts non-TLS connections, or no protocol reported)
- encrypted_protocol_databases — Number of databases whose client protocol is Encrypted (TLS only); null when the cluster list, or any cluster's database list, could not be read
- plaintext_protocol_databases — Number of databases that do not require an encrypted client protocol (Plaintext, which accepts non-TLS connections, or no protocol reported); null when the cluster list, or any cluster's database list, could not be read
- customer_managed_key_clusters — Number of clusters encrypted with a customer-managed key

Who can reach the clusters?
Expand All @@ -107,5 +107,5 @@ evidence_set:
- private_only_clusters — Number of clusters with public network access Disabled and at least one Approved private endpoint connection

How do clients authenticate?
- access_keys_disabled_databases — Number of databases with access-key authentication Disabled, so only Microsoft Entra ID can be used
- access_keys_enabled_databases — Number of databases not reporting access-key authentication Disabled, including those reporting nothing, which are treated as Enabled (the service default before 2024)
- access_keys_disabled_databases — Number of databases with access-key authentication Disabled, so only Microsoft Entra ID can be used; null when the cluster list, or any cluster's database list, could not be read
- access_keys_enabled_databases — Number of databases not reporting access-key authentication Disabled, including those reporting nothing, which are treated as Enabled (the service default before 2024); null when the cluster list, or any cluster's database list, could not be read
9 changes: 6 additions & 3 deletions fetchers/azure/rbac_custom_roles/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,16 @@ def split_custom_roles(roles: list[dict], exclusions: ResourceExclusions) -> tup
return kept, excluded


def summarize(custom_roles: list[dict], total_definitions: int, excluded_custom_roles: int = 0) -> dict:
def summarize(custom_roles: list[dict] | None, total_definitions: int, excluded_custom_roles: int = 0) -> dict:
"""Escalation-capable custom roles are the headline.

`total_role_definitions` and `builtin_role_definitions` are reported alongside so
`custom_role_definitions: 0` is legible: a non-zero built-in count proves the list
call worked rather than returning nothing.
call worked rather than returning nothing. `custom_roles` None means the list could not be
read: every count is null, never 0.
"""
if custom_roles is None:
return dict.fromkeys(summarize([], 0))
escalating = [r for r in custom_roles if r["can_escalate_privileges"]]
return {
"total_role_definitions": total_definitions,
Expand Down Expand Up @@ -427,7 +430,7 @@ def main() -> int:
"excluded": excluded,
},
summary={
**summarize(custom_roles, total_definitions, len(excluded)),
**summarize(custom_roles if listed else None, total_definitions, len(excluded)),
"provider_registration_status": registration,
**counts,
},
Expand Down
10 changes: 5 additions & 5 deletions fetchers/azure/rbac_custom_roles/fetcher.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: azure_rbac_custom_roles
version: 0.2.2
version: 0.3.0
description: >-
Lists every custom Azure role in the subscription with its permissions, flagging wildcards and permissions that let a holder grant itself more access.
category: azure
Expand Down Expand Up @@ -82,9 +82,9 @@ evidence_set:
Summary fields:

What was checked?
- total_role_definitions — Number of role definitions listed for the subscription, built-in, custom and excluded; 0 when the list could not be read
- builtin_role_definitions — Number of built-in role definitions; above 0 shows the list was read even when there are no custom roles; 0 when the list could not be read
- custom_role_definitions — Number of custom role definitions in scope; every count and percentage below covers only these, so when the role list could not be read this and every custom_roles_*, owner_equivalent_*, contributor_equivalent_* and least_privilege_* field below reads 0, and custom_roles_with_escalation_names is empty
- total_role_definitions — Number of role definitions listed for the subscription, built-in, custom and excluded; null when the list could not be read
- builtin_role_definitions — Number of built-in role definitions; above 0 shows the list was read even when there are no custom roles; null when the list could not be read
- custom_role_definitions — Number of custom role definitions in scope; every count and percentage below covers only these, so when the role list could not be read this and every custom_roles_*, owner_equivalent_*, contributor_equivalent_* and least_privilege_* field below is null
- provider_registration_status — Whether Microsoft.Authorization is registered on the subscription: registered, not_registered or unknown

Which custom roles are left out of scope?
Expand All @@ -97,7 +97,7 @@ evidence_set:
- custom_roles_with_privilege_escalation — Number of custom roles that grant at least one escalation permission: writing role assignments, role definitions or deny assignments. A role grants a permission when one of its actions matches it, with * matching any text including / (so */write and Microsoft.Authorization/* both match), and no notAction in the same permission block removes it; data actions are not checked
- custom_roles_that_can_assign_roles — Number of custom roles that grant Microsoft.Authorization/roleAssignments/write, so a holder can assign any role, Owner included, to anyone
- custom_roles_that_can_write_role_definitions — Number of custom roles that grant Microsoft.Authorization/roleDefinitions/write, so a holder can rewrite a role it already holds
- custom_roles_with_escalation_names — List of the names of custom roles that grant an escalation permission
- custom_roles_with_escalation_names — List of the names of custom roles that grant an escalation permission; null when the role list could not be read

How broad are custom roles?
- custom_roles_with_wildcard_actions — Number of custom roles with * anywhere in an action or data action, such as *, */read or Microsoft.Compute/*
Expand Down
Loading
Loading