[erlang-questions] Intrusive function intercept

Richard Carlsson carlsson.richard@REDACTED
Thu Oct 10 11:13:45 CEST 2013


On 2013-10-10 10:54 , Tyron Zerafa wrote:
> Yes, we can change the code of the /test/ function and use messages;
> however I was wondering whether there is another approach. Our idea is
> to build a resource access control system which authorizes access to
> resources. We came up with the following implementation options:
>   1) change the Erlang/OTP libraries - ruled out (not an option)
>   2) perform checks before each access - will have to change our current
> code and add these checks
>   3) using monitoring as described in the previous post - monitoring
> process performs checks and only allow processes to proceed if they've
> got the correct privilieges

If you're not afraid of getting down and dirty, there's another 
possibility that doesn't require any source code changes, and which 
guarantees that you check all resource accesses: rewrite the BEAM 
bytecode of modules at load time, inserting checks automatically.

     /Richard




More information about the erlang-questions mailing list