nodetool invalidatecidrpermissionscache
Cassandra 5.0+
This command is available in Cassandra 5.0 and later.
Invalidates the CIDR permissions cache on the node.
Synopsis
Section titled “Synopsis”nodetool [connection_options] invalidatecidrpermissionscacheSee connection options for connection options.
Description
Section titled “Description”nodetool invalidatecidrpermissionscache clears the cached CIDR authorization decisions on the node. This forces re-evaluation of CIDR-based permissions for subsequent connection attempts.
The CIDR permissions cache stores the results of IP-to-CIDR-group lookups to improve authorization performance. Invalidating this cache is necessary after modifying CIDR groups to ensure changes take effect immediately.
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”nodetool invalidatecidrpermissionscacheAfter CIDR Group Changes
Section titled “After CIDR Group Changes”# Update CIDR groupnodetool updatecidrgroup app_servers '10.100.0.0/16,10.101.0.0/16'
# Invalidate cache to apply changes immediatelynodetool invalidatecidrpermissionscacheAfter Dropping a CIDR Group
Section titled “After Dropping a CIDR Group”# Remove CIDR groupnodetool dropcidrgroup deprecated_network
# Clear cachenodetool invalidatecidrpermissionscacheCluster-Wide Invalidation
Section titled “Cluster-Wide Invalidation”# Run on all nodes for cluster-wide effectfor host in node1 node2 node3; do ssh "$host" "nodetool invalidatecidrpermissionscache"doneWhen to Use
Section titled “When to Use”After CIDR Configuration Changes
Section titled “After CIDR Configuration Changes”# After any CIDR group modificationnodetool updatecidrgroup new_network '10.200.0.0/16'nodetool invalidatecidrpermissionscacheAlways invalidate the cache after:
- Creating new CIDR groups
- Updating CIDR group ranges
- Dropping CIDR groups
- Modifying role-to-CIDR associations
Immediate Security Response
Section titled “Immediate Security Response”# Block compromised network immediatelynodetool dropcidrgroup compromised_subnetnodetool invalidatecidrpermissionscacheDuring security incidents, invalidate the cache to ensure access revocations take effect immediately.
Troubleshooting Authorization Issues
Section titled “Troubleshooting Authorization Issues”# Clear cache to rule out stale datanodetool invalidatecidrpermissionscache
# Test connection from affected IPnodetool getcidrgroupsofip 10.50.100.25Best Practices
Section titled “Best Practices”Cache Invalidation Guidelines
- Run on affected nodes - Execute on all nodes where clients connect
- Include in change procedures - Always invalidate after CIDR modifications
- Monitor after invalidation - Watch for authorization issues after cache clear
- Consider timing - Cache invalidation may briefly increase authorization latency
Non-Persistent Setting
This is a runtime operation only. The cache will automatically rebuild as new authorization checks occur. No configuration changes are persisted.
Cache Behavior
- Cache entries expire based on
permissions_validitysetting - Invalidation clears all cached CIDR authorization decisions
- New entries are cached as clients reconnect or new checks occur
- High connection rates may see brief latency increase after invalidation
Performance Considerations
Section titled “Performance Considerations”After invalidating the cache:
- First authorization check for each IP requires full evaluation
- Cache rebuilds automatically as checks occur
- Brief increase in authorization latency is normal
- Monitor
cidrfilteringstatsfor cache performance metrics
# Check cache performance after invalidationnodetool cidrfilteringstatsRelated Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| cidrfilteringstats | View cache statistics |
| listcidrgroups | List CIDR groups |
| updatecidrgroup | Modify CIDR groups |
| dropcidrgroup | Remove CIDR groups |
| reloadcidrgroupscache | Reload groups from storage |
| invalidatepermissionscache | Clear role permissions cache |