Fwupd.SecurityAttr¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Fwupd.SecurityAttr(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A Host Security ID attribute that represents something that was measured.
- classmethod array_from_variant(value)[source]¶
- Parameters:
value (
GLib.Variant
) – the serialized data- Returns:
attributes, or
None
if value was invalid- Return type:
Creates an array of new security attributes using serialized data.
New in version 1.5.0.
- classmethod flag_from_string(flag)[source]¶
- Parameters:
- Returns:
enumerated value
- Return type:
Converts a string to an enumerated flag.
New in version 1.7.1.
- classmethod flag_to_string(flag)[source]¶
- Parameters:
flag (
Fwupd.SecurityAttrFlags
) – security attribute flags, e.g.Fwupd.SecurityAttrFlags.SUCCESS
- Returns:
string, or
None
- Return type:
Returns the printable string for the flag.
New in version 1.5.0.
- classmethod flag_to_suffix(flag)[source]¶
- Parameters:
flag (
Fwupd.SecurityAttrFlags
) – security attribute flags, e.g.Fwupd.SecurityAttrFlags.RUNTIME_UPDATES
- Returns:
string, or
None
- Return type:
Returns the string suffix for the flag.
New in version 1.5.0.
- classmethod from_variant(value)[source]¶
- Parameters:
value (
GLib.Variant
) – the serialized data- Returns:
a new
Fwupd.SecurityAttr
, orNone
if value was invalid- Return type:
Creates a new security attribute using serialized data.
New in version 1.5.0.
- classmethod new(appstream_id)[source]¶
- Parameters:
appstream_id (
str
orNone
) – the AppStream component ID, e.g.com.intel.BiosGuard
- Returns:
a new
Fwupd.SecurityAttr
- Return type:
Creates a new security attribute.
Plugins should not use this method, and should instead use
fu_plugin_security_attr_new()
orfu_security_attr_new()
.New in version 1.5.0.
- classmethod result_from_string(result)[source]¶
- Parameters:
- Returns:
enumerated value
- Return type:
Converts a string to an enumerated result.
New in version 1.7.1.
- classmethod result_to_string(result)[source]¶
- Parameters:
result (
Fwupd.SecurityAttrResult
) – security attribute result, e.g.Fwupd.SecurityAttrResult.ENABLED
- Returns:
string, or
None
- Return type:
Returns the printable string for the result enum.
New in version 1.5.0.
- add_flag(flag)[source]¶
- Parameters:
flag (
Fwupd.SecurityAttrFlags
) – theFwupd.SecurityAttrFlags
, e.g.Fwupd.SecurityAttrFlags.OBSOLETED
Adds a specific attribute flag to the attribute.
New in version 1.5.0.
- add_guid(guid)[source]¶
- Parameters:
guid (
str
) – the GUID
Adds a device GUID to the attribute. This indicates the GUID in some way contributed to the result decided.
New in version 1.7.0.
- add_guids(guids)[source]¶
- Parameters:
guids ([
str
]) – the GUIDs
Adds device GUIDs to the attribute. This indicates the GUIDs in some way contributed to the result decided.
New in version 1.7.0.
- add_metadata(key, value)[source]¶
-
Adds metadata to the attribute which may be used in the name.
New in version 1.5.0.
- add_obsolete(appstream_id)[source]¶
- Parameters:
appstream_id (
str
) – the appstream_id or plugin name
Adds an attribute appstream_id to obsolete. The obsoleted attribute will not contribute to the calculated HSI value or be visible in command line tools.
New in version 1.5.0.
- copy()[source]¶
- Returns:
a new
Fwupd.SecurityAttr
- Return type:
Makes a full (deep) copy of a security attribute.
New in version 1.7.1.
- from_json(json_node)[source]¶
-
Loads a fwupd security attribute from a JSON node.
New in version 1.7.1.
- get_bios_setting_current_value()[source]¶
- Returns:
the current value of the attribute.
- Return type:
Gets the current value of the BIOS setting that can be changed.
New in version 1.8.4.
- get_bios_setting_id()[source]¶
- Returns:
The unique ID used for
Fwupd.BiosSetting
orNone
- Return type:
Gets the
Fwupd.BiosSetting
that can be used to improve thisFwupd.SecurityAttr
.New in version 1.8.4.
- get_bios_setting_target_value()[source]¶
- Returns:
the target value of the attribute.
- Return type:
Gets the value that when written to an attribute would activate it or satisfy a security requirement.
New in version 1.8.4.
- get_created()[source]¶
- Returns:
the UNIX time, or 0 if unset
- Return type:
Gets when the attribute was created.
New in version 1.7.1.
- get_description()[source]¶
-
Gets the attribute description which is a few lines of prose that normal users will understand.
The fwupd client program may be able to get translations for this value using a method call like
dgettext("fwupd",str)
.NOTE: The returned string may contain placeholders such as
$HostVendor$
or$HostProduct$
and these should be replaced with the values from [method`FwupdClient`.get_host_vendor] and [method`FwupdClient`.get_host_product].New in version 1.8.2.
- get_flags()[source]¶
- Returns:
security attribute flags, or 0 if unset
- Return type:
Gets the self flags.
New in version 1.5.0.
- get_guids()[source]¶
- Returns:
the GUIDs, which may be empty
- Return type:
[
str
]
Gets the list of attribute GUIDs. The GUID values will not modify the calculated HSI value.
New in version 1.7.0.
- get_kernel_current_value()[source]¶
- Returns:
the current value of the attribute.
- Return type:
Gets the current value of the BIOS setting that can be changed.
New in version 1.9.6.
- get_kernel_target_value()[source]¶
- Returns:
the current value of the attribute.
- Return type:
Gets the target value of the kernel setting that can be changed.
New in version 1.9.6.
- get_level()[source]¶
- Returns:
the security attribute level, or
Fwupd.SecurityAttrLevel.NONE
if unset- Return type:
Gets the HSI level.
New in version 1.5.0.
- get_metadata(key)[source]¶
-
Gets private metadata from the attribute which may be used in the name.
New in version 1.5.0.
- get_obsoletes()[source]¶
- Returns:
the obsoletes, which may be empty
- Return type:
[
str
]
Gets the list of attribute obsoletes. The obsoleted attributes will not contribute to the calculated HSI value or be visible in command line tools.
New in version 1.5.0.
- get_result()[source]¶
- Returns:
the
Fwupd.SecurityAttrResult
, e.g %FWUPD_SECURITY_ATTR_LEVEL_LOCKED- Return type:
Gets the optional HSI result.
New in version 1.5.0.
- get_result_fallback()[source]¶
- Returns:
the
Fwupd.SecurityAttrResult
, e.g %FWUPD_SECURITY_ATTR_LEVEL_LOCKED- Return type:
Gets the optional fallback HSI result.
New in version 1.7.1.
- get_result_success()[source]¶
- Returns:
the
Fwupd.SecurityAttrResult
, e.g %FWUPD_SECURITY_ATTR_LEVEL_LOCKED- Return type:
Gets the desired HSI result.
New in version 1.9.3.
- get_title()[source]¶
-
Gets the attribute title, which is typically a two word title.
The fwupd client program may be able to get translations for this value using a method call like
dgettext("fwupd",str)
.New in version 1.8.2.
- has_flag(flag)[source]¶
- Parameters:
flag (
Fwupd.SecurityAttrFlags
) – the attribute flag, e.g.Fwupd.SecurityAttrFlags.OBSOLETED
- Returns:
True
if the flag is set- Return type:
Finds if the attribute has a specific attribute flag.
New in version 1.5.0.
- has_guid(guid)[source]¶
-
Finds out if a specific GUID was added to the attribute.
New in version 1.7.0.
- has_obsolete(appstream_id)[source]¶
- Parameters:
appstream_id (
str
) – the attribute appstream_id- Returns:
True
if the self matches- Return type:
Finds out if the attribute obsoletes a specific appstream_id.
New in version 1.5.0.
- remove_flag(flag)[source]¶
- Parameters:
flag (
Fwupd.SecurityAttrFlags
) – theFwupd.SecurityAttrFlags
, e.g.Fwupd.SecurityAttrFlags.OBSOLETED
Removes a specific attribute flag from the attribute.
New in version 1.8.3.
- set_bios_setting_current_value(value)[source]¶
-
Sets the current value of the BIOS setting that can be changed.
New in version 1.8.4.
- set_bios_setting_id(id)[source]¶
- Parameters:
id (
str
orNone
) – Unique identifier used forFwupd.BiosSetting
Sets the
Fwupd.BiosSetting
that can be used to improve thisFwupd.SecurityAttr
.New in version 1.8.4.
- set_bios_setting_target_value(value)[source]¶
-
Sets the string used for the target value of an attribute.
New in version 1.8.4.
- set_created(created)[source]¶
- Parameters:
created (
int
) – the UNIX time
Sets when the attribute was created.
New in version 1.7.1.
- set_flags(flags)[source]¶
- Parameters:
flags (
Fwupd.SecurityAttrFlags
) – security attribute flags, e.g.Fwupd.SecurityAttrFlags.OBSOLETED
Sets the attribute flags.
New in version 1.5.0.
- set_kernel_current_value(value)[source]¶
-
Sets the current value of the BIOS setting that can be changed.
New in version 1.9.6.
- set_kernel_target_value(value)[source]¶
-
Sets the target value of the kernel setting that can be changed.
New in version 1.9.6.
- set_level(level)[source]¶
- Parameters:
level (
Fwupd.SecurityAttrLevel
) – a security attribute level, e.g.Fwupd.SecurityAttrLevel.IMPORTANT
Sets the HSI level. A level of
Fwupd.SecurityAttrLevel.NONE
is not used for the HSI calculation.New in version 1.5.0.
- set_result(result)[source]¶
- Parameters:
result (
Fwupd.SecurityAttrResult
) – a security attribute result, e.g. %FWUPD_SECURITY_ATTR_LEVEL_LOCKED
Sets the optional HSI result. This is required because some attributes may be a “success” when something is
locked
or may be “failed” iffound
.New in version 1.5.0.
- set_result_fallback(result)[source]¶
- Parameters:
result (
Fwupd.SecurityAttrResult
) – a security attribute, e.g. %FWUPD_SECURITY_ATTR_LEVEL_LOCKED
Sets the optional fallback HSI result. The fallback may represent the old state, or a state that may be considered equivalent.
New in version 1.7.1.
- set_result_success(result)[source]¶
- Parameters:
result (
Fwupd.SecurityAttrResult
) – a security attribute, e.g. %FWUPD_SECURITY_ATTR_LEVEL_LOCKED
Sets the desired HSI result.
New in version 1.9.3.
- to_json(builder)[source]¶
- Parameters:
builder (
Json.Builder
) – a JSON builder
Adds a fwupd security attribute to a JSON builder
New in version 1.5.0.