Computer Systems Security: Winter 2018 Assignment 2: Difference between revisions

From Soma-notes
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 21: Line 21:
<li>What is one way the OS protects itself from modification by third parties?</li>
<li>What is one way the OS protects itself from modification by third parties?</li>
</li>
</li>
</ol>
</ol>
==Solutions==
<ol>
<li>A certificate is a public key with associated metadata (such as the name of the person or host associated with the key, the algorithm of the key, etc).  Normally certificates are digitally signed using private keys belonging to trusted entities, namely certificate authorities.  Certificates can also be signed using the private key associated with the certificate's public key.  In this case the certificate is "self signed". (1 point for public key + metadata, 1 for explaining CA signatures)</li>
<li>A client ssh process receives a public key from a remote host.  The client then engages in a cryptographic protocol which demonstrates to the client that the remote host has the private key associated with the presented public key.  The client also checks its record of public keys fore remote hosts (normally in ~/.ssh/known_hosts or /etc/ssh/ssh_known_hosts). If the verification protocol succeeds and the client has a record of the public key belonging to the remote host, the remote host is authenticated.  If there is no key stored for the remote host, the user is given the option to remember this key; thus, on future connections the connection can be authenticated.  If the key stored is different from the key presented, the ssh client warns of a host key mismatch and terminates the connection. (1 for protocol to verify public key, 1 for role of known_hosts)</li>
<li>Web browsers connecting via TLS do a very similar thing to ssh, in that the remote host sends a public key (as part of a certificate) and the browser verifies that the remote host has the corresponding private key by engaging in a public key verification protocol.  Rather than checking a database of stored public keys, however, web browsers instead verify a chain of signatures on the supplied certificate, with the final signature in the chain being verified using a stored public key that comes from a trusted certificate authority.  The set of trusted CA public keys are normally included in a browser; however, this database can be modified manually to add or remove keys. (1 for public key verification, 1 for role of CAs)</li>
<li>The browser sandbox is designed to prevent web pages from interacting with other loaded web pages (tabs or windows) or the underlying host operating system.  Thus when functioning properly the sandbox thus prevents random websites cannot modify arbitrary files or processes belonging to the current user or any other user.  Further, it also prevents websites from interfering with each other (e.g., a page from google.com cannot change what is seen in another tab loading bing.com).  The browser sandbox does not prevent interactions between components loaded into the same tab (e.g., a twitter feed and a facebook like button).  While stored data such as cookies are separated on a per-host basis (thus storage is also sandboxed in a sense), the browser sandbox not prevent attacks that make use of stored information (e.g., cookies in cross-site request forgery attacks).  (1 point for attacks prevented, 1 for attacks not prevented.  Full credit answers should make it clear what is and is not in scope of the browser sandbox.)</li>
<li>Yes, an attacker could exploit a bookmark-based vulnerability simply by tricking a user into bookmarking a website.  Once the page was bookmarked, the attack code would be stored; this code would then be run any time the browser accessed the bookmarks file, which would be at least every time the browser is started. (1 for saying yes, 1 for the explanation)</li>
<li>Backdoors are normally hard to discover because they are simply code that is designed to look normal while adding malicious functionality (such as a way to bypass authentication).  Thus finding a backdoor is like trying to find a bug, except that 1) the creator of the bug has tried to hide the bug, and 2) the bug does not manifest except in extremely unusual circumstances, and you do not have a working test case with which to demonstrate the bug.  Thus the only times backdoors are normally found are either when someone is doing a detailed security audit (and is very good at finding hidden features in code), the backdoor is used and the defender has a record of the input given that triggered the backdoor, someone confesses to inserting the backdoor, or someone gets lucky when examining or modifying the affected application. (1 point for understanding what a backdoor is, 1 for properly explaining why they are hard to find)</li>
<li>Hardware virtual machines can mitigate attacks on other virtual machines and the VM's host operating system, in that software running inside of a guest virtual machine should not be able to affect other VMs or the host OS, other than using the resources it has been allocated.  VMs, however, open new opportunities to attackers because it is very difficult to observe behavior in a guest OS.</li>
<li>The key advantage of mandatory access control is that attackers cannot change access restrictions even when they gain access as root, thus limiting the damage attacks can do.  The disadvantage is that a sysadmin (running as root) cannot change access restrictions; instead, they have to reboot the system into a special mode in which the security policies can be changed (but the system isn't otherwise running normally).  Thus the biggest advantage of MAC is also its biggest disadvantage.</li>
<li>The security of the initial install of most OSs is first guaranteed by verifying the authenticity and integrity of install media (e.g., looking up the hash of an ISO image on a trusted website).  Once a system is installed, the integrity and authenticity of updates are verified normally using digital signatures that can be verified with pubic keys embedded in the OS image.  If applications are sandboxed (e.g., iOS, snap and flatpak on Linux), they cannot modify the underlying OS, even at install time.  Otherwise, generally applications are given full administrative access at install time and so they can modify arbitrary files as part of the installation.  The only way to prevent them from doing damage is to not install them.</li>
</ol>
</ol>

Latest revision as of 17:08, 5 March 2018

Please answer the following questions. There are 9 questions with 20 points. Submit your answers as a text or PDF file via cuLearn by March 5, 2018 at 10:00 AM. Be sure to put your name and student number at the beginning of your submission.

When answering each question, please indicate the sources of your answer. This could be a man page, your own experiments, discussion with a friend, or a website. Please list all your sources. You are allowed to collaborate; such collaboration should be clearly documented! If you already know an answer because of background knowledge you had before the class, that is fine, just state that this is the case.

Questions

  1. [2] Explain what a certificate is, in relationship to public keys, digital signatures, and other characteristics.
  2. [2] How does ssh verify the identity of remote hosts? Specifically, what information does the ssh client receive, and how is this information used?
  3. [2] How do web browsers verify the identity of remote websites when connecting via TLS? Specifically, what information does the web browser receive, and how is this information used?
  4. [2] What is the threat model behind the design of the browser sandbox? Specifically, what kinds of attacks does the browser sandbox prevent (assuming it works as designed), and what kinds of attacks does the browser sandbox not prevent?
  5. [2] Assume that Firefox has a memory corruption vulnerability in its parsing of locally stored bookmarks. Could an attacker exploit such a vulnerability? Explain briefly.
  6. [2] Why are backdoors normally hard to discover? Describe the means by which a backdoor could be discovered in an application. Be sure to explain what conditions had to be present in order for the backdoor to be discovered.
  7. [2] What kinds of attacks can a hardware virtual machine, such as VirtualBox, mitigate? Do virtual machines open up any new opportunities for attackers?
  8. [2] What is the key advantage of mandatory access control (over discretionary access control)? What is the key disadvantage?
  9. [4] For an operating system/distribution of your choice, answer the following questions:
    1. How does one verify the integrity and authenticity of the initial operating system install?
    2. How is the integrity of software updates verified?
    3. Are third party applications given the ability to modify (corrupt) the operating system?
    4. What is one way the OS protects itself from modification by third parties?

Solutions

  1. A certificate is a public key with associated metadata (such as the name of the person or host associated with the key, the algorithm of the key, etc). Normally certificates are digitally signed using private keys belonging to trusted entities, namely certificate authorities. Certificates can also be signed using the private key associated with the certificate's public key. In this case the certificate is "self signed". (1 point for public key + metadata, 1 for explaining CA signatures)
  2. A client ssh process receives a public key from a remote host. The client then engages in a cryptographic protocol which demonstrates to the client that the remote host has the private key associated with the presented public key. The client also checks its record of public keys fore remote hosts (normally in ~/.ssh/known_hosts or /etc/ssh/ssh_known_hosts). If the verification protocol succeeds and the client has a record of the public key belonging to the remote host, the remote host is authenticated. If there is no key stored for the remote host, the user is given the option to remember this key; thus, on future connections the connection can be authenticated. If the key stored is different from the key presented, the ssh client warns of a host key mismatch and terminates the connection. (1 for protocol to verify public key, 1 for role of known_hosts)
  3. Web browsers connecting via TLS do a very similar thing to ssh, in that the remote host sends a public key (as part of a certificate) and the browser verifies that the remote host has the corresponding private key by engaging in a public key verification protocol. Rather than checking a database of stored public keys, however, web browsers instead verify a chain of signatures on the supplied certificate, with the final signature in the chain being verified using a stored public key that comes from a trusted certificate authority. The set of trusted CA public keys are normally included in a browser; however, this database can be modified manually to add or remove keys. (1 for public key verification, 1 for role of CAs)
  4. The browser sandbox is designed to prevent web pages from interacting with other loaded web pages (tabs or windows) or the underlying host operating system. Thus when functioning properly the sandbox thus prevents random websites cannot modify arbitrary files or processes belonging to the current user or any other user. Further, it also prevents websites from interfering with each other (e.g., a page from google.com cannot change what is seen in another tab loading bing.com). The browser sandbox does not prevent interactions between components loaded into the same tab (e.g., a twitter feed and a facebook like button). While stored data such as cookies are separated on a per-host basis (thus storage is also sandboxed in a sense), the browser sandbox not prevent attacks that make use of stored information (e.g., cookies in cross-site request forgery attacks). (1 point for attacks prevented, 1 for attacks not prevented. Full credit answers should make it clear what is and is not in scope of the browser sandbox.)
  5. Yes, an attacker could exploit a bookmark-based vulnerability simply by tricking a user into bookmarking a website. Once the page was bookmarked, the attack code would be stored; this code would then be run any time the browser accessed the bookmarks file, which would be at least every time the browser is started. (1 for saying yes, 1 for the explanation)
  6. Backdoors are normally hard to discover because they are simply code that is designed to look normal while adding malicious functionality (such as a way to bypass authentication). Thus finding a backdoor is like trying to find a bug, except that 1) the creator of the bug has tried to hide the bug, and 2) the bug does not manifest except in extremely unusual circumstances, and you do not have a working test case with which to demonstrate the bug. Thus the only times backdoors are normally found are either when someone is doing a detailed security audit (and is very good at finding hidden features in code), the backdoor is used and the defender has a record of the input given that triggered the backdoor, someone confesses to inserting the backdoor, or someone gets lucky when examining or modifying the affected application. (1 point for understanding what a backdoor is, 1 for properly explaining why they are hard to find)
  7. Hardware virtual machines can mitigate attacks on other virtual machines and the VM's host operating system, in that software running inside of a guest virtual machine should not be able to affect other VMs or the host OS, other than using the resources it has been allocated. VMs, however, open new opportunities to attackers because it is very difficult to observe behavior in a guest OS.
  8. The key advantage of mandatory access control is that attackers cannot change access restrictions even when they gain access as root, thus limiting the damage attacks can do. The disadvantage is that a sysadmin (running as root) cannot change access restrictions; instead, they have to reboot the system into a special mode in which the security policies can be changed (but the system isn't otherwise running normally). Thus the biggest advantage of MAC is also its biggest disadvantage.
  9. The security of the initial install of most OSs is first guaranteed by verifying the authenticity and integrity of install media (e.g., looking up the hash of an ISO image on a trusted website). Once a system is installed, the integrity and authenticity of updates are verified normally using digital signatures that can be verified with pubic keys embedded in the OS image. If applications are sandboxed (e.g., iOS, snap and flatpak on Linux), they cannot modify the underlying OS, even at install time. Otherwise, generally applications are given full administrative access at install time and so they can modify arbitrary files as part of the installation. The only way to prevent them from doing damage is to not install them.