hws/hw04.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Thu, 15 Oct 2015 01:41:33 +0100
changeset 406 0516bffd3f5f
parent 404 4e3bc09748f7
child 413 0f824ca252e4
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass{article}
250
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
     2
\usepackage{../style}
39
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\begin{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\section*{Homework 4}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
401
2d6eb340fd98 updated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 392
diff changeset
     8
\HEADER
2d6eb340fd98 updated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 392
diff changeset
     9
39
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\begin{enumerate}
392
4dff36e2bbc6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 389
diff changeset
    11
\item What should the architecture of a network application under Unix
4dff36e2bbc6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 389
diff changeset
    12
  be that processes potentially hostile data?
4dff36e2bbc6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 389
diff changeset
    13
4dff36e2bbc6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 389
diff changeset
    14
\item What is a unikernel system and why is a unikernel
4dff36e2bbc6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 389
diff changeset
    15
preferable on a web server system (in contrast to a traditional
404
4e3bc09748f7 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 401
diff changeset
    16
general purpose operating system like Linux). Hint: What is
4e3bc09748f7 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 401
diff changeset
    17
the idea of a unikernel.
392
4dff36e2bbc6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 389
diff changeset
    18
239
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    19
\item What does the principle of least privilege say?
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    20
389
9019f84ef99c updated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 348
diff changeset
    21
\item How can you exploit the fact that every night root has a cron
9019f84ef99c updated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 348
diff changeset
    22
  job that deletes the files in \texttt{/tmp}? (Hint: cron-attack)
9019f84ef99c updated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 348
diff changeset
    23
9019f84ef99c updated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 348
diff changeset
    24
239
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    25
\item In which of the following situations can the access control mechanism of Unix
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    26
file permissions be used?
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    27
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    28
\begin{itemize}
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    29
\item[(a)] Alice wants to have her files readable, except for her office mates.
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    30
\item[(b)] Bob and Sam want to share some secret files.
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    31
\item[(c)] Root wants some of her files to be public.
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    32
\end{itemize}
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    33
117
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
    34
\item Explain what is meant by \emph{Kerckhoffs' principle}.
39
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
122
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    36
\item How can a system that separates between \emph{users} and \emph{root} be of any 
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    37
help with buffer overflow attacks?
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    38
239
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    39
\item What does it mean that the program \texttt{passwd} has the
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 122
diff changeset
    40
  \texttt{setuid} bit set? Why is this necessary?
122
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    41
348
b322a245589c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 250
diff changeset
    42
\item Which permissions does the program \texttt{login}
247
95e14b2dbc94 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 239
diff changeset
    43
normally have and why is this needed?
122
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    44
250
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
    45
\item The variable \texttt{PATH} is a shell variable in UNIX which
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
    46
  lists all directories that should be automatically searched for a
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
    47
  program. For example if \texttt{PATH} contains the directory
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
    48
  \texttt{/usr/bin} and the program \texttt{ls} is stored there, then
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
    49
  a user does not need to type \texttt{/usr/bin/ls} to run this file,
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
    50
  but \texttt{ls} suffices. The question is why is it a bad idea in
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
    51
  general, but in particular for root, to have \texttt{.} as the first
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
    52
  entry in ones variable \texttt{PATH}?
bf4538649619 updated hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 247
diff changeset
    53
122
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    54
\item A Unix directory might look as follows:
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    55
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    56
\begin{center}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    57
\begin{verbatim}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    58
$ ls -ld . * */*
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    59
drwxr-xr-x 1 ping staff  32768 Apr  2 2010 .
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    60
-rw----r-- 1 ping students  31359 Jul 24 2011 manual.txt
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    61
-r--rw--w- 1 bob students   4359 Jul 24 2011 report.txt
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    62
-rwsr--r-x 1 bob students 141359 Jun  1 2013 microedit
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    63
dr--r-xr-x 1 bob staff  32768 Jul 23 2011 src
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    64
-rw-r--r-- 1 bob staff  81359 Feb 28 2012 src/code.c
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    65
-r--rw---- 1 emma students    959 Jan 23 2012 src/code.h
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    66
\end{verbatim}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    67
\end{center}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    68
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    69
with group memberships assigned as follows:
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    70
\begin{center}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    71
\begin{tabular}{ll}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    72
Members of group staff: & ping, bob, emma\\ 
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    73
Members of group students: & emma\\
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    74
\end{tabular}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    75
\end{center}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    76
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    77
The file microedit is a text editor, which allows its users to open, edit and 
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    78
save files. Note carefully that microedit has set its setuid flag. 
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    79
Fill in the access control matrix below that shows for each of the above five files, 
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    80
whether ping, bob, or emma are able to obtain the right to read (R) or replace (W) its 
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    81
contents using the editor microedit.\bigskip
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    82
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    83
\begin{center}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    84
\begin{tabular}{r|c|c|c|c|c}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    85
        & manual.txt & report.txt & microedit & src/code.c & src/code.h \\\hline
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    86
ping & & & & &\\\hline
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    87
bob & & & & &\\\hline
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    88
emma   & & & & &\\
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    89
\end{tabular}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    90
\end{center}
f0e51ffd2965 added hw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
    91
247
95e14b2dbc94 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 239
diff changeset
    92
\item In the context of which information flow should be protected, explain briefly the 
95e14b2dbc94 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 239
diff changeset
    93
differences between the {\it read rule} of the Bell-LaPadula access
95e14b2dbc94 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 239
diff changeset
    94
policy and the Biba access policy. Do the same for the {\it write rule}.
39
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
\end{enumerate}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
50
33b26c8efa03 added hw
Christian Urban <urbanc@in.tum.de>
parents: 40
diff changeset
    98
39
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
%%% Local Variables: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
%%% End: