https://github.com/awslabs/python-uefivars

Python package and helper tool to analyze, convert and modify UEFI variable stores.

https://github.com/awslabs/python-uefivars

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.6%) to scientific vocabulary

Keywords

aws efi efivarfs efivars python uefi uefivars
Last synced: 6 months ago · JSON representation

Repository

Python package and helper tool to analyze, convert and modify UEFI variable stores.

Basic Info
  • Host: GitHub
  • Owner: awslabs
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 84 KB
Statistics
  • Stars: 25
  • Watchers: 3
  • Forks: 10
  • Open Issues: 1
  • Releases: 3
Topics
aws efi efivarfs efivars python uefi uefivars
Created over 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

uefivars

This is a set of Python modules and a helper application "uefivars" to introspect and modify UEFI variable stores.

Why do I need this?

UEFI variable stores are typically opaque to users. You access them using UEFI runtime services as function calls. However, the data is then stored in a binary data format. When running virtual machines or extracting UEFI variable stores directly from Flash storage, you can receive and write that binary data and thus modify variables directly.

This is useful in situations where you have incorrect UEFI variable data and need to modify variables without runtime service access. It can also be useful to analyze and introspect the variable store and check what data is stored inside.

How do I use it?

You can convert a variable store into human readable format by setting the output type to json. This will show you all variables that are currently present in the variable store.

console $ uefivars -i edk2 -o json -I OVMF_VARS.secboot.fd [ { "name": "SecureBootEnable", "data": "AQ==", "guid": "f0a30bc7-af08-4556-99c4-001009c93a44", "attr": 3 }, [...] ]

In addition, you can convert from the human readable json representation back into edk2 format:

console $ uefivars -i json -o edk2 -I vars.json -O OVMF_VARS.fd

Given any variable store (including an empty one) the --PK , --KEK , --db and --dbx switches can be used to (over-)write the four SecureBoot variables from input files. (Usually .esl files). For a general rundown of the key generation process the ArchLinux wiki has proven itself as a first point of guidance.

You can also use the tool to convert between the AWS EC2 uefi-data format and edk2 to import and export UEFI variable stores between an EC2 instance and QEMU:

console $ uefivars -i edk2 -o aws -I OVMF_VARS.fd -O uefi-data.aws

console $ uefivars -i aws -o edk2 -I uefi-data.aws -O OVMF_VARS.fd

How can I take a snapshot of my current UEFI variable store?

If you are running on a live UEFI system, the variable store that gets exposed to the Operating System is incomplete: It does not contain UEFI variables that are only present at boot time and it does not get access to variable authentication data.

If you don't need either - for example because you're only interested in saving the boot order - you can use the efivarfs backend to convert the local variable store into a file:

console $ uefivars -i efivarfs -o aws -I /sys/firmware/efi/efivars -O uefi-data.aws

What formats are supported?

This package currently supports the following formats:

aws - File format used in AWS EC2 \ edk2 - File format used for flash storage in OVMF \ efivarfs - Ingests all non-authenticated variables from an efivarfs mount point (read only)

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 44
  • Total Committers: 6
  • Avg Commits per committer: 7.333
  • Development Distribution Score (DDS): 0.432
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Alexander Graf g****f@a****m 25
Johanna Amélie Schander m****a@a****e 9
Thomas Bechtold t****d@c****m 4
Erdem Meydanli m****i@a****m 3
Mate Kukri m****i@c****m 2
Benjamin Herrenschmidt b****h@a****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 2
  • Total pull requests: 14
  • Average time to close issues: 2 days
  • Average time to close pull requests: about 2 months
  • Total issue authors: 2
  • Total pull request authors: 8
  • Average comments per issue: 3.5
  • Average comments per pull request: 1.36
  • Merged pull requests: 12
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 14 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 4.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • toabctl (1)
  • kukrimate (1)
Pull Request Authors
  • agraf (5)
  • kukrimate (4)
  • toabctl (3)
  • meerd (3)
  • kernelmoja (2)
  • izaakschroeder (2)
  • umishko (1)
  • ozbenh (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 27 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 4
  • Total maintainers: 1
pypi.org: uefivars

UEFI variable store tools

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 27 Last month
Rankings
Dependent packages count: 9.7%
Average: 37.0%
Dependent repos count: 64.3%
Maintainers (1)
Last synced: 6 months ago
pypi.org: python-uefivars

UEFI variable store tools

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 9.7%
Average: 37.0%
Dependent repos count: 64.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • crc32c *
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/uefivars.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
requirements.txt pypi
  • deepdiff *
  • google_crc32c *