Skip to content
Open
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
4 changes: 2 additions & 2 deletions metrics/servicediscovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package metrics

import (
"context"
"crypto/sha1" // #nosec G505
"crypto/sha256"
"encoding/json"
"fmt"
"log/slog"
Expand Down Expand Up @@ -41,7 +41,7 @@ func (sd *AzureServiceDiscovery) fetchResourceList(subscriptionId, filter string
// nolint:gosec
cacheKey := fmt.Sprintf(
"%x",
sha1.Sum([]byte(fmt.Sprintf("%v:%v", subscriptionId, filter))),
sha256.Sum256([]byte(fmt.Sprintf("%v:%v", subscriptionId, filter))),
)

// try to fetch info from cache
Expand Down
4 changes: 2 additions & 2 deletions probe_metrics_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"context"
"crypto/sha1" // #nosec G505
"crypto/sha256"
"fmt"
"log/slog"
"net/http"
Expand Down Expand Up @@ -54,7 +54,7 @@ func probeMetricsListHandler(w http.ResponseWriter, r *http.Request) {
prober.SetAzureResourceTagManager(AzureResourceTagManager)
prober.SetPrometheusRegistry(registry)
if settings.Cache != nil {
cacheKey := fmt.Sprintf("list:%x", sha1.Sum([]byte(r.URL.String()))) // #nosec G401
cacheKey := fmt.Sprintf("list:%x", sha256.Sum256([]byte(r.URL.String())))
prober.EnableMetricsCache(metricsCache, cacheKey, settings.CacheDuration(startTime))
}

Expand Down
4 changes: 2 additions & 2 deletions probe_metrics_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"context"
"crypto/sha1" // #nosec G505
"crypto/sha256"
"fmt"
"log/slog"
"net/http"
Expand Down Expand Up @@ -54,7 +54,7 @@ func probeMetricsResourceHandler(w http.ResponseWriter, r *http.Request) {
prober.SetAzureResourceTagManager(AzureResourceTagManager)
prober.SetPrometheusRegistry(registry)
if settings.Cache != nil {
cacheKey := fmt.Sprintf("resource:%x", sha1.Sum([]byte(r.URL.String()))) // #nosec G401
cacheKey := fmt.Sprintf("resource:%x", sha256.Sum256([]byte(r.URL.String())))
prober.EnableMetricsCache(metricsCache, cacheKey, settings.CacheDuration(startTime))
}

Expand Down
4 changes: 2 additions & 2 deletions probe_metrics_resourcegraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"context"
"crypto/sha1" // #nosec G505
"crypto/sha256"
"fmt"
"log/slog"
"net/http"
Expand Down Expand Up @@ -61,7 +61,7 @@ func probeMetricsResourceGraphHandler(w http.ResponseWriter, r *http.Request) {
prober.SetAzureResourceTagManager(AzureResourceTagManager)
prober.SetPrometheusRegistry(registry)
if settings.Cache != nil {
cacheKey := fmt.Sprintf("scrape:%x", sha1.Sum([]byte(r.URL.String()))) // #nosec G401
cacheKey := fmt.Sprintf("scrape:%x", sha256.Sum256([]byte(r.URL.String())))
prober.EnableMetricsCache(metricsCache, cacheKey, settings.CacheDuration(startTime))
}

Expand Down
4 changes: 2 additions & 2 deletions probe_metrics_scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"context"
"crypto/sha1" // #nosec G505
"crypto/sha256"
"fmt"
"log/slog"
"net/http"
Expand Down Expand Up @@ -66,7 +66,7 @@ func probeMetricsScrapeHandler(w http.ResponseWriter, r *http.Request) {
prober.SetAzureResourceTagManager(AzureResourceTagManager)
prober.SetPrometheusRegistry(registry)
if settings.Cache != nil {
cacheKey := fmt.Sprintf("scrape:%x", sha1.Sum([]byte(r.URL.String()))) // #nosec G401
cacheKey := fmt.Sprintf("scrape:%x", sha256.Sum256([]byte(r.URL.String())))
prober.EnableMetricsCache(metricsCache, cacheKey, settings.CacheDuration(startTime))
}

Expand Down
4 changes: 2 additions & 2 deletions probe_metrics_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"context"
"crypto/sha1" // #nosec G505
"crypto/sha256"
"fmt"
"log/slog"
"net/http"
Expand Down Expand Up @@ -54,7 +54,7 @@ func probeMetricsSubscriptionHandler(w http.ResponseWriter, r *http.Request) {
prober.SetAzureResourceTagManager(AzureResourceTagManager)
prober.SetPrometheusRegistry(registry)
if settings.Cache != nil {
cacheKey := fmt.Sprintf("list:%x", sha1.Sum([]byte(r.URL.String()))) // #nosec G401
cacheKey := fmt.Sprintf("list:%x", sha256.Sum256([]byte(r.URL.String())))
prober.EnableMetricsCache(metricsCache, cacheKey, settings.CacheDuration(startTime))
}

Expand Down