Decrypt PGP encrypted files in ServiceNow

marcelorsc
Kilo Expert

I have a requirement where I need to import an encrypted csv file from an SFTP location into ServiceNow and then, in theory, decrypt the file and process its decrypted contents using a import set/transform map to create and maintain user records on the sys_user table.  

The encrypted file needs to use PGP encryption.

I can generate the public/private pair of keys and provide the public key to have the file encrypted before that is posted on the SFTP.

I understand there is already transport encryption when using SFTP but the solution still requires the file to have its contents encrypted with PGP at the source, before it gets to ServiceNow.

I know if the file encryption was not a requirement, I could create a Data Source to get the file from the SFTP server and process its contents via import set/transform map.

My question is if there is any way this could be accomplished in ServiceNow or if I will have to decrypt the file outside of the platform and then retrieve its contents.   I experimented a bit with the Encryption Support plugin but that doesn't appear to be an option.   I also came across the post below but it doesn't appear to be a fit for the requirements I have.

https://community.servicenow.com/thread/226555

Any thoughts would be greatly appreciated.

Marcelo Correia

16 REPLIES 16

It does. Sounds like a lot of work to achieve it though right? Do you remember how much time it took to build this? 

Hi prashantdharne,

 

In between a couple of other projects I was working on at that time, it took me a while (2 to 3 months) to put everything together but I never worked with either WinSCP or GPG.  I also remember I needed to wait a bit on the provisioning of a dedicated virtual machine for the MID Server so I used that time to research.  I prototyped all this at home with my personal instance, a couple of old Windows machines, a Raspberry PI and a Synology NAS for a small proof of concept.

 

Marcelo

User754729
Kilo Contributor

Hi @marcelorsc 

I have same requirement with GPG encrypted file.

Can you please let me know how did you achieved this?

 

Thanks,

Rajesh

Hi Rajesh,

 

Yes I was.  I ended up implementing with the option via MID Server.  I used WinSCP (adding some scripting) for retrieving the file from the SFTP server, then I generated the keys to encrypt/decrypt with Kleopatra (from GPG4Win).

 

I hope this helps.

 

Marcelo

Hi Marcelo,

 

I have got the same requirement, could you please elaborate what did you done to achieve this

Could you please provide me the scripting which you have used in your scenario

How did you automate the process to decrypt the encrypted PGP file and attached it to import set/transform map 

 

Thanks in advance for your great help.


I will look forward for your response, have a great day.