Skip to main content

Malicious participation analysis for a programming exercise

Deimos screens programming exercise participations for signs of malicious intent against the build infrastructure. It can be started for a whole course or for a single programming exercise. This page covers the exercise-scoped run and what Deimos can actually observe about a programming exercise.

The workflow, the time window, the limits, and how to read the completion email are documented once, on Malicious participation analysis. Start there if you have not run an analysis before.

Starting a run for one exercise​

  1. Open the programming exercise in Course Management → Exercises.
  2. Select the exercise title to open its details and scroll to Exercise administration at the bottom of the page.
  3. Select Run Malicious Participation Analysis.
  4. Choose the time window and confirm.

The button only appears for instructors, and only when the Deimos module is loaded and its feature toggle is on. The dialog, the validation, and the completion email are identical to a course-wide run; only the set of participations differs.

Exercise scope or course scope​

SituationUse
A single exercise looks suspicious, for example after an unusual build failureExercise scope
A specific exercise attracts attention because of its topic, for example anything touching shells or networkingExercise scope
Routine screening after a deadline across all programming exercisesCourse scope
The run keeps hitting the participation limitExercise scope, exercise by exercise

Exercise scope is also the better choice when you expect false positives. An exercise whose subject is security, process handling, or networking will produce flagged participations that are entirely legitimate, and reviewing those is much easier when they are not mixed into a course-wide result.

Which participations are included​

A participation is included when it belongs to the exercise and has at least one submission with a submission date inside the chosen window. Beyond that there is no filter, which has consequences that are easy to overlook:

  • Practice participations and exam test runs are not excluded. Your own test run of an exercise can be analysed and, in principle, flagged.
  • Template, solution, and test repositories are never analysed. Only student participations are.
  • Team participations are analysed as one participation, like any other. The verdict applies to the team's repository, not to an individual member.
  • Submissions without a submission date are invisible to the selection.

Remember that a qualifying participation is reconstructed over its complete observed history, not only over the part inside the window, and that history is what gets analysed, subject to the size bounds below. The window is a filter on participations, not on commits.

What is analysed​

For each selected participation, Artemis reconstructs the observed submission snapshot history and turns it into unified diffs:

  1. A diff of the first snapshot against the exercise template, followed by a diff between each pair of consecutive snapshots, in chronological order. The template is the baseline, so the first section shows everything the student added to the given starting point. Deimos reads it from the template repository of the exercise, in the version Artemis recorded last before the student's participation was set up, and never from the student's repository, whose history the student controls. If the template repository cannot be read, the participation fails with Repository could not be read.
  2. A cumulative diff of the final state against the exercise template. It is usually present, and it is what lets the model see where the participation ended up even when intermediate snapshots were dropped. It is left out in two cases: when the final state does not differ from the template at all, and when it would exactly repeat a single snapshot whose text was emitted without any omission or truncation.

Diffs contain changed lines with surrounding context, together with file paths, abbreviated commit hashes, and submission timestamps. Every text file is included, shell and batch scripts as well. Binary files, such as images or archives, symbolic links and submodules are left out; their names are still checked for imitated markers. When the student adds such an entry or changes its content, the data the model receives says how many such changes were left out, without naming them, and the participation is reported as incompletely checked even if the model finds it benign. If nothing but such entries changed, the model is not asked at all. An entry that matches the exercise template, whether left unchanged or restored, does not count. The model receives this history and classifies the participation as malicious or benign, with a short rationale. It is instructed to look for patterns across snapshots, such as incremental probing or escalation, not only for a single incriminating line.

Independently of the model, Artemis checks the complete content of every snapshot, and every file path, for text that imitates the markers separating student code from the instructions to the model, such as ---END UNTRUSTED DATA ...---. Case, spacing and the identifier do not matter, and text around the marker, for example a comment sign, does not hide it. The check covers files that the size limits below keep from the model, so padding a submission does not hide a forged marker from it. A marker that the exercise template already contains is not attributed to the student, as often as the same file of the template contains it: every further copy counts. A hit is reported as a manipulation attempt.

Changing the template after students have started usually does not affect their analysis: a student who still has a marker line you removed later is not reported for it, and your changes do not appear in the diffs as if the student had made them. Deimos finds the version the student received from what Artemis records whenever the template changes: the version recorded last before the participation was set up is the baseline. This is an approximation. Where no such record exists, Deimos uses the current template instead. Your changes since the student started then appear in the diffs as if the student had made them in reverse, a marker line you removed counts as a finding for every student who still has it, and a marker line you added is no longer attributed to a student who wrote the same line. This happens for participations without a start date, such as programming practice participations, and when the recorded version is no longer in the template repository. The approximation can also pick a version other than the one the student received: when you deleted template submissions of the exercise, when you reset the template history to an earlier version, when the template changed in the moments between copying the repository and recording the start, when a student repository was recreated later, and for practice participations copied from the graded one.

Snapshots are not commits​

Deimos reconstructs the history from Artemis submission records rather than by walking the git commit graph. Several commits that a student pushed together therefore appear collapsed into a single snapshot, and the intermediate states between them are never seen. When you verify a flagged participation, expect the commit list in the submissions view to be finer-grained than the snapshots the model was shown.

Size limits and truncation​

The payload sent to the model is bounded, so a single very large participation cannot consume the whole run. Your administrator can change these bounds; the defaults are:

BoundDefaultEffect
Input size per file256 KiBFiles above this are not diffed at all.
Diff size per file32 KiBLarger per-file diffs are truncated at a line boundary. If that would leave none of the added code of the first changed section, for example because the first changed line alone is too long, as in a minified file, the beginning of the removed and of the added line is shown instead.
Total payload128 KiBA hard bound on the submission history the model receives for one participation, including diff headers and omission notices. The fixed instructions around it come on top. Files and snapshots beyond it are dropped.
Reserved for the final state32 KiBPart of the total held back so there is always room for the cumulative diff against the template. A cumulative diff larger than the remaining budget is itself truncated.

Omissions caused by these budgets are marked explicitly in the data the model receives, and the reservation for the final state exists so that exhausting the budget cannot leave the model judging only the earliest part of a long history. Still, a participation with a very large repository is analysed less completely than a small one. When the model finds such a participation benign, the completion email reports it as incompletely checked instead, so you know which parts nobody has looked at. It lists up to ten omissions with their reason, the file where a single file is affected, and the snapshot, or final state for the cumulative diff. Omissions beyond the first ten are counted.

A submission with a blank commit hash cannot be read. It is marked in the data the model receives and makes an otherwise benign participation incompletely checked as well. Submissions that carry no commit hash at all are excluded before the history is even built and leave no trace. Both are rare, and they are distinct from a hash that exists but cannot be resolved in the repository. That case is not silent: if no marker was found earlier, the participation fails with Repository could not be read. Otherwise, it is reported as a manipulation attempt, with the repository error as additional information.

What Deimos does not see​

  • Other exercise types. Quiz, modelling, text, and file upload exercises are out of scope. Deimos is specific to programming exercises.
  • Code that was never pushed. Only what reached Artemis as a submission is observable.
  • Build behaviour. Deimos reads source diffs. It does not inspect build logs, runtime behaviour, container activity, or network traffic from the build. A participation that only becomes malicious through interaction with the build environment may look unremarkable in the diff.
  • Anything outside the repository, such as an attack carried out through the web interface.

After the run​

The result arrives by email, to you alone, with deep links to the flagged participations of this exercise. How to read it, how to verify a flagged participation before acting on it, and what to do if a finding holds are described in Malicious participation analysis.

Exercise-scoped runs are also where the arithmetic works in your favour. Because false alarms scale with the number of analysed participations while real cases do not, a run over one exercise produces a far higher share of useful flags than a course-wide one. The worked example shows the difference.

Search documentation