redacting-logger 1.2.1 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50d2ace6d4130e53b43dae0a28b9d735052783c1679b86d2bfb6ec989143b8ed
4
- data.tar.gz: 3e9b45f38e2c71db6c2d989803f7212a684cdaf20cf00dc3ab801551a2b16d9a
3
+ metadata.gz: 103a53e496f8efc3d6d21fa37c07a773f9f36c2f879a6a07fd0cb8daa3e0db90
4
+ data.tar.gz: 5494118743b74310aae14aab0d3c3b8ba6a2b963f88eff7a60171d4a663af436
5
5
  SHA512:
6
- metadata.gz: 1674309a01a5077923ec987dc9eaeb7b6d9acd040131711d77961dc351cf7171d4483668a3f60d77c6838fb6728c3d7984361a78a4af8847f52b95d298638c30
7
- data.tar.gz: fc68d0007bcdd149600fbbd824a896fcc27352087fdef121139496c47d8226b95580da8261e942b575456062c0e79607895d7d77769bac533974b3c13a7b4f3c
6
+ metadata.gz: 44f56e1658d46788b23124064d30d7efba075c000757494a1e6f4710fe1b278be22c51a99f1bbb14c3cbad87c9a919fabcac289dd558df1d2b4c9c6a5a51ed85
7
+ data.tar.gz: 4f414b31538ae5e6863f096eaf298b43dae339d87b1ac7b2ea4029e8d58c50205e5d9b0e300b15732cda03c2e179d4058a96d4f65f64567fc629a9092c444e2a
@@ -1,12 +1,52 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This module contains the default patterns to redact.
4
+ # These patterns are sourced from different places on the internet, some came from https://github.com/l4yton/RegHex
4
5
  module Patterns
5
6
  DEFAULT = [
6
- /ghp_[A-Za-z0-9]{36,}|[0-9A-Fa-f]{40,}/, # GitHub Personal Access Token
7
- /github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}/, # GitHub Personal Access Token (fine-grained)
8
- /ghs_[a-zA-Z0-9]{36}/, # Temporary GitHub Actions Tokens
9
- /\b(ey[a-zA-Z0-9]{17,}\.ey[a-zA-Z0-9\/\\_-]{17,}\.(?:[a-zA-Z0-9\/\\_-]{10,}={0,2})?)(?:['|\"|\n|\r|\s|\x60|;]|$)/, # JWT tokens
10
- /(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY( BLOCK)?----/ # private keys
7
+ # GitHub Personal Access Token
8
+ # https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/
9
+ /ghp_[A-Za-z0-9]{36,}|[0-9A-Fa-f]{40,}/,
10
+ /github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}/, # Fine Grained
11
+ /ghs_[a-zA-Z0-9]{36}/, # Temporary Actions Tokens
12
+
13
+ # JWT Token
14
+ # https://en.wikipedia.org/wiki/JSON_Web_Token
15
+ %r{\b(ey[a-zA-Z0-9]{17,}\.ey[a-zA-Z0-9/\\_-]{17,}\.(?:[a-zA-Z0-9/\\_-]{10,}={0,2})?)(?:['|"|\n|\r|\s|\x60|;]|$)},
16
+
17
+ # PEM Private Keys
18
+ # https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
19
+ /(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY( BLOCK)?----/,
20
+
21
+ # Slack Webhook
22
+ # https://api.slack.com/messaging/webhooks
23
+ %r{https://hooks\.slack\.com/services/[a-zA-Z0-9]{9,}/[a-zA-Z0-9]{9,}/[a-zA-Z0-9]{24}},
24
+
25
+ # Slack Workflows
26
+ %r{https://hooks\.slack\.com/workflows/[a-zA-Z0-9]{9,}/[a-zA-Z0-9]{9,}/[0-9]+?/[a-zA-Z0-9]{24}},
27
+
28
+ # Slack Trigger
29
+ # https://slack.com/help/articles/360041352714-Build-a-workflow--Create-a-workflow-that-starts-outside-of-Slack
30
+ %r{https://hooks\.slack\.com/triggers/.+},
31
+
32
+ # Slack Tokens
33
+ # https://api.slack.com/authentication/token-types
34
+ /xoxp-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9a-f]{6,})/,
35
+ /xoxb-(?:[0-9]{7,})-(?:[A-Za-z0-9]{14,})/,
36
+ /xoxs-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9a-f]{7,})/,
37
+ /xoxa-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9a-f]{7,})/,
38
+ /xoxo-(?:[0-9]{7,})-(?:[A-Za-z0-9]{14,})/,
39
+ /xoxa-2-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9a-f]{7,})/,
40
+ /xoxr-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[0-9a-f]{7,})/,
41
+ /xoxb-(?:[0-9]{7,})-(?:[0-9]{7,})-(?:[A-Za-z0-9]{14,})/,
42
+
43
+ # Vault Tokens
44
+ # https://github.com/hashicorp/vault/issues/27151
45
+ /[sbr]\.[a-zA-Z0-9]{24,}/, # <= 1.9.x
46
+ /hv[sbr]\.[a-zA-Z0-9]{24,}/, # >= 1.10
47
+
48
+ # RubyGems Token
49
+ # https://guides.rubygems.org/api-key-scopes/
50
+ /rubygems_[0-9a-f]{48}/
11
51
  ].freeze
12
52
  end
data/lib/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RedactingLogger
4
4
  module Version
5
- VERSION = "1.2.1"
5
+ VERSION = "1.3.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redacting-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-03-25 00:00:00.000000000 Z
12
+ date: 2024-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: logger