Skip to content

Repository files navigation

Database Security Experiments

Chinese README

Requirements

  • Docker
  • Docker Compose plugin
  • Python 3 for host-side helper scripts

Single-Database Deployment

cd single-db-security-experiments
docker compose up -d

Run the attack client:

docker compose exec attack-client bash

Run the default automated attack workflow:

docker compose exec attack-client python3 /root/attack-scripts/automate_attacks.py

Run detection-log parsing inside the started environment:

python3 attack-scripts/detect_metrics.py

Start only the encryption-related services:

docker compose up -d postgres-acra acra-server postgres-pgcrypto

Run host-side helper scripts from the same directory:

python3 attack-scripts/benchmark_encryption.py
python3 attack-scripts/test_encryption_protection.py
python3 attack-scripts/test_volume_leakage.py
python3 attack-scripts/test_acra_improvement_simple.py

Inspect script options:

python3 attack-scripts/benchmark_encryption.py --help
python3 attack-scripts/detect_metrics.py --help
docker compose exec attack-client python3 /root/attack-scripts/automate_attacks.py --help

Stop the single-database stack:

docker compose down

Distributed Deployment

cd distributed-db-security-experiments

Start the PostgreSQL shard stack:

docker compose -f docker-compose.postgres-shards.yml up -d

Run PostgreSQL shard scripts:

python3 scripts/exp1_single_shard_flood.py
python3 scripts/exp3_cross_shard_frontrun_sim.py

Start the Citus stack:

docker compose -f docker-compose.citus.yml up -d

Run the Citus script:

python3 scripts/exp1_citus_hotspot.py

Start the TiDB stack:

docker compose -f docker-compose.tidb.yml up -d

Run TiDB scripts:

python3 scripts/exp1_tidb_hotspot.py
python3 scripts/exp2_tidb_leader_stress.py

Each distributed script can also start its own compose stack:

python3 scripts/exp1_single_shard_flood.py --start-services
python3 scripts/exp1_citus_hotspot.py --start-services
python3 scripts/exp1_tidb_hotspot.py --start-services

Regenerate derived tables and figures:

python3 scripts/analyze_results.py
python3 scripts/render_fig8_distributed_risks.py

Stop a distributed stack by using the same compose file with down:

docker compose -f docker-compose.postgres-shards.yml down
docker compose -f docker-compose.citus.yml down
docker compose -f docker-compose.tidb.yml down

About

Database-Security-Experiments

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors