Script for data scrambling in non production instances

Divya Dattatra2
Giga Contributor

Hi,

Can anyone help me with the post cloning script for data scrambling in non production instances.

Thanks in advance!

1 ACCEPTED SOLUTION

VigneshMC
Mega Sage

Got this from stackoverflow. you can use normal GlideRecord and use this function to scramble text wherever needed

function shuffelWord(word){
    var shuffledWord = '';
    word = word.split('');
    while (word.length > 0) {
      shuffledWord +=  word.splice(word.length * Math.random() << 0, 1);
    }
    gs.print (shuffledWord);
}

shuffelWord("test test");

Thanks

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Divya,

Can you explain in detail what is exactly needed?

Regards

Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

Thanks for responding.

post cloning to the non production instances i want to scramble the data from some tables for eg., email id of users. i.e., if email is 'xyz@abc.com' then after scrambling it should be 'yzx@cab.com' (somethng like that). So that we can secure the client's confidential data.

We can do this via post cloning script but i need help in the scripting part.

 

Thanks!

Hi Divya,

For which all tables you want to do this?

Is it consistent that you will be scrambling in similar manner i.e. pattern will be same or change based on table

What is the purpose of secure client's confidential data?

you can secure data or records in servicenow using ACLs, query business rules etc

what is your exact use case here?

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

We want to secure client's data from our team itself. ACL is not the approach that team wants to follow. pattern will be same for all the tables.

Thanks!