Exemple #1
0
        public IApiResult ClearStats(string apikey, string keyPrefix)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("keyPrefix", keyPrefix);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "clearStats", parameters));
        }
Exemple #2
0
        /// <summary>
        /// Enables all passive scanners with the given IDs (comma separated list of IDs)
        /// </summary>
        /// <param name="apikey">The api key for the Zap-server</param>
        /// <param name="ids">Comma separated list of IDs</param>
        /// <returns>Result of the action</returns>
        public IApiResult EnableScanners(string apikey, string ids)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("ids", ids);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "enableScanners", parameters));
        }
Exemple #3
0
        public IApiResult Scan(string apikey, string url, IDictionary <string, string> param = null)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey, param);

            parameters.Add("url", url);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "scan", parameters));
        }
Exemple #4
0
        public IApiResult LoadSession(string apikey, string name)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("name", name);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "loadSession", parameters));
        }
Exemple #5
0
        public IApiResult ExcludeFromScan(string apikey, string regex)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("regex", regex);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "excludeFromScan", parameters));
        }
Exemple #6
0
        public IApiResult SetHomeDirectory(string apikey, string dir)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("dir", dir);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setHomeDirectory", parameters));
        }
        public IApiResult UnsetActiveSession(string apikey, string site)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("site", site);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "unsetActiveSession", parameters));
        }
Exemple #8
0
        private IApiResult SetScanners(string apikey, string ids, string action)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("ids", ids);
            return(_zapClient.CallApi(Component, ActionTypes.Action, action, parameters));
        }
Exemple #9
0
        public IApiResult SetOptionHandleParameters(string apikey, string param)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("param", param);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setOptionHandleParameters", parameters));
        }
Exemple #10
0
        public IApiResult SetForcedUserModeEnabled(string apikey, bool option)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("boolean", option.ToString());
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setForcedUserModeEnabled", parameters));
        }
Exemple #11
0
        public IApiResult RemoveContext(string apikey, string contextName)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("contextName", contextName);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "removeContext", parameters));
        }
Exemple #12
0
        public IApiResult Stop(string apikey, string scanId)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("scanId", scanId);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "stop", parameters));
        }
Exemple #13
0
        /// <summary>
        /// Sets whether or not the passive scanning is enabled
        /// </summary>
        /// <param name="apikey">The api key for the Zap-server</param>
        /// <param name="enabled">If scanning should be set enabled</param>
        /// <returns>Result of the action</returns>
        public IApiResult SetEnabled(string apikey, bool enabled)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("enabled", enabled.ToString());
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setEnabled", parameters));
        }
Exemple #14
0
        /// <summary>
        /// Sets if shows hidden fields and enables disabled fields
        /// </summary>
        /// <param name="apikey">The api key for the Zap-server</param>
        /// <param name="reveal">If reveal should be enabled</param>
        /// <returns>Result of the action</returns>
        public IApiResult SetReveal(string apikey, bool reveal)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("reveal", reveal.ToString());
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setReveal", parameters));
        }
Exemple #15
0
        public IApiResult RemoveScanPolicy(string apikey, string scanPolicyName)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("scanPolicyName", scanPolicyName);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "removeScanPolicy", parameters));
        }
Exemple #16
0
        public IApiResult ExcludeAllContextTechnologies(string apikey, string contextName)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("contextName", contextName);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "excludeAllContextTechnologies", parameters));
        }
Exemple #17
0
        internal IApiResult ActionWithParameter <T>(string apikey, T option, string action)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);
            var parameter  = GetParameterName(typeof(T));

            parameters.Add(parameter, option.ToString());
            return(_zapClient.CallApi(_component, ActionTypes.Action, action, parameters));
        }
Exemple #18
0
        private IApiResult SetContextTechnologies(string apikey, string contextName, string technologyNames, string action)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("contextName", contextName);
            parameters.Add("technologyNames", technologyNames);
            return(_zapClient.CallApi(Component, ActionTypes.Action, action, parameters));
        }
Exemple #19
0
        public IApiResult SetContextInScope(string apikey, string contextName, bool inScope)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("contextName", contextName);
            parameters.Add("booleanInScope", inScope.ToString());
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setContextInScope", parameters));
        }
Exemple #20
0
        public IApiResult SetLoggedOutIndicator(string apikey, string contextId, string loggedOutIndicatorRegex)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("contextId", contextId);
            parameters.Add("loggedOutIndicatorRegex", loggedOutIndicatorRegex);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setLoggedOutIndicator", parameters));
        }
Exemple #21
0
        private IApiResult SetContext(string apikey, string contextName, string regex, string action)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("contextName", contextName);
            parameters.Add("regex", regex);
            return(_zapClient.CallApi(Component, ActionTypes.Action, action, parameters));
        }
Exemple #22
0
 public IApiResult ScanAsUser(string apikey, string url, string contextId, string userId, IDictionary <string, string> parameters = null)
 {
     parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey, parameters);
     parameters.Add("url", url);
     parameters.Add("contextId", contextId);
     parameters.Add("userId", userId);
     return(_zapClient.CallApi(Component, ActionTypes.Action, "scanAsUser", parameters));
 }
        private IApiResult SetSession(string apikey, string site, string session, string action)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("site", site);
            parameters.Add("session", session);
            return(_zapClient.CallApi(Component, ActionTypes.Action, action, parameters));
        }
Exemple #24
0
        /// <summary>
        /// Sets the alert threshold of the passive scanner with the given ID, accepted values for alert threshold: OFF, DEFAULT, LOW, MEDIUM and HIGH
        /// </summary>
        /// <param name="apikey">The api key for the Zap-server</param>
        /// <param name="id">ID of the passive scanner</param>
        /// <param name="alertThreshold">Accepted values for alert threshold: OFF, DEFAULT, LOW, MEDIUM and HIGH</param>
        /// <returns>Result of the action</returns>
        public IApiResult SetScannerAlertThreshold(string apikey, string id, AlertThreshold alertThreshold)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("id", id);
            parameters.Add("alertThreshold", alertThreshold.ToString());
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setScannerAlertThreshold", parameters));
        }
Exemple #25
0
        public IApiResult RemoveUser(string apikey, string contextId, string userId)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("contextId", contextId);
            parameters.Add("userId", userId);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "removeUser", parameters));
        }
Exemple #26
0
        public IApiResult NewUser(string apikey, string contextId, string name)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("contextId", contextId);
            parameters.Add("name", name);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "newUser", parameters));
        }
        public IApiResult SetSessionTokenValue(string apikey, string session, string sessionToken, string tokenValue)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("session", session);
            parameters.Add("sessionToken", sessionToken);
            parameters.Add("tokenValue", tokenValue);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setSessionTokenValue", parameters));
        }
Exemple #28
0
        /// <summary>
        /// Break
        /// </summary>
        /// <param name="apikey">The api key for the Zap-server</param>
        /// <param name="type">Type</param>
        /// <param name="scope">Scope</param>
        /// <param name="state">State</param>
        /// <returns>Result of the action</returns>
        public IApiResult Break(string apikey, string type, string scope, string state)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("type", type);
            parameters.Add("scope", scope);
            parameters.Add("state", state);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "break", parameters));
        }
        public IApiResult RenameSession(string apikey, string site, string oldSessionName, string newSessionName)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("site", site);
            parameters.Add("oldSessionName", oldSessionName);
            parameters.Add("newSessionName", newSessionName);
            return(_zapClient.CallApi(Component, ActionTypes.Action, "renameSession", parameters));
        }
Exemple #30
0
        private IApiResult SetAllScanners(string apikey, string scanPolicyName, string action)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            if (scanPolicyName != null)
            {
                parameters.Add("scanPolicyName", scanPolicyName);
            }
            return(_zapClient.CallApi(Component, ActionTypes.Action, action, parameters));
        }