✈️A private, authenticated, permissioned cargo registry

Overview

chartered

a little dig at creating a private cargo repository with authenticated downloads, the plan is to have git connect to a git server we setup that we can serve a fake index from generated just for the authenticated user that we can embed authentication credentials into.

learn more at https://book.chart.rs/

designed to be easily morphable into a first-class authenticated registry-provider once one of the cargo RFCs go through.

open tasks

fine grained permissions per user per crate

  • VISIBLE
  • PUBLISH_VERSION
  • YANK_VERSION
  • MANAGE_USERS

organisation support

crates are required to be under an organisation, the organisation can be specified when declaring the custom registry in .cargo/config.toml like so:

[registries]
my-org       = { index = "ssh://chart.rs:22/my-org" }
my-other-org = { index = "ssh://chart.rs:22/my-other-org" }

screen shots

crate view (light) crate view (dark) organisation members

Comments
  • 'create crate' endpoint

    'create crate' endpoint

    crates are well hidden behind most other endpoints as we can just return a 404 but cargo publish becomes a bit of a problem. in the crates.io world you can publish any crate you want without 'pre-registering' it first and you just become the owner like that, but that's a bit problematic for us because there's some cases where we might wish to hide some crates from some users altogether.

    currently in chartered cargo publish will only push to a registered crate that the user has the PUBLISH_VERSION permission for, returning a 403 if the user doesn't have the permission or a 404 if the user doesn't even have the VISIBLE permission. we should expose a 'create crate' endpoint for the web ui to use to register a crate and give the registering user 'owner' access to allow them to start pushing to it.

    this means we don't have to rate limit pushes at all, but it does mean the create endpoint can leak private crate names (though only to authenticated users). this endpoint should be limited to 1 req/s to prevent help this from being feasible.


    one thing to note is we do currently ignore the directory passed in the registry git definition:

    [registries]
    chartered = { git = "ssh://127.0.0.1:2233/this/is/ignored" }
    

    perhaps we could, at some point in the future, have these 'subdirectories' scoped to certain teams or something? I think it's a little bit out of scope for an MVP release though

    opened by w4 2
  • Server SSH key config value

    Server SSH key config value

    Need to decide how we'll accept SSH keys:

    • take a directory where we can write any files we want?
    • take a path to a certificate and create it if it doesn't already exist?
    • should we be creating certs already or should the admin do that while they're setting up chartered?
    opened by w4 1
  • RUSTSEC-2020-0159: Potential segfault in `localtime_r` invocations

    RUSTSEC-2020-0159: Potential segfault in `localtime_r` invocations

    Potential segfault in localtime_r invocations

    | Details | | | ------------------- | ---------------------------------------------- | | Package | chrono | | Version | 0.4.19 | | URL | https://github.com/chronotope/chrono/issues/499 | | Date | 2020-11-10 |

    Impact

    Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

    Workarounds

    No workarounds are known.

    References

    See advisory page for additional details.

    opened by github-actions[bot] 1
  • RUSTSEC-2020-0071: Potential segfault in the time crate

    RUSTSEC-2020-0071: Potential segfault in the time crate

    Potential segfault in the time crate

    | Details | | | ------------------- | ---------------------------------------------- | | Package | time | | Version | 0.1.44 | | URL | https://github.com/time-rs/time/issues/293 | | Date | 2020-11-18 | | Patched versions | >=0.2.23 | | Unaffected versions | =0.2.0,=0.2.1,=0.2.2,=0.2.3,=0.2.4,=0.2.5,=0.2.6 |

    Impact

    Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

    The affected functions from time 0.2.7 through 0.2.22 are:

    • time::UtcOffset::local_offset_at
    • time::UtcOffset::try_local_offset_at
    • time::UtcOffset::current_local_offset
    • time::UtcOffset::try_current_local_offset
    • time::OffsetDateTime::now_local
    • time::OffsetDateTime::try_now_local

    The affected functions in time 0.1 (all versions) are:

    • at
    • at_utc

    Non-Unix targets (including Windows and wasm) are unaffected.

    Patches

    Pending a proper fix, the internal method that determines the local offset has been modified to always return None on the affected operating systems. This has the effect of returning an Err on the try_* methods and UTC on the non-try_* methods.

    Users and library authors with time in their dependency tree should perform cargo update, which will pull in the updated, unaffected code.

    Users of time 0.1 do not have a patch and should upgrade to an unaffected version: time 0.2.23 or greater or the 0.3. series.

    Workarounds

    No workarounds are known.

    References

    time-rs/time#293

    See advisory page for additional details.

    opened by github-actions[bot] 1
  • Moving crates between orgs

    Moving crates between orgs

    Should be easy just updating organisation_id on the crate but we need to make sure the user has CREATE_CRATE on both orgs. Proper UI needs to be in place to inform the user it's a destructive action. If we setup a redirect between old and new orgs the user needs to be informed some users may lose privileges.

    opened by w4 1
  • Clean up git parsing code

    Clean up git parsing code

    Right now we're just doing string comparisons on incoming messages, we should actually 'understand' these commands and acknowledge git client capabilities etc..

    opened by w4 1
  • Session extending

    Session extending

    This could either happen:

    • when the client requests, ie. a setTimeout just before the session is about to expire, or
    • upon every request from the session
    opened by w4 0
  • Fix 500 when crate pushed to non-existent org

    Fix 500 when crate pushed to non-existent org

    Caused by:
      failed to get a 200 OK response, got 500
      headers:
      	HTTP/1.1 100 Continue
    
      	HTTP/1.1 500 Internal Server Error
      	content-type: application/json
      	content-length: 20
      	date: Mon, 11 Oct 2021 18:34:28 GMT
    
      body:
      {"error":"NotFound"}
    
    Oct 11 19:34:28.618 ERROR chartered_web::middleware::logging: 127.0.0.1:51358 - "PUT /a/[snip]/o/dave/api/v1/crates/new" 500 2.248239ms "cargo 1.56.0-nightly (b51439fd8 2021-08-09)" "Err(Database(Query(NotFound)))"
    
    opened by w4 0
  • Public organisations

    Public organisations

    The two ways this can be approached are:

    • a * 'user' which applies a set of permissions to any users not already listed, or:
    • a checkbox to set public org y/n that implies VISIBLE for everyone
    opened by w4 0
  • Implied permissions

    Implied permissions

    • [x] CREATE_CRATE should imply PUBLISH_VERSION, etc.
    • [x] We also need "public" orgs which imply VISIBLE for everyone.
    • [x] Whether we keep around crate-level permissions and how they're factored in (other than doing a bitwise OR against group permissions) is still an open question - should someone in an org be able to be disallowed from viewing specific crates in that org?
    • [x] ~should public crates in otherwise private orgs be a thing?~ No
    • [x] ~Does MANAGE_USERS imply the user can set a crate/group to public?~ Can now only pick when creating the org
    opened by w4 0
  • Implement groups

    Implement groups

    All crates should be scoped to a group - group permissions will apply to crate permissions by default, however the crate permissions can be overridden. Group admins decide who gets to push new crates with the new permission NEW_CRATE.

    Any attempts to push to an unscoped crate (ie. rand, instead of my-group/rand) will be disallowed.

    This means per-group registries will have to be defined in ~/.cargo/config.toml:

    [registries]
    registry--cool   = { index = "ssh://chart.rs/cool" }
    registry--uncool = { index = "ssh://chart.rs/uncool" }
    

    This change should also allow for "global" permissions

    opened by w4 0
  • RUSTSEC-2021-0141: dotenv is Unmaintained

    RUSTSEC-2021-0141: dotenv is Unmaintained

    dotenv is Unmaintained

    | Details | | | ------------------- | ---------------------------------------------- | | Status | unmaintained | | Package | dotenv | | Version | 0.15.0 | | URL | https://github.com/dotenv-rs/dotenv/issues/74 | | Date | 2021-12-24 |

    dotenv by description is meant to be used in development or testing only.

    Using this in production may or may not be advisable.

    Alternatives

    The below may or may not be feasible alternative(s):

    See advisory page for additional details.

    opened by github-actions[bot] 0
  • RUSTSEC-2021-0139: ansi_term is Unmaintained

    RUSTSEC-2021-0139: ansi_term is Unmaintained

    ansi_term is Unmaintained

    | Details | | | ------------------- | ---------------------------------------------- | | Status | unmaintained | | Package | ansi_term | | Version | 0.12.1 | | URL | https://github.com/ogham/rust-ansi-term/issues/72 | | Date | 2021-08-18 |

    The maintainer has adviced that this crate is deprecated and will not receive any maintenance.

    The crate does not seem to have much dependencies and may or may not be ok to use as-is.

    Last release seems to have been three years ago.

    Possible Alternative(s)

    The below list has not been vetted in any way and may or may not contain alternatives;

    Dependency Specific Migration(s)

    See advisory page for additional details.

    opened by github-actions[bot] 0
  • chartered-git tree caching

    chartered-git tree caching

    It'd be nice to cache the entire tree of chartered-git and filter it down based on the user rather than fetching every crate from the database and building the tree upon every git pull.

    opened by w4 0
  • User profile updating

    User profile updating

    For OAuth users we collect some basic info on first login such as email, real name, some website links. We should allow password-based users to set these too and also for OAuth users to update them.

    opened by w4 0
  • Reverse dependencies

    Reverse dependencies

    We have a dependents section on the crate page but it currently has placeholder text, so we need to implement reverse dependencies there. More importantly however, we need to make sure the user has the VISIBLE permission for each of these crates when pulling them

    opened by w4 1
Releases(v0.1.0)
  • v0.1.0(Oct 30, 2021)

    Our first release of chartered 🎉. Implements many of the core requirements of chartered including:

    • Git server using thrussh, authenticating the user to their profile using SSH keys, only serving the crates they have the VISIBLE permission for.
    • Storage for crates on local filesystem or S3
    • SQLite or Postgres support
    • A slick Web UI for viewing/searching crates & managing organisations, members and permissions (with dark mode!)
    • Organisation support for grouping crates
    • Most of the cargo API
    • OpenID support

    Per user, per crate/organisation permissions:

    • VISIBLE
    • PUBLISH_VERSION
    • YANK_VERSION
    • MANAGE_USERS
    • CREATE_CRATE

    https://book.chart.rs/

    crate view (dark)

    Source code(tar.gz)
    Source code(zip)
Owner
Jordan Doyle
world wide web wrangler
Jordan Doyle
An implementation of the OPAQUE password-authenticated key exchange protocol

The OPAQUE key exchange protocol OPAQUE is an asymmetric password-authenticated key exchange protocol. It allows a client to authenticate to a server

Novi 178 Jan 9, 2023
Password-Authenticated Key Agreement protocols

RustCrypto: PAKEs Password-Authenticated Key Agreement protocols implementation. Warnings Crates in this repository have not yet received any formal c

Rust Crypto 81 Dec 5, 2022
Authenticated Encryption with Associated Data Algorithms: high-level encryption ciphers

RustCrypto: Authenticated Encryption with Associated Data (AEAD) Algorithms Collection of Authenticated Encryption with Associated Data (AEAD) algorit

Rust Crypto 457 Jan 4, 2023
Bessie - an authenticated, chunked cipher based on BLAKE3

Bessie Bessie is an authenticated, chunked cipher based on BLAKE3. Right now it's in the early design stages. See design.md. Although the Bessie ciphe

Jack O'Connor 12 Dec 9, 2022
Scalable layer-2 registry and prover for subspaces

Subspacer Note: this does not fully implement the functionality described in the Spaces protocol yet and should be considered a proof of concept. Scal

Spaces Protocol 5 Feb 22, 2024
cargo-crev to cargo-vet code review exporter

cargo-crev to cargo-vet converter Crev and Vet are supply-chain security tools for auditing Rust/Cargo dependencies. This tool (crevette) is a helper

crev - Code REView system 3 Dec 6, 2023
Private payments for mobile devices.

MobileCoin Fog This is the README file for MobileCoin Fog. Note to Developers MobileCoin Fog is a prototype. Expect substantial changes before and aft

MobileCoin Foundation 36 May 6, 2022
Private payments for mobile devices.

Testing your first payment Please see TESTNET.md for instructions on participating in the TestNet! Sending your first payment Please see MAINNET.md fo

MobileCoin Foundation 1.1k Dec 30, 2022
Convert private keys to PKCS#8 format in pure Rust

topk8 Convert private keys to PKCS#8 format in pure Rust. The following formats are supported at the moment: PKCS#1 PEM (RSA PRIVATE KEY) SEC1 PEM (EC

kazk 1 Dec 10, 2021
Add Rust on private-isu

private-isu Rust実装 private-isuにRust実装を追加するためのリポジトリです. 現状,Docker Composeのみ対応しています. Using Rustで起動するためには以下の手順が必要です. private-isuのwebappに本リポジトリを追加する. cd pr

Romira 3 Jun 22, 2022
Rust implementation of Namada, a sovereign proof-of-stake blockchain that enables asset-agnostic private transfers

Namada Overview Namada is a sovereign proof-of-stake blockchain, using Tendermint BFT consensus, that enables multi-asset private transfers for any na

anoma 144 Jan 2, 2023
Kryptokrona SDK in Rust for building decentralized private communication and payment systems.

Kryptokrona Rust SDK Kryptokrona is a decentralized blockchain from the Nordic based on CryptoNote, which forms the basis for Monero, among others. Cr

null 5 May 25, 2023
a Solana program for granting friends permissions on your account without revealing your private key.

Delegatooooor Granting Permission: An account holder (the delegator) decides to grant permission to a delegate. They create and sign a transaction tha

0xGhostMac 3 Apr 3, 2024
Private key finder based on the (Bitcoin) secp256k1 elliptic curve.

keyripper keyripper is a powerful tool developed in Rust to assist in the recovery of Bitcoin private keys by leveraging the Baby-Step Giant-Step (BSG

Denzy 12 Sep 27, 2024
A cryptographically verifiable code review system for the cargo (Rust) package manager.

A cryptographically verifiable code review system for the cargo (Rust) package manager.

crev - Code REView system 1.8k Jan 2, 2023
Audit Cargo.lock files for dependencies with security vulnerabilities

RustSec Crates ?? ??️ ?? The RustSec Advisory Database is a repository of security advisories filed against Rust crates published via crates.io. The a

RustSec 1.2k Dec 30, 2022
Extends cargo to execute the given command on multiple crates - upstream is at

cargo-multi GitLab CI: master: develop: Travis: master: develop: Extends cargo to execute the given command on multiple crates. Inspired by git multi.

Cyril Plisko 6 Feb 27, 2022
A cargo subcommand for displaying when Rust dependencies are out of date

cargo-outdated Linux: A cargo subcommand for displaying when Rust dependencies are out of date About cargo-outdated is for displaying when dependencie

Kevin K. 911 Dec 30, 2022
A minimal esp-hal application template for use with cargo-generate

{{ project-name }} A minimalist template for use with cargo-generate to create no_std applications targeting Espressif's line of SoCs and modules. At

esp-rs 35 Dec 29, 2022