Arguments
You can get the full list of arguments by running cats -h. Below is a short description for each:
--contract=LOCATION_OF_THE_CONTRACTsupplies the location of the OpenApi or Swagger contract.--server=URLsupplies the URL of the service implementing the contract.--basicauth=USR:PWDsupplies ausername:passwordpair, in case the service uses basic auth.--authRefreshInterval=value_in_secondsAmount of time in seconds after which to get new auth credentials--authRefreshScript=scriptScript to get executed after--authRefreshIntervalin order to get new auth credentials. The script will replace any headers that haveauth_scriptas value. If you don't supply a--authRefreshInterval, but you supply a script, the script will be used to get the initial auth credentials.--fuzzers=LIST_OF_FUZZERSsupplies a comma separated list of fuzzers. The supplied list of Fuzzers can be partial names, not full Fuzzer names. CATS which check for all Fuzzers containing the supplied strings. If the argument is not supplied, all fuzzers will be run.--log=PACKAGE:LEVELcan configure custom log level for a given package. You can provide a comma separated list of packages and levels or a level to apply to everything. This is helpful when you want to see full HTTP traffic:--log=org.apache.http.wire:debugor suppress CATS logging:--log=com.endava.cats:warn--skipLog=LEVELSA list of log levels to skip. For example, you can skip only note and info levels, but leave the rest--paths=PATH_LISTsupplies a comma separated list of OpenApi paths to be tested. If no path is supplied, all paths will be considered.--skipPaths=PATH_LISTa comma separated list of paths to ignore. If no path is supplied, no path will be ignored--fieldsFuzzingStrategy=STRATEGYspecifies which strategy will be used for field fuzzing. Available strategies areONEBYONE,SIZEandPOWERSET. More information on field fuzzing can be found in the sections below.--maxFieldsToRemove=INTEGERspecifies the maximum number of fields to be removed when using theSIZEfields fuzzing strategy.--refData=FILEspecifies the file containing static reference data which must be fixed in order to have valid business requests. This is a YAML file. It is explained further in the sections below.--headers=FILEspecifies a file containing headers that will be added when sending payloads to the endpoints. You can use this option to add oauth/JWT tokens for example.--edgeSpacesStrategy=STRATEGYspecifies how to expect the server to behave when sending trailing and prefix spaces within fields. Possible values aretrimAndValidateandvalidateAndTrim.--sanitizationStrategy=STRATEGYspecifies how to expect the server to behave when sending Unicode Control Chars and Unicode Other Symbols within the fields. Possible values aresanitizeAndValidateandvalidateAndSanitize--urlParams param1:value1 param2:value2A comma separated list of 'name:value' pairs of parameters to be replaced inside the URLs. This is useful when you have static parameters in URLs (like 'version' for example).--functionalFuzzerFile=FILEa file used by theFunctionalFuzzerthat will be used to create user-supplied payloads.--skipFuzzers=LIST_OF_FIZZERsa comma separated list of fuzzers that will be skipped for all paths. You can either provide fullFuzzernames (for example:--skippedFuzzers=VeryLargeStringsFuzzer) or partialFuzzernames (for example:--skipFuzzers=VeryLarge).CATSwill check if theFuzzernames contains the string you provide in the arguments value.--skipFields=field1,field2#subField1a comma separated list of fields that will be skipped by replacement Fuzzers like EmptyStringsInFields, NullValuesInFields, etc. When a field starts with!any field that starts with that name will be entirely skipped for fuzzing--httpMethods=PUT,POST,etca comma separated list of HTTP methods that will be used to filter which http methods will be executed for each path within the contract--securityFuzzerFile=FILEA file used by theSecurityFuzzerthat will be used to inject special strings in order to exploit possible vulnerabilities--printExecutionStatisticsIf supplied (no value needed), prints a summary of execution times for each endpoint and HTTP method. By default this will print a summary for each endpoint: max, min and average. If you want detailed reports you must supply--printExecutionStatistics=detailed--timestampReportsIf supplied (no value needed), it will output the report still inside thecats-reportfolder, but in a sub-folder with the current timestamp--reportFormat=FORMATSpecifies the format of the CATS report. Supported formats:HTML_ONLY,HTML_JSorJUNIT. You can useHTML_ONLYif you want the report to not contain any Javascript. This is useful in CI environments due to Javascript content security policies. Default isHTML_JSwhich includes some sorting and filtering capabilities.--[no-]useExamplesIftruethen CATS will use ALL examples supplied in the OpenAPI contract. This is equivalent to setting--usePropertyExamples --useRequestBodyExamples --useResponseBodyExamples --useSchemaExamples. IffalseCATS will rely only on generated values--[no-]usePropertyExamplesIftruethen CATS will use examples supplied in the OpenAPI contract for properties. IffalseCATS will rely only on generated values--[no-]useRequestBodyExamplesIftruethen CATS will use examples supplied in the OpenAPI contract for request bodies, at media-type level. IffalseCATS will rely only on generated values--[no-]useResponseBodyExamplesIftruethen CATS will use examples supplied in the OpenAPI contract for response bodies, at media-type level. IffalseCATS will rely only on generated values--[no-]useSchemaExamplesIftruethen CATS will use examples supplied in the OpenAPI contract for schemas. IffalseCATS will rely only on generated values--checkFieldsIf supplied (no value needed), it will only run theFieldFuzzers--checkHeadersIf supplied (no value needed), it will only run theHeaderFuzzers--checkHttpIf supplied (no value needed), it will only run theHTTPFuzzers--includeWhitespacesIf supplied (no value needed), it will include theWhitespacesFuzzers--includeEmojisIf supplied (no value needed), it will include theEmojisFuzzers--includeControlCharsIf supplied (no value needed), it will include theControlCharsFuzzers--includeContractIf supplied (no value needed), it will includeContractInfoFuzzers--sslKeystoreLocation of the JKS keystore holding certificates used when authenticating calls using one-way or two-way SSL--sslKeystorePwdThe password of thesslKeystore--sslKeyPwdThe password of the private key from thesslKeystore--proxyHost=INTEGERThe proxy server's host name (if running behind proxy)--proxyPort=INTEGERThe proxy server's port number (if running behind proxy)--maxRequestsPerMinute=INTEGERMaximum number of requests per minute; this is useful when APIs have rate limiting implemented; default is 10000--connectionTimeout=INTEGERTime period in seconds which CATS should establish a connection with the server; default is 10 seconds--writeTimeout=INTEGERMaximum time of inactivity in seconds between two data packets when sending the request to the server; default is 10 seconds--readTimeout=INTEGERMaximum time of inactivity in seconds between two data packets when waiting for the server's response; default is 10 seconds--dryRunIf provided, it will simulate a run of the service with the supplied configuration. The run won't produce a report, but will show how many tests will be generated and run for each OpenAPI endpoint--ignoreResponseCodesHTTP_CODES_LIST a comma separated list of HTTP response codes that will be considered as SUCCESS, even if the Fuzzer will typically report it as WARN or ERROR. You can use response code families as2xx,4xx, etc.--ignoreResponseSizeSIZE_LIST a comma separated list of response sizes that will be considered as SUCCESS, even if the Fuzzer will typically report it as WARN or ERROR--ignoreResponseWordsCOUNT_LIST a comma separated list of words count in the response that will be considered as SUCCESS, even if the Fuzzer will typically report it as WARN or ERROR--ignoreResponseLinesLINES_COUNT a comma separated list of lines count in the response that will be considered as SUCCESS, even if the Fuzzer will typically report it as WARN or ERROR--ignoreResponseRegexa REGEX that will match against the response that will be considered as SUCCESS, even if the Fuzzer will typically report it as WARN or ERROR--ignoreErrorLeaksCheckIf supplied (no value needed) it won't check if the response body contains sensitive information and will return the test result as SUCCESS instead of ERROR--filterResponseCodesHTTP_CODES_LIST a comma separated list of HTTP response codes that will be filtered and not included in the final report. You can use response code families as2xx,4xx, etc.--filterResponseSizeSIZE_LIST a comma separated list of response sizes that will be filtered and not included in the final report--filterResponseWordsCOUNT_LIST a comma separated list of words count in the response that will be filtered and not included in the final report--filterResponseLinesLINES_COUNT a comma separated list of lines count in the response that will be filtered and not included in the final report--filterResponseRegexa REGEX that will match against the response that will be filtered and not included in the final report--testsTESTS_LIST a comma separated list of executed tests in JSON format from the cats-report folder. If you supply the list without the .json extension CATS will search the test in the cats-report folder--ignoreResponseCodeUndocumentedCheckIf supplied (not value needed) it won't check if the response code received from the service matches the value expected by the fuzzer and will return the test result as SUCCESS instead of WARN--ignoreResponseBodyCheckIf supplied (no value needed) it won't check if the response body received from the service matches the schema supplied inside the contract and will return the test result as SUCCESS instead of WARN--ignoreResponseContentTypeCheckIf supplied (no value needed) it won't check if the response content type matches the one(s) defined in the contract for the corresponding http response code--blackboxIf supplied (no value needed) it will ignore all response codes except for 5XX which will be returned as ERROR. This is similar to--ignoreResponseCodes="2xx,4xx,501"--contentTypeA custom mime type if the OpenAPI spec uses content type negotiation versioning.--output=PATHThe path where the CATS report will be written. Default iscats-reportin the current directory--skipReportingForIgnoredCodesSkip reporting entirely for any of the ignored arguments provided in--ignoreResponseXXX--skipReportingForSuccessSkip reporting entirely for tests cases reported as success. Default: false--skipReportingForWarningSkip reporting entirely for tests cases reported as warnings. Default: false--largeStringsSize=NUMBERThe size of the strings used by the Fuzzers sending large values likeVeryLargeStringsFuzzer. Default:40000--debugSets logging level to all--jsonMake specific commands output injsonformat--words=FILEA custom dictionary that can be supplied. When this is supplied only theTemplateFuzzerwill be active.--[no-]-checkUpdatesIf true checks if there is a CATS update available and prints the release notes along with the links. Default: true--[no-]-colorIf true enables ANSI codes and coloured console output. Default: true--onlyLog=star,noteA list of log levels to include; allows more granular control of the log levels--userAgent=USER_AGENTThe user agent to be set in the User-Agent HTTP header. Default: cats/version--verbosity=DETAILED|SUMMARYSets the verbosity of the console logging. If set to summary CATS will only output a simple progress screen per path. Default:SUMMARY--oneOfSelection "field1=value1",--anyOfSelectionAname=valuelist of discriminator names and values that can be use to filter request payloads when objects use oneOf or anyOf definitions which result in multiple payloads for a single endpoint and http method--randomHeadersNumber=NUMBERThe number of random headers that will be sent by theLargeNumberOfRandomAlphanumericHeadersFuzzerandLargeNumberOfRandomHeadersFuzzer. Default:10000--skipFieldTypes=string,integer,etc.A comma separated list of OpenAPI data types to skip. It only supports standard types: https://swagger.io/docs/specification/data-models/data-types--skipFieldFormats=date,email,etcA comma separated list of OpenAPI data formats to skip. It supports formats mentioned in the documentation: https://swagger.io/docs/specification/data-models/data-types--fieldTypes=string,integer,etc.A comma separated list of OpenAPI data types to include. It only supports standard types: https://swagger.io/docs/specification/data-models/data-types--fieldFormats=date,email,etc.A comma separated list of OpenAPI data formats to include. It supports formats mentioned in the documentation: https://swagger.io/docs/specification/data-models/data-types--maxResponseTimeInMsSets a response time limit in milliseconds. If responses take longer than the provided value, they will get marked as error with reasonResponse time exceeds max. The response time limit check is triggered only if the test case is considered successful i.e. response matches Fuzzer expectations--rfc7396When set to true it will send Content-Type=application/merge-patch+json for PATCH requests. Default: false`--maskHeadersA comma separated list of headers to mask to protect sensitive info such as login credentials to be written in report files. Masked headers will be replaced with$$HeaderNameso that test cases can be replayed using environment variables--tagsA comma separated list of tags to include. If no tag is supplied, all tags will be considered. To list all available tags run:cats stats -c api.yml--skipTagsA comma separated list of tags to ignore. If no tag is supplied, no tag will be ignored. To list all available tags run:cats stats -c api.yml--fuzzersConfig=FILEA properties file with Fuzzer configuration that changes default behaviour. Configuration keys are prefixed with the fully qualified Fuzzer name--mutators=FOLDERA folder containing custom mutators. Only applicable when using thecats randomsub-command--allowInvalidEnumValuesWhen set to true theInvalidValuesInEnumsFieldsFuzzerwill expect a 2XX response code instead of 4XX--selfReferenceDepth=<selfReferenceDepth>Max depth for objects having cyclic dependencies--limitXxxOfCombinations=<limitXxxOfCombinations>Max number of anyOf/oneOf combinations--limitFuzzedFields=<numberOfFields>Max number of fields that will be fuzzed--[no-]useDefaultsIf set to true, it will use the default values when generating examples--nameReplaceIf set to true, it will simply do a replacement between the targetFields names provided and the fuzz values--stopAfterErrors=<stopAfterErrors>Number of errors after which the continuous fuzzing will stop running. Errors are defined as conditions matching the given match arguments. Only available incats randomsub-command.--stopAfterMutations=<stopAfterMutations>Number of mutations (test cases) after which the continuous fuzzing will stop running. Only available incats randomsub-command.--stopAfterTimeInSec=<stopAfterTimeInSec>Amount of time in seconds for how long the continuous fuzzing will run before stopping. Only available incats randomsub-command.--pathsRunOrder=<pathsOrderFile>A file with the order in which the paths will be executed. The paths are on each line. The order from file will drive the execution order--errorLeaksKeywords=<errorLeaksKeywords>A properties file with error leaks keywords that will be used when processing responses to detect potential error leaks. If one of these keyword is found, the test case will be marked as error
When you want to skip fuzzing entirely for a specific JSON object or specific fields you must prefix the field name from the --skipFields argument with !.
The following --skipFields="!address" will skip fuzzing for all sub-fields of the address object. If you also want CATS to not sent the address
object at all to the service (sometimes some object might not make sense in conjunction with other objects) you must also use the cats_remove_field
within the reference data file.
all:
address: cats_remove_field
Next arguments are active only when supplying a custom dictionary via --words:
--matchResponseCodes=<matchResponseCodes>[,<matchResponseCodes>...]A comma separated list of HTTP response codes that will be matched as error. All other response codes will be ignored from the final report. If provided, all Contract Fuzzers will be skipped--matchResponseLines=<matchResponseLines>[,<matchResponseLines>...]A comma separated list of number of line counts in the response that will be matched as error. All other response line counts will be ignored from the final report. If provided, all Contract Fuzzers will be skipped--matchResponseRegex=<matchResponseRegex>A regex that will match against the response that will be matched as error. All other response body matches will be ignored from the final report. If provided, all Contract Fuzzers will be skipped--matchResponseSize=<matchResponseSizes>[,<matchResponseSizes>...]A comma separated list of response sizes that will be matched as error. All other response sizes will be ignored from the final report. If provided, all Contract Fuzzers will be skipped--matchResponseWords=<matchResponseWords>[,<matchResponseWords>...]A comma separated list of word counts in the response that will be matched as error. All other response word counts will be ignored from the final report. If provided, all Contract Fuzzers will be skipped
cats --contract=my.yml --server=https://locathost:8080 --checkHeaders
This will run CATS against http://localhost:8080 using my.yml as an API spec and will only run the HTTP headers Fuzzers.