Implementation of archival authentication
Project description
TAF
TAF (The Archive Framework) is an implementation of archival authentication. In other words, TAF ensures that a git repository can be securely cloned/updated and authenticated. In our case, a git repository is a collection of thousands of XML documents and represents a Library of official legal material, but TAF can be used to secure any git repository, regardless of its content.
A git repository can be compromised in a number of ways:
- an attacker could hack a user's account on a code hosting platform, like GitHub or GitLab,
- an attacker could hack the hosting platform,
- an attacker could gain access to a developer's personal computer.
This attacker could then:
- upload a new GPG key to GitHub,
- push new commits to any repository,
- add another authorized user with write access,
- unprotected the master branch of any of the repositories and force push to it.
TAF's goal is not to prevent any of the attacks listed above from happening, but to detect that an attack took place and cancel an update if that is the case. So, TAF should be used instead of directly calling git pull
and git clone
.
TAF's implementation strongly relies on The Update Framework (TUF), which helps developers maintain the security of a software update system and provides a flexible framework and specification that developers can adopt into any software update system.
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.
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.6!
- Install dependencies
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
sudo apt-get install python3.6-venv
sudo apt-get install python3.6-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.6 -m venv env
pip install --upgrade pip
pip install wheel
pip install taf
- Test CLI
taf
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.11.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 845bdf8f0eb471d754fad9ffa6d562c2c8b41c7784d5625e3b1d32aacf4da9df |
|
MD5 | ae8cce3dfe461727b08b3708b0d6d217 |
|
BLAKE2b-256 | 3b9f7471c727d6a2315053ec8f254c8be79cf414085a781a396f67f8f143afc6 |
Hashes for taf-0.11.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d69732fe1f5c0b227a96b32cb0e933db728d73650a8b494f7892ce3feb3e826a |
|
MD5 | 689ad85fb55708f34368ae1b05867d30 |
|
BLAKE2b-256 | a1f1f70d38c8ae830b6f4b0ae70aeaa9eeb6913860b78963435134003b69b523 |
Hashes for taf-0.11.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eb9399492f36e5082dd0598dc84a9301e38f9fff5d2e5f332f4a062cc710461 |
|
MD5 | c7cd7e91339ccd9227721934be297156 |
|
BLAKE2b-256 | 47fe6dd315dde04551c01ef0fa367078ff6f6e5899a0a049649e0122af6eb04d |
Hashes for taf-0.11.1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42bcf68078b4764350b5dad33ad44d29a247a4f9e360ded0fef73329474b1e4f |
|
MD5 | 46f8e59cec66feeb6e7bce24665df0fb |
|
BLAKE2b-256 | f588b31e40205c986c28881c3467ecdd7c3b9cb60a22b70090aee2a86473a072 |