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

bookChallenge: Secure Logging

Tehtävä

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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 5
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

Awesome!

Completion rate improved to 5.56

bookChallenge: Secure Logging

Pyyhkäise näyttääksesi valikon

Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 5
single

single

some-alt