Fwupd.SecurityAttr

g Fwupd.SecurityAttr Fwupd.SecurityAttr GObject.Object GObject.Object GObject.Object->Fwupd.SecurityAttr

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

array_from_variant (value)

class

flag_from_string (flag)

class

flag_to_string (flag)

class

flag_to_suffix (flag)

class

from_variant (value)

class

new (appstream_id)

class

result_from_string (result)

class

result_to_string (result)

add_flag (flag)

add_guid (guid)

add_guids (guids)

add_metadata (key, value)

add_obsolete (appstream_id)

copy ()

from_json (json_node)

get_appstream_id ()

get_bios_setting_current_value ()

get_bios_setting_id ()

get_bios_setting_target_value ()

get_created ()

get_description ()

get_flags ()

get_guids ()

get_kernel_current_value ()

get_kernel_target_value ()

get_level ()

get_metadata (key)

get_name ()

get_obsoletes ()

get_plugin ()

get_result ()

get_result_fallback ()

get_result_success ()

get_title ()

get_url ()

has_flag (flag)

has_guid (guid)

has_obsolete (appstream_id)

remove_flag (flag)

set_appstream_id (appstream_id)

set_bios_setting_current_value (value)

set_bios_setting_id (id)

set_bios_setting_target_value (value)

set_created (created)

set_description (description)

set_flags (flags)

set_kernel_current_value (value)

set_kernel_target_value (value)

set_level (level)

set_name (name)

set_plugin (plugin)

set_result (result)

set_result_fallback (result)

set_result_success (result)

set_title (title)

set_url (url)

to_json (builder)

to_string ()

to_variant ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Fwupd.SecurityAttr(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Fwupd.SecurityAttrClass

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:

[Fwupd.SecurityAttr]

Creates an array of new security attributes using serialized data.

New in version 1.5.0.

classmethod flag_from_string(flag)[source]
Parameters:

flag (str or None) – a string, e.g. success

Returns:

enumerated value

Return type:

Fwupd.SecurityAttrFlags

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:

str

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:

str

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, or None if value was invalid

Return type:

Fwupd.SecurityAttr

Creates a new security attribute using serialized data.

New in version 1.5.0.

classmethod new(appstream_id)[source]
Parameters:

appstream_id (str or None) – the AppStream component ID, e.g. com.intel.BiosGuard

Returns:

a new Fwupd.SecurityAttr

Return type:

Fwupd.SecurityAttr

Creates a new security attribute.

Plugins should not use this method, and should instead use fu_plugin_security_attr_new() or fu_security_attr_new().

New in version 1.5.0.

classmethod result_from_string(result)[source]
Parameters:

result (str or None) – a string, e.g. not-encrypted

Returns:

enumerated value

Return type:

Fwupd.SecurityAttrResult

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:

str

Returns the printable string for the result enum.

New in version 1.5.0.

add_flag(flag)[source]
Parameters:

flag (Fwupd.SecurityAttrFlags) – the Fwupd.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]
Parameters:
  • key (str) – metadata key

  • value (str or None) – metadata value

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:

Fwupd.SecurityAttr

Makes a full (deep) copy of a security attribute.

New in version 1.7.1.

from_json(json_node)[source]
Parameters:

json_node (Json.Node) – a JSON node

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Loads a fwupd security attribute from a JSON node.

New in version 1.7.1.

get_appstream_id()[source]
Returns:

the AppStream ID, or None if unset

Return type:

str

Gets the AppStream ID.

New in version 1.5.0.

get_bios_setting_current_value()[source]
Returns:

the current value of the attribute.

Return type:

str

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 or None

Return type:

str

Gets the Fwupd.BiosSetting that can be used to improve this Fwupd.SecurityAttr.

New in version 1.8.4.

get_bios_setting_target_value()[source]
Returns:

the target value of the attribute.

Return type:

str

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:

int

Gets when the attribute was created.

New in version 1.7.1.

get_description()[source]
Returns:

the attribute description, or None if unset

Return type:

str

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:

Fwupd.SecurityAttrFlags

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:

str

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:

str

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:

Fwupd.SecurityAttrLevel

Gets the HSI level.

New in version 1.5.0.

get_metadata(key)[source]
Parameters:

key (str) – metadata key

Returns:

the metadata value, or None if unfound

Return type:

str or None

Gets private metadata from the attribute which may be used in the name.

New in version 1.5.0.

get_name()[source]
Returns:

the attribute name, or None if unset

Return type:

str

Gets the attribute 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_plugin()[source]
Returns:

the plugin name, or None if unset

Return type:

str

Gets the plugin that created the attribute.

New in version 1.5.0.

get_result()[source]
Returns:

the Fwupd.SecurityAttrResult, e.g %FWUPD_SECURITY_ATTR_LEVEL_LOCKED

Return type:

Fwupd.SecurityAttrResult

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:

Fwupd.SecurityAttrResult

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:

Fwupd.SecurityAttrResult

Gets the desired HSI result.

New in version 1.9.3.

get_title()[source]
Returns:

the attribute title, or None if unset

Return type:

str

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.

get_url()[source]
Returns:

the attribute result, or None if unset

Return type:

str

Gets the attribute URL.

New in version 1.5.0.

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:

bool

Finds if the attribute has a specific attribute flag.

New in version 1.5.0.

has_guid(guid)[source]
Parameters:

guid (str) – the attribute guid

Returns:

True if the self matches

Return type:

bool

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:

bool

Finds out if the attribute obsoletes a specific appstream_id.

New in version 1.5.0.

remove_flag(flag)[source]
Parameters:

flag (Fwupd.SecurityAttrFlags) – the Fwupd.SecurityAttrFlags, e.g. Fwupd.SecurityAttrFlags.OBSOLETED

Removes a specific attribute flag from the attribute.

New in version 1.8.3.

set_appstream_id(appstream_id)[source]
Parameters:

appstream_id (str or None) – the AppStream component ID, e.g. com.intel.BiosGuard

Sets the AppStream ID.

New in version 1.5.0.

set_bios_setting_current_value(value)[source]
Parameters:

value (str or None) – The string to set current value to

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 or None) – Unique identifier used for Fwupd.BiosSetting

Sets the Fwupd.BiosSetting that can be used to improve this Fwupd.SecurityAttr.

New in version 1.8.4.

set_bios_setting_target_value(value)[source]
Parameters:

value (str or None) – The string to set target value to

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_description(description)[source]
Parameters:

description (str or None) – the attribute description

Sets the attribute description.

New in version 1.8.2.

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]
Parameters:

value (str or None) – The string to set current value to

Sets the current value of the BIOS setting that can be changed.

New in version 1.9.6.

set_kernel_target_value(value)[source]
Parameters:

value (str or None) – The string to set current value to

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_name(name)[source]
Parameters:

name (str or None) – the attribute name

Sets the attribute name.

New in version 1.5.0.

set_plugin(plugin)[source]
Parameters:

plugin (str or None) – the plugin name

Sets the plugin that created the attribute.

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” if found.

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.

set_title(title)[source]
Parameters:

title (str or None) – the attribute title

Sets the attribute title.

New in version 1.8.2.

set_url(url)[source]
Parameters:

url (str or None) – the attribute URL

Sets the attribute result.

New in version 1.5.0.

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.

to_string()[source]
Returns:

text, or None for invalid

Return type:

str

Builds a text representation of the object.

New in version 1.5.0.

to_variant()[source]
Returns:

the serialized data, or None for error

Return type:

GLib.Variant

Serialize the security attribute.

New in version 1.5.0.