diff --git a/ereuse_devicehub/migrations/versions/d65745749e34_add_is_server_erase.py b/ereuse_devicehub/migrations/versions/d65745749e34_add_is_server_erase.py new file mode 100644 index 00000000..20d001db --- /dev/null +++ b/ereuse_devicehub/migrations/versions/d65745749e34_add_is_server_erase.py @@ -0,0 +1,34 @@ +"""add is_server_erase + +Revision ID: d65745749e34 +Revises: a13ed6ad0e3e +Create Date: 2022-10-17 13:20:29.875274 + +""" +import sqlalchemy as sa +from alembic import context, op + +# revision identifiers, used by Alembic. +revision = 'd65745749e34' +down_revision = 'a13ed6ad0e3e' +branch_labels = None +depends_on = None + + +def get_inv(): + INV = context.get_x_argument(as_dictionary=True).get('inventory') + if not INV: + raise ValueError("Inventory value is not specified") + return INV + + +def upgrade(): + op.add_column( + 'snapshot', + sa.Column('is_server_erase', sa.Boolean(), nullable=True), + schema=f'{get_inv()}', + ) + + +def downgrade(): + op.drop_column('snapshot', 'is_server_erase', schema=f'{get_inv()}') diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index 496eed34..87a9d392 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -676,6 +676,7 @@ class Snapshot(JoinedWithOneDeviceMixin, ActionWithOneDevice): of time it took to complete. """ sid = Column(CIText(), nullable=True) + is_server_erase = Column(Boolean(), nullable=True) def get_last_lifetimes(self): """We get the lifetime and serial_number of the first disk""" diff --git a/ereuse_devicehub/resources/action/views/snapshot.py b/ereuse_devicehub/resources/action/views/snapshot.py index bca48f84..dd967fee 100644 --- a/ereuse_devicehub/resources/action/views/snapshot.py +++ b/ereuse_devicehub/resources/action/views/snapshot.py @@ -115,8 +115,15 @@ class SnapshotMixin: if snapshot.device.hid is None: snapshot.severity = Severity.Warning + self.is_server_erase(snapshot) + return snapshot + def is_server_erase(self, snapshot): + if snapshot.device.binding: + if snapshot.device.binding.kangaroo: + snapshot.is_server_erase = True + def get_old_smbios_version(self, debug): capabilities = debug.get('lshw', {}).get('capabilities', {}) for x in capabilities.values(): diff --git a/ereuse_devicehub/templates/workbench/settings.html b/ereuse_devicehub/templates/workbench/settings.html index f1644d3e..1a051e76 100644 --- a/ereuse_devicehub/templates/workbench/settings.html +++ b/ereuse_devicehub/templates/workbench/settings.html @@ -68,7 +68,7 @@
+ A certified collection of hardware details and testing reports
+ Desktops, Servers and Laptops
+
Settings for basic hardware metadata collection and hard drive smart Test reports.
+ Download settings file +
+ A certified data erasure software to irreversibly removing data sored on hard drives.
+ Desktops, Servers and Laptops
+
+ Settings for basic data erasure using shred Linux command. + A software-based fast non-100%-secured way of erasing data storage. +
++ Performs 1 pass overwriting one round using all zeros. + Compliant with NIST SP-800-88 +
+ + Download settings file + ++ Settings for advanced data erasure using badblocks Linux software. + A secured-way of erasing data storages, erase hidden areas, checking the erase sector by sector. +
++ Performs 1 pass overwriting each sector with zeros and a final verification. + Compliant with HMG Infosec Standard 5 Baseline. +
+ + Download settings file + ++ Settings for advanced data erasure using badblocks Linux software. + A secured-way of erasing data storages, erase hidden areas, checking the erase sector by sector. +
++ Performs 3 passes overwriting every sector with zeros and ones, and final verification. + Compliant with HMG Infosec Standard 5 Enhanced. +
+ + Download settings file + +- Settings for advanced data erasure through sectors and hidden areas. Guarantee of data removal. | Help -
-- Settings for register devices. -
-