Skip to main content

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:

  1. UELMA whitepaper
  2. TAF implementation and integration with TUF

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:

  1. copy taf-complete.sh to user's directory
  2. add source ./taf-complete.sh to ~/.bash_profile or ~/.bashrc
  3. 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:

  1. Insert test Yubikey
  2. 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!
  3. Run REAL_YK=True pytest or set REAL_YK=True pytest depending on platform.

Platform-specific Wheels

  1. Open https://dev.azure.com/openlawlibrary/TAF/_build
  2. Click on latest build
  3. Open Summary tab
  4. 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

taf-0.13.4.tar.gz (662.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

taf-0.13.4-cp38-cp38-win_amd64.whl (699.5 kB view details)

Uploaded CPython 3.8Windows x86-64

taf-0.13.4-cp38-cp38-win32.whl (639.5 kB view details)

Uploaded CPython 3.8Windows x86

taf-0.13.4-cp38-cp38-macosx_10_15_x86_64.whl (429.6 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

taf-0.13.4-cp36-cp36m-win_amd64.whl (699.5 kB view details)

Uploaded CPython 3.6mWindows x86-64

taf-0.13.4-cp36-cp36m-win32.whl (639.5 kB view details)

Uploaded CPython 3.6mWindows x86

taf-0.13.4-cp36-cp36m-macosx_10_15_x86_64.whl (429.6 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

File details

Details for the file taf-0.13.4.tar.gz.

File metadata

  • Download URL: taf-0.13.4.tar.gz
  • Upload date:
  • Size: 662.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for taf-0.13.4.tar.gz
Algorithm Hash digest
SHA256 9bea5e869af7205f1a7f0eafdd3c65f2694b737ad63def80979411d92b60555e
MD5 802929eccbe3d9f5e8eaff5da0f14197
BLAKE2b-256 6806e049668ef8a69aa02a15d69a4b11ad5657aeefd4c5308c1e10acc2b906fc

See more details on using hashes here.

File details

Details for the file taf-0.13.4-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: taf-0.13.4-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 699.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for taf-0.13.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 66cb84f05ea680731b893e184741cadcb7750734ae37e0e60fa43575020b158b
MD5 3fb1e2edf4703c5d84f48803d6f2a8ba
BLAKE2b-256 57bacb63a394a7e0dd1ddd63cbdb7dfed943b4af2cf2ac6e1619c43b3003242c

See more details on using hashes here.

File details

Details for the file taf-0.13.4-cp38-cp38-win32.whl.

File metadata

  • Download URL: taf-0.13.4-cp38-cp38-win32.whl
  • Upload date:
  • Size: 639.5 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for taf-0.13.4-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 414424be0df1fd23aae6ccb56744890a9085bee0c1133f1fb13fb9f18d93adc0
MD5 43740ea1159fd7808dac8f70b7eaf715
BLAKE2b-256 377e518b970c68915f7e558944da8e66dee2d40c4ef0b26b9ae01e20cdb58131

See more details on using hashes here.

File details

Details for the file taf-0.13.4-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: taf-0.13.4-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 429.6 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for taf-0.13.4-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f0a8f22934c891659b4993aae1935217dea87e0211c7af5193656946d043b5c9
MD5 fc20d388c86c52aea021df6e99c124b7
BLAKE2b-256 29e14e5916f88f105617de5b83825b09c32d6025224572d936b39d4d9c6f40eb

See more details on using hashes here.

File details

Details for the file taf-0.13.4-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: taf-0.13.4-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 699.5 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for taf-0.13.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9ca6b507ef7e90c9cec7ea99c73e137ceb54931f54c2b5f3c47b56cf407aafb1
MD5 e07acd582b4ecfb188b5c95a9e3db68c
BLAKE2b-256 fda5a5b439e3e0afb0528dbac9675919a5b23dd54739144aa694714359b251de

See more details on using hashes here.

File details

Details for the file taf-0.13.4-cp36-cp36m-win32.whl.

File metadata

  • Download URL: taf-0.13.4-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 639.5 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for taf-0.13.4-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 7fbf629e7ce4ae92e84d38362fffc58aef8ff8a61d4368b06d1e8333527197bd
MD5 fb6eb2e50d79aa57b8e08f707cb72c5c
BLAKE2b-256 aa3d9ab1056da74d77f2ee3f8cf0c6f85584da4a797e261ba17feffa10374f57

See more details on using hashes here.

File details

Details for the file taf-0.13.4-cp36-cp36m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: taf-0.13.4-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 429.6 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for taf-0.13.4-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2970fa6ca763d23e02929f4fdd61e7c7f42ec7c2609189d8d99067f3f31a2d79
MD5 dbe0f67740316ba03450347c6b8c9bb6
BLAKE2b-256 60751c152e1bc764a1b34646341d89e083019951a9d23435d0d1e981a6230d64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page