Retrieve a PGP-Encrypted File from SFTP, Decrypt It, and Send Data to ServiceNow

Nandini Sahay1
Tera Contributor

HI Everyone, 

I have a scenario, where i have to pick a PGP encrypted file from SFTP server, then decrypt the PGP file and send back to ServiceNow . The file contains data related to HR.

Please do help me on this. 

Thank You, 
Nandini

3 REPLIES 3

Tanushree Maiti
Kilo Patron

Hi @Nandini Sahay1 ,

 

Go Through This blog: Implementing PGP Encryption in ServiceNow for Secure PII/HRSD Data Exports

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Nandini Sahay1
Tera Contributor

The mentioned one is for PGP encryption in ServiceNow through sys_attachment table.

Vaibhav Chouhan
Tera Guru

You can achieve this, but it needs to be split into two parts, file retrieval and PGP decryption.

For picking the file from the SFTP server, you can either use a Data Source with SFTP or the IntegrationHub SFTP spoke, depending on what is available in your instance. Both approaches can bring the encrypted file into ServiceNow.

For the PGP decryption part, ServiceNow does not support it out of the box, so you have two options. The common approach is to send the file to a MID Server or an external system where PGP decryption is handled using standard tools, and then send the decrypted data back to ServiceNow for processing.

Alternatively, you can implement a custom solution inside ServiceNow using external libraries or APIs as shown in the developer blog, but this involves custom scripting and is generally more complex to maintain.

Developer Blog: Implementing PGP Encryption in ServiceNow for Secu... - ServiceNow Community

So the overall flow is retrieve the file using Data Source or SFTP spoke, perform decryption either externally or via a custom implementation, and then bring the decrypted data back into ServiceNow for further processing.