@@ -8,6 +8,8 @@ To embed the cli tool into your web application you need to
* if it is `0` then the excution was successful - we have a result. You can send the JSON after setting the content type as http response header
* if it is `> 0` the response is no JSON syntax. You should send the output that the error is seen in the appm nitor server.
Don't forget to protect the ini file and the monitoring request. See page Security.
## PHP
This code snippet is for demonstration purposes only. A PHP web app should use the PHP client - see <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/index.html>
...
...
@@ -15,10 +17,7 @@ This code snippet is for demonstration purposes only. A PHP web app should use t
The ini file can contain credentials for databases or api secrets if checks must test its acess.
* If possible put them outside webroot or
* protect its access with http, put it into a folder "protected" below webroot and deny the access
Snippet for Apache httpd:
```txt
<Location "/protected">
Require all denied
</Location>
```
### IP restriction
The request to exec the `amcli` (or the generated static json file) should be protected. Maybe your output has no sensitive information but maybe it does on error. The monitoring request is not for the public.
Dynamic requests depending on the kind of checks can run a bit longer and could be misused for DOS attacks.
You can set an ip restriction to the ip address of your appmonitor server instance + localhost.