Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 52 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,55 @@
```
# Debian packaging artifacts
securex_project/DEBIAN/
securex_project/debian/
securex_project/*.deb
# Dependencies
__pycache__/
*.pyc
*.pyo
*.pyd
*.egg-info/
.eggs/
build/
dist/
*.egg
*.whl
pip-log.txt
pip-delete-this-directory.txt

# Build artifacts
*.deb
# Virtual environments
venv/
.venv/
env/
.ENV/
env.bak/
venv.bak/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Logs
*.log

# Environment
.env
.env.local
.env.*
!.env.example

# Coverage
.coverage
coverage/
htmlcov/
.coverage.*
.nyc_output/

# Testing
.pytest_cache/
.mypy_cache/
.hypothesis/

# OS
.DS_Store
Thumbs.db
```
167 changes: 167 additions & 0 deletions INSTALLATION_PROCEDURES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# SecureX Installation Procedures

This document describes the procedures for installing and distributing the SecureX package via both apt server and pip.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (typo): Add an article before "apt server" for grammatical correctness.

Consider wording this as “via both an APT server and pip” to add the article and align capitalization with later references to APT.

Suggested change
This document describes the procedures for installing and distributing the SecureX package via both apt server and pip.
This document describes the procedures for installing and distributing the SecureX package via both an APT server and pip.


## Distribution Methods

### 1. Debian Package (APT Server Distribution)

#### Building the Debian Package

The SecureX project is structured to build a proper Debian package that can be distributed through APT repositories.

1. **Build the package:**
```bash
cd /workspace/securex_project
dpkg-deb --build . securex_1.0_all.deb
```

2. **Verify the package:**
```bash
dpkg --info securex_1.0_all.deb
dpkg --contents securex_1.0_all.deb
```

#### Setting up APT Repository

To distribute SecureX through an APT repository:

1. **Create the repository structure:**
```
apt-repo/
├── dists/
│ └── stable/
│ ├── main/
│ │ └── binary-amd64/
│ │ └── Packages
│ └── Release
└── pool/
└── main/
└── s/
└── securex/
└── securex_1.0_all.deb
```

2. **Place the package in the repository:**
```bash
mkdir -p apt-repo/pool/main/s/securex/
cp securex_1.0_all.deb apt-repo/pool/main/s/securex/
```

3. **Generate package index:**
```bash
cd apt-repo
apt-ftparchive packages pool/ > dists/stable/main/binary-amd64/Packages
gzip -c dists/stable/main/binary-amd64/Packages > dists/stable/main/binary-amd64/Packages.gz
```

4. **Create Release file:**
```bash
apt-ftparchive release dists/stable > dists/stable/Release
```

5. **Sign the repository (recommended):**
```bash
gpg --clearsign -o dists/stable/InRelease dists/stable/Release
gpg -abs -o dists/stable/Release.gpg dists/stable/Release
```

#### Client Installation via APT

Users can install SecureX using the following steps:

1. **Add repository:**
```bash
echo "deb [trusted=yes] https://your-apt-server.com/stable/ ./" | sudo tee /etc/apt/sources.list.d/securex.list
```

2. **Update package list:**
```bash
sudo apt update
```

3. **Install SecureX:**
```bash
sudo apt install securex
```

### 2. Python Package (Pip Distribution)

#### Building the Python Package

The SecureX project can also be distributed as a Python package:

1. **Install build tools:**
```bash
pip install build twine
```

2. **Build the package:**
```bash
python -m build
```

3. **Upload to PyPI:**
```bash
python -m twine upload dist/*
```

#### Client Installation via Pip

Users can install SecureX using pip:

1. **Install from PyPI:**
```bash
pip install securex-vault
```

2. **Install from source:**
```bash
pip install git+https://github.com/username/securex.git
```

## Dependencies

Both distribution methods ensure that the required system dependencies are installed:

- `fscrypt` - For file encryption
- `oathtool` - For TOTP verification

These dependencies are declared in the Debian control file and installation scripts will ensure they are available.

## Post-Installation

After installation, the system will have:

- The `securex` command available in PATH
- Default directories created for user convenience
- Proper permissions set for security

## Verification

After installation, verify the installation:

```bash
securex --help
```

This should display the help information for the SecureX tool.

## Uninstallation

### For Debian Package:
```bash
sudo apt remove securex
```

### For Pip Package:
```bash
pip uninstall securex-vault
```

## Security Considerations

1. The installation process preserves the security model of SecureX
2. Default directories are created with appropriate permissions (700)
3. Configuration files maintain restricted permissions (600)
4. The vault remains encrypted and requires TOTP authentication
110 changes: 109 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,109 @@
# securex
# SecureX - Encrypted TOTP-protected Vault

SecureX is a command-line tool that provides an encrypted vault protected by Time-based One-Time Password (TOTP) authentication. Files are stored encrypted and can only be accessed through the CLI after successful TOTP verification.

## Features

- TOTP-based authentication for all access
- Uses fscrypt for file encryption
- Vault remains locked when not in use
- Only accessible through the securex CLI
- Automatic cleanup of accessed files after specified time

## Installation

### Using pip

```bash
pip install securex-vault
```

### Using Debian Package

```bash
wget https://github.com/<username>/securex/releases/download/v1.0/securex.deb
sudo apt install ./securex.deb
```

## Usage

### Setup

Initialize the secure vault:

```bash
securex setup
```

This will:
- Create the vault directory at `$HOME/.securex_vault`
- Create the access directory at `$HOME/.securex_access`
- Prompt for a TOTP secret
- Encrypt the vault using fscrypt

### Adding Files

Add a file to the vault:

```bash
securex add <file>
```

### Removing Files

Remove a file from the vault:

```bash
securex remove <file>
```

### Accessing Files

Copy all files from the vault to the access directory for a specified time:

```bash
securex get --time <minutes>
```

The files will be automatically deleted after the specified time.

## Commands

- `securex setup` - Initialize the secure vault
- `securex add <file>` - Add a file to the vault
- `securex remove <file>` - Remove a file from the vault
- `securex get --time <minutes>` - Copy all files to access directory for specified minutes
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Improve grammar in the description of the securex get command.

Consider "Copy all files to the access directory for the specified number of minutes," or at least add "the" before "access directory" for smoother grammar.

Suggested change
- `securex get --time <minutes>` - Copy all files to access directory for specified minutes
- `securex get --time <minutes>` - Copy all files to the access directory for the specified number of minutes


## Dependencies

- `fscrypt` - For file encryption
- `oathtool` - For TOTP verification

These will be automatically installed during package installation.

## Security

- All vault access requires TOTP verification
- The vault is encrypted using fscrypt
- The vault is locked when not in use
- Files in the access directory are automatically deleted after the specified time
- Configuration files are stored with restricted permissions

## Building the Package

### Building Debian Package

```bash
cd securex_project
dpkg-deb --build .
```

### Building Python Package

```bash
python setup.py sdist bdist_wheel
```

## License

MIT License - see LICENSE file for details.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# No Python dependencies required for this bash-based tool
# The tool depends on system packages: fscrypt and oathtool
20 changes: 20 additions & 0 deletions securex_project/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Source: securex
Section: utils
Priority: optional
Maintainer: SecureX Maintainers <maintainer@example.com>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.8

Package: securex
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, fscrypt, oathtool
Description: Encrypted TOTP-protected vault CLI tool
SecureX is a command-line tool that provides an encrypted vault protected by
Time-based One-Time Password (TOTP) authentication. Files are stored encrypted
and can only be accessed through the CLI after successful TOTP verification.
.
- TOTP-based authentication for all access
- Uses fscrypt for file encryption
- Vault remains locked when not in use
- Only accessible through the securex CLI
- Automatic cleanup of accessed files after specified time
22 changes: 22 additions & 0 deletions securex_project/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

# Create user directories if they don't exist
if [ "$1" = "configure" ]; then
# Create default directories with proper permissions
if [ ! -d "$HOME/.securex_vault" ]; then
mkdir -p "$HOME/.securex_vault"
fi

if [ ! -d "$HOME/.securex_access" ]; then
mkdir -p "$HOME/.securex_access"
fi

# Ensure proper permissions
chmod 700 "$HOME/.securex_vault" 2>/dev/null || true
chmod 700 "$HOME/.securex_access" 2>/dev/null || true
fi

#DEBHELPER#

exit 0
Loading