security.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Security</title>
  5. <!-- Copyright Embedthis Software. All Rights Reserved. -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <meta charset="utf-8" />
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  10. <meta name="description" content="Simple, fast, secure embedded web server" />
  11. <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Open+Sans:300italic,400,300,700'
  12. rel='stylesheet' type='text/css'>
  13. <link href='https://fonts.googleapis.com/css?family=Julius+Sans+One' rel='stylesheet' type='text/css'>
  14. <link href="../images/favicon.ico" rel="shortcut icon" />
  15. <link href="../lib/semantic-ui/semantic.min.css" rel="stylesheet" type="text/css" />
  16. <link href="../css/all.min.css" rel="stylesheet" type="text/css" />
  17. <link href="../css/api.min.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body class="show-sidebar">
  20. <div class="sidebar">
  21. <div class="ui large left vertical inverted labeled menu">
  22. <div class="item">
  23. <a href="../" class="logo">GoAhead Docs</a>
  24. </div>
  25. <div class="item">
  26. <a href="../">
  27. <b>General</b>
  28. </a>
  29. <div class="menu">
  30. <a class="item" href="../">GoAhead Overview</a>
  31. <a class="item" href="../users/features.html">GoAhead Features</a>
  32. <a class="item" href="https://embedthis.com/goahead/download.html">Download</a>
  33. <a class="item" href="../licensing/">Licensing</a>
  34. </div>
  35. </div>
  36. <div class="item">
  37. <a href="../start/">
  38. <b>Getting Started</b>
  39. </a>
  40. <div class="menu">
  41. <a class="item" href="../start/quick.html">Quick Start</a>
  42. <a class="item" href="../start/installing.html">Installing GoAhead</a>
  43. <a class="item" href="../start/running.html">Running GoAhead</a>
  44. <a class="item" href="../start/releaseNotes.html">Release Notes</a>
  45. <a class="item" href="../start/faq.html">GoAhead FAQ</a>
  46. <a class="item" href="../start/source.html">Building from Source</a>
  47. </div>
  48. </div>
  49. <div class="item">
  50. <a href="../users/"><b>User's Guide</b></a>
  51. <div class="menu">
  52. <a class="item" href="../users/ports.html">Ports and Binding</a>
  53. <a class="item" href="../users/routing.html">Routing Requests</a>
  54. <a class="item" href="../users/handlers.html">Request Handlers</a>
  55. <a class="item" href="../users/js.html">Embedded Javascript</a>
  56. <a class="item" href="../users/jst.html">Javascript Templates</a>
  57. <a class="item" href="../users/goactions.html">GoActions</a>
  58. <a class="item" href="../users/cgi.html">CGI Programs</a>
  59. <a class="item" href="../users/authentication.html">User Authentication</a>
  60. <a class="item" href="../users/logFiles.html">Log Files</a>
  61. <a class="item" href="../users/ssl.html">Secure Sockets (SSL)</a>
  62. <a class="item" href="../users/security.html">Security Considerations</a>
  63. <a class="item" href="../users/man.html">Man Pages</a>
  64. </div>
  65. </div>
  66. <div class="item">
  67. <a href="../developers/">Developer's Guide</a>
  68. <div class="menu">
  69. <a class="item" href="../developers/embedding.html">Embedding GoAhead</a>
  70. <a class="item" href="../developers/handlers.html">Creating GoAhead Handlers</a>
  71. <a class="item" href="../developers/authstore.html">Creating Password Verifiers</a>
  72. <a class="item" href="../developers/migrating.html">Migrating to GoAhead 3</a>
  73. <a class="item" href="../developers/rom.html">Serving Pages from ROM</a>
  74. </div>
  75. </div>
  76. <div class="item">
  77. <a href="../ref/">Reference Guide</a>
  78. <div class="menu">
  79. <a class="item" href="../ref/compatibility.html">Compatibility</a>
  80. <a class="item" href="../ref/native.html">API Library</a>
  81. <a class="item" href="../ref/architecture.html">GoAhead Architecture</a>
  82. <a class="item" href="../standards/http.html">HTTP References</a>
  83. </div>
  84. </div>
  85. <div class="item">
  86. <a href="../developers/project.html">Project Resources</a>
  87. <div class="menu">
  88. <a class="item" href="http://goo.gl/IGbiio">Official GoAhead News</a>
  89. <a class="item" href="https://embedthis.com/goahead/">GoAhead Web Site</a>
  90. <a class="item" href="https://github.com/embedthis/goahead">Source Code Repository</a>
  91. <a class="item" href="https://github.com/embedthis/goahead/issues/99">GoAhead Security Alerts</a>
  92. <a class="item" href="https://github.com/embedthis/goahead/issues">Project Issue Database</a>
  93. <a class="item" href="https://github.com/embedthis/goahead/releases">Change Log</a>
  94. <a class="item" href="https://github.com/embedthis/goahead/milestones">Roadmap</a>
  95. <a class="item" href="https://embedthis.com/developers/contributors.html">Contributors Agreement</a>
  96. </div>
  97. </div>
  98. <div class="item">
  99. <b>Links</b>
  100. <div class="menu">
  101. <a class="item" href="https://embedthis.com/">Embedthis Web Site</a>
  102. <a class="item" href="https://embedthis.com/blog/">Embedthis Blog</a>
  103. <a class="item" href="http://twitter.com/embedthat">Twitter</a>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="ui inverted masthead">
  109. <div class="ui fixed inverted menu">
  110. <div class="ui sidebar-launch button">
  111. <i class="icon list layout"></i>
  112. </div>
  113. <div class="right menu">
  114. <a class="item" href="https://embedthis.com/">Embedthis</a>
  115. <a class="item" href="https://embedthis.com/goahead/">GoAhead Site</a>
  116. <span class="desktop-only">
  117. <a class="item" href="http://goo.gl/9bL9rM">GoAhead News</a>
  118. <a class="item" href="https://github.com/embedthis/goahead">Repository</a>
  119. <a class="item" href="https://embedthis.com/blog/">Blog</a>
  120. <a class="item" href="https://twitter.com/embedthat">Twitter</a>
  121. </span>
  122. </div>
  123. </div>
  124. <div class="ui breadcrumb">
  125. <a class="section" href="../">Home</a>
  126. <div class="divider">/</div>
  127. <a class="section" href="../users/">
  128. User's Guide
  129. </a>
  130. <div class="divider">/</div>
  131. <a class="active section" href="security.html">Security</a>
  132. </div>
  133. <iframe class="version desktop-only" src="../version.html"></iframe>
  134. </div>
  135. <div class="content">
  136. <h1>Security Considerations</h1>
  137. <p>Securing applications that are accessible to the Internet is not a trivial task. This page outlines some
  138. of the issues, and offers tips to help you secure your application using the Embedthis GoAhead
  139. product.</p><a id="updates"></a>
  140. <h2 >Updates</h2>
  141. <p>Even the best application or HTTP server can experience some security vulnerabilities that are
  142. discovered after being deployed in the field. It is highly recommended that you stay up to date with the
  143. latest version of GoAhead.</p>
  144. <p><a href="http://www.embedthis.com/">Embedthis</a> offers a Security Enhancement Service as part of an
  145. GoAhead commercial license that will proactively notify you of any security flaws and will expedite fixes or
  146. workarounds to minimize the vulnerability.</p>
  147. <a id="account"></a>
  148. <h2 >GoAhead User Account</h2>
  149. <p>It is important that you run GoAhead with the lowest system privilege that will get the job done. If any
  150. application is compromised, including GoAhead, then the system will be safest if the compromised application
  151. has as few privileges as possible.</p>
  152. <a id="directoryPermissions"></a>
  153. <h2 >Directory and File Permissions</h2>
  154. <p>This section explains the policy should you need to move or modify files and directories.</p>
  155. <p>To enhance security you need to consider the directory and file permissions for three classes of
  156. content:</p>
  157. <ul>
  158. <li>Pages served by the HTTP server</li>
  159. <li>Scripts run by the HTTP server</li>
  160. <li>Configuration and log files used by the HTTP server.</li>
  161. </ul>
  162. <p>Pages served by the GoAhead server should be owned by root or administrator and should only be readable
  163. by the GoAhead user account. Directories containing served pages should be readable and executable only.</p>
  164. <p>Scripts run by the GoAhead server should always be outside all directories containing served pages. After
  165. all, you don't want prying eyes viewing your scripts! Scripts should be owned by the <b>root</b> or
  166. <b>administrator</b> and should only be readable and executable by the GoAhead user account.</p>
  167. <p>Configuration and log files used by the GoAhead server should always be outside all directories
  168. containing served pages or scripts. The directory containing the log files must be writable by the GoAhead
  169. user account.</p>
  170. <h3>Home Permissions</h3>
  171. <p>The home directory in which GoAhead executes should be owned by <b>root</b> or administrator, and should be
  172. in the group <b>root</b> or administrators. They should only be writable by this specific user and group.</p>
  173. <a id="authentication"></a>
  174. <h2 >Authentication</h2>
  175. <p>It is highly recommended that you use Form-based <a href="authentication.html#formAuthentication">Form</a>
  176. authentication and not Basic authentication. As implemented in GoAhead, Form authentication over SSL
  177. provides many safeguards against known exploits including; man-in-the-middle attacks, client spoofing,
  178. and replay attacks.</p>
  179. <a id="sandBoxing"></a>
  180. <h2 >Sandboxing</h2>
  181. <p>Sandboxing is the term applied to running GoAhead in a confined environment. When embedding a HTTP server
  182. in an application, the profile of client access is often well known. This profile includes the rate of
  183. accesses, the length of URLs and the size of pages returned to the user.</p>
  184. <p>GoAhead has a set of build time configuration options that allow you to define a sandbox which specifies how
  185. GoAhead must be used for a request to be serviced. By using well defined sandbox directives, you can help
  186. ensure that your application will not be compromised by malicious requests.</p>
  187. <h3>Limit Directives</h3>
  188. <p>The limit directives are defined in main.me which is used by <i>MakeMe</i> when configuring GoAhead
  189. and generating the <i>bit.h</i> header that is included by GoAhead source code.</p>
  190. <table title="sandbox" class="ui table segment">
  191. <thead>
  192. <tr>
  193. <th>Directive</th><th>Purpose</th>
  194. </tr>
  195. </thead>
  196. <tbody>
  197. <tr>
  198. <td class="pivot">limitBuffer</td>
  199. <td>General I/O buffer size</td>
  200. </tr>
  201. <tr>
  202. <td class="pivot">limitFilename</td>
  203. <td>Maximum filename size</td>
  204. </tr>
  205. <tr>
  206. <td class="pivot">limitHeader</td>
  207. <td>Maximum size of the request header</td>
  208. </tr>
  209. <tr>
  210. <td class="pivot">limitNumHeaders</td>
  211. <td>Maximum number of header lines in the request</td>
  212. </tr>
  213. <tr>
  214. <td class="pivot">limitParseTimeout</td>
  215. <td>Maximum time to parse the request headers</td>
  216. </tr>
  217. <tr>
  218. <td class="pivot">limitPassword</td>
  219. <td>Maximum size of a password</td>
  220. </tr>
  221. <tr>
  222. <td class="pivot">limitPost</td>
  223. <td>Maximum size of the incoming POST request body</td>
  224. </tr>
  225. <tr>
  226. <td class="pivot">limitPut</td>
  227. <td>Maximum size of the incoming PUT request body</td>
  228. </tr>
  229. <tr>
  230. <td class="pivot">limitSessionLife</td>
  231. <td>Default session lifespan in seconds</td>
  232. </tr>
  233. <tr>
  234. <td class="pivot">limitSessionCount</td>
  235. <td>Maximum number of sessions</td>
  236. </tr>
  237. <tr>
  238. <td class="pivot">limitString</td>
  239. <td>Default string size</td>
  240. </tr>
  241. <tr>
  242. <td class="pivot">limitTimeout</td>
  243. <td>Request inactivity timeout in seconds</td>
  244. </tr>
  245. <tr>
  246. <td class="pivot">limitUri</td>
  247. <td>Maximum URI size</td>
  248. </tr>
  249. <tr>
  250. <td class="pivot">limitUpload</td>
  251. <td>Maximum size of a file upload request</td>
  252. </tr>
  253. </tbody>
  254. </table>
  255. </div>
  256. <div class="terms ui basic center aligned segment">
  257. <p>&copy; Embedthis Software, 2003-2015. All rights reserved.</p>
  258. </div>
  259. <script src="../lib/jquery/jquery.min.js"></script>
  260. <script src="../lib/semantic-ui/semantic.min.js"></script>
  261. <script src="../scripts/sidebar.min.js"></script>
  262. </body>
  263. </html>