modifySMARTDatabase — Setting SMART Database Scan configuration settings
The modifySMARTDatabase method provides the SMART Database Scan configuration settings for a site.
| SMART must be configured before the SMART Database Scan configuration can be completed. |
The API endpoint is:
https://api.sitelock.com/v1/partner
Request format
-
SiteLockOnlineRequest: This element is used to delineate the full API request.
-
authentication: The partner’s username, password, and branding
-
username: The partner’s API username
-
password: The partner’s API password
-
-
modifySMARTDatabase: The method name
-
site_id: The ID of the site for which to provide settings
-
ftp_settings: The FTP settings
-
protocol: The file transfer protocol. The possible values are
ftp,sftp, andftps. -
ftp_host: The hostname or IP address of the FTP server
-
ftp_user: The FTP username for the file download process
-
ftp_pw: The FTP password. If you’re using SSH key authentication, pass
gen_ssh_keyinstead. -
port: Specify if FTP/SFTP is running on a non-default port (default ports are
21for FTP/FTPS,22for SFTP). -
gen_ssh_key: Specifies whether to generate an SSH key pair for access through the SFTP protocol. You can omit this element if a key pair already exists. If you’re using password authentication, pass
ftp_pwinstead. The possible values are:-
yes: Generate a new SSH key pair.
-
no: (Optional) Use an existing SSH key pair. This value is retained for backwards compatibility.
-
-
-
malware: Determines if the user is warned of malicious code or if the code is fixed. The value is
fixorwarn(default). -
spam_code: Determines if the user is warned of spam code (HTML hiding malicious links/URLs) or if the code is fixed. The value is
fixorwarn(default). -
spam_link: Determines if the user is warned of spam links (a link to a website that has been marked as spam) or if the link is fixed. The value is
fixorwarn(default). -
on_version_conflict: Determines the action if a conflict arises when the record has been modified after SiteLock finds the issue, but before SiteLock tries to fix the record. The value is
fixorwarn(default). -
platform: The application platform type. The value can be one of the following:
-
wordpress: (default) Wordpress
-
joomla: Joomla
-
other: For the
otherplatform type, the following additional elements are required:-
db_name: The database name
-
db_user: The database username
-
db_pw: The database password
-
db_host: The hostname or IP address of the database server
-
-
-
platform_dir: The directory where the application platform instance is installed. If the connection protocol is
ftporftps, the directory can be relative to the FTP account’s home directory. Forsftpconnections, we recommend you use the full absolute path from the system root to the platform’s directory location. -
platform_url: The site URL where the application platform site is located. The URL must start with
http://orhttps://, and must be a subdomain or subdirectory of the site. In most cases, this is the site’s default home page URL.
-
-
Example request
<SiteLockOnlineRequest>
<authentication>
<user>Username</user>
<password>Password</password>
</authentication>
<modifySMARTDatabase>
<site_id>10900</site_id>
<ftp_settings>
<protocol>ftp</protocol>
<ftp_host>ftp.ipower.com</ftp_host>
<ftp_user>john_doe</ftp_user>
<ftp_pw>doe_124</ftp_pw>
<port>21</port>
</ftp_settings>
<malware>warn</malware>
<spam_code>warn</spam_code>
<spam_link>warn</spam_link>
<on_version_conflict>warn</on_version_conflict>
<platform>wordpress</platform>
<platform_dir>public_html/</platform_dir>
<platform_url>https://example.com/</platform_url>
</modifySMARTDatabase>
</SiteLockOnlineRequest>
Response format
-
SiteLockOnlineResponse: This element is used to delineate the full API response.
-
modifySMARTDatabase: The method name
-
check_support_features: This element is present when the FTP connection succeeded.
-
feature: A list of features supported on your server
-
name: The name of a supported feature
-
crypto: Encryption utility available
-
db: Can connect to a database
-
fs: File and directory access available
-
gzip: Archive utility available
-
zip: Archive utility available
-
http: Can make outbound HTTP connection
-
json: JSON support available
-
schemas: Able to read database schemas
-
singlesite: No multisite configuration
-
-
status: The status of a feature. The possible values
okanderror.
-
-
-
ftp_settings: The FTP settings
-
connection_status: The value can be
okorfailed -
connection_err_msg: This element is present if the request failed. The possible values are:
-
no_dir: The requested directory wasn’t found on the FTP server.
-
bad_conn_max_retries: SiteLock reached the maximum number of connection retry attempts.
-
get_pass_failed: SiteLock couldn’t get access to the FTP server because of invalid credentials.
-
bad_name: SiteLock couldn’t find the FTP server or connect to it.
-
access_denied: SiteLock was denied access to the FTP server.
-
cannot_upload_file: SiteLock doesn’t have the write permission on the FTP server.
-
-
ftp_host: The hostname or IP address of the FTP server
-
ftp_user: The FTP username for the file download process
-
port: The port that the FTP/SFTP server is running on
-
protocol: The file transfer protocol. The possible values are
ftp,sftp, andftps. -
ssh_pub_key: An SSH public key. This element is present when
gen_ssh_keywas passed in to generate an SSH key pair for access through the SFTP protocol. -
status: The value can be
activeorinactive
-
-
msg: The FTP message
-
error: An error message
-
platform: The application platform type
-
platform_dir: The directory where the application platform instance is installed.
-
platform_url: The site URL where the application platform site is located.
-
site_id: The ID of the site for which the settings were provided
-
status: The status of SMART Database Scan setting
-
-
Example success response
<SiteLockOnlineResponse>
<modifySMARTDatabase>
<check_support_features>
<feature>
<name>crypto</name>
<status>ok</status>
</feature>
<feature>
<name>db</name>
<status>ok</status>
</feature>
…
</check_support_features>
<ftp_settings>
<connection_status>ok</connection_status>
<ftp_host>ftp.ipower.com</ftp_host>
<ftp_user>john_doe</ftp_user>
<port></port>
<protocol>sftp</protocol>
<ssh_pub_key>...</ssh_pub_key>
<status></status>
</ftp_settings>
<msg>updated</msg>
<platform>wordpress</platform>
<platform_dir>public_html/</platform_dir>
<platform_url>https://example.com/</platform_url>
<site_id>10900</site_id>
<status>active</status>
</modifySMARTDatabase>
</SiteLockOnlineResponse>
Example error response
<SiteLockOnlineResponse>
<modifySMARTDatabase>
<check_support_features>
<feature>
<name>system</name>
<status>error</status>
</feature>
</check_support_features>
<ftp_settings>
<connection_err_msg>cannot_upload_file</connection_err_msg>
<connection_status>failed</connection_status>
<ftp_host>ftp.ipower.com</ftp_host>
<ftp_user>john_doe</ftp_user>
<port></port>
<protocol>sftp</protocol>
<status></status>
</ftp_settings>
<msg>updated</msg>
<site_id>10900</site_id>
<status>inactive</status>
</modifySMARTDatabase>
</SiteLockOnlineResponse>
Minimum values required to successfully configure SMART Database Scan
The following elements must be specified in the request to successfully configure SMART Database Scan:
-
site_id -
ftp_settings-
protocol -
ftp_host -
ftp_user -
ftp_pworgen_ssh_key
-
-
platform_dir -
platform_url
To configure SSH key-based authentication, do the following:
-
Call
modifySMARTDatabasewith the following elements in theftp_settings.<SiteLockOnlineRequest> <modifySMARTDatabase> <site_id>123456789</site_id> <ftp_settings> <protocol>sftp</protocol> <ftp_host>ftp.ipower.com</ftp_host> <gen_ssh_key>yes</gen_ssh_key> </ftp_settings> </modifySMARTDatabase> </SiteLockOnlineRequest> -
Install the public key from the
ssh_pub_keyresponse element to your FTP server.Call
modifySMARTDatabasewith the following elements in theftp_settings.<SiteLockOnlineRequest> <modifySMARTDatabase> <site_id>123456789</site_id> <ftp_settings> <protocol>sftp</protocol> <ftp_host>ftp.ipower.com</ftp_host> <ftp_user>john_doe</ftp_user> <gen_ssh_key>no</gen_ssh_key> </ftp_settings> <platform_url>https://example.com</platform_url> <platform_dir>public_html/</platform_dir> </modifySMARTDatabase> </SiteLockOnlineRequest>
Using the same SSH key for SMART and SMART Database Scan
When gen_ssh_key is set to yes, SiteLock will skip the credential validation check and generate the public key and return its value to partner.
This is because the public key must be installed on the origin server before validating the credentials.
To verify the connection after installing the public key, make a subsequent request with gen_ssh_key set to no.
This step is critical in ensuring the feature is recognized as configured.
|
To share SSH key between SMART File Scan and SMART Database Scan:
-
Call
modifySMARTwithgen_ssh_keyset to yes to get the key. -
Update key in the server.
-
modifySMARTwithgen_ssh_keyset to no to test connection. -
modifySMARTDatabasewithgen_ssh_keyset to no.
Using different SSH keys for SMART File Scan and SMART Database Scan
To use unique/different keys for SMART File Scan and SMART Database Scan:
-
Call
modifySMARTwithgen _ssh_keyset to yes to get the key. -
Add key in the server.
-
modifySMARTwithgen_ssh_keyset to no to test connection. -
modifySMARTDatabasewithgen_ssh_keyset to yes. -
Add key in the server.
-
modifySMARTDatabasewithgen_ssh_keyset to no.