Skip to content

Commit e2c4271

Browse files
authored
Merge branch 'develop' into ai_config
2 parents 6aa4b9b + d385c55 commit e2c4271

3 files changed

Lines changed: 143 additions & 42 deletions

File tree

README.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ know more about crAPI, please check [crAPI's overview][overview].
1010

1111
## QuickStart Guide
1212

13+
### Application Workflow (Happy Path)
14+
15+
After setting up crAPI, it is recommended to follow the intended user workflow
16+
to understand how the application is supposed to work before attempting any
17+
security challenges.
18+
19+
-[Application Workflow (Happy Path)](docs/happy-path.md)
20+
21+
1322
### Docker and docker compose
1423

1524
You'll need to have Docker and docker compose installed and running on your host system. Also, the version of docker compose should be `1.27.0` or above. Check your docker compose version using:
@@ -29,14 +38,10 @@ You can use prebuilt images generated by our CI workflow by downloading the dock
2938
- Linux Machine
3039

3140
```
32-
curl -o /tmp/crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/main.zip
33-
41+
curl -L -o /tmp/crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/main.zip
3442
unzip /tmp/crapi.zip
35-
3643
cd crAPI-main/deploy/docker
37-
3844
docker compose pull
39-
4045
docker compose -f docker-compose.yml --compatibility up -d
4146
```
4247
@@ -51,14 +56,10 @@ You can use prebuilt images generated by our CI workflow by downloading the dock
5156
- Windows Machine
5257

5358
```
54-
curl.exe -o crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/main.zip
55-
59+
curl.exe -L -o crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/main.zip
5660
tar -xf .\crapi.zip
57-
5861
cd crAPI-main/deploy/docker
59-
6062
docker compose pull
61-
6263
docker compose -f docker-compose.yml --compatibility up -d
6364
```
6465
@@ -75,14 +76,10 @@ You can use prebuilt images generated by our CI workflow by downloading the dock
7576
- Linux Machine
7677

7778
```
78-
curl -o /tmp/crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/develop.zip
79-
80-
unzip /tmp/crapi.zip
81-
79+
curl -L -o /tmp/crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/develop.zip
80+
unzip /tmp/crapi.zip
8281
cd crAPI-develop/deploy/docker
83-
8482
docker compose pull
85-
8683
docker compose -f docker-compose.yml --compatibility up -d
8784
```
8885
@@ -97,14 +94,10 @@ You can use prebuilt images generated by our CI workflow by downloading the dock
9794
- Windows Machine
9895
9996
```
100-
curl.exe -o crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/develop.zip
101-
97+
curl.exe -L -o crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/develop.zip
10298
tar -xf .\crapi.zip
103-
10499
cd crAPI-develop/deploy/docker
105-
106100
docker compose pull
107-
108101
docker compose -f docker-compose.yml --compatibility up -d
109102
```
110103

docs/happy-path.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# crAPI – Happy Path Guide
2+
3+
## Purpose of This Document
4+
crAPI (Completely Ridiculous API) is intentionally vulnerable, but new users often struggle to understand
5+
how the application is supposed to work *before* exploring security issues.
6+
7+
This document explains the **happy path** — the normal, intended workflow — so users can:
8+
- Understand application behavior
9+
- Navigate APIs with confidence
10+
- Clearly differentiate expected behavior vs vulnerabilities
11+
12+
---
13+
14+
## Prerequisites
15+
Before following this guide, ensure:
16+
- crAPI is running locally using Docker
17+
- You can access:
18+
- Swagger UI (OpenAPI)
19+
- Postman collection (optional but recommended)
20+
21+
---
22+
23+
## Application Overview (Conceptual)
24+
crAPI simulates a backend system for:
25+
- User identity and authentication
26+
- User profiles
27+
- Mechanic services
28+
- Orders and notifications
29+
30+
The happy path represents **how a legitimate user interacts with the system**.
31+
32+
---
33+
34+
## Happy Path Workflow (High Level)
35+
36+
1. User signs up
37+
2. User logs in
38+
3. User accesses their profile
39+
4. User interacts with available APIs as intended
40+
5. System responds with valid data and permissions
41+
42+
---
43+
44+
## Step-by-Step Happy Path
45+
46+
### 1. User Registration
47+
**Goal:** Create a new user account
48+
49+
- Endpoint: `/identity/api/auth/signup`
50+
- Action:
51+
- Provide email, username, and password
52+
- Expected Result:
53+
- Successful registration confirmation
54+
55+
This step establishes a valid user identity in the system.
56+
57+
---
58+
59+
### 2. User Login
60+
**Goal:** Authenticate and obtain an access token
61+
62+
- Example endpoint: `/identity/api/auth/signup`
63+
- Action:
64+
- Login using registered credentials
65+
- Expected Result:
66+
- Access token returned
67+
68+
This token is required for all authenticated API calls.
69+
70+
---
71+
72+
### 3. Access User Profile
73+
**Goal:** Verify authenticated access
74+
75+
- Example endpoint: `/identity/api/auth/signup`
76+
- Action:
77+
- Include access token in Authorization header
78+
- Expected Result:
79+
- User’s own profile data is returned
80+
81+
This confirms authentication and authorization are working as intended.
82+
83+
---
84+
85+
### 4. Explore Available APIs
86+
**Goal:** Understand normal system behavior
87+
88+
- Browse Swagger UI to view:
89+
- User APIs
90+
- Mechanic APIs
91+
- Order-related APIs
92+
- Execute read-only or permitted actions
93+
94+
This step helps users recognize **expected responses** and permissions.
95+
96+
---
97+
98+
### 5. Normal Application Usage
99+
**Goal:** Follow intended business logic
100+
101+
- Create or view resources where permitted
102+
- Receive appropriate success or error responses
103+
- Observe correct access controls
104+
105+
At this stage, users fully understand the baseline system behavior.
106+
107+
---
108+
109+
## Why This Matters
110+
Understanding the happy path allows users to:
111+
- Identify where behavior deviates from expectations
112+
- Recognize insecure authorization or validation
113+
- Learn API security concepts more effectively
114+
115+
This guide should be followed **before attempting any challenges or exploitation**.
116+
117+
---
118+
119+
## Next Steps
120+
Once the happy path is clear, users can proceed to:
121+
- `docs/challenges.md`
122+
- `docs/challengeSolutions.md`
123+
124+
to explore vulnerabilities intentionally built into crAPI.

docs/setup.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ You can use prebuilt images generated by our CI workflow by downloading the dock
2323
- Linux Machine
2424

2525
```
26-
curl -o /tmp/crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/main.zip
27-
26+
curl -L -o /tmp/crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/main.zip
2827
unzip /tmp/crapi.zip
29-
3028
cd crAPI-main/deploy/docker
31-
3229
docker compose pull
33-
3430
docker compose -f docker-compose.yml --compatibility up -d
3531
```
3632
@@ -45,14 +41,10 @@ You can use prebuilt images generated by our CI workflow by downloading the dock
4541
- Windows Machine
4642

4743
```
48-
curl.exe -o crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/main.zip
49-
44+
curl.exe -L -o crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/main.zip
5045
tar -xf .\crapi.zip
51-
5246
cd crAPI-main/deploy/docker
53-
5447
docker compose pull
55-
5648
docker compose -f docker-compose.yml --compatibility up -d
5749
```
5850
@@ -64,19 +56,15 @@ You can use prebuilt images generated by our CI workflow by downloading the dock
6456
LISTEN_IP="0.0.0.0" docker compose -f docker-compose.yml --compatibility up -d
6557
```
6658

67-
- To use the latest development version
59+
- To use the latest development version
6860

6961
- Linux Machine
7062

7163
```
72-
curl -o /tmp/crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/develop.zip
73-
64+
curl -L -o /tmp/crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/develop.zip
7465
unzip /tmp/crapi.zip
75-
7666
cd crAPI-develop/deploy/docker
77-
7867
docker compose pull
79-
8068
docker compose -f docker-compose.yml --compatibility up -d
8169
```
8270
@@ -91,14 +79,10 @@ You can use prebuilt images generated by our CI workflow by downloading the dock
9179
- Windows Machine
9280
9381
```
94-
curl.exe -o crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/develop.zip
95-
82+
curl.exe -L -o crapi.zip https://github.com/OWASP/crAPI/archive/refs/heads/develop.zip
9683
tar -xf .\crapi.zip
97-
9884
cd crAPI-develop/deploy/docker
99-
10085
docker compose pull
101-
10286
docker compose -f docker-compose.yml --compatibility up -d
10387
```
10488

0 commit comments

Comments
 (0)