As encoding becomes a regular part of your development cycle, you may start to wonder how you can automate the process and make it part of your continuous delivery model. This article explains how to automate code obfuscation as part of your continuous delivery model.
As a release manager or developer I would like to have the source code encoded when a new version is released without having to do it manually.
We used to have a machine in our office dedicated to run the ionCube software. Whenever a new version was released, someone had to manually execute a step-by-step sequence to create an encoded version thereof. The ionCube software allows you to do it very easily. However, if you have to do this frequently, the repetitive nature of it would drive you insane.
It was during this insanity that we decided to automate it. The idea is very simple: move it to a cloud server and trigger it remotely. This extended into adopting it in our deployment pipeline, making it completely automated.
The developer pushes a tag (or a branch) to the remote repository. Bitbucket’s pipelines catches the new tag (or updated branch) and executes a script. This script connects to the remote machine via ssh and executes the ionCube encoder.
- Guaranteed compatibility of source code against the version of PHP
- Reverse engineering attempts require more effort
- Mitigate license manipulation/abuse
- Setup time
- Adds some time to your CD (depends on the size of your project)
This article was also published here.
Step-by-step walkthrough to help you get started. You should be able to adapt this into your CI/CD flow regardless of what technology you are using.
- Sign up for the ionCube Encoder trial and copy the download link (will be emailed to your inbox)
- Set up public key authentication to the remote server
- Copy git repo on local machine
- Copy git repo on remote machine
- Install ionCube PHP Encoder on remote machine
- Trigger encoding from local machine