Skip to content

ARTEMIS-1600 Support masked passwords in bootstrap.xm and login.config#1771

Closed
gaohoward wants to merge 1 commit into
apache:masterfrom
gaohoward:fent908
Closed

ARTEMIS-1600 Support masked passwords in bootstrap.xm and login.config#1771
gaohoward wants to merge 1 commit into
apache:masterfrom
gaohoward:fent908

Conversation

@gaohoward
Copy link
Copy Markdown
Contributor

We provide a feature to mask passwords in the configuration files.
However, passwords in the bootstrap.xml (when the console is
secured with HTTPS) cannot be masked. This enhancement has
been opened to allow passwords in the bootstrap.xml to be masked
using the built-in masking feature provided by the broker.

Also the LDAPLoginModule configuration (in login.config) has a
connection password attribute that also needs this mask support.

@jbertram
Copy link
Copy Markdown
Contributor

Aside from the failing tests this looks OK.

That said, I would love to see us move all our password masking to use the "ENC()" syntax instead of using boolean "mask-password" attributes everywhere if possible. This is done for the properties login module and it's very clean. If the text follows the pattern then it should be treated as masked otherwise it shouldn't.

@gaohoward
Copy link
Copy Markdown
Contributor Author

@jbertram good point. I think I can do that. Do you think we still need to support "mask-password" for backward compatibility?

@gaohoward
Copy link
Copy Markdown
Contributor Author

@jbertram ok I think we can support ENC() as well as "mask-password".

@jbertram
Copy link
Copy Markdown
Contributor

We should keep mask-password config support where it exists already, but don't add any new features that use it. Instead we can rely on the ENC() syntax.

@gaohoward
Copy link
Copy Markdown
Contributor Author

OK, so I'd add ENC() syntax and keeps the mask-password as an option. (I mean I won't remove this from this PR, but won't add any more in the future if there is new password mask requirements).

@jbertram
Copy link
Copy Markdown
Contributor

In my opinion, you should remove the mask-password config property from this PR as it will require more code/documentation changes later when it's deprecated and eventually removed.

@gaohoward
Copy link
Copy Markdown
Contributor Author

that's fine. I'll remove it.

@gaohoward gaohoward force-pushed the fent908 branch 2 times, most recently from eec4197 to 4c94dbf Compare January 16, 2018 15:56
@gaohoward
Copy link
Copy Markdown
Contributor Author

@jbertram Hi Justin, I think it's done. Can you take a look again?

Thanks

@gaohoward
Copy link
Copy Markdown
Contributor Author

well, almost done. Just found a unused var. I'll delete it right away. Sorry about that. :)

@gaohoward gaohoward force-pushed the fent908 branch 2 times, most recently from 568e701 to 41b7883 Compare January 17, 2018 08:10
*/
public static boolean isDefaultMaskPassword() {
return DEFAULT_MASK_PASSWORD;
public static Boolean isDefaultMaskPassword() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this?

Why you need a third state? true / false / undefined?

Why not just keep it boolean.. either mask it or not...

Besides.. if you really need the third option.. I would make DEFAULT_MASK_PASSWORD = null; instead of returning null here.

I couldn't understand why you need it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clebertsuconic, check out org.apache.activemq.artemis.utils.PasswordMaskingUtil.resolveMask. I believe the way that method works is why he needs 3 values.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clebertsuconic yes that's the purpose as @jbertram pointed out. I need 'null' to represent the case where the mask-password is not specified at all.

}
isRoleAttributeSet = isLoginPropertySet(ROLE_NAME);
roleAttributeName = getLDAPPropertyValue(ROLE_NAME);
String isMask = (String) options.get(MASK_PASSWORD);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't used anywhere so it can be removed.

passwords.

In general, a masked password can be identified using one of two ways. The first one
iS the ENC() syntax, i.e. any string value wrapped in ENC() is to be treated as
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization error on "iS".

@gaohoward gaohoward force-pushed the fent908 branch 2 times, most recently from 9647a36 to 1e04cef Compare January 18, 2018 02:45
@gaohoward
Copy link
Copy Markdown
Contributor Author

@jbertram @clebertsuconic done!

@gaohoward
Copy link
Copy Markdown
Contributor Author

@jbertram Please hold for a moment. I just found a change that may be wrong.

We provide a feature to mask passwords in the configuration files.
However, passwords in the bootstrap.xml (when the console is
secured with HTTPS) cannot be masked. This enhancement has
been opened to allow passwords in the bootstrap.xml to be masked
using the built-in masking feature provided by the broker.

Also the LDAPLoginModule configuration (in login.config) has a
connection password attribute that also needs this mask support.

In addition the ENC() syntax is supported for password masking
to replace the old 'mask-password' flag.
@gaohoward
Copy link
Copy Markdown
Contributor Author

OK it's done.

@asfgit asfgit closed this in 0d9a114 Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants