mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-05 21:07:43 +00:00
refactor(logging): standardize concurrency and trusted proxy events (#3417)
* refactor(logging): standardize concurrency and proxy events * chore(logging): extend guardrails for concurrency and proxies * feat(skill): add rustfs logging governance skill
This commit is contained in:
@@ -18,6 +18,21 @@ checked_files=(
|
||||
"crates/ecstore/src/store/peer.rs"
|
||||
"crates/ecstore/src/store/init.rs"
|
||||
"crates/ecstore/src/tier/tier.rs"
|
||||
"crates/concurrency/src/workers.rs"
|
||||
"crates/concurrency/src/manager.rs"
|
||||
"crates/concurrency/src/lock.rs"
|
||||
"crates/concurrency/src/deadlock.rs"
|
||||
"crates/trusted-proxies/src/global.rs"
|
||||
"crates/trusted-proxies/src/config/loader.rs"
|
||||
"crates/trusted-proxies/src/proxy/metrics.rs"
|
||||
"crates/trusted-proxies/src/proxy/validator.rs"
|
||||
"crates/trusted-proxies/src/proxy/chain.rs"
|
||||
"crates/trusted-proxies/src/middleware/service.rs"
|
||||
"crates/trusted-proxies/src/cloud/detector.rs"
|
||||
"crates/trusted-proxies/src/cloud/ranges.rs"
|
||||
"crates/trusted-proxies/src/cloud/metadata/aws.rs"
|
||||
"crates/trusted-proxies/src/cloud/metadata/azure.rs"
|
||||
"crates/trusted-proxies/src/cloud/metadata/gcp.rs"
|
||||
)
|
||||
|
||||
forbidden_patterns=(
|
||||
@@ -111,6 +126,95 @@ forbidden_patterns=(
|
||||
'warn!("KMS initialization skipped: {e}")'
|
||||
'warn!("Audit system: {e}")'
|
||||
'warn!("notification system: {e}")'
|
||||
'info!("worker take, {}", *available)'
|
||||
'info!("worker give, {}", *available)'
|
||||
'info!("worker wait end")'
|
||||
'"Concurrency manager started (timeout={}, lock={}, deadlock={}, backpressure={}, scheduler={})"'
|
||||
'info!("Concurrency manager stopped")'
|
||||
'info!("Deadlock detection started")'
|
||||
'info!("Deadlock detection stopped")'
|
||||
'"Lock released early (optimization active)"'
|
||||
'"Lock released on drop (normal release)"'
|
||||
'info!("Trusted Proxies module is disabled via configuration")'
|
||||
'info!("Trusted Proxies module initialized")'
|
||||
'info!("Configuration loaded successfully from environment variables")'
|
||||
'warn!("Failed to load configuration from environment: {}. Using defaults", e)'
|
||||
'info!("=== Application Configuration ===")'
|
||||
'info!("Server: {}", config.server_addr)'
|
||||
'info!("Trusted Proxies: {}", config.proxy.proxies.len())'
|
||||
'info!("Validation Mode: {:?}", config.proxy.validation_mode)'
|
||||
'info!("Cache Capacity: {}", config.cache.capacity)'
|
||||
'info!("Metrics Enabled: {}", config.monitoring.metrics_enabled)'
|
||||
'info!("Cloud Metadata: {}", config.cloud.metadata_enabled)'
|
||||
'info!("Failed validations will be logged")'
|
||||
'debug!("Trusted networks: {:?}", config.proxy.get_network_strings())'
|
||||
'info!("Metrics collection is disabled")'
|
||||
'info!("Proxy metrics enabled for application: {}", self.app_name)'
|
||||
'info!("Available metrics:")'
|
||||
'debug!("SocketAddr extension is missing; skipping trusted proxy evaluation")'
|
||||
'debug!("Peer address is unspecified; skipping trusted proxy evaluation")'
|
||||
'debug!("Request received from trusted proxy: {}", peer_ip)'
|
||||
'"Request from private network but not trusted: {}. This might indicate a configuration issue."'
|
||||
'debug!("No Tokio runtime available; trusted proxy cache maintenance is disabled")'
|
||||
'trace!("Analyzing proxy chain: {:?} with current proxy: {}", proxy_chain, current_proxy_ip)'
|
||||
'debug!("Trusted proxy middleware is disabled")'
|
||||
'debug!("Proxy validation successful in {:?}", duration)'
|
||||
'debug!("Unrecoverable proxy validation error: {}", err)'
|
||||
'debug!("Cloud metadata fetching is disabled")'
|
||||
'info!("Detected AWS environment, fetching metadata")'
|
||||
'info!("Detected Azure environment, fetching metadata")'
|
||||
'info!("Detected GCP environment, fetching metadata")'
|
||||
'info!("Detected Cloudflare environment")'
|
||||
'info!("Detected DigitalOcean environment")'
|
||||
'warn!("Unknown cloud provider detected: {}", name)'
|
||||
'debug!("No cloud provider detected")'
|
||||
'debug!("Trying to fetch metadata from {}", provider_name)'
|
||||
'info!("Fetched {} IP ranges from {}", ranges.len(), provider_name)'
|
||||
'debug!("Failed to fetch metadata from {}: {}", provider_name, e)'
|
||||
'warn!("Failed to fetch network CIDRs from {}: {}", self.provider_name(), e)'
|
||||
'warn!("Failed to fetch public IP ranges from {}: {}", self.provider_name(), e)'
|
||||
'info!("Loaded {} static Cloudflare IP ranges", networks.len())'
|
||||
'debug!("Fetched {} IP ranges from {}", networks.len(), url)'
|
||||
'debug!("Failed to parse IP ranges from {}: {}", url, e)'
|
||||
'debug!("Failed to fetch IP ranges from {}: HTTP {}", url, response.status())'
|
||||
'debug!("Failed to fetch from {}: {}", url, e)'
|
||||
'info!("Successfully fetched {} Cloudflare IP ranges from API", all_ranges.len())'
|
||||
'info!("Loaded {} static DigitalOcean IP ranges", networks.len())'
|
||||
'info!("Successfully fetched {} Google Cloud IP ranges from API", networks.len())'
|
||||
'debug!("Failed to fetch Google IP ranges: HTTP {}", response.status())'
|
||||
'debug!("Failed to fetch Google IP ranges: {}", e)'
|
||||
'debug!("IMDSv2 token request failed with status: {}", response.status())'
|
||||
'debug!("IMDSv2 token request failed: {}", e)'
|
||||
'debug!("Using default AWS VPC network ranges")'
|
||||
'info!("Successfully fetched {} AWS public IP ranges", networks.len())'
|
||||
'debug!("Failed to fetch AWS IP ranges: HTTP {}", response.status())'
|
||||
'debug!("Failed to fetch AWS IP ranges: {}", e)'
|
||||
'debug!("Fetching Azure metadata from: {}", url)'
|
||||
'debug!("Azure metadata request failed with status: {}", response.status())'
|
||||
'debug!("Azure metadata request failed: {}", e)'
|
||||
'debug!("Fetching Azure IP ranges from: {}", url)'
|
||||
'info!("Successfully fetched {} Azure public IP ranges", networks.len())'
|
||||
'debug!("Failed to fetch Azure IP ranges: HTTP {}", response.status())'
|
||||
'debug!("Failed to fetch Azure IP ranges: {}", e)'
|
||||
'debug!("Using default Azure public IP ranges")'
|
||||
'info!("Successfully fetched {} network CIDRs from Azure metadata", cidrs.len())'
|
||||
'debug!("No network CIDRs found in Azure metadata, falling back to defaults")'
|
||||
'warn!("Failed to fetch Azure network metadata: {}", e)'
|
||||
'debug!("Using default Azure VNet network ranges")'
|
||||
'debug!("Fetching GCP metadata from: {}", url)'
|
||||
'debug!("GCP metadata request failed with status: {}", response.status())'
|
||||
'debug!("GCP metadata request failed: {}", e)'
|
||||
'warn!("No network interfaces found in GCP metadata")'
|
||||
'debug!("Failed to get IP/mask for GCP interface {}: {}", index, e)'
|
||||
'warn!("Could not determine network CIDRs from GCP metadata, falling back to defaults")'
|
||||
'info!("Successfully fetched {} network CIDRs from GCP metadata", cidrs.len())'
|
||||
'warn!("Failed to fetch GCP network metadata: {}", e)'
|
||||
'debug!("Fetching GCP IP ranges from: {}", url)'
|
||||
'info!("Successfully fetched {} GCP public IP ranges", networks.len())'
|
||||
'debug!("Failed to fetch GCP IP ranges: HTTP {}", response.status())'
|
||||
'debug!("Failed to fetch GCP IP ranges: {}", e)'
|
||||
'debug!("Using default GCP public IP ranges")'
|
||||
'debug!("Using default GCP VPC network ranges")'
|
||||
)
|
||||
|
||||
for pattern in "${forbidden_patterns[@]}"; do
|
||||
|
||||
Reference in New Issue
Block a user