Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
Typescript / Eslint rules to catch PII being logged?

I've been looking for a way to catch potential PII logging violations using linting rules. Specifically, if I have an object that contains PII, I'd like to mark the fields that are expected to contain PII so it doesn't inadvertently get logged, i.e. avoid a situation as follows:

interface Member {
  id: string,
  email: string,
  // other non-pii fields
}
....
const m: Member = getMemberFromRequest(request);
....
if (condition) {
  logger.info(`No fluffy bunnies found for ${m.email}`);
}

My first thought would be to add some sort of annotation on the object property (e.g. @PII), then write linter rules to make sure that the specific property isn't used as part of a string literal somewhere. So far, I've only come across a PII linter that looks through comments or string literals (eslint-plugin-pii).

With typescript, I guess another possibility would be to declare a type alias for string and have a tslint rule to catch that type from being used in logs.

Are either of these workable (or good) approaches? Are there better alternatives that I haven't found?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda