Coder Social home page Coder Social logo

repository-service-tuf / repository-service-tuf-api Goto Github PK

View Code? Open in Web Editor NEW
8.0 7.0 19.0 10.41 MB

Repository Service for TUF: API

License: MIT License

Makefile 1.17% Python 97.90% Dockerfile 0.68% Shell 0.25%
api docker hacktoberfest repository security service tuf

repository-service-tuf-api's Introduction

Repository Service for TUF (RSTUF)

image

OpenSSF Best Practices

Repository Service for TUF (RSTUF) is a collection of components that provide services for securing content downloads from tampering between the repository and the client (for example, by an on-path attacker).

RSTUF security properties are achieved by implementing The Update Framework (TUF) as a service.

Repository Service for TUF is platform, artifact, language, and process-flow agnostic.

RSTUF simplifies the adoption of TUF by removing the need to design a repository integration -- RSTUF encapsulates that design.

Repository Service for TUF (RSTUF) is designed to be integrated with existing content delivery solutions -- at the edge or in public/private clouds --alongside current artifact production systems, such as build systems, including; Jenkins, GitHub Actions, GitLab, CircleCI, etc. RSTUF protects downloading, installing, and updating content from arbitrary content repositories, such as a web server, JFrog Artifactory, GitHub packages, etc.

If a user wants to integrate RSTUF into an existing CI/CD pipeline the only requirement is to make a REST API request to RSTUF:

image

The same can be said when a user wants to integrate RSTUF into an existing distribution platform:

image

Thanks to the REST API, integrating RSTUF into existing content delivery solutions is straightforward. Furthermore, RSTUF is designed for scalability and can support active repositories with multiple repository workers.

At present, RSTUF implements a streamlined variant of the Python Package Index (PyPI)'s PEP 458 โ€“ Secure PyPI downloads with signed repository metadata. In the future, RSTUF will grow to provide additional protections through supporting the end-to-end signing of packages, comparable to PyPI's PEP 480 โ€“ Surviving a Compromise of PyPI: End-to-end signing of packages.

How does Repository Service for TUF compare to other solutions?

Rugged: Repository Service for TUF is a collection of services to deploy a scalable and distributed TUF Repository. RSTUF provides an easy interface to integrate (the REST API) and a tool for managing the Metadata Repository (CLI).

PyPI/PEP 458: Repository Service for TUF is a generalization of the design in PEP 458 that can be integrated into a variety of content repository architectures.

image

Using

Please, check the Repository Service for TUF Guide for the instructions about deployment, using and more details.

Contributing

This git repository contains high-level documentation guides and component integrations.

Check our CONTRIBUTING.rst for more details on how to contribute.

Please, check the Repository Service for TUF Development Guide.

Questions, feedback, and suggestions are welcomed on the #repository-service-for-tuf channel on OpenSSF Slack.

repository-service-tuf-api's People

Contributors

breakingpitt avatar dependabot[bot] avatar enyinna1234 avatar fsavoia avatar github-actions[bot] avatar juniorlpa avatar kairoaraujo avatar kapsalis avatar kauth avatar muhahahmad68 avatar mvrachev avatar rdimitrov avatar simi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

repository-service-tuf-api's Issues

Base URL as a settings

The information Base-URL needs to be required in the bootstrap.

The base-URL is a piece of information about where targets files will be downloaded by future client (python-tuf for example)

Example:
https://www.example.com/downloads/product_a/XXXX/product_a_installer_1.0.0.tar.gz
https://www.example.com/ is the base-URL
downloads/product_a/ is the delegation */*/* from Targets Role -> BIN Role
XXXX/product_a_installer_1.0.0.tar.gz will be the delegation from BIN Role to BINS Role followed by file name

Create the initial endpoint for bootstrap the Kaprien API Service

This is the initial version/structure for the Kaprien API Service

The basic initial API is the bootstrap. That will give the initialization of the service.
The bootstrap needs to receive as a payload the settings and the metadata and contain the full API documentation.

The minimum documentation is also necessary for operating the development.

settings
Needs to contain all information about the roles

  • number of keys
  • threshold
  • expiration
  • keys (when online keys -- bins, snapshot, and timestamp), credentials
  • paths (delegated to bin)
  • number_hash_prefixes (delegated from bin to bins)

metadata
Needs to contain all metadata data using python-tuf Metadata in JSON (dictionary format)
role name containing the version (no version means 1)
All versions after the initial delegation need to be available:
1. root
1.targets, 2.targets (delegating to bin)
1.bin, 2.bin(delegating to bins)
1.snapshot, 2.snapshot (delegation to bin) and 3.snapshot (delegation to bins)

Clean up the ``kaprien.tuf.repository``

Clean up the kaprien.tuf.repository
The idea is to remove the Metadata initialization once it is done always by the kaprien-cli
Reuse the TUF data-structure for the Delegation as well.

Add option to add task_id to the target custom fields

Add possibility to the target payload include the task_id in the Targets custom field

'payload': {
  'targets': '...',
  'add_task_id_to_custom': bool
}

It will have registered to the Metadata the task id responsible for adding the task.

How to handle the if system is bootstrapped or not?

We use across many API endpoints the tuf_repository.is_initialized to say that the system is Bootstrapped but it is not safe.
In case, for example, storage (filesystem or SaaS) is unavailable we will say that the system is available to bootstrap.

It is not part of the MVP (as a MUST) but it will be a VERY GOOD TO HAVE.
The system needs to combine access to the Repository Metadata/Storage Service + if the security (#27)

It requires changes in all endpoints.

Improve Bootstrap endpoints

  • Return the Metadata in case of success
  • Change the return code to 400 in case the system has already a metadata
  • The error message can be more precise: "System already has a Repository Metadata in the Storage."

Fix container database path

Define the database path in the Dockerfile

./database does not exist in /opt/kaprien-rest-api/database container build.

Implement UT for `kaprien_api/tuf`

[Why low priority] There is low coverage because it's not used yet by the existent API.

Implement UT for kaprien_api/tuf
If needed sub-issues can be created for it

  • hash_bins.py low-hanging-fruit, just copy from kaprien-cli
  • interfaces.py
  • repository.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.