Skip to content

False positive for TypeScript import: import { chain_Anvil1_Key, chain_Anvil2_Key } from ... #1800

@atodorov

Description

@atodorov

Describe the bug
I have a bunch of test files which contain the following snippet

import { chain_Anvil1_Key, chain_Anvil2_Key } from '../blockchain-tests/pallets/supported-chains/consts';

both of these are integer values defined as:

export const chain_Anvil1_Key = 2;
export const chain_Anvil2_Key = 4;

gitleaks (executed via MegaLinter) triggers on the second imported variable:

  Finding:     import { chain_Anvil1_Key, REDACTED } from '../blockcha...
  Secret:      REDACTED
  RuleID:      generic-api-key
  Entropy:     3.625000
  File:        cli/src/test/cc3-indexer-tests/handleEventAttestorUnregistered.test.ts

Expected behavior
No error

Screenshots

Image

Basic Info (please complete the following information):

  • OS: Ubuntu-24.04
  • Gitleaks Version: v8.23.3

Additional context
Add any other context about the problem here.

cc @zricethezav

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions