11) Security



APyaX is currently not intended to be suitable for creating highly secure applications.

This section provides some security precautions to take when implementing applications with APyaX.

Somewhat obvious, but ensure that the server-side python scripts used in an APyaX application cannot be modified, removed or read by clients.

This is essential if you are going to pass any kind of secure information (for example, passwords) from the client to/from APyaX scripts running on the server. APyaX itself does not provide any kind of encryption mechanism.

APyaX uses cookies to manage its sessions. If cookies are stolen from a client computer, an unauthorised user will be able to gain access to APyaX session objects. For this reason, be careful about storing sensitive user data within an APyaX session object. In particular, you should not store database passwords within an APyaX session object.

Store all sensitive information in a password protected database and do not cache database passwords in an APyaX session object. Design your application so that the user must enter their password when first required, and re-transmit the password to the server each time it is needed to retrieve information.

APyaX performs both generation-time and run-time checks to ensure that only python methods that have a first parameter named apyax may be invoked by the client. Make sure that only methods that are intended to be exposed to be called from the client have a first parameter with this name.

Its important to remember that server side code should not trust the client, the original client code may easily be compromised in order to invoke exposed server-side methods in an unanticipated way and exploit them. In a crude example, it would be more dangerous to expose separate server-side methods:

debit(apyax,source_account,amount)

credit(apyax,destination_account,amount)

It would be safer to combine them into one, for example:

transfer(apyax,source_account,destination_account,amount)