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

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

This version

0.4.0

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.4.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

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

taf-0.4.0-cp36-cp36m-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.6mWindows x86-64

taf-0.4.0-cp36-cp36m-win32.whl (3.8 MB view details)

Uploaded CPython 3.6mWindows x86

taf-0.4.0-cp36-cp36m-macosx_10_14_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.6mmacOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: taf-0.4.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for taf-0.4.0.tar.gz
Algorithm Hash digest
SHA256 415e042de70a55be07d87e5656639d02f838132adccf9c45a48b49f9ab91e1c7
MD5 96d067c9241f60b5e21d503486336437
BLAKE2b-256 aaa398909331ac33c691932d9a7f9f424e82bbf86e4b997619a3f329aa4e9a7b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: taf-0.4.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8

File hashes

Hashes for taf-0.4.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 67c4b4dbd2faa6ac968dc2c657c1dc238e8325ba8692b0ead53ee78f5fc0c3b3
MD5 d6b48730ed8cf1e448e54471f4100675
BLAKE2b-256 6f2dd58c841426da7ae113f987dff1b10a7237296cad90487ba13018e9cd37d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: taf-0.4.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8

File hashes

Hashes for taf-0.4.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 9ed1d3adbe08e94fb1e618f164f9b4c81b63306225ae6b31061643f5294df35c
MD5 de2826c79ae987ffb0d14437a97df72f
BLAKE2b-256 c80d908354e198adbfc2ea098faca909b23df2d5f474ef34e27a6ef4b90354f5

See more details on using hashes here.

File details

Details for the file taf-0.4.0-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: taf-0.4.0-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for taf-0.4.0-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 1d73312bb35b6f01a07f3a4d8a3db2a015c5fff7c0e408caf0381b016468416f
MD5 bd7662556d9c2b0e7eaf62e18f6deec9
BLAKE2b-256 de7d9a6f1dcf7968f7335fd228998030aecc836737fedec39e25b3f4db094218

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