Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

190
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda