Child pages
  • WHM API 1 Functions - modsec_update_vendor

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function updates a vendor with the current version of the rule set.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledWebServerRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/modsec_update_vendor?api.version=1&url=http%3A%2F%2Fexample.com%2Fupdate%2Fmeta_MyVendor.yaml



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/modsec_update_vendor?api.version=1&url=http%3A%2F%2Fexample.com%2Fupdate%2Fmeta_MyVendor.yaml



Expand
titleCommand Line


Code Block
languagebash
whmapi1 modsec_update_vendor url=http%3A%2F%2Fexample.com%2Fupdate%2Fmeta_MyVendor.yaml%20

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
    "data": {
        "diagnostics": {
            "deleted_configs": [
                "modsec_vendor_configs/MyVendor/one.conf"
            ],
            "new_configs": [
                {
                    "vendor_id": "MyVendor",
                    "active": 0,
                    "config": "modsec_vendor_configs/MyVendor/two.conf"
                },
                {
                    "vendor_id": "MyVendor",
                    "active": 1,
                    "config": "modsec_vendor_configs/MyVendor/three.conf"
                }
            ],
            "added_configs": [
                "modsec_vendor_configs/MyVendor/three.conf"
            ],
            "prev_configs": [
                {
                    "config": "modsec_vendor_configs/MyVendor/one.conf"
                },
                {
                    "config": "modsec_vendor_configs/MyVendor/two.conf"
                }
            ]
        },
        "vendor": {
            "locked": 0,
            "vendor_url": "http://www.example.com/",
            "inst_dist": "MyVendor-2",
            "vendor_id": "MyVendor",
			"installed": 1
			"cpanel_provided": 0
            "name": "My Vendor",
            "path": "/usr/local/apache/conf/modsec_vendor_configs/MyVendor",
            "installed_from": "http://example.com/update/meta_MyVendor.yaml",
            "description": "This is an example of a custom vendor set (updated)",
            "archive_url": "http://example.com/update/MyVendor.zip",
            "dist_md5": "ecafce1bf148532250a8d4743a8374d1",
            "enabled": 1
        }
    },
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": 1,
        "command": "modsec_update_vendor"
    }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
 <result>
    <data>
        <diagnostics>
            <deleted_configs>modsec_vendor_configs/MyVendor/one.conf</deleted_configs>
            <new_configs>
                <vendor_id>MyVendor</vendor_id>
                <active>0</active>
                <config>modsec_vendor_configs/MyVendor/two.conf</config>
            </new_configs>
            <new_configs>
                <vendor_id>MyVendor</vendor_id>
                <active>1</active>
                <config>modsec_vendor_configs/MyVendor/three.conf</config>
            </new_configs>
            <added_configs>modsec_vendor_configs/MyVendor/three.conf</added_configs>
            <prev_configs>
                <config>modsec_vendor_configs/MyVendor/one.conf</config>
            </prev_configs>
            <prev_configs>
                <config>modsec_vendor_configs/MyVendor/two.conf</config>
            </prev_configs>
        </diagnostics>
        <vendor>
			<archive_url>http://example.com/update/MyVendor.zip</archive_url>
			<cpanel_provided>0</cpanel_provided>
			<description>This is an example of a custom vendor set (updated)</description>
			<dist_md5>ecafce1bf148532250a8d4743a8374d1</dist_md5>
			<enabled>1</enabled>
			<inst_dist>MyVendor-2</inst_dist>
			<installed>1</installed>
			<installed_from>http://example.com/update/meta_MyVendor.yaml</installed_from>
			<name>My Vendor</name>
			<path>/usr/local/apache/conf/modsec_vendor_configs/MyVendor</path>
			<vendor_id>MyVendor</vendor_id>
			<vendor_url>http://www.example.com</vendor_url>
        </vendor>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>modsec_update_vendor</command>
    </metadata>
</result>


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


Parameters

Parameter

Type

Description

Possible values

Example

url

string

Required

The vendor metadata file's URL.

A valid URL.

http://example.com/update/meta_MyVendor.yaml

Returns

Return

Type

Description

Possible values

Example

vendor

hash

A hash of updated vendor information.

This hash includes the locked, vendor_url, inst_dist, vendor_id, name, path, installed_from, description, archive_url, dist_md5, and enabled returns.

 

installed

Boolean

Whether the vendor is installed.

The function returns this value in the vendor hash.

  • 1 — Installed.

  • 0Not installed.

1

vendor_url

string

The URL to the vendor's website.

The function returns this value in the vendor hash.

A valid URL.

http://example.com/

inst_dist

string

The unique identifier for the rule set version.

The function returns this parameter in the   vendor   hash.

A valid string.

MyVendor-2

vendor_id

string

The vendor's unique short name.

The function returns this parameter in the vendor hash.

A valid string.

MyVendor

name

string

The vendor's name.

The function returns this parameter in the vendor hash.

A valid string.

My Vendor

path

string

The file path to the vendor's ModSecurity configuration files.

The function returns this value in the vendor hash.

An absolute file path.


Expand
titleClick to view...

/usr/local/apache/conf/modsec_vendor_configs/MyVendor


installed_from

string

The URL to the vendor's metadata file.

The function returns this value in the vendor hash.

A valid URL.


Expand
titleClick to view...

http://example.com/update/meta_MyVendor.yaml


description

string

The vendor's description.

The function returns this value in the vendor hash.

A valid string.


Expand
titleClick to view...

This is an example of a custom vendor set (updated).


archive_url

string

The URL to download the vendor rules.

The function returns this value in the vendor hash.

A valid URL.


Expand
titleClick to view...

http://example.com/update/MyVendor.zip


dist_md5

string

The download's MD5 checksum value.

The function returns this value in the vendor hash.

A valid checksum.

ecafce1bf148532250a8d4743a8374d1

enabled

Boolean

Whether the vendor is enabled.

The function returns this value in the vendor hash.

  • 1 — Enabled.

  • 0 — Disabled.

1

diagnostics

hash

A hash of diagnostic information about the update.

This hash includes the added_configs, deleted_configs, new_configs, and prev_configs arrays.

 

added_configs

array

A list of configuration files that the update added.

The function returns this array in the   diagnostics hash.

A list of added ModSecurity configuration files.


Expand
titleClick to view...

modsec_vendor_configs/MyVendor/three.conf


deleted_configs

array

A list of configuration files that the update removed.

The function returns this array in the   diagnostics hash.

An array of deleted ModSecurity configuration files.


Expand
titleClick to view...

modsec_vendor_configs/MyVendor/one.conf


new_configs

array of hashes

A complete list of configuration files that the update modified.

The function returns this array in the   diagnostics hash.

Each hash includes the active, config, and vendor_id returns.

 

active

Boolean

Whether the configuration file is active.

The function returns this value in the new_configs array.

  • 1 — Active.

  • 0Not active.

0

config

string

The file path to the configuration file.

The function returns this value in the new_configs array.

A path to the configuration file, relative to the /usr/local/apache/conf/ Apache configuration directory.


Expand
titleClick to view...

 modsec_vendor_configs/MyVendor/two.conf


vendor_id

string

The vendor's unique name.

The function returns this value in the new_configs array.

A valid string.

MyVendor

prev_configs

array of hashes

A complete list of configuration files in the old version.

The function returns this array in the   diagnostics hash.

Each hash includes the config return.

 

config

string

The file path of the configuration file.

The function returns this value in the prev _configs array.

A path to the configuration file, relative to the /usr/local/apache/conf/ Apache configuration directory.


Expand
titleClick to view...

modsec_vendor_configs/MyVendor/two.conf