AnsweredAssumed Answered

How to secure arcpy-based Python toolbox solutions as a pyd

Question asked by johnmdye on Oct 5, 2015
Latest reply on Oct 5, 2015 by FGibson-esristaff

I want to secure some sensitive business logic used in a Python toolbox tool.

Python toolboxes are inherently insecure. Any one who is even semi-curious can figure out how to open one and view the source code and there seems to be no good way to secure that source code and nothing on the horizon from Esri that will facilitate it in the future. Sure I could use a regular old Script tool but you know, who would want to go back to a script tool when there's Python toolboxes? One could also just compile the source to a .pyc and ship that instead of the raw .py file but that can easily be decompiled by anyone who is capable of googling.

 

One thing I'm wondering is whether it would be possible to install Cython alongside the Python distro that ships with ArcGIS, build the arcpy-based solution and then just call the needed functions out of the resulting .pyd file. What I don't know is whether or not this is possble to do this with solutions that include arcpy-based functions and if so, how? Does anyone have any experience with this or even securing source code used in a Python toolbox

 

UPDATE:

Thanks to everyone for your replies. I agree that the open nature of a pyt has it's advantages. I also agree that if someone really wants to get to the source and is thoroughly determined, there's no stopping them.

 

I don't necessarily think that when you're in a business environment, the latter fact should negate responsibility on a developer working with sensitive IP to implement some safeguards and obstacles for an adversary to overcome.

 

If you're running an orchard, just because someone who really wants your apples could probably pick them off without much effort doesn't mean you should leave the ladders leaning next to the trees.

Outcomes