Verifying the Secure Baseline
Even a rule sheet that allows no worksheet lets a few through. The permitted aids need them to do their work, such as picking a random number.
Both ways of watching have to let exactly the same things through and stop the same things. This page lists each one and the proof that the two agree. They agree on every one but one. With some editions of the permitted aids, one way stops an aid fetching a tool it needs for itself, and the other way never sees it. Where one way never even sees an act, the page names that difference, so a new one cannot slip in unseen.
The secure baseline is what a policy with no file entries still allows. The instructor-facing list is What works without an entry. This page records how each backend decides each item and which test proves it, so a change to one backend that the other does not follow fails the build.
The parity test
BaselineExemptionParityTest (src/test/java/de/tum/cit/ase/ares/api/aop/java/) sends the same
call, with the same arguments and the same allow-list, through the real file-system check of both
runtime backends, from a supervised frame (example.student.BaselineAdviceProbe). Each row states
the verdict expected from each backend. A row whose two verdicts differ must be named in
INTENDED_ASYMMETRIES, and every name there must still differ, so fixing a difference forces its
entry to be deleted. Today the list is empty: every verdict row agrees.
The same class compares the constants the backends duplicate:
- the native-library suffixes trusted under
java.home, equal on both; - the random-seed devices, named on instrumentation only (see below);
- no list of file names allowed wherever they lie, on either backend;
- the calls ArchUnit and T. J. Watson Libraries for Analysis (WALA) allow without an entry, equal once both use one notation.
What each backend decides
| Operation | Instrumentation | AspectJ | Proven by (parity test covers runtime backends only) |
|---|---|---|---|
Read under java.home | Allowed: trusted start-up root | Allowed: same root, from the Java Virtual Machine (JVM)'s start-up record | Parity test; BaselineStandardAllowTest (certificates, locale and charset data) |
Create, replace or delete under java.home | Refused | Refused | Parity test |
Load a Java Development Kit (JDK) native library under java.home, by path | Allowed | Allowed | Parity test |
| The JDK loading its own native library by name | Allowed at Runtime.loadLibrary0 for a caller from the JVM's own or the platform class loader, a plain name and a file directly in the JDK's library folder, on JDK 17, 21 and 25 only | Nothing to allow: the JDK's call sites are not woven | NativeLibraryFirstLoadTest; NativeLibraryJdkLoadTest |
| Load a native library by name from student code, or from test code beneath student code | Refused | Refused | Parity test (the three by bare name rows); NativeLibraryLoadDeniedTest |
Read a .jar in the start-up Maven repository | Allowed | Allowed | Parity test; JceGeneratedExerciseTest (start-up repository only) |
Read an entry of an already-open JarFile/ZipFile | Allowed for entries or getInputStream on a JDK archive class; Ares still checks opening it | Same | Parity test (including malformed method details); ArchiveEntryInterceptionTest (student subclass, four modes); BaselineStandardAllowTest (open JDK archives, both backends) |
SecureRandom, UUID.randomUUID() | Allowed while the JDK's own seed class reads the device | Nothing to allow: the JDK's read is not woven | BaselineStandardAllowTest; BaselineStillDeniedTest (direct read, provider callback) |
| System timezone | Nothing to allow: read natively or under java.home | Same | BaselineStandardAllowTest; BaselineStillDeniedTest (direct read) |
| Temporary file without a directory | Allowed in the directory fixed at start-up | Allowed in the start-up directory | Parity test; BaselineStandardAllowTest; BaselineStillDeniedTest (named directories, links, a planting file attribute) |
Files.createTempDirectory | Refused | Refused | Parity test; BaselineStillDeniedTest |
| A file named like one of Ares's own files | Checked like any other file | Checked like any other file | Parity test |
| A student record | Rewritten for thread and monitor calls; its generated methods pass through | Woven like any class | BaselineStandardAllowTest.test_useRecord…, ThreadSystemAccessTest.test_recordStartsThread…, JavaInstrumentationRecordCallSiteTest |
Named differences
- Random-seed devices. Instrumentation sees the JDK opening
/dev/urandomwhile seeding and allows exactly that; AspectJ never sees it. Both refuse a student who opens the device directly. The reason AspectJ cannot see the JDK's own calls is section 2 of the weaknesses page. - The JDK's own native libraries. Instrumentation sees the JDK ask for its own library by
name, such as
awton a student's firstBufferedImage, and allows exactly that atRuntime.loadLibrary0; AspectJ never sees it. Both refuse a load by name that student code, or test code beneath it, asks for. On a feature release other than 17, 21 and 25, instrumentation keeps the check at the publicloadLibrarymethods and refuses the JDK's own first loads too, see the execute operations. - A thread started through a method reference. Refused on instrumentation, missed by AspectJ; this is an AspectJ weakness outside the baseline, listed in section 3 of the weaknesses page.
Removed name-based exemptions
Both backends dropped two exemptions that once matched a file by its name alone:
- the JDK's cryptography policy file names (
default_local.policyand the like): genuine cryptography reads them underjava.home; - six Ares file names (
messages.properties,EssentialClasses.yamland others), matched by their ending for every action. Ares reads its own files itself, outside any student call. The re-entrancy guard skips file access made while a check runs.
The parity test has denied rows for a default_local.policy outside java.home (read), a
messages.properties (read, overwrite and delete) and an EssentialClasses.yaml (overwrite).
PrecompileTest checks that a generated exercise's copy of the advice carries neither list.
Running the evidence
mvn test -Dtest=BaselineExemptionParityTest,JavaInstrumentationRecordCallSiteTest
mvn test -Dtest='BaselineStandardAllowTest,BaselineStillDeniedTest,ThreadSystemAccessTest'
mvn test -Dtest='PrecompileTest,JceGeneratedExerciseTest'
The integration tests carry one method per mode combination (…MavenArchunitAspectJ,
…MavenArchunitInstrumentation, …MavenWalaAspectJ, …MavenWalaInstrumentation).