Skip to main content

Linux CLI for administering Rapid SCADA BaseDAT configuration files

Project description

rapidscada-admin

CI PyPI Python License: MIT

A Linux command-line utility for administering Rapid SCADA v6 BaseDAT configuration files.

What is Rapid SCADA?

Rapid SCADA is an open-source industrial automation and SCADA system. It stores configuration -- users, roles, rights, and other tables -- in binary BaseDAT (.dat) files. Editing these files normally requires the Windows Administrator application. This tool fills the gap for Linux environments.

Why this tool?

  • Automate user management from shell scripts and Ansible playbooks
  • Inspect and modify user.dat without the Windows GUI
  • Validate file integrity before and after changes
  • Export/import user data as JSON for backup and migration
  • No third-party dependencies -- pure Python standard library

Supported platforms

  • Linux (primary target)
  • macOS / Windows (should work, but untested)

Requires Python 3.11+.

Installation

From PyPI

pip install rapidscada-admin

Or with pipx (recommended for CLI tools):

pipx install rapidscada-admin

From source

git clone https://github.com/Shadow21AR/rapidscada-admin.git
cd rapidscada-admin
pip install .

For development:

pip install -e .
pip install pytest ruff

Verify installation

rapidscada-admin --version

Usage

Every command takes the .dat file path as a positional argument. No files are hardcoded.

rapidscada-admin <command> [file] [options]
rapidscada-admin users <file> <subcommand> [options]

User management

# List all users
rapidscada-admin users user.dat list

# Show one user (displays full details including password hash)
rapidscada-admin users user.dat show --user admin

# Add a user
rapidscada-admin users user.dat add \
    --name operator \
    --password 'S3cur3P@ss!' \
    --role 2 \
    --description "Shift operator"

# Delete a user
rapidscada-admin users user.dat delete --user operator

# Rename a user
rapidscada-admin users user.dat rename --old-name operator --new-name op2

# Change password
rapidscada-admin users user.dat passwd --user admin --password 'NewP@ssw0rd!'

# Enable / disable account
rapidscada-admin users user.dat enable --user admin
rapidscada-admin users user.dat disable --user admin

Export and import

# Export all users to JSON
rapidscada-admin users user.dat export > users.json

# Import users from JSON
rapidscada-admin users user.dat import --input users.json

Password hashing

Compute a Rapid SCADA password hash without modifying any file:

rapidscada-admin hash --password secret
rapidscada-admin hash --user-id 11 --password scada

Validation

Check a BaseDAT file for corruption, schema errors, and duplicate entries:

rapidscada-admin verify user.dat

Exit code 0 means valid, 1 means errors found.

Safety

Every mutating command follows a 7-step safety protocol:

  1. Verify schema -- required fields (UserID, Enabled, Name, Password, RoleID) must be present
  2. Create backup -- timestamped .bak file alongside the original
  3. Write temporary file -- changes go to a temp file first
  4. Re-read temporary file -- parse the file we just wrote
  5. Validate -- check schema, duplicates, integrity
  6. Atomic replace -- os.replace() ensures no partial writes
  7. Report -- print the backup location

A malformed .dat file can prevent Rapid SCADA from starting. Always verify before and after operations.

Limitations

  • Only supports BaseDAT format version 4.x (Rapid SCADA v6)
  • Does not support editing the Windows Administrator application's in-memory state
  • Password hashing uses MD5 (matching the Rapid SCADA protocol -- not a general security recommendation)
  • Does not validate RoleID values against role.dat (role table is not yet supported)

Publishing to PyPI

This project uses Trusted Publishing (OIDC) -- no API tokens needed.

Setup

  1. Create an account on pypi.org
  2. Create the project at pypi.org/manage/project/publishing
  3. Add a GitHub publisher:
    • Owner: Shadow21AR
    • Repository: rapidscada-admin
    • Workflow: release.yml
    • Environment: pypi
  4. In GitHub repo settings, create an environment named pypi

Release

git tag v1.0.0
git push origin v1.0.0

The CI workflow runs on every push. The release workflow runs only on v* tags and publishes to PyPI.

Contributing

Contributions are welcome. Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Run pytest and ruff check before submitting
  5. Open a pull request

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rapidscada_admin-1.0.1.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rapidscada_admin-1.0.1-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file rapidscada_admin-1.0.1.tar.gz.

File metadata

  • Download URL: rapidscada_admin-1.0.1.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rapidscada_admin-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d2a6aa998f88a871d196b5157baf605c8eb4007517a7289ed95f11ad1098b1e4
MD5 e748f9681bf7752cf341b1ca24a70a6c
BLAKE2b-256 264bf7e41d2e28b5331d4f214a25d76d1ef82ef40b84f0eb4f732affec3eb588

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidscada_admin-1.0.1.tar.gz:

Publisher: release.yml on Shadow21AR/rapidscada-admin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidscada_admin-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rapidscada_admin-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e650e569183f6d44aa7101bff56fa0c63d873d8809ad6cd50c27f36bdd8dc618
MD5 a467b25a66e43e2c224f5fcdfea801e1
BLAKE2b-256 a8024e1a6873fad96d778cefe3d20d9e78455d6f018664f28af4e631ca58ad15

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidscada_admin-1.0.1-py3-none-any.whl:

Publisher: release.yml on Shadow21AR/rapidscada-admin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page