Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Secure Logging | Safe Coding Practices
Python Security Best Practices

bookChallenge: Secure Logging

Tarefa

Swipe to start coding

Write a function that logs user actions without exposing sensitive information. Your function must ensure that no secrets or personal data are included in the logs.

  • Remove any key-value pairs from the details dictionary whose key matches 'password', 'ssn', 'credit_card', or 'secret'.
  • Create a log message that includes the user_id, action, and the filtered details.
  • Log the message using the logging module.
  • Return the log message as a string.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 5
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain that in simpler terms?

What are the main benefits of this approach?

Are there any common mistakes to avoid with this?

close

Awesome!

Completion rate improved to 5.56

bookChallenge: Secure Logging

Deslize para mostrar o menu

Tarefa

Swipe to start coding

Write a function that logs user actions without exposing sensitive information. Your function must ensure that no secrets or personal data are included in the logs.

  • Remove any key-value pairs from the details dictionary whose key matches 'password', 'ssn', 'credit_card', or 'secret'.
  • Create a log message that includes the user_id, action, and the filtered details.
  • Log the message using the logging module.
  • Return the log message as a string.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 5
single

single

some-alt