-
Notifications
You must be signed in to change notification settings - Fork 1.3k
sensitive information leak to log #12018
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
base: 4.20
Are you sure you want to change the base?
Changes from all commits
1ee7c6d
7e09770
08b1d9e
e084644
4a614b6
c97662d
0e85b58
badf6bc
d9f18b6
460e71e
53e1861
3393f3e
830a5a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -46,10 +46,10 @@ public boolean configure(String name, Map<String, Object> params) throws Configu | |||||
| com.trilead.ssh2.Connection sshConnection = null; | ||||||
| try { | ||||||
| super.configure(name, params); | ||||||
| logger.debug(String.format("Trying to connect to DHCP server(IP=%1$s, username=%2$s, password=%3$s)", _ip, _username, _password)); | ||||||
| logger.debug(String.format("Trying to connect to DHCP server(IP=%1$s, username=%2$s, password=******", _ip, _username)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| sshConnection = SSHCmdHelper.acquireAuthorizedConnection(_ip, _username, _password); | ||||||
| if (sshConnection == null) { | ||||||
| throw new ConfigurationException(String.format("Cannot connect to DHCP server(IP=%1$s, username=%2$s, password=%3$s", _ip, _username, _password)); | ||||||
| throw new ConfigurationException(String.format("Cannot connect to DHCP server(IP=%1$s, username=%2$s, password=******", _ip, _username)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| if (!SSHCmdHelper.sshExecuteCmd(sshConnection, "[ -f '/usr/sbin/dnsmasq' ]")) { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -131,7 +131,7 @@ private Answer execute(VmDataCommand cmd) { | |||||
| sshConnection.connect(null, 60000, 60000); | ||||||
| if (!sshConnection.authenticateWithPassword(_username, _password)) { | ||||||
| logger.debug("SSH Failed to authenticate"); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=%3$s", _ip, _username, _password)); | ||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| String script = String.format("python /usr/bin/baremetal_user_data.py '%s'", arg); | ||||||
|
|
@@ -167,7 +167,7 @@ private Answer execute(PrepareKickstartPxeServerCommand cmd) { | |||||
| sshConnection.connect(null, 60000, 60000); | ||||||
| if (!sshConnection.authenticateWithPassword(_username, _password)) { | ||||||
| logger.debug("SSH Failed to authenticate"); | ||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=%3$s", _ip, _username, _password)); | ||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| String copyTo = String.format("%s/%s", _tftpDir, cmd.getTemplateUuid()); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -151,7 +151,7 @@ protected PreparePxeServerAnswer execute(PreparePxeServerCommand cmd) { | |||||
| sshConnection.connect(null, 60000, 60000); | ||||||
| if (!sshConnection.authenticateWithPassword(_username, _password)) { | ||||||
| logger.debug("SSH Failed to authenticate"); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=%3$s", _ip, _username, _password)); | ||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| String script = | ||||||
|
|
@@ -179,7 +179,7 @@ protected Answer execute(PrepareCreateTemplateCommand cmd) { | |||||
| sshConnection.connect(null, 60000, 60000); | ||||||
| if (!sshConnection.authenticateWithPassword(_username, _password)) { | ||||||
| logger.debug("SSH Failed to authenticate"); | ||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=%3$s", _ip, _username, _password)); | ||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| String script = | ||||||
|
|
@@ -237,7 +237,7 @@ private Answer execute(VmDataCommand cmd) { | |||||
| sshConnection.connect(null, 60000, 60000); | ||||||
| if (!sshConnection.authenticateWithPassword(_username, _password)) { | ||||||
| logger.debug("SSH Failed to authenticate"); | ||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=%3$s", _ip, _username, _password)); | ||||||
| throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| String script = String.format("python /usr/bin/baremetal_user_data.py '%s'", arg); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -500,8 +500,12 @@ public static InputStream getInputStreamFromUrl(String url, String user, String | |||||
| if ((user != null) && (password != null)) { | ||||||
| httpclient.getParams().setAuthenticationPreemptive(true); | ||||||
| Credentials defaultcreds = new UsernamePasswordCredentials(user, password); | ||||||
| httpclient.getState().setCredentials(new AuthScope(hostAndPort.first(), hostAndPort.second(), AuthScope.ANY_REALM), defaultcreds); | ||||||
| LOGGER.info("Added username=" + user + ", password=" + password + "for host " + hostAndPort.first() + ":" + hostAndPort.second()); | ||||||
| httpclient.getState().setCredentials( | ||||||
| new AuthScope(hostAndPort.first(), hostAndPort.second(), AuthScope.ANY_REALM), defaultcreds); | ||||||
| LOGGER.info("Added username={}, password=****** for host {}:{}" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| , user | ||||||
| , hostAndPort.first() | ||||||
| , hostAndPort.second()); | ||||||
| } | ||||||
| // Execute the method. | ||||||
| GetMethod method = new GetMethod(url); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to log it