opengrok icon indicating copy to clipboard operation
opengrok copied to clipboard

User/password visible in process listing during indexing of SVN repository

Open cosmoJFH opened this issue 8 years ago • 6 comments

During indexing the user and the password are printed to the console.

505       9205 11803 15 07:53 ?        00:00:00 /usr/bin/svn log --non-interactive --username XXXXX --password XXXX --trust-server-cer

This information is available to any user connected to the machine by the command pf -ef. Is there any way to avoid this?

cosmoJFH avatar Apr 29 '17 06:04 cosmoJFH

I'm afraid there's not. Needs to be solved

tulinkry avatar Apr 30 '17 18:04 tulinkry

Not sure this is actually a bug. That said, the indexer does this:

412      private List<String> getAuthCommandLineParams() {
413          List<String> result = new ArrayList<>();
414          String userName = System.getenv(ENV_SVN_USERNAME);
415          String password = System.getenv(ENV_SVN_PASSWORD);
416          if (userName != null && !userName.isEmpty() && password != null
417                  && !password.isEmpty()) {
418              result.add("--username");
419              result.add(userName);
420              result.add("--password");
421              result.add(password);
422          }

Not sure this is your case - i.e. if you are using the ENV_SVN_USERNAME / ENV_SVN_PASSWORD environment variables.

According to the documentation on http://svnbook.red-bean.com/en/1.7/svn.serverconfig.netmodel.html, Subversion should cache the user/password values so maybe there's a way around that.

vladak avatar May 02 '17 12:05 vladak

There's maybe a way around this but we shouldn't print the passwords into the log files anyway.

tulinkry avatar May 02 '17 21:05 tulinkry

The logger output from Executor would have to be redacted to achieve that.

vladak avatar May 03 '17 14:05 vladak

I think that some regexp matching (as I guess this is only in svn) would solve the issue with some combination of LOGGER.isLoggable(Level ...) to avoid unnecessary string operations when the logger is not active.

tulinkry avatar May 03 '17 22:05 tulinkry

The question is whether SVN allows to specify the user/pass by other means.

vladak avatar Mar 30 '21 08:03 vladak