dxa4481 / truffleHogRegexes

These are the regexes that power truffleHog
GNU General Public License v3.0
211 stars 97 forks source link

Adding a regexp for Google (GCP) service accounts #4

Closed freddd closed 6 years ago

freddd commented 6 years ago

In GCP, you have service accounts that are used for system - system communication. The key that you can download to use for authentication is either a p12- or json-file. The json-file has the following structure:

{
  "type": "service_account",
  "project_id": "<gcp_project_id>",
  "private_key_id": "<private_key_id>",
  "private_key": "-----BEGIN PRIVATE KEY-----\n<key>\n-----END PRIVATE KEY-----\n",
  "client_email": "<service_account_email>",
  "client_id": "<client_id>",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://accounts.google.com/o/oauth2/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/<service_account_email>"
}

I added a regexp to find "type": "service_account". A generic regexp for finding -----BEGIN PRIVATE KEY----- would also work if you prefer it.

Ping @dxa4481