Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that no passwords are shown in the logs #1511

Open
3 tasks
fuss86 opened this issue Oct 7, 2019 · 24 comments · May be fixed by #1768
Open
3 tasks

Make sure that no passwords are shown in the logs #1511

fuss86 opened this issue Oct 7, 2019 · 24 comments · May be fixed by #1768

Comments

@fuss86
Copy link
Contributor

fuss86 commented Oct 7, 2019

Task Description

When a user authenticates, the logs may contain his hashed password. We should make sure that we don't leak any credential information in the logs (even hashed passwords).

Tasks

The following tasks will need to be carried out:

  • Enumerate all possible classes that uses credentials / passwords
  • Make sure their toString methods do not contain sensitive data
  • Make sure credentials / passwords are not logged anywhere

Help

@fuss86 fuss86 added good first issue help wanted hacktoberfest Pre-selected issues for Hacktoberfest labels Oct 7, 2019
@n00ner
Copy link

n00ner commented Oct 8, 2019

I want to help

@carlspring
Copy link
Member

Feel free to dig in! :)

@onobc
Copy link

onobc commented Oct 8, 2019

I would recommend doing this for all PII. If we are already going to be scouring logs for creds - it woulld be worth doing that as well. Could be done in a follow on ticket as well.

@carlspring
Copy link
Member

I'm assuming you're referring to "personally identifiable information"?

If so, I believe the only information that we keep a record of is the username/e-mail, so I'm not quite sure what else we could sanitize and restrict.

@onobc
Copy link

onobc commented Oct 8, 2019

Yep. Email would be one.

@rohithjayaraman
Copy link

Has someone taken this up already ?

@carlspring
Copy link
Member

@theparselmouth , @n00ner said they'd look into it, but as we haven't seen a pull request yet, I'd say it's probably up for grabs, so you can have a go at it, if you like.

@n00ner
Copy link

n00ner commented Oct 11, 2019

@theparselmouth, try it =)

I just studying and work slowly.

@RutgerDOW
Copy link

I'm participating at hacktoberfest and choose this issue to start working on.

@carlspring
Copy link
Member

carlspring commented Oct 18, 2019

Hi @RutgerDOW ,

Feel free to look into it! Thanks for offering to help! :)

(As we haven't heard back from @n00ner and @theparselmouth , or seen a pull request, I believe it's safe to proceed).

Please, feel free to join our chat channel! :)

@RutgerDOW
Copy link

  • Enumerate all possible classes that uses credentials / passwords

Do you need tooling for it, or is manually search and output to enumeration satisfying? In last case, how will it be maintained?

  • Make sure their toString methods do not contain sensitive data

Is a search and delete in the logged data the solution, or is must all password object or string be omitted from methods of toString object in underlying classes?

@carlspring
Copy link
Member

I think you can start by ommitting things from the toString method and work your way through. Deleting things through the logger might be quite an undertaking...

@steve-todorov
Copy link
Member

@carlspring / @fuss86 / @sbespalov in addition and as a fallback option, maybe we could try to configure logback to mask certain messages using replace (example)?

@fuss86
Copy link
Contributor Author

fuss86 commented Oct 20, 2019

@steve-todorov I think it might be hard to prepare a regex for such purpose. We can't predict it I think.

@deepankkartikey
Copy link

@carlspring
@fuss86
@sbespalov
@steve-todorov
Can I look into this?
Just a beginner, willing to learn about code

@steve-todorov
Copy link
Member

Hi @deepank120896 - feel free to pick it up. You can also join our chat if you have more questions. :)

@VishnuLakkimsetty
Copy link

Hi @deepank120896 - Are you contributing to this issue. If not I'm interested in contributing to this issue

@deepankkartikey
Copy link

@VishnuLakkimsetty Yes I am working on it

@Syntax753
Copy link

@deepank120896 Are you still working on this?

I've done a quick initial investigation and happy to continue. These would be the first files to look into:

find . -type f -name '*.java' | grep -v "/test" | xargs grep -l password | xargs grep -l toString                                              
./strongbox-rest-client/src/main/java/org/carlspring/strongbox/client/RestClient.java
./strongbox-security/strongbox-user-management/src/main/java/org/carlspring/strongbox/users/dto/UserDto.java
./strongbox-security/strongbox-user-management/src/main/java/org/carlspring/strongbox/users/userdetails/SpringSecurityUser.java
./strongbox-security/strongbox-user-management/src/main/java/org/carlspring/strongbox/users/domain/UserData.java
./strongbox-security/strongbox-authentication-providers/strongbox-default-authentication-provider/src/main/java/org/carlspring/strongbox/authentication/api/password/PasswordAuthenticationProvider.java
./strongbox-security/strongbox-authentication-providers/strongbox-default-authentication-provider/src/main/java/org/carlspring/strongbox/authentication/api/CacheManagerAuthenticationCache.java
./strongbox-storage/strongbox-storage-core/src/main/java/org/carlspring/strongbox/configuration/MutableProxyConfiguration.java
./strongbox-client/src/main/java/org/carlspring/strongbox/client/ArtifactClient.java

@steve-todorov
Copy link
Member

@Syntax753 feel free to pick this up if you're still interested and open a PR :)

@hT013 hT013 linked a pull request May 12, 2020 that will close this issue
10 tasks
@steve-todorov steve-todorov removed the hacktoberfest Pre-selected issues for Hacktoberfest label Oct 1, 2021
@colinldbd
Copy link

Hi, I'm a contributor and I see this is a good first issue. Can you assign this issue to me so I can work on it?

Many thanks!

@strongbox strongbox deleted a comment from DSkilton Oct 20, 2023
@strongbox strongbox deleted a comment from Syntax753 Oct 20, 2023
@carlspring
Copy link
Member

@colinldbd : This project is on hold.

@khushbukareliya07
Copy link

Hi @carlspring - I would recommend adding an appropriate label for the status.

@carlspring
Copy link
Member

@khushbukareliya07 : The point being? I assume you've read my last comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.