-
-
Notifications
You must be signed in to change notification settings - Fork 783
quickstart: Add Scan Policy option to Automated Scan panel #7300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 11 commits
dd04522
7d31089
0d28a2e
bb06386
fb17451
cf77ea6
6790bb9
caf689e
bf90ec1
6df912b
dc27728
9dbc905
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,12 @@ <H3>URL to attack</H3> | |
| This is because https://example.com/test/ is treated as a leaf node internally, which would mean that ZAP would not attack | ||
| URLs like https://example.com/test/1 etc. | ||
|
|
||
| <H3>Scan Policy</H3> | ||
|
|
||
| The scan policy to use when performing the active scan. | ||
|
thc202 marked this conversation as resolved.
|
||
| Note that the policies will not be shown dynamically, any added/removed policies will be missing until a restart is done. | ||
| <br><br> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is still outstanding |
||
|
|
||
| <H3>Use traditional spider</H3> | ||
|
|
||
| The traditional spider explores the application by finding links in HTML pages. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /* | ||
| * Zed Attack Proxy (ZAP) and its related class files. | ||
| * | ||
| * ZAP is an HTTP/HTTPS proxy for assessing web application security. | ||
| * | ||
| * Copyright 2026 The ZAP Development Team | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.zaproxy.zap.extension.quickstart; | ||
|
|
||
| import static org.hamcrest.MatcherAssert.assertThat; | ||
| import static org.hamcrest.Matchers.equalTo; | ||
| import static org.hamcrest.Matchers.is; | ||
|
|
||
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.Test; | ||
| import org.zaproxy.zap.utils.ZapXmlConfiguration; | ||
|
|
||
| /** Unit test for {@link QuickStartParam}. */ | ||
| class QuickStartParamUnitTest { | ||
|
|
||
| private QuickStartParam param; | ||
| private ZapXmlConfiguration configuration; | ||
|
|
||
| @BeforeEach | ||
| void setUp() { | ||
| param = new QuickStartParam(); | ||
| configuration = new ZapXmlConfiguration(); | ||
| param.load(configuration); | ||
| } | ||
|
|
||
| @Test | ||
| void shouldDefaultScanPolicyNameToEmpty() { | ||
| assertThat(param.getScanPolicyName(), is(equalTo(""))); | ||
| } | ||
|
|
||
| @Test | ||
| void shouldSaveScanPolicyName() { | ||
| // Given | ||
| String policyName = "Test Policy"; | ||
| // When | ||
| param.setScanPolicyName(policyName); | ||
| // Then | ||
| assertThat(param.getScanPolicyName(), is(equalTo(policyName))); | ||
| } | ||
|
|
||
| @Test | ||
| void shouldLoadScanPolicyNameFromConfig() { | ||
| // Given | ||
| configuration.setProperty("quickstart.scanPolicyName", "My Policy"); | ||
| // When | ||
| param.load(configuration); | ||
| // Then | ||
| assertThat(param.getScanPolicyName(), is(equalTo("My Policy"))); | ||
| } | ||
| } |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should be no changes to this file
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For gradle.properties: reply i Reverted in latest commit. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| org.gradle.caching=true | ||
| org.gradle.parallel=true | ||
| org.gradle.parallel=true | ||
| org.gradle.jvmargs=-Xmx2g | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be reverted. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
policyExists(…)again.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preferable to inline in the if than declare variables upfront that might not be even used.