You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -49,7 +49,7 @@ You can log in to the application with the following credentials:
49
49
|https://localhost:9000/openapi.yaml| The OpenAPI spec in YAML format |
50
50
|https://localhost:9000/swagger-ui.html| The Swagger doc for the OpenAPI spec |
51
51
52
-
##Scanning
52
+
### Security Bugs
53
53
54
54
A [ZAP](https://www.zaproxy.org/) or [StackHawk](https://www.stackhawk.com/login) scan should uncover these bugs:
55
55
@@ -58,58 +58,86 @@ A [ZAP](https://www.zaproxy.org/) or [StackHawk](https://www.stackhawk.com/login
58
58
| SQL Injection via search box |`a%'; insert into item values (999, 'bad bad description', 'hacker item name'); select * from item where name like '%banan`|
59
59
| Cross Site Scripting via search box |`<script>alert('hey guy');</script>`|
60
60
61
-
### StackHawk Scan
61
+
##Scanning
62
62
63
-
The following examples will run HawkScan against the JavaSpringVulny app running on localhost and port 9000, which is the default setup. The StackHawk configuration files are already present in this repository.
63
+
The following examples will run HawkScan against the JavaSpringVulny app running on localhost and port 9000, which is the default setup. The StackHawk configuration files are already present in this repository in the `stackhawk.d` directory.
64
64
65
65
You should create a new application in the [StackHawk app](https://app.stackhawk.com/applications) to collect data from these scans. The following environment variables are required for these scans to work:
66
66
67
-
*`API_KEY`: Your StackHawk API key
68
-
*`APP_ID`: The application ID from the [StackHawk app](https://app.stackhawk.com/applications).
67
+
*`API_KEY`: Your StackHawk [API key](https://app.stackhawk.com/settings/apikeys)
68
+
*`APP_ID`: The [application ID](https://app.stackhawk.com/applications)
69
+
70
+
For example:
71
+
72
+
```shell
73
+
export API_KEY=<your-StackHawk-API-key>
74
+
export APP_ID=<your-StackHawk-App-ID>
75
+
```
69
76
70
77
You can optionally include the following variables to customize the scan.
71
78
72
79
*`APP_HOST`: The host to scan. Default: https://localhost:9000
73
-
*`APP_ENV`: The application environment. Default: Development
80
+
*`APP_ENV`: The application environment name.
74
81
75
82
Baseline scan without authentication:
76
83
```shell
84
+
# With the CLI
85
+
hawk scan stackhawk.d/stackhawk.yml
86
+
87
+
# With Docker
77
88
docker run --tty --rm --network host --volume $(pwd):/hawk \
78
89
--env API_KEY \
79
90
--env APP_ID \
80
-
stackhawk/hawkscan
91
+
stackhawk/hawkscan stackhawk.d/stackhawk.yml
81
92
```
82
93
83
94
Scan using web form authentication with a session cookie. [See the docs](https://docs.stackhawk.com/hawkscan/configuration/authenticated-scanning.html#example-usernamepassword-authentication--cookie-authorization) for more information.
Scan using an authorization token retrieved by POSTing credentials to an API endpoint. [See the docs](https://docs.stackhawk.com/hawkscan/configuration/authenticated-scanning.html#usernamepassword-authentication--bearer-token-authorization) for more information.
Scan using an authorization token extracted by an external script. This method can be useful for third-party authentication systems. [See the docs](https://docs.stackhawk.com/hawkscan/configuration/authenticated-scanning.html#example-external-token-authentication--custom-token-authorization) for more information.
Scan using basic authentication, using an external script to derive the correct authorization token. This legacy method is an insecure form of bearer token authentication. [See the docs](https://docs.stackhawk.com/hawkscan/configuration/authenticated-scanning.html#example-external-token-authentication--custom-token-authorization) for more information.
0 commit comments