Network system access
Three things look after the telephone. The teacher clears the desks before any call, the teacher watches during the examination, and the special examination room is meant to cover every line out of the room. Each sees different things, which is why all three exist. When the teacher picks up the rule sheet for each question, nobody uses the room.
Grading instructions that test the telephone must not put their own telephone in the room, because the rule sheet covers that telephone too. They ring a number outside the room instead.
For the fields an exercise author writes, see Network system access in the instructor guide. This page is about how the domain is enforced.
Model
NetworkPermission, one record per host and port, with separate connect, send and receive
flags.
Validation and normalisation
Host and port are validated separately. A wildcard host is accepted by the model but is almost never what an exercise means.
What it generates
Architecture, aspect-oriented programming (AOP) and Phobos test cases. The Phobos path produces the network section of
SpecificExercise.cfg.
Static enforcement
Matched against network-access-methods.txt. In every domain, a policy with no network
allowance produces a static deny-all rule that fires before any runtime mechanism is
consulted.
Runtime enforcement
JavaInstrumentationAdviceNetworkSystemToolbox inside the Java Virtual Machine (JVM). Outside it,
Phobos is meant to apply the allow-list to the whole process, including anything the JVM shells
out to; see ls1intum/phobos.
Where the code lives
policy/policySubComponents/NetworkPermission.javaaop/java/instrumentation/advice/JavaInstrumentationAdviceNetworkSystemToolbox.javatemplates/phobos/PhobosCopyTool.sh, copied into the exercise- the network layer itself, in ls1intum/phobos
Known gaps
Ares writes the Phobos section but only enforces it when the Phobos wrapper runs the build. In Postcompile Ares generates the Phobos cases and never dispatches them.
A test fixture that opens a socket inside the sandboxed JVM is itself subject to the policy, so network tests must use an external echo server. See Testing conventions.