SNow Underground

ServiceNow Development Tips!

  • Underground Blog
  • Archive
  • About
  • Search
pw_property.PNG

How to use Password Properties

September 27, 2021 by Tyler Teter in security

There are quite a few ways to store encrypted passwords and fields in ServiceNow, besides just the obvious credential table and user table. A little known method is to use the Password Type for System Properties.

How to Create a Password System Property

This part is reasonably documented on the ServiceNow Docs, and it’s not too different from a regular system property.

  1. In the filter navigator type “sys_properties.list” and click enter.

  2. Select to create a new property.

  3. Fill out the name, description, and set the type as “password”, and put the password you want to encrypt in the value field.

  4. Submit/Save the record, and notice the value changes to an encrypted value.

How to Decrypt from a Password System Property

You could shorten this down to a single line if needed, but you can easily decrypt the value from the property value using the following script.

var passwordEnc = new gs.getProperty('property.name'); var ge = new GlideEncrypter(); var decrString = ge.decrypt(passwordEnc);

There is a limitation because GlideEncrypter is not natively available in Scoped Applications. If you need to get around this security limitation, you can easily create a global script include wrapper for GlideEncrypter, and then just call that from your scoped app.

September 27, 2021 /Tyler Teter
password, encrypt, properties
security
  • Newer
  • Older

Powered by Squarespace