Page tree
Skip to end of metadata
Go to start of metadata

Description

This function returns the metadata for a ModSecurity™ vendor rule set.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/modsec_preview_vendor?api.version=1&url=https%3A%2F%2Fwww.example.com%2Fvendor1rules%2Fmeta_vendor1.yaml
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/modsec_preview_vendor?api.version=1&url=https%3A%2F%2Fwww.example.com%2Fvendor1rules%2Fmeta_vendor1.yaml
 Command Line
whmapi1 modsec_preview_vendor url=https%3A%2F%2Fwww.example.com%2Fvendor1rules%2Fmeta_vendor1.yaml

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
 {
    "data": {
        "vendor_url": "http://www.example.com",
        "vendor_id": "vendor1",
        "installed": 1,
        "cpanel_provided": 0,
        "name": "Vendor1 ModSecurity Core Rule Set",
        "path": "/usr/local/apache/conf/modsec_vendor_configs/vendor1",
        "installed_from": "https://www.example.com/vendor1rules/meta_vendor1.yaml",
        "description": "This is the Vendor1 ModSecurity Core Rule Set.",
        "archive_url": "https://www.example.com/vendor1.zip",
        "dist_md5": "307cb5320441ebd712e5581d12100dc9"
    },
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": 1,
        "command": "modsec_preview_vendor"
    }
}
 Output (XML)
 <result>
   <data>
      <archive_url>https://www.example.com/vendor1.zip</archive_url>
      <cpanel_provided>0</cpanel_provided>
      <description>This is the Vendor1 ModSecurity Core Rule Set.</description>
      <dist_md5>307cb5320441ebd712e5581d12100dc9</dist_md5>
      <installed>1</installed>
      <installed_from>https://www.example.com/vendor1rules/meta_vendor1.yaml</installed_from>
      <name>Vendor1 ModSecurity Core Rule Set</name>
      <path>/usr/local/apache/conf/modsec_vendor_configs/vendor1</path>
      <vendor_id>vendor1</vendor_id>
      <vendor_url>http://www.example.com</vendor_url>
   </data>
   <metadata>
      <command>modsec_preview_vendor</command>
      <reason>OK</reason>
      <result>1</result>
      <version>1</version>
   </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
urlstring

Required

The YAML metadata's URL, which describes the vendor and how to obtain its rules.

A valid URL to the metadata YAML file.

Note:

  • The metadata file uses the YAML format.
  • The filename must use the meta_ prefix.
  • The filename must match the vendor_id value for your vendor.
  • The filename must end with the . yaml extension.


 Click to view...

https://www.example.com/vendor1rules/meta_vendor1.yaml

Returns

ReturnTypeDescriptionPossible valuesExample
vendor_urlstringThe vendor's website URL.A valid URL.

http://www.example.com

vendor_idstring

The vendor's unique short name.

A valid string.

vendor1

installedBooleanWhether the vendor is installed.
  • 1 — Installed.
  • 0Not installed.
1
cpanel_providedBooleanWhether cPanel, Inc. provided the vendor.
  • 1 — cPanel-provided.
  • 0Not cPanel-provided.
0
namestringThe vendor's nameA valid string.

Vendor1 ModSecurity Core Rule Set

pathstringThe absolute path to the directory that contains the vendor's configuration files.A valid directory path.
 Click to view...
/usr/local/apache/conf/modsec_vendor_configs/vendor1
installed_fromstringThe vendor's metadata file URL.A valid URL.
 Click to view...

https://www.example.com/vendor1rules/meta_vendor1.yaml

descriptionstringThe vendor's description.A valid string.
 Click to view...
This is the Vendor1 ModSecurity Core Rule Set.
archive_urlstring

The URL to the vendor's rule set archive.

A valid URL.
 Click to view...
https://www.example.com/vendor1.zip
dist_md5stringThe download's MD5 checksum value.A valid string.
 Click to view...
307cb5320441ebd712e5581d12100dc9