Implementation of archival authentication
Project description
TAF (The Archive Framework)
TAF is a framework that aims to provide archival authentication and ensure that Git repositories can be securely cloned/updated. TAF's implementation strongly relies on The Update Framework (TUF), which helps developers maintain the security of a software update system. It provides a flexible framework and specification that developers can integrate into any software update system. TAF integrates Git with TUF:
- TUF targets were modified to authenticate Git commits instead of individual files. This reduces the metadata size and simplifies authentication.
- The TUF metadata repository storage utilizes Git. That means TUF metadata files are stored in a Git repository, which is referred to as an authentication repository.
When a TAF authentication repository is cloned, all target repositories are also cloned, and TUF validation is performed against every commit since the repository's inception. When a TAF repository is updated, data is fetched from upstream and each commit is authenticated. A TAF clone/update differs from a standard Git clone/fetch in that remote commits aren't added to the local Git repositories until they've been fully authenticated locally. TAF can be used to secure any git repository, regardless of its content.
Threats
A git repository can be compromised in several ways:
- An attacker might hack a user's account on a code hosting platform, like GitHub or GitLab.
- An attacker might compromise the hosting platform itself.
- An attacker might gain access to a developer's personal computer.
Such an attacker could then:
- Upload a new GPG key to GitHub.
- Push new commits to any repository.
- Add another authorized user with write access.
- Unprotect the master branch of any repository and force-push to it.
TAF's primary objective is not to prevent the attacks listed above but rather to detect when
an attack has occurred and halt an update if necessary. Thus, TAF should be used instead of
directly calling git pull
and git clone
.
Further reading
Installation Steps
From PyPI
pip install taf
From source:
pip install -e .
Install extra dependencies when using Yubikey:
pip install taf[yubikey]
Add bash completion:
- copy
taf-complete.sh
to user's directory - add
source ./taf-complete.sh
to~/.bash_profile
or~/.bashrc
- source
~/.bash_profile
Development Setup
We are using pre-commit to run black code formatter, flake8 and bandit code quality checks, as well as Mypy static type checker.
pip install -e .[dev]
pip install -e .[test]
pre-commit install # registers git pre-commit hook
pre-commit run --all-files # runs code formatting and quality checks for all files
NOTE: For Windows users: Open settings.json and replace paths.
Running Tests
To run tests with mocked Yubikey:
pytest
To run tests with real Yubikey:
- Insert test Yubikey
- Run
taf setup_test_key
WARNING: This command will import targets private key to signature slot of your Yubikey, as well as new self-signed x509 certificate! - Run
REAL_YK=True pytest
orset REAL_YK=True pytest
depending on platform.
Platform-specific Wheels
- Open https://dev.azure.com/openlawlibrary/TAF/_build
- Click on latest build
- Open Summary tab
- Under Build artifacts published, click on *wheels to download zip
More info in devops document.
Building Wheels on Ubuntu 16.04 and 18.04
Binary wheels exists only for macOS, windows-32bit and windows-64bit platforms for python 3.10!
- Install dependencies
sudo add-apt-repository ppa:jonathonf/python-3.10
sudo apt-get update
sudo apt-get install python3.10
sudo apt-get install python3.10-venv
sudo apt-get install python3.10-dev
sudo apt-get install swig
sudo apt-get install libpcsclite-dev
sudo apt-get install libssl-dev
sudo apt-get install libykpers-1-dev
- Create virtual environment
python3.10 -m venv env
pip install --upgrade pip
pip install wheel
pip install taf
- Test CLI
taf
Acknowledgements
This project was made possible in part by the Institute of Museum and Library Services (LG-246285-OLS-20)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for taf-0.30.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 101847cefe75f7d2123b82e29863c5b032c9225ce1196ed632bd974ee1ea17cd |
|
MD5 | 7f5fa407555da706fd5f0c7851975a26 |
|
BLAKE2b-256 | a62c43a501dfbac2b7949eb406a864ab911fd8261a5295df6031085c72176691 |
Hashes for taf-0.30.0-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3605205937d5ab4e1ec98c605f7596eae08a20718ca3568121a7c2c311b4b6e4 |
|
MD5 | e91b6c2dc1ba05121d336a7dfed8aa37 |
|
BLAKE2b-256 | 900b7bd5ce68e959e4c0b82931bc3d4e50b5b9109160cd399ca9df2a737b5de3 |
Hashes for taf-0.30.0-cp312-cp312-macosx_11_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 184f9cf59eed8280862a397d9bd47770f2efdc102fcb757ddeb53bfc91213140 |
|
MD5 | fe09115ebdb5cb3f92f903b92f8bfc96 |
|
BLAKE2b-256 | 5f6c8773a7d697c3ab47e506cffb57bb0107ff67b2baed6a5a7dd9dabe354c51 |
Hashes for taf-0.30.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 002b31a0cbbad58dbaf5fc81f39754129dd99b6c53cd2ad007dfc62c717f4b49 |
|
MD5 | b18f2f5a81c21b8535f9df760329848c |
|
BLAKE2b-256 | 7fc9e429c6709de272a4fb9a827a11461e310ce61189f4ff9a4099ea84dddf64 |
Hashes for taf-0.30.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 770a573b11e34e26448c07422a2c6fab24104d710cd7d9d06f29fb2fcc895871 |
|
MD5 | 6cfc1660ab075a65dab32f58a4e85722 |
|
BLAKE2b-256 | f96a5b682e4bbc985a4568eeeb503b4a1d778c98f7ac1714d279cad1c5e57b9f |
Hashes for taf-0.30.0-cp311-cp311-macosx_11_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e46f2a09f10e14108e619a291d8fd10bd38c9bee4ccb3ecb3c4c29f414d1464 |
|
MD5 | 948a7469b073d4b056e4e0e0b79e27d4 |
|
BLAKE2b-256 | 0b026e86d33621537ad9aee4951f03f4d35b23ba89beed6a98bea4dcbeb679c1 |
Hashes for taf-0.30.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a82397e9d06017ff0dad43f2f4e229b42d59e6248bf5009520c862d517b27acd |
|
MD5 | 5c357c0d3b2b1bb0ce4acb6b4cbbee34 |
|
BLAKE2b-256 | 5e2fd49c0908ba32187825af3c214db3c22444cc1df36578494d090828090f23 |
Hashes for taf-0.30.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb7408be67857614f0b48319eb7482ab8be3b67d985c7ff1ec39c3e38e5645c9 |
|
MD5 | df462d3bce7b9bc3e6e2f144c096fff9 |
|
BLAKE2b-256 | 65ef3d2cbdc32754815277c68d8266f6fa2dc3226c805ef009bad23c94e89e87 |
Hashes for taf-0.30.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f895ec9722ca649c9fb799e91beef3ee0196909aaf3b096d07db9130f9b27689 |
|
MD5 | 024b3f49302cf8beba2ed451666beca7 |
|
BLAKE2b-256 | ffbfb9943df58b7d35b28d697984273c7f252c0ea0358cb07e76e31371c15686 |
Hashes for taf-0.30.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bee86eef71aba1afcc4151a99294fc87f9805cfa15cc317e52570e084dcb770e |
|
MD5 | 96a6731879bf6042d4b656de4049926c |
|
BLAKE2b-256 | 3bd49d3a40a36950fb364dfa60d86884847f30a5d2bb61a12fc93254bd589cdf |
Hashes for taf-0.30.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e85144f890e2e6eecda7462b20b49b04362be33e7b4a049fc1f874dc00ec06b4 |
|
MD5 | 79053786f999271ba6e8d70f97594573 |
|
BLAKE2b-256 | 09c5f3d6ede524784cee2352ad0bd2d00f937ced8aa05c50998d382ddc068bb4 |
Hashes for taf-0.30.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df18edd98e82b35d253468674949416cb259915047743dd1181159edf2078209 |
|
MD5 | a83e18e44f77c550466650087d4c625d |
|
BLAKE2b-256 | acdd4d2c0caa06fe66f2a005317593ac98181dcf11740000aa83ddec086eb652 |
Hashes for taf-0.30.0-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd08c97ebb1867341d87204b739129aaaa60f6691e8d5e891b4c895b1a71482c |
|
MD5 | 5e03265501eaae82dbeef34b9f3ad9be |
|
BLAKE2b-256 | 2f95ff9234baead49d30caeda27ca563660ecab45504f05db4fa185e3384e3aa |
Hashes for taf-0.30.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6d5de99799092e558430ff218c7d505244abc788e78441f0e3d9ae9c9c7ac04 |
|
MD5 | 379c43e92b0b73e8478f365783a7ea54 |
|
BLAKE2b-256 | 061401c6c1f09a612d612a5a42db89d199189d879299934ddea37618b9ec9077 |
Hashes for taf-0.30.0-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08c9415bf2573bd031c078afbfd974f403ca1c4d0f77419f1d2c465af1a8fbab |
|
MD5 | 55dcf0013e6220909ce63b9fe703ae8f |
|
BLAKE2b-256 | 76b8ab6cc5d50e5a217990ebfe2621c579ad09d6dd6143dd3db2ae302133d55f |