├── .gitignore
├── README.md
├── lib
└── zap-api-1.2.0.jar
├── pom.xml
├── proxy.iml
└── src
├── main
├── java
│ └── net
│ │ └── continuumsecurity
│ │ └── proxy
│ │ ├── Authentication.java
│ │ ├── ContextModifier.java
│ │ ├── HarUtils.java
│ │ ├── LoggingProxy.java
│ │ ├── ProxyException.java
│ │ ├── ScanningProxy.java
│ │ ├── Spider.java
│ │ ├── ZAProxyScanner.java
│ │ └── model
│ │ ├── AuthenticationMethod.java
│ │ ├── Context.java
│ │ ├── ScanInfo.java
│ │ ├── ScanResponse.java
│ │ ├── ScannerInfo.java
│ │ ├── Script.java
│ │ └── User.java
└── resources
│ ├── extendedapi-alpha-1.zap
│ └── extendedapi-alpha-2.zap
└── test
├── java
└── net
│ └── continuumsecurity
│ └── proxy
│ ├── SpiderTest.java
│ ├── TestEnvironment.java
│ ├── TestHarUtils.java
│ └── ZAProxyScannerTest.java
└── resources
└── ropeytasks-0.1.war
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | .idea/
3 | *.iml
4 | target/
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | zap-java-api
2 | ============
3 |
4 | Java client library for OWASP ZAP. In addition to scanning and spidering, it also provides programmatic access to the proxy.
5 |
6 | The core functionality is in [ZAProxyScanner.java](https://github.com/continuumsecurity/zap-java-api/blob/master/src/main/java/net/continuumsecurity/proxy/ZAProxyScanner.java)
7 |
8 | To build
9 | ========
10 |
11 | mvn package -DskipTests
--------------------------------------------------------------------------------
/lib/zap-api-1.2.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iriusrisk/zap-java-api/4f9fe090a073345e9ae33b40ff0e378662a7c2a8/lib/zap-api-1.2.0.jar
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | net.continuumsecurity
8 | zap-java-api
9 | 2.6.0
10 |
11 |
12 |
13 |
14 | org.apache.maven.plugins
15 | maven-compiler-plugin
16 | 3.1
17 |
18 | 1.6
19 | 1.6
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | org.hamcrest
28 | hamcrest-all
29 | 1.3
30 |
31 |
32 | org.mortbay.jetty
33 | jetty
34 | 6.1.26
35 | test
36 |
37 |
38 | org.codehaus.jackson
39 | jackson-mapper-asl
40 | 1.9.12
41 |
42 |
43 | junit
44 | junit
45 | 4.11
46 | test
47 |
48 |
49 | org.seleniumhq.selenium
50 | selenium-java
51 | 2.32.0
52 |
53 |
54 | org.zaproxy
55 | zap-clientapi
56 | 1.2.0
57 |
58 |
59 | edu.umass.cs.benchlab
60 | harlib
61 | 1.1.2
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/proxy.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/src/main/java/net/continuumsecurity/proxy/Authentication.java:
--------------------------------------------------------------------------------
1 | package net.continuumsecurity.proxy;
2 |
3 | import net.continuumsecurity.proxy.model.User;
4 |
5 | import java.io.IOException;
6 | import java.io.UnsupportedEncodingException;
7 | import java.util.List;
8 | import java.util.Map;
9 |
10 | public interface Authentication {
11 | /**
12 | * Returns the supported authentication methods by ZAP.
13 | * @return list of supported authentication methods.
14 | * @throws ProxyException
15 | */
16 | List getSupportedAuthenticationMethods() throws ProxyException;
17 |
18 | /**
19 | * Returns logged in indicator pattern for the given context.
20 | * @param contextId Id of the context.
21 | * @return Logged in indicator for the given context.
22 | * @throws ProxyException
23 | */
24 | String getLoggedInIndicator(String contextId) throws ProxyException;
25 |
26 | /**
27 | * Returns logged out indicator pattern for the given context.
28 | * @param contextId Id of the context.
29 | * @return Logged out indicator for the given context.
30 | * @throws ProxyException
31 | */
32 | String getLoggedOutIndicator(String contextId) throws ProxyException;
33 |
34 | /**
35 | * Sets the logged in indicator to a given context.
36 | * @param contextId Id of a context.
37 | * @param loggedInIndicatorRegex Regex pattern for logged in indicator.
38 | * @throws ProxyException
39 | */
40 | void setLoggedInIndicator(String contextId, String loggedInIndicatorRegex) throws ProxyException;
41 |
42 | /**
43 | * Sets the logged out indicator to a given context.
44 | * @param contextId Id of a context.
45 | * @param loggedOutIndicatorRegex Regex pattern for logged out indicator.
46 | * @throws ProxyException
47 | */
48 | void setLoggedOutIndicator(String contextId, String loggedOutIndicatorRegex) throws ProxyException;
49 |
50 | /**
51 | * Returns authentication method for a given context.
52 | * @param contextId Id of a context.
53 | * @return Authentication method details for the given context id.
54 | * @throws ProxyException
55 | */
56 | Map getAuthenticationMethodInfo(String contextId) throws ProxyException;
57 |
58 | /**
59 | * Returns the list of authentication config parameters.
60 | * Each config parameter is a map with keys "name" and "mandatory", holding the values name of the configuration parameter and whether it is mandatory/optional respectively.
61 | * @param authMethod Valid authentication method name.
62 | * @return List of configuration parameters for the given authentication method name.
63 | * @throws ProxyException
64 | */
65 | List