management.models.securityΒΆ

Security Configuration Model.

Module ContentsΒΆ

class management.models.security.SecurityConfig(*args, **kwargs)[source]ΒΆ

Bases: django.db.models.Model

Security Configuration model.

Stores the active security level together with all security thresholds for that level:

Calling apply_security_settings() applies the mode defaults onto this instance.

class SecurityModeChoices(*args, **kwds)[source]ΒΆ

Bases: django.db.models.TextChoices

Types of security modes.

LAB[source]ΒΆ
BROWNFIELD[source]ΒΆ
INDUSTRIAL[source]ΒΆ
HARDENED[source]ΒΆ
CRITICAL[source]ΒΆ
class NamedCurveChoices(*args, **kwds)[source]ΒΆ

Bases: django.db.models.TextChoices

Selectable ECC curve OIDs sourced from trustpoint_core.oid.NamedCurve.

SECP192R1[source]ΒΆ
SECP224R1[source]ΒΆ
SECP256K1[source]ΒΆ
SECP256R1[source]ΒΆ
SECP384R1[source]ΒΆ
SECP521R1[source]ΒΆ
BRAINPOOLP256R1[source]ΒΆ
BRAINPOOLP384R1[source]ΒΆ
BRAINPOOLP512R1[source]ΒΆ
class HashAlgorithmChoices(*args, **kwds)[source]ΒΆ

Bases: django.db.models.TextChoices

Selectable hash/signature algorithm OIDs from trustpoint_core.oid.HashAlgorithm.

MD5[source]ΒΆ
SHA1[source]ΒΆ
SHA224[source]ΒΆ
SHA256[source]ΒΆ
SHA384[source]ΒΆ
SHA512[source]ΒΆ
security_mode[source]ΒΆ
auto_gen_pki[source]ΒΆ
auto_gen_pki_key_algorithm[source]ΒΆ
rsa_minimum_key_size[source]ΒΆ
not_permitted_ecc_curve_oids[source]ΒΆ
not_permitted_signature_algorithm_oids[source]ΒΆ
max_cert_validity_days[source]ΒΆ
max_crl_validity_days[source]ΒΆ
allow_ca_issuance[source]ΒΆ
allow_auto_gen_pki[source]ΒΆ
allow_self_signed_ca[source]ΒΆ
require_physical_hsm[source]ΒΆ
permitted_no_onboarding_pki_protocols[source]ΒΆ
permitted_onboarding_protocols[source]ΒΆ
apply_security_settings()[source]ΒΆ

Reset all thresholds to the defaults for the current security mode.

Return type:

None

classmethod get_settings_preview_json()[source]ΒΆ

Return a JSON string of each mode’s display-friendly threshold values for the settings JS.

Return type:

str

check_mode_transition(target_mode)[source]ΒΆ

Check whether the existing data satisfies all requirements of target_mode.

Parameters:

target_mode (str)

Return type:

list[str]