security.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. {
  2. title: 'Security',
  3. crumbs: [
  4. { "User's Guide": '../users/' },
  5. ],
  6. }
  7. <h1>Security Considerations</h1>
  8. <p>Securing applications that are accessible to the Internet is not a trivial task. This page outlines some
  9. of the issues, and offers tips to help you secure your application using the Embedthis GoAhead
  10. product.</p><a id="updates"></a>
  11. <h2 >Updates</h2>
  12. <p>Even the best application or HTTP server can experience some security vulnerabilities that are
  13. discovered after being deployed in the field. It is highly recommended that you stay up to date with the
  14. latest version of GoAhead.</p>
  15. <p><a href="http://www.embedthis.com/">Embedthis</a> offers a Security Enhancement Service as part of an
  16. GoAhead commercial license that will proactively notify you of any security flaws and will expedite fixes or
  17. workarounds to minimize the vulnerability.</p>
  18. <a id="account"></a>
  19. <h2 >GoAhead User Account</h2>
  20. <p>It is important that you run GoAhead with the lowest system privilege that will get the job done. If any
  21. application is compromised, including GoAhead, then the system will be safest if the compromised application
  22. has as few privileges as possible.</p>
  23. <a id="directoryPermissions"></a>
  24. <h2 >Directory and File Permissions</h2>
  25. <p>This section explains the policy should you need to move or modify files and directories.</p>
  26. <p>To enhance security you need to consider the directory and file permissions for three classes of
  27. content:</p>
  28. <ul>
  29. <li>Pages served by the HTTP server</li>
  30. <li>Scripts run by the HTTP server</li>
  31. <li>Configuration and log files used by the HTTP server.</li>
  32. </ul>
  33. <p>Pages served by the GoAhead server should be owned by root or administrator and should only be readable
  34. by the GoAhead user account. Directories containing served pages should be readable and executable only.</p>
  35. <p>Scripts run by the GoAhead server should always be outside all directories containing served pages. After
  36. all, you don't want prying eyes viewing your scripts! Scripts should be owned by the <b>root</b> or
  37. <b>administrator</b> and should only be readable and executable by the GoAhead user account.</p>
  38. <p>Configuration and log files used by the GoAhead server should always be outside all directories
  39. containing served pages or scripts. The directory containing the log files must be writable by the GoAhead
  40. user account.</p>
  41. <h3>Home Permissions</h3>
  42. <p>The home directory in which GoAhead executes should be owned by <b>root</b> or administrator, and should be
  43. in the group <b>root</b> or administrators. They should only be writable by this specific user and group.</p>
  44. <a id="authentication"></a>
  45. <h2 >Authentication</h2>
  46. <p>It is highly recommended that you use Form-based <a href="authentication.html#formAuthentication">Form</a>
  47. authentication and not Basic authentication. As implemented in GoAhead, Form authentication over SSL
  48. provides many safeguards against known exploits including; man-in-the-middle attacks, client spoofing,
  49. and replay attacks.</p>
  50. <a id="sandBoxing"></a>
  51. <h2 >Sandboxing</h2>
  52. <p>Sandboxing is the term applied to running GoAhead in a confined environment. When embedding a HTTP server
  53. in an application, the profile of client access is often well known. This profile includes the rate of
  54. accesses, the length of URLs and the size of pages returned to the user.</p>
  55. <p>GoAhead has a set of build time configuration options that allow you to define a sandbox which specifies how
  56. GoAhead must be used for a request to be serviced. By using well defined sandbox directives, you can help
  57. ensure that your application will not be compromised by malicious requests.</p>
  58. <h3>Limit Directives</h3>
  59. <p>The limit directives are defined in main.me which is used by <i>MakeMe</i> when configuring GoAhead
  60. and generating the <i>bit.h</i> header that is included by GoAhead source code.</p>
  61. <table title="sandbox" class="ui table segment">
  62. <thead>
  63. <tr>
  64. <th>Directive</th><th>Purpose</th>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. <tr>
  69. <td class="pivot">limitBuffer</td>
  70. <td>General I/O buffer size</td>
  71. </tr>
  72. <tr>
  73. <td class="pivot">limitFilename</td>
  74. <td>Maximum filename size</td>
  75. </tr>
  76. <tr>
  77. <td class="pivot">limitHeader</td>
  78. <td>Maximum size of the request header</td>
  79. </tr>
  80. <tr>
  81. <td class="pivot">limitNumHeaders</td>
  82. <td>Maximum number of header lines in the request</td>
  83. </tr>
  84. <tr>
  85. <td class="pivot">limitParseTimeout</td>
  86. <td>Maximum time to parse the request headers</td>
  87. </tr>
  88. <tr>
  89. <td class="pivot">limitPassword</td>
  90. <td>Maximum size of a password</td>
  91. </tr>
  92. <tr>
  93. <td class="pivot">limitPost</td>
  94. <td>Maximum size of the incoming POST request body</td>
  95. </tr>
  96. <tr>
  97. <td class="pivot">limitPut</td>
  98. <td>Maximum size of the incoming PUT request body</td>
  99. </tr>
  100. <tr>
  101. <td class="pivot">limitSessionLife</td>
  102. <td>Default session lifespan in seconds</td>
  103. </tr>
  104. <tr>
  105. <td class="pivot">limitSessionCount</td>
  106. <td>Maximum number of sessions</td>
  107. </tr>
  108. <tr>
  109. <td class="pivot">limitString</td>
  110. <td>Default string size</td>
  111. </tr>
  112. <tr>
  113. <td class="pivot">limitTimeout</td>
  114. <td>Request inactivity timeout in seconds</td>
  115. </tr>
  116. <tr>
  117. <td class="pivot">limitUri</td>
  118. <td>Maximum URI size</td>
  119. </tr>
  120. <tr>
  121. <td class="pivot">limitUpload</td>
  122. <td>Maximum size of a file upload request</td>
  123. </tr>
  124. </tbody>
  125. </table>