Thanks
Use micro services. IE, separation of functionality.
A typical application has three states, application, database, and bitcoin service. Generally, following the micro service system design, each one of these states should be located on a separate instance/server with local networking enabled.
In design, the application server should have access to the db server, but not the bitcoin server, the bitcoin server should have access to the db server, but not the application server.
Application >><< DB >><< Bitcoin
The bitcoin server should be configured with a listener to determine incoming transactions. These transactions would then be written to the db for use in the application. Outgoing transactions would be written to the db from the application server and processed via a cron with a set interval.
Disable external networking on the DB / bitcoin server with the exception of your local ip and key. Make sure that both states that utilize the db have different permission and users. Application can only write to transaction out bitcoin table, while bitcoin can only write to transaction out. Be sure when out processing transactions you can check the flow of bitcoin for a user via a history table.
By configuring the application in this manner, you are removing direct access to your bitcoin server as it is not exactly front facing. This method will not prevent hackers, but it will help to mitigate them and secure your application. Additional steps and monitoring should always be implemented