diff --git a/pebblo/app/pebblo-ui/src/constants/keywordMapping.js b/pebblo/app/pebblo-ui/src/constants/keywordMapping.js index b03a0bc6..b1dfb296 100644 --- a/pebblo/app/pebblo-ui/src/constants/keywordMapping.js +++ b/pebblo/app/pebblo-ui/src/constants/keywordMapping.js @@ -27,6 +27,7 @@ export const KEYWORD_MAPPING = { "iban-code": "IBAN code", "us-itin": "US ITIN", "github-token": "Github Token", + "github-finergrained-token": "Github Finergrained Token", "slack-token": "Slack Token", "aws-access-key": "AWS Access Key", "aws-secret-key": "AWS Secret Key", diff --git a/pebblo/entity_classifier/utils/config.py b/pebblo/entity_classifier/utils/config.py index 7ec42c22..fdca3668 100644 --- a/pebblo/entity_classifier/utils/config.py +++ b/pebblo/entity_classifier/utils/config.py @@ -6,6 +6,7 @@ secret_entities_context_mapping = { "github-token": ["github", "github_token", "git"], + "github-finergrained-token": ["github", "github_token", "git"], "slack-token": ["slack", "slack token", "slack_token"], "aws-access-key": ["aws_access_key", "aws_key", "access", "id", "api"], "aws-secret-key": ["aws_secret_key", "secret"], @@ -39,6 +40,7 @@ class SecretEntities(Enum): AZURE_KEY_ID = "azure-key-id" AZURE_CLIENT_SECRET = "azure-client-secret" GOOGLE_API_KEY = "google-api-key" + GITHUB_FINEGRAINED_TOKEN = "github-finergrained-token" class PIIGroups(Enum): @@ -59,13 +61,14 @@ class PIIGroups(Enum): Entities.US_BANK_NUMBER.value: (0.4, PIIGroups.Financial.value), Entities.IBAN_CODE.value: (0.8, PIIGroups.Financial.value), # Secret - SecretEntities.GITHUB_TOKEN.value: (0.8, PIIGroups.Secrets.value), + SecretEntities.GITHUB_TOKEN.value: (0.4, PIIGroups.Secrets.value), SecretEntities.SLACK_TOKEN.value: (0.8, PIIGroups.Secrets.value), SecretEntities.AWS_ACCESS_KEY.value: (0.45, PIIGroups.Secrets.value), SecretEntities.AWS_SECRET_KEY.value: (0.8, PIIGroups.Secrets.value), SecretEntities.AZURE_KEY_ID.value: (0.8, PIIGroups.Secrets.value), SecretEntities.AZURE_CLIENT_SECRET.value: (0.8, PIIGroups.Secrets.value), - SecretEntities.GOOGLE_API_KEY.value: (0.8, PIIGroups.Secrets.value), + SecretEntities.GOOGLE_API_KEY.value: (0.4, PIIGroups.Secrets.value), + SecretEntities.GITHUB_FINEGRAINED_TOKEN.value: (0.4, PIIGroups.Secrets.value), # Network Entities.IP_ADDRESS.value: (0.4, PIIGroups.Network.value), } diff --git a/pebblo/entity_classifier/utils/regex_pattern.py b/pebblo/entity_classifier/utils/regex_pattern.py index a42641d1..af3628b1 100644 --- a/pebblo/entity_classifier/utils/regex_pattern.py +++ b/pebblo/entity_classifier/utils/regex_pattern.py @@ -6,11 +6,12 @@ regex_secrets_patterns = { "github-token": r"""\b((?:ghp|gho|ghu|ghs|ghr)_[a-zA-Z0-9]{36,255})\b""", - "slack-token": r"""(xoxb|xoxp|xapp|xoxa|xoxr)\-[0-9]{10,13}\-[a-zA-Z0-9\-]*""", + "github-finergrained-token": r"""\b((?:github_pat)_[a-zA-Z0-9_]{36,255})\b""", + "slack-token": r"""(xoxb|xoxp|xapp|xoxa|xoxr|xoxo|xoxs|xoxe)\-[0-9]{10,13}\-[a-zA-Z0-9\-]*""", # "Slack Token V2": r"""xox[baprs]-([0-9a-zA-Z]{10,48})?""", "aws-access-key": r"""\b((?:AKIA|ABIA|ACCA|ASIA)[0-9A-Z]{16})\b""", "aws-secret-key": r"""\b([A-Za-z0-9+/]{40})[ \r\n'"\x60]""", "azure-key-id": r"""(?i)(%s).{0,20}([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})""", "azure-client-secret": r"""\b(?i)(%s).{0,20}([a-z0-9_\.\-~]{34})\b""", - "google-api-key": r"""(?i)(?:youtube)(?:.|[\n\r]){0,40}\bAIza[0-9A-Za-z\-_]{35}\b""", + "google-api-key": r"""\bAIza[0-9A-Za-z\-_]{35}\b""", } diff --git a/pebblo/reports/enums/keyword_mapping.py b/pebblo/reports/enums/keyword_mapping.py index 14c8e33b..9ca0ed27 100644 --- a/pebblo/reports/enums/keyword_mapping.py +++ b/pebblo/reports/enums/keyword_mapping.py @@ -27,6 +27,7 @@ "iban-code": "IBAN code", "us-itin": "US ITIN", "github-token": "Github Token", + "github-finergrained-token": "Github Finergrained Token", "slack-token": "Slack Token", "aws-access-key": "AWS Access Key", "aws-secret-key": "AWS Secret Key",