Restore SEBPatch

This commit is contained in:
2025-06-01 11:44:20 +02:00
commit 8c656e3137
1297 changed files with 142172 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
namespace SafeExamBrowser.Settings.Security
{
/// <summary>
/// Defines all policies with respect to the usage of the clipboard.
/// </summary>
public enum ClipboardPolicy
{
/// <summary>
/// Allows the usage of the system clipboard without restrictions.
/// </summary>
Allow,
/// <summary>
/// Completely blocks the usage of the system clipboard by continuously clearing its content and blocking all related keyboard shortcuts.
/// </summary>
Block,
/// <summary>
/// Continuously clears the content of the system clipboard and enables an isolated clipboard only working within the browser application.
/// </summary>
Isolated
}
}

View File

@@ -0,0 +1,31 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
namespace SafeExamBrowser.Settings.Security
{
/// <summary>
/// Defines all kiosk modes which SEB supports.
/// </summary>
public enum KioskMode
{
/// <summary>
/// No kiosk mode - should only be used for testing / debugging.
/// </summary>
None,
/// <summary>
/// Creates a new desktop and runs the client on it, without modifying the default desktop.
/// </summary>
CreateNewDesktop,
/// <summary>
/// Terminates the Windows explorer shell and runs the client on the default desktop.
/// </summary>
DisableExplorerShell
}
}

View File

@@ -0,0 +1,96 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
using System;
using System.Collections.Generic;
namespace SafeExamBrowser.Settings.Security
{
/// <summary>
/// Defines all settings related to security.
/// </summary>
[Serializable]
public class SecuritySettings
{
/// <summary>
/// The hash code of the administrator password for the settings.
/// </summary>
public string AdminPasswordHash { get; set; }
/// <summary>
/// Determines whether any log information will be accessible via the user interface.
/// </summary>
public bool AllowApplicationLogAccess { get; set; }
/// <summary>
/// Determines whether the user may initiate the termination of SEB. This setting does not affect automated mechanisms like a quit URL.
/// </summary>
public bool AllowTermination { get; set; }
/// <summary>
/// Determines whether the user may reconfigure the application.
/// </summary>
public bool AllowReconfiguration { get; set; }
/// <summary>
/// Determines whether the user may use the sticky keys feature of the operating system.
/// </summary>
public bool AllowStickyKeys { get; set; }
/// <summary>
/// Determines whether the user is allowed to use the system clipboard, a custom clipboard or no clipboard at all.
/// </summary>
public ClipboardPolicy ClipboardPolicy { get; set; }
/// <summary>
/// Determines whether the lock screen is disabled in case of a user session change. This setting overrides the activation based on
/// <see cref="Service.ServiceSettings.IgnoreService"/> and <see cref="Service.ServiceSettings.DisableUserLock"/> or <see cref="Service.ServiceSettings.DisableUserSwitch"/>.
/// </summary>
public bool DisableSessionChangeLockScreen { get; set; }
/// <summary>
/// The kiosk mode which determines how the computer is locked down.
/// </summary>
public KioskMode KioskMode { get; set; }
/// <summary>
/// The hash code of the quit password.
/// </summary>
public string QuitPasswordHash { get; set; }
/// <summary>
/// An URL to optionally restrict with which resource SEB may be reconfigured. Allows the usage of a wildcard character (<c>*</c>).
/// </summary>
public string ReconfigurationUrl { get; set; }
/// <summary>
/// Determines whether the cursor configuration will be verified during session initialization.
/// </summary>
public bool VerifyCursorConfiguration { get; set; }
/// <summary>
/// Determines whether the session integrity will be verified after session initialization.
/// </summary>
public bool VerifySessionIntegrity { get; set; }
/// <summary>
/// All restrictions which apply to the SEB version to be used.
/// </summary>
public IList<VersionRestriction> VersionRestrictions { get; set; }
/// <summary>
/// Determines whether SEB is allowed to run in a virtual machine.
/// </summary>
public VirtualMachinePolicy VirtualMachinePolicy { get; set; }
public SecuritySettings()
{
VersionRestrictions = new List<VersionRestriction>();
}
}
}

View File

@@ -0,0 +1,54 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
using System;
namespace SafeExamBrowser.Settings.Security
{
/// <summary>
/// Defines a restriction for the SEB version to be used.
/// </summary>
[Serializable]
public class VersionRestriction
{
/// <summary>
/// The major version to be used.
/// </summary>
public int Major { get; set; }
/// <summary>
/// The minor version to be used.
/// </summary>
public int Minor { get; set; }
/// <summary>
/// Optionally defines the patch version to be used.
/// </summary>
public int? Patch { get; set; }
/// <summary>
/// Optionally defines the build version to be used.
/// </summary>
public int? Build { get; set; }
/// <summary>
/// Determines whether the restriction defines the minimum version to be used.
/// </summary>
public bool IsMinimumRestriction { get; set; }
/// <summary>
/// Determines whether the restriction requires the usage of the Alliance Edition.
/// </summary>
public bool RequiresAllianceEdition { get; set; }
public override string ToString()
{
return $"{Major}.{Minor}{(Patch.HasValue ? $".{Patch}" : "")}{(Build.HasValue ? $".{Build}" : "")}{(RequiresAllianceEdition ? ".AE" : "")}{(IsMinimumRestriction ? ".min" : "")}";
}
}
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
namespace SafeExamBrowser.Settings.Security
{
/// <summary>
/// Defines all policies with respect to running SEB in a virtual machine.
/// </summary>
public enum VirtualMachinePolicy
{
/// <summary>
/// SEB is allowed to be run in a virtual machine.
/// </summary>
Allow,
/// <summary>
/// SEB is not allowed to be run in a virtual machine.
/// </summary>
Deny
}
}