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

bookChallenge: Secure Logging

Taak

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.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 5
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

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

Veeg om het menu te tonen

Taak

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.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 5
single

single

some-alt