Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Replace raw `console.log` and unstructured `Logger.log` string interpolation with structured, redacted logging

Aperta
#281 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

@ravimahatonp ci sta già lavorando.

Dal 9/10/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
aws, nodejs, typescript

Direzione di ricerca

Start in src/logging/, which holds the logger the redaction wrapper would sit in, then read the object-payload example in cache-warming.service.ts around lines 59-62 as the style to match. Find the interpolated call in src/blockchain/oracle/services/submitter.service.ts around lines 243-244 and the console.* call in database-index.service.ts near line 117. Done means a test asserting that password, privateKey and token keys are masked, no console.* outside specs, and the policy written in CONTRIBUTING.md. Check with the maintainers first, since the issue asks to coordinate with the logging-facade issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

help wanted intermediate refactor security

Problem

Logging is not consistently structured, and there is no evidence of a redaction policy. Two concrete issues:

  1. Six raw console.* calls remain in src/ — one is in src/common/database/database-index.service.ts:117, which logs index names immediately after building SQL from interpolated identifiers.
  2. Controllers use string interpolation, e.g. src/blockchain/oracle/services/submitter.service.ts:243-244:
    this.logger.log(
      `Submitting payload ${payloadId} with gas limit ${gasLimit} (attempt ${attempt})`,
    );
    
    while services use structured object payloads (e.g. cache-warming.service.ts:59-62). Interpolated strings cannot be filtered by field in CloudWatch, so an operator cannot query payloadId=X without a full-text grep.

The risk is what gets interpolated. The codebase handles credentials, tokens, wallet signatures, API keys (.env.secrets.template), and wallet private keys — and the README instructs operators to "store signing keys in a KMS" (line 243). Any of those reaching a log line is a disclosure, and logs are commonly shipped to third parties (CloudWatch is configured in package.json).

Why it matters

This is a real and common source of credential leakage. The relevant question for each log site is what values it interpolates — and today that is not answerable by inspection, because there is no convention and no redaction layer.

Note the related issue on plaintext refresh tokens: an adjacent leak path. Fixing one and not the other leaves the same risk open.

Suggested Direction

  1. Adopt one structured call style, matching what already exists:
    this.logger.log({ payloadId, gasLimit: gasLimit.toString(), attempt }, 'Submitting payload');
    
    Object payload plus a static message. Never interpolate values into the message string.
  2. Add a redaction layer at the logger, not per call site. A wrapper that walks the payload and masks keys matching a denylist — password, token, secret, privateKey, authorization, signature, mnemonic, seed — is far more reliable than relying on every developer to remember. src/logging/ (14 files) is the natural home.
  3. Audit the existing call sites for values that should never be logged, starting with the auth and oracle paths.
  4. Replace the six console.* calls with the configured logger.
  5. Document the redaction policy in CONTRIBUTING.md so new call sites follow it.

Constraints

  • Never log secret values, even temporarily — including in error paths. Check catch blocks carefully, since they are the most likely place to dump a whole object.
  • Preserve log levels; do not demote an error to log to reduce noise.
  • Redaction must not break structured querying — mask values, keep keys, so an operator can still filter on which key appeared.
  • Coordinate with the logging-facade issue so redaction lands in the single chosen implementation.

Acceptance Criteria

  • A redaction layer masks configured sensitive keys in all log payloads.
  • No log call interpolates a value into the message string.
  • No console.* calls remain outside spec files.
  • A test asserts that a payload containing password/privateKey/token is masked.
  • The auth and oracle log sites are audited, with findings recorded.
  • The policy is documented in CONTRIBUTING.md.
Lingua principale
TypeScript
Stelle
7
Fork
55
Merge medio
1g 17h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SourceXXL/alian_structure-api

Tutte le issue di SourceXXL/alian_structure-api

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.