Skip to content

Commit 9ae6d3a

Browse files
author
hp23 Server
committed
Update README
1 parent 74443d8 commit 9ae6d3a

File tree

2 files changed

+31
-48
lines changed

2 files changed

+31
-48
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,5 @@ example-tabs.ipynb
6969
filebeat-etc.yml
7070
filebeat.yaml
7171
_hp/asis/
72-
trees/
72+
trees/
73+
pre_*.ipynb

README.md

Lines changed: 29 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,36 @@ All test and analysis code for our paper can be found in the `_hp` directory.
77
Our modified version of the wptserve HTTP server implementation can be found in `tools/serve` and `tools/wptserve`. All other directories are untouched and required for `wptserve` to run, we removed the other WPT test directories for better clarity.
88

99
## Setup
10+
- Create a fresh Ubuntu22 container/VM: `lxc launch ubuntu:22.04 <name>` and connect to it `lxc exec <name> bash`
11+
- Switch to the ubuntu user: `su - ubuntu`
12+
- Clone this repository: `[email protected]:header-testing/header-testing.git`
13+
- Run the setup file: `cd header-testing/_hp`, `./setup.bash` (reopen all terminals or run `source ~/.bashrc` afterwards)
14+
- Configure DB settings in [config.json](_hp/config.json)
15+
- Setup the database: `cd _hp/tools && poetry run python models.py`
16+
- Setup certs: either remove `.demo` from the files in `_hp/tools/certs/` to use self-signed certs or add your own certs here
1017

1118
## Run Instructions
19+
- Always start the WPT server first (from the top-most folder): `poetry run -C _hp python wpt serve --config _hp/wpt-config.json`
20+
- Create the basic and parsing responses: Run `cd _hp/tools && poetry run create_responses.py` (basic), run `cd analysis` and execute `response_header_generation.ipynb` to generate the parsing responses.
21+
- Manually check if the server and the tests are working: Visit http://sub.headers.websec.saarland:80/_hp/tests/framing.sub.html
22+
- Automatic testrunners:
23+
- `cd _hp/tools/crawler`
24+
- Android: `poetry run android_intent.py` (Additional config required)
25+
- MacOS/Ubuntu: `poetry run desktop_selenium.py`
26+
- iPadOS/iOS: `poetry run desktop_selenium.py ----gen_page_runner --page_runner_json urls.json --max_urls_until_restart 10000"`, then visit the URLs in that file manually
27+
- Analysis: Open `_hp/tools/analysis/main_analysis_desktop_basic+parsing.ipynb` (Also contains the mobile analysis)
1228

1329
## Inventory
14-
- `_hp`: All test and analysis code for the paper:
15-
-
16-
- `tools`: Contains modified `wptserve`
17-
- Other directories are used by `wptserve` internally but are not modified
18-
19-
20-
21-
- Setup:
22-
- Create a fresh Ubuntu22 container/VM: `lxc launch ubuntu:22.04 <name>` and connect to it `lxc exec <name> bash`
23-
- Switch to the ubuntu user: `su - ubuntu`
24-
- Clone this repository: `[email protected]:header-testing/header-testing.git`
25-
- Run the setup file: `cd wpt/_hp`, `./setup.bash` (reopen all terminals or run `source ~/.bashrc` afterwards)
26-
- Configure DB settings in [config.json](config.json)
27-
- Setup the database: `cd _hp/tools && poetry run python models.py`
28-
- Setup certs: either remove `.demo` from the files in `_hp/tools/certs/` to use self-signed certs or add the real certs there
29-
- Run:
30-
- Start the WPT Server (from the top-most folder): `poetry run -C _hp python wpt serve --config _hp/wpt-config.json`
31-
- Automatic: Start the testrunners, e.g., `poetry run desktop_selenium.py`
32-
- Manual: Visit http://sub.headers.websec.saarland:80/_hp/tests/framing.sub.html (HTTPS: 443)
33-
- TODOs:
34-
- analyse results!
35-
- discover differences in browsers/versions
36-
- "explain" reasons (keep in mind that other features such as blocked mixed content and CORB might be responsible for differences and not different parsing of the security header)
37-
- ...
38-
- Inventory (of _hp):
39-
- wpt-config.json: Ports, Domains, Certs, ... (Subdomains currently hardcoded in tools/serve/serve.py)
40-
- common/: Shared non-js files for the tests (images, html, ...)
41-
- resources/: Shared javascript files for the tests (testharness, save_results, ...)
42-
- server/
43-
- responses.py: Serves the correct responses from the db (responses.py?resp_id=<int>&feature_group=<str>)
44-
- store_results.py: Stores the test results in the db (expects JSON with {tests: [...], browser=browser_id})
45-
- tests/
46-
- One file for each feature group to test
47-
- Create one testcase for everything one wants to test
48-
- Then run these for all corresponding responses and relevant origin configurations
49-
- How to provide parameters to the tests
50-
- http://sub.headers.websec.saarland:80/_hp/tests/framing.sub.html?browser=<browser_id>&first_id=<id>&last_id=<id>
51-
- tools/
52-
- Non web files
53-
- config.json: DB connection and co.
54-
- crawler/ The code for the crawlers that visit the tests
55-
- models.py: Defines the database models (results, responses, ...); creates dummy data if run directly
56-
- create_responses.py: create two responses for each feature group: "deny" and "allow" for testing the tests
57-
- The only other relevant files are:
58-
- tools/serve/...: Config to run WPT
59-
- tools/wptserve/...: The WPT server
60-
- Some of the tests to take inspirations e.g., x-frame-options/...
30+
- `_hp/`: All test and analysis code for the paper:
31+
- `common/`: Response helper files required for the tests
32+
- `resources/`:
33+
- `store_results.sub.js`: Main JavaScript file with all helper functions such that our test functions work
34+
- `testharness.sub.js`: Modified testharness.js to store the recorded output additonally to the test status
35+
- `server/`: Custom server endpoints to save data in our database and serve the correct responses from the DB
36+
- `tests/`: The template pages containing the test functions for the 12 tested features
37+
- `tools/`: All other code
38+
- `analysis/`: Analysis code (.ipynb files) + utils
39+
- `certs/`: Put your certs here to enable testing of HTTPS
40+
- `crawler/`: Intent (Android), Selenium (Mac + Ubuntu), and Browser Page Runner (iOS) test runners + utils
41+
- `tools/`: Contains modified `wptserve`
42+
- Other directories are used by `wptserve` internally but are not modified

0 commit comments

Comments
 (0)