Security.html 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <html lang="en">
  2. <head>
  3. <title>Security - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="up" href="User-Manual.html#User-Manual" title="User Manual">
  9. <link rel="prev" href="Diagnostics.html#Diagnostics" title="Diagnostics">
  10. <link rel="next" href="Example-Script.html#Example-Script" title="Example Script">
  11. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13. <style type="text/css"><!--
  14. pre.display { font-family:inherit }
  15. pre.format { font-family:inherit }
  16. pre.smalldisplay { font-family:inherit; font-size:smaller }
  17. pre.smallformat { font-family:inherit; font-size:smaller }
  18. pre.smallexample { font-size:smaller }
  19. pre.smalllisp { font-size:smaller }
  20. span.sc { font-variant:small-caps }
  21. span.roman { font-family:serif; font-weight:normal; }
  22. span.sansserif { font-family:sans-serif; font-weight:normal; }
  23. --></style>
  24. </head>
  25. <body>
  26. <div class="node">
  27. <a name="Security"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="Example-Script.html#Example-Script">Example Script</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="Diagnostics.html#Diagnostics">Diagnostics</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="User-Manual.html#User-Manual">User Manual</a>
  32. <hr>
  33. </div>
  34. <h3 class="section">1.7 Security</h3>
  35. <p><a name="index-security-115"></a>A few obvious security considerations are relevant to running untrusted
  36. virtual code applications. These points are only as reliable as the
  37. assumption that the <code>avram</code> executable has not been modified to the
  38. contrary.
  39. <a name="index-filter-mode-116"></a>
  40. <ul><li>The applications with the best protection from malicious code are
  41. those that run in filter mode, because they have no access to any
  42. information not presented to them in standard input, nor the ability to
  43. affect anything other than the contents of standard output (provided that
  44. the <code>--jail</code> command line option is used). The worst
  45. they can do is use up a lot of memory, which can be prevented with the
  46. <samp><span class="command">ulimit</span></samp> command. Unfortunately, not all applications are usable
  47. in this mode.
  48. <li>Parameter mode applications that do not involve the <samp><span class="option">-i</span></samp>,
  49. <a name="index-parameter-mode-117"></a><a name="index-standard-input-118"></a><samp><span class="option">-t</span></samp> or <samp><span class="option">-s</span></samp> options are almost as safe (also assuming
  50. <code>--jail</code>). They have (read-only) access to environment variables, and to the files that are
  51. indicated explicitly on the command line. If standard input is one of
  52. the files (as indicated by the use of <code>-</code> as a parameter), the
  53. virtual code application may infer the current date and time. However,
  54. a parameter mode application may write any file that the user has
  55. permission to write. The <samp><span class="option">--ask-to-overwrite</span></samp> option should be
  56. used for better security, or at least the <samp><span class="option">--quiet</span></samp> option should
  57. not be used. The virtual code can neither override nor detect the use
  58. of these options.
  59. <li>Interactive parameter mode applications (those that use either the
  60. <a name="index-interactive-applications-119"></a><samp><span class="option">-i</span></samp>, <samp><span class="option">-t</span></samp> or <samp><span class="option">-s</span></samp> options) are the least secure
  61. because they can execute arbitrary shell commands on behalf of the
  62. user. This statement also applies to filter mode and parameter mode
  63. applications where the <samp><span class="option">--jail</span></samp> option is not used. Use of
  64. <samp><span class="option">--step</span></samp> is preferable to <samp><span class="option">-i</span></samp> for making an audit
  65. trail of all commands executed, but the application could probably
  66. subvert it. The <samp><span class="option">--step</span></samp> option may be slightly better because
  67. it can allow the user to inspect each command and interrupt it if
  68. appropriate. However, in most cases a command will not be displayed
  69. until it is already executed. Commands executed by non-interactive
  70. applications normally will display no output to that effect. A
  71. <samp><span class="command">chroot</span></samp> environment may be the only secure way of running
  72. untrusted interactive applications.
  73. </ul>
  74. </body></html>