Skip to content

Commit 752a7bb

Browse files
committed
Explained how to set up the database compatible with the backend.
Use the same parameters in the example runs.
1 parent 80ccd70 commit 752a7bb

5 files changed

+31
-9
lines changed

README.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,26 @@ Run the following commands:
1313
# cabal test
1414
```
1515

16-
Example run: ./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection dbname=banach --leak-mode if-exists -o output.att src/psql/cat_group_query.sql src/psql/cat_attacker.att src/psql/cat_schema.sql src/psql/cat_group_schema.sql
16+
If PostgreSQL has not been installed yet, it needs to be done before running. The analyser has been tested with versions from 9.5.13 to 10.
17+
18+
After PostgreSQL has been installed, it is necessary to create a database that will be used by the tool. For compatibility with pleak-backend, the database name should be 'ga_propagation'. Permissions on 'ga_propagation' should be given to the user 'ga_propagation', whose password is the same as used inside "pleak-tools/pleak-backend/src/main/java/com/naples/rest/GuessingAdvantageService.java", which is 'ceec4eif7ya' by default. If any other database or user names are used, they should be changed in "GuessingAdvantageService.java" as well. Here is an example of how to do it with Ubuntu system:
19+
20+
USERNAME@xxxx:~$ sudo -u postgres -i
21+
(prompts USERNAME's password)
22+
postgres@xxxx:~$ createuser --interactive --pwprompt
23+
Enter name of role to add: ga_propagation
24+
Enter password for new role: ceec4eif7ya
25+
Enter it again:
26+
Shall the new role be a superuser? (y/n) n
27+
Shall the new role be allowed to create databases? (y/n) n
28+
Shall the new role be allowed to create more new roles? (y/n) n
29+
30+
postgres@xxxx:~$ psql
31+
postgres=# create database ga_propagation;
32+
CREATE DATABASE
33+
USERNAME=# \q
34+
35+
The tool assumes that the contents of input tables are uploaded to the database by some other application. The example runs will fail if there is no suitable data, i.e. no tables specified in the input schema file.
36+
37+
Example run: ./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection "host=localhost dbname=ga_propagation user=ga_propagation password=ceec4eif7ya" --leak-mode if-exists -o output.att src/psql/cat_group_query.sql src/psql/cat_attacker.att src/psql/cat_input_schema.sql src/psql/cat_group_output_schema.sql
38+

example_runs.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
./dist/build/sql-constraint-propagation/sql-constraint-propagation --iterations 5 --connection dbname=banach --leak-mode if-exists -o output.att src/psql/ship_q1.sql src/psql/ship_q1_attacker.att src/psql/ship_q1_input_schema.sql src/psql/ship_q1_output_schema.sql
1+
./dist/build/sql-constraint-propagation/sql-constraint-propagation --iterations 5 --connection "host=localhost dbname=ga_propagation user=ga_propagation password=ceec4eif7ya" --leak-mode if-exists -o output.att src/psql/ship_q1.sql src/psql/ship_q1_attacker.att src/psql/ship_q1_input_schema.sql src/psql/ship_q1_output_schema.sql
22

3-
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection dbname=banach --leak-mode if-exists -o output.att src/psql/ship_q2.sql src/psql/ship_q2_attacker.att src/psql/ship_q2_input_schema.sql src/psql/ship_q2_output_schema.sql
3+
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection "host=localhost dbname=ga_propagation user=ga_propagation password=ceec4eif7ya" --leak-mode if-exists -o output.att src/psql/ship_q2.sql src/psql/ship_q2_attacker.att src/psql/ship_q2_input_schema.sql src/psql/ship_q2_output_schema.sql
44

5-
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection dbname=banach --leak-mode if-exists -o output.att src/psql/ship_q3.sql src/psql/ship_q3_attacker.att src/psql/ship_q3_input_schema.sql src/psql/ship_q3_output_schema.sql
5+
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection "host=localhost dbname=ga_propagation user=ga_propagation password=ceec4eif7ya" --leak-mode if-exists -o output.att src/psql/ship_q3.sql src/psql/ship_q3_attacker.att src/psql/ship_q3_input_schema.sql src/psql/ship_q3_output_schema.sql
66

7-
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection dbname=banach --leak-mode if-exists -o output.att src/psql/cat_select_query.sql src/psql/cat_attacker.att src/psql/cat_schema.sql src/psql/cat_select_schema.sql
7+
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection "host=localhost dbname=ga_propagation user=ga_propagation password=ceec4eif7ya" --leak-mode if-exists -o output.att src/psql/cat_select_query.sql src/psql/cat_attacker.att src/psql/cat_input_schema.sql src/psql/cat_select_output_schema.sql
88

9-
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection dbname=banach --leak-mode if-exists -o output.att src/psql/cat_group_query.sql src/psql/cat_attacker.att src/psql/cat_schema.sql src/psql/cat_group_schema.sql
9+
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection "host=localhost dbname=ga_propagation user=ga_propagation password=ceec4eif7ya" --leak-mode if-exists -o output.att src/psql/cat_group_query.sql src/psql/cat_attacker.att src/psql/cat_input_schema.sql src/psql/cat_group_output_schema.sql
1010

11-
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection dbname=banach --leak-mode if-exists -o output.att src/psql/ship_query.sql src/psql/ship_attacker.att src/psql/ship_schema.sql src/psql/ship_count_schema.sql
11+
./dist/build/sql-constraint-propagation/sql-constraint-propagation --connection "host=localhost dbname=ga_propagation user=ga_propagation password=ceec4eif7ya" --leak-mode if-exists -o output.att src/psql/ship_query.sql src/psql/ship_attacker.att src/psql/ship_schema.sql src/psql/ship_count_schema.sql
1212

13-
./dist/build/sql-constraint-propagation/sql-constraint-propagation --iterations 1000 --connection dbname=banach --leak-mode if-exists -o output.att src/psql/const_query.sql src/psql/const_attacker.att src/psql/const_schema.sql src/psql/const_output_schema.sql
13+
./dist/build/sql-constraint-propagation/sql-constraint-propagation --iterations 1000 --connection "host=localhost dbname=ga_propagation user=ga_propagation password=ceec4eif7ya" --leak-mode if-exists -o output.att src/psql/const_query.sql src/psql/const_attacker.att src/psql/const_schema.sql src/psql/const_output_schema.sql
1414

15-
./dist/build/sql-constraint-propagation/sql-constraint-propagation --iterations 100 --connection dbname=banach --leak-mode if-exists -o output.att src/psql/test1.sql src/psql/const_attacker.att src/psql/test1_input_schema.sql src/psql/test1_output_schema.sql
15+
./dist/build/sql-constraint-propagation/sql-constraint-propagation --iterations 100 --connection "host=localhost dbname=ga_propagation user=ga_propagation password=ceec4eif7ya" --leak-mode if-exists -o output.att src/psql/test1.sql src/psql/const_attacker.att src/psql/test1_input_schema.sql src/psql/test1_output_schema.sql
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)