RubyGems API Key

Detects RubyGems.org API keys (rubygems_ prefix), used to push gems. A leaked key lets an attacker publish or yank gems under the owner's account.

Type
regex
Engine
universal
Confidence
high
Confidence justification
High confidence: the rubygems_ prefix with a fixed 48-character hexadecimal body is highly specific to RubyGems.org API keys.
Jurisdictions
global
Regulations
Criminal Code Act 1995 (Cth)
Frameworks
CIS Controls, ISO 27001, NIST CSF, SOC 2
Data categories
credentials, security
Scope
narrow
Risk rating
8
Platform compatibility
Purview: Compatible, GCP DLP: Unsupported, Macie: Unsupported, Zscaler: Compatible, Palo Alto: Unsupported, Netskope: Unsupported

Pattern

(?<![A-Za-z0-9_])rubygems_[a-f0-9]{48}(?![A-Za-z0-9])

Corroborative evidence keywords

rubygems, rubygems.org, gem push, api key, RUBYGEMS_API_KEY, credentials, bundler

Proximity: 300 characters

Should match

Should not match

Known false positives

References