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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Marcelo,



Any type of file manipulation needs to be done outside ServiceNow preferably MID Server.


PGP decryption support




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


Thanks


Ankur


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

Thanks Ankur.   I came across the post you replied with and since that was quite old I was hoping that some support for PGP were added to the platform more recently but it looks like that doesn't seem to be the case.



Marcelo


Hi Marcelo,



That's correct. You will have to use MID Server in this scenario.


Pass file, key and decrypt the file in MID Server and send the decrypted file back into ServiceNow and attach that to data source and trigger the transform map.



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


Thanks


Ankur


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

Hey @Ankur Bawiskar  / @marcelorsc ,

I need to implement a similar scenario where we need to pull PGP encrypted file from SFTP Server. I am thinking of leveraging SFTP step in a custom action & use the mid server.  When I add a SFTP Step in the actions & choose SFTP Command as 'Cope Files to this Instance' then under Capabilities I see all the options such as SSH, etc but not PGP. So how will I decrypt the file using Mid Server if I cannot choose the Capability ?

 

Any response will be greatly appreciated !

 

Thanks,

Ritika Saran