Skip to main content

Test class exemptions

Simple Story

The rule sheet holds back the pupils, not the grading instructions. When the grading instructions tell the teacher to open a pupil's worksheet and check it, the teacher can do so.

The head teacher names which papers are the grading instructions. They write no second list of who is free from the rule sheet: naming the grading instructions is what frees them.

Who is who

Position in the example policy file​

The section documented on this page is marked in red. Every page in this section shows the same example file, so reading them in order walks it from top to bottom.

security-policy.yaml
thisPolicyFileCompliesToThePolicyVersion: 1
regardingTheSupervisedCode:
theFollowingProgrammingLanguageConfigurationIsUsed: JAVA_USING_MAVEN_WALA_AND_ASPECTJ
theSupervisedCodeUsesTheFollowingPackage: "org.example"
theMainClassInsideThisPackageIs: "Main"

theFollowingClassesAreTestClasses:
- "org.example.PenguinTest"

theFollowingResourceAccessesArePermitted:

regardingFileSystemInteractions:
- onThisPathAndAllPathsBelow: "something.txt"
readAllFiles: true
overwriteAllFiles: true
createAllFiles: true
executeAllFiles: false
deleteAllFiles: false

regardingNetworkConnections:
- onTheHost: "www.example.com"
onThePort: 80
openConnections: true
sendData: true
receiveData: true

regardingCommandExecutions:
- executeTheCommand: "ls"
withTheseArguments:
- "-l"

regardingThreadCreations:
- createTheFollowingNumberOfThreads: 10
ofThisClass: "org.example.Worker"

regardingPackageImports:
- importTheFollowingPackage: "java.util"

regardingTimeouts:
- timeout: 120000

Fields​

Implemented by ClassPermission in policy/policySubComponents/ClassPermission.java.

FieldDatatypeExplanationExampleRegex or Range
classNameStringA fully qualified class name that is trusted and therefore not sandboxed. Never written directly in the policy file; see the note below.org.example.PenguinTestMust not be null and must not be blank. No pattern is applied, because the values are produced internally rather than authored.

Notes​

This is the one entry in this section with no field of its own in the policy file. The field you write is theFollowingClassesAreTestClasses, marked above. The ClassPermission record Ares builds from it is derived, not authored: it is the union of two sets,

  1. the essential classes, which are Ares' own infrastructure, and
  2. the test classes declared in theFollowingClassesAreTestClasses, the field marked above.

How that set is derived and how it reaches the two enforcement layers is described in the contributor guide under Class permission.

Each entry in theFollowingClassesAreTestClasses is itself validated against JAVA_CLASS_PATH_PATTERN, a fully qualified Java class name.

Before Ares creates any security test, it looks for each entry in the compiled test output. If it cannot find a usable class file of that name there, Ares stops with an error rather than exempting the bare name. Typical causes are a typo, a renamed or deleted test, or an entry that names a package. A student class could otherwise take that name and inherit the exemption. Compile the tests before running Ares, and list each test class by its exact name.