Just thought about hardening our Apache/PHP server installations and pondering about a general approach. Is it possible to create a configuration in that php code is only then executed, when it is "signed" or the hash sum (e.g. MD5) is known?
Has anyone a suggestion?
Just a head's up: I wouldn't recommend MD5 here, at all.
That being said, PHP Archives (a.k.a. Phar) support code-signing through OpenSSL. This is used in random_compat (see: random_compat.phar
and random_compat.phar.pubkey
; the .asc
file is a GPG signature of the .pubkey
file).
The code we use to generate signed Phars is located here.