Preventing the Gatekeeper From Being Re-Enabled in OS X Using a Terminal Command
Gatekeeper is a great feature in OS X that prevents unknown developers from opening applications, which helps keep your computer safe from malware. However, power users don’t really need it, but when you turn it off, it turns back on after 30 days. Fortunately, Terminal can solve this problem.
When you turn off a gatekeeper, it only stays off for 30 days. This can be annoying if you are someone who knows what you are doing in OS X. To disable this feature, open Terminal (Applications> Utilities) and enter the following command:
by default sudo write /Library/Preferences/com.apple.security GKAutoRearm -bool NO
Press Enter, then enter your password. The gatekeeper will now speak disabled until you manually enable it.
How to prevent the gatekeeper from being turned on automatically in OS X | OS X Daily