kolob

module
v0.0.0-...-d488f8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2024 License: MIT

README

Kolob - Simple & Secure Accountless Collaboration

Kolob is a simple collaboration tool designed to target an audience that may not have email addresses or mobile phones but does have access to the internet. Once a verified user has created a group, other users can use the group information to sign in to Kolob and start posting messages to the group.

Motivation

TODO

Capabilities

TODO

Command Interface

The kolob command is used to launch a single Kolob server.

The kolobctl command is used to manage several kolob servers. It provides a clean user interfaces that lets users create new groups and monitors the Kolob server associated with a group. kolobctl uses containerization technologies to do most of the heavy lifting, so you should make sure Docker is installed if you are going to be using it.

Data Model

Kolob focuses on a minimal feature set in order to provide the highest quality experience for a special niche of users. The remainder of this section breaks down this data model and explains the motivation behind the different elements.

---
config:
    er:
        layoutDirection: LR
---
erDiagram
    CONVERSATION }o--||  GROUP : belongs
    MEMBER }o--|| GROUP : belongs
    CONVERSATION ||--o{ MESSAGE : contains
    MEMBER }|--|{ CONVERSATION : mediates
    MEMBER }o--o{ CONVERSATION : participates
    MEMBER ||--o{ MESSAGE : writes
    MESSAGE ||--o| THREAD : owns
    MEMBER }|--|| GROUP : administers
    THREAD ||--|{ MESSAGE : contains
Group

The central element in this data model is the Group. A group is where users can join together and post messages about various topics. Every group has at least one Adminstrator. Additional details about the Group Administrator are provided in the "Member" sections.

A single Kolob server can only run one group. This enables complete isolation of group data and also make the project easier to maintain. As such, the idea of a group is more conceptual than it is concrete in the program's implementation.

Conversation

A Conversation is a time-ordered list of messages sent by group members surrounding a particular topic. A single group may contain more than one conversation. When a group is first created it contains a single conversation titled "General" that serves as a starting point for the group. The Group Creator is free to remove this conversation after the group is created so long as there is at least one additional conversation in the group.

Member

A Member belongs to one and only one group. Member's are identified within a group by their username. A username is unique within a group, but Kolob does not require that usernames be unique across groups.

Group Administrator

The member that creates the group is called the Group Administrator. While other group members do not need to provide a separate email or phone number, the Group Creator must provide contact information and respond to a confirmation before the group is created.

Only the Group Administrator can create profiles for Members to join a group.

This security feature protects the Kolob server from being overwhelemed with fake groups and helps provide group members with a sense of security because they must know the Group Administrator personally in order to join a group, as group information must be given to them by a Group Administator.

Message

Members write Messages to communicate with each other. A single Message can belong to only one Conversation, although Message links can be used between Conversations to direct Members to previously posted content. Messages can be edited and removed by the Member who originally wrote the Message.

Thread

Sometimes Members may want to respond to a specific Message in a Conversation. To do so, a Member can create a Thread on a Message where additional Messages can be posted that relate to the original Message directly.

Data Storage

Kolob can be extended to support multiple backend data storage technologies. The default backend is driven by SQLite.

Data is always written to disk before it is applied to the in-memory store. Data on disk is always encrypted.

Security

All member, conversation, and message information within a group is encrypted using AES with a 256-bit key generated by a cryptographically strong random number generator when the group is created. This key is itself encrypted using a key derived by the PBKDF2 algorithm from a group password set by the Group Administrator. This PBKDF2 algorithms uses the password, a 32 byte salt, and 1,000,000 iterations to generate the key used to encrypt group data.

The user provided password must be between 16 and 72 characters and contain at least one lowercase letter, one uppercase leter, one number, and one special character.

The encrypted key is stored in the group database and extracted whenever a user makes a request for encrypted data. Only authenticated group members are able to make these requests.

The hashed group password and hashed member passwords are also stored in the database to support authentication; however, it is important to note that the password itself is used to generated the key that encrypts the group key, not the hash of the password used for authentication. The member username and hash used for authentication is stored in an encrypted format inside the database. This guarantees that users still can't be identified even by their usernames if the database is compromised.

NOTE: The iteration count was selected based on the OWASP suggestion of 600,000 or more as referenced in a document of comments on SP 800-132 provided to the NIST. The password criteria was selected based on the password guidelines provided by OWASP.

Interfaces

REST Over HTTP

The following table provides a summary of the available HTTP resources and the methods on those resources you can use to interact with the Kolob server.

Path Method Action
/api/group POST Initialize the group for the first time
/api/group GET Fetch group information
/api/group PUT Update group information
/api/group/auth POST Sign in with group credentials
/api/group/auth PUT Update group credentials
/api/membrs POST Add a member to the group
/api/membrs GET List all group members
/api/membrs/auth POST Sign in with member credentials
/api/membrs/{id} GET Fetch member information
/api/membrs/{id} PUT Update member information
/api/membrs/{id} DELETE Remove a member from the group
/api/membrs/{id}/auth PUT Update member credentials
/api/convos POST Create a new conversation
/api/convos/{id} GET Fetch conversation information
/api/convos/{id} PUT Update conversation information
/api/convos/{id}/msgs GET List all messages in a conversation
/api/convos/{id}/membrs GET List all messages in a conversation
/api/msgs/{id} PUT Update a message
/api/msgs/{id} DELETE Delete a message
/api/msgs/{id}/thread POST Add to a message thread
/api/thread/{id} PUT Update a thread message
/api/thread/{id} DELETE Remove to a message thread

Design

TODO

Directories

Path Synopsis
cmd
kolob
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
kolobctl
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
internal
crypto
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
fail
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
model
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
server
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
server/session
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
services/sqlite
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL