add template for Enhanced Secure Erasure

This commit is contained in:
Cayo Puigdefabregas 2022-10-21 17:43:21 +02:00
parent 13605abbaf
commit a5bf59c561
3 changed files with 20 additions and 11 deletions

View File

@ -191,7 +191,7 @@
Performs <strong>1</strong> pass overwriting each sector with zeros and a final verification. Performs <strong>1</strong> pass overwriting each sector with zeros and a final verification.
Compliant with <strong>HMG Infosec Standard 5 Baseline</strong>. Compliant with <strong>HMG Infosec Standard 5 Baseline</strong>.
</p> </p>
<a href="{{ url_for('workbench.settings') }}?opt=erease_sectors" <a href="{{ url_for('workbench.settings') }}?opt=baseline_erease"
class="btn btn-primary" class="btn btn-primary"
style="width: 100%;"> style="width: 100%;">
Download settings file Download settings file
@ -210,11 +210,11 @@
Performs <strong>3</strong> passes overwriting every sector with zeros and ones, and final verification. Performs <strong>3</strong> passes overwriting every sector with zeros and ones, and final verification.
Compliant with <strong>HMG Infosec Standard 5 Enhanced</strong>. Compliant with <strong>HMG Infosec Standard 5 Enhanced</strong>.
</p> </p>
<span <a href="{{ url_for('workbench.settings') }}?opt=enhanced_erease"
class="btn btn-secondary" class="btn btn-primary"
style="width: 100%;"> style="width: 100%;">
Download settings file Download settings file
</span> </a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -16,8 +16,7 @@ WB_ERASE_STEPS = 1
WB_ERASE_LEADING_ZEROS = False WB_ERASE_LEADING_ZEROS = False
WB_DEBUG = True WB_DEBUG = True
{% endif %} {% elif baseline_erease %}
{% if erease_sectors %}
DH_HOST = {{ host }} DH_HOST = {{ host }}
DH_DATABASE = {{ schema }} DH_DATABASE = {{ schema }}
DEVICEHUB_URL = https://${DB_HOST}/${DB_DATABASE}/ DEVICEHUB_URL = https://${DB_HOST}/${DB_DATABASE}/
@ -27,7 +26,7 @@ WB_STRESS_TEST = 0
WB_SMART_TEST = short WB_SMART_TEST = short
WB_ERASE = EraseSectors WB_ERASE = EraseSectors
WB_ERASE_STEPS = 1 WB_ERASE_STEPS = {{ erase_steps }}
WB_ERASE_LEADING_ZEROS = True WB_ERASE_LEADING_ZEROS = True
WB_DEBUG = True WB_DEBUG = True

View File

@ -43,7 +43,13 @@ class SettingsView(GenericMixin):
form_kangaroo.save() form_kangaroo.save()
self.opt = request.values.get('opt') self.opt = request.values.get('opt')
if self.opt in ['register', 'erease_basic', 'erease_sectors']: options = [
'register',
'erease_basic',
'baseline_erease',
'enhanced_erease',
]
if self.opt in options:
return self.download() return self.download()
return flask.render_template(self.template_name, **self.context) return flask.render_template(self.template_name, **self.context)
@ -54,7 +60,7 @@ class SettingsView(GenericMixin):
'token': self.get_token(), 'token': self.get_token(),
'url': url, 'url': url,
'erease_basic': None, 'erease_basic': None,
'erease_sectors': None, 'baseline_erease': None,
} }
# if is a v14 version # if is a v14 version
# TODO when not use more v14, we can remove this if # TODO when not use more v14, we can remove this if
@ -63,10 +69,14 @@ class SettingsView(GenericMixin):
self.wbContext['url'] = url self.wbContext['url'] = url
self.wbContext['host'] = app.config['HOST'] self.wbContext['host'] = app.config['HOST']
self.wbContext['schema'] = app.config['SCHEMA'] self.wbContext['schema'] = app.config['SCHEMA']
if self.opt == 'erease_basic': if self.opt == 'erease_basic':
self.wbContext['erease_basic'] = True self.wbContext['erease_basic'] = True
if self.opt == 'erease_sectors': if self.opt in ['baseline_erease', 'enhanced_erease']:
self.wbContext['erease_sectors'] = True self.wbContext['baseline_erease'] = True
self.wbContext['erase_steps'] = 1
if self.opt == 'enhanced_erease':
self.wbContext['erase_steps'] = 3
data = flask.render_template('workbench/wbSettings.ini', **self.wbContext) data = flask.render_template('workbench/wbSettings.ini', **self.wbContext)
return self.response_download(data) return self.response_download(data)