3

I have made a python web application in Django.

I want to install it locally on someone's computer. But I want the code to be completely inaccessible.

Currently I run the application in a docker container.

So is there a way I can make a container completely unreadable to someone at the same time run the webserver from inside.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
Santhosh
  • 9,965
  • 20
  • 103
  • 243
  • *Completely* unreadable, no. If the code can be run, then by definition it can be reverse engineered. It's just a matter of how much effort you're willing to put in vs. how much effort the reverser is willing to put in. – Jeroen Mostert Sep 15 '21 at 07:00
  • How about setting a root password for your app container? Someone else can not log in and read your code in the container directly. – rustyhu Sep 15 '21 at 07:06
  • Anyone who can run any `docker` command has unrestricted root access on the host; you can't stop someone from launching an interactive shell or Python REPL on the container instead of your program, or just finding the source code in `/var/lib/docker`. (And nothing in Docker ever enforces user passwords; setting a root or user password is meaningless when you can `docker run -u root` anything you want.) Consider a compiled language like Go or Rust that doesn't require you to distribute its source code. – David Maze Sep 15 '21 at 09:40

1 Answers1

0

It is not possibile. it is against the fundamentals of container architecture.

The only suggestion I feel to give you is to obfuscate the code of your python application. Here has been deeper discussed the obfuscation topic.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74