From the course: Secure Coding in Java

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Solution: Prevent sensitive data leaks

Solution: Prevent sensitive data leaks - Java Tutorial

From the course: Secure Coding in Java

Start my 1-month free trial

Solution: Prevent sensitive data leaks

(upbeat music) - So now I will present my solution to this challenge. Now there definitely were a couple of ways to solve this one. You could have simply not admitted the email address and the to toSring method of the president object. You could have tokenized that data. Now the solution that I picked, and the one that I will show you is what I usually do with email addresses and other unique identifiers that I need in my logs. And it's a great pattern to have in your toolkit. Okay, so the first thing that I'm want to do here is I'm want to run the test before I put in my fix. So as I run the test, and bring up the console, you'll see, that we're logging out the email address, in our query. So we return data, and in that data, we logged out the email address. Now, if you take a look at the DAO method, again, this is before you started the challenge. But if you look, and we scroll down, you will see in the process result…

Contents