Skip to content

secutils-dev/secutils

Repository files navigation

Secutils.dev is an open-source, versatile, yet simple security toolbox for engineers and researchers built by application security engineers.

Refer to secutils-dev/secutils-webui for the web interface component of Secutils.dev.

Why Secutils.dev?

Big security solutions are impressive, but often too expensive, complex, and kind of overkill for us regular engineers. On the other hand, there's a bunch of handy tools and scripts tackling specific security problems - they're simple and affordable, but trying to juggle them is hard and messy. Secutils.dev aims to be the sweet spot between hefty solutions and scattered tools. It's open, user-friendly, and your go-to toolbox filled with carefully selected utilities commonly used in daily work, whether you're operating solo or part of a big team.

Secutils.dev adheres to open security principles and offers:

Secutils.dev Webhooks

Secutils.dev Web Scraping

Secutils.dev Digital Certificates

Secutils.dev Web Security

Getting started

Before running the Secutils.dev server, you need to configure the database and Ory Kratos connections. If you don't have a PostgreSQL and an Ory Kratos servers running, you can run them locally with the following Docker Compose file:

docker-compose -f ./dev/docker/postgres-and-kratos.yml up --build --force-recreate

To remove everything and start from scratch, run:

docker-compose -f ./dev/docker/postgres-and-kratos.yml down --volumes --remove-orphans

Make sure to replace POSTGRES_HOST_AUTH_METHOD=trust in Docker Compose file with a more secure authentication method if you're planning to use a local database for an extended period. For the existing database, you'll need to provide connection details in the TOML configuration file as explained below.

Once all services are configured, you can start the Secutils.dev server with cargo run. By default, the server will be accessible via http://localhost:7070. Use curl to verify that the server is up and running:

curl -XGET http://localhost:7070/api/status
---
{"version":"1.0.0-beta.1","level":"available"}

The server can be configured with a TOML configuration file. See the example below for a basic configuration:

port = 7070

[db]
name = 'secutils'
host = 'localhost'
port = 5432
username = 'postgres'
password = 'password'

# Connection details for Ory Kratos and Web Scraper services.
[components]
kratos-url = 'http://localhost:4433/'
web-scraper-url = 'http://localhost:7272/'

# A list of preconfigured users. Once a user with the specified email signs up, 
# the server will automatically assign the user the specified handle and tier.
[security.preconfigured-users]
"admin@mydomain.dev" = { handle = "admin", tier = "ultimate" }

# The configuration of the Deno runtime used to run responder scripts.
[js-runtime]
max-heap-size = 10_485_760 # 10 MB
max-user-script-execution-time = 30_000 # 30 seconds

# SMTP server configuration used to send emails (signup emails, notifications etc.).
[smtp]
address = "xxx"
username = "xxx"
password = "xxx"

[utils]
webhook-url-type = "path"

If you saved your configuration to a file named secutils.toml, you can start the server with the following command:

cargo run -- -c secutils.toml

You can also use .env file to specify the location of the configuration file and database connection details required for development and testing:

# Path to the configuration file.
SECUTILS_CONFIG=${PWD}/secutils.toml

# Refer to https://github.com/launchbadge/sqlx for more details.
DATABASE_URL=postgres://postgres@localhost/secutils

Usage

At this point, it is recommended to use the Secutils.dev APIs through the Web UI.

Re-initialize local database

To manage development database, you need to install the SQLx's command-line utility:

cargo install --force sqlx-cli

# Drops, creates, and migrates the database referenced
# in the `DATABASE_URL` from the `.env` file.
sqlx database drop
sqlx database create
sqlx migrate run

Docker

Build images with the following commands:

# Host architecture
docker build --tag secutils-api:latest .

# Cross-compile to ARM64 architecture
docker build --platform linux/arm64 --tag secutils-api:latest .

# Cross-compile to ARM64 musl architecture
docker build --platform linux/arm64 --tag secutils-api:latest -f Dockerfile.aarch64-unknown-linux-musl .

Documentation

The documentation for Secutils.dev is located in github.com/secutils-dev/secutils-docs and hosted at secutils.dev/docs.

Shoutouts

Secutils.dev wouldn't be possible without the following amazing projects and tools:

Name Description
JetBrains logo JetBrains develops fantastic developer tools that I use daily to build Secutils.dev. While the products aren't open-source or free by default, they provide a generous free license for open-source project maintainers. Check it out!
Ory Kratos logo Ory Kratos is an open-source alternative to Auth0, Okta, or Firebase with hardened security and PassKeys, SMS, OIDC, Social Sign In, MFA, FIDO, TOTP and OTP, WebAuthn, passwordless and much more.
To be continued...

Community