With Grafana, you can use the GitHub Secret Scanning service to determine if your [service account tokens]({{< relref "../../administration/service-accounts" >}}) have been leaked on GitHub.
When GitHub Secret Scanning detects a Grafana secret, its hash is stored in Grafana Labs' secret scanning service.
Grafana instances, whether on-premises or on the cloud, can use this service to verify if a token generated by the instance has been made public. This verification is done by comparing the token's hash with the exposed token's hash.
If the service detects a leaked token, it immediately revokes it, making it useless, and logs the event.
If the `revoke` option is disabled, the service only sends a notification to the configured webhook URL and logs the event. The token is not automatically revoked.
For more information about service account migration, refer to [Migrate API keys to Grafana service accounts]({{< relref "../../administration/api-keys#migrate-api-keys-to-grafana-service-accounts" >}}).
1. In the `[secretscan]` section, update the following parameters:
```ini
[secretscan]
# Enable secretscan feature
enabled = true
# Whether to revoke the token if a leak is detected or just send a notification
revoke = true
```
Save the configuration file and restart Grafana.
## Configure outgoing webhook notifications
1. Create an oncall integration of the type **Webhook** and set up alerts.
To learn how to create a Grafana OnCall integration, refer to [Webhook integrations for Grafana OnCall](/docs/oncall/latest/integrations/available-integrations/configure-webhook/).
1. Copy the webhook URL of the new integration.
1. Open the Grafana configuration file.
1. In the `[secretscan]` section, update the following parameters,
replacing the URL with the webhook URL you copied in step 2.