Post and upload a file with one or more Reputation entries.
- IP, domain name, and file hash entries — Import file must be in a comma-separated value (CSV) format with each line representing a Reputation entry without any blank lines. Each line is made up of one or more fields separated by commas. The SMS can upload one file at a time, and each file can contain multiple entries.
- URL entries — Import file must be delimited by a pipe (|) instead of a comma with each entry representing URLs only or URLs associated with one or more tags. Each line is made up of one or more fields separated by pipes. For more information about the URL import guidelines, see the URL Reputation Filtering Deployment and Best Practices Guide.
- Comment lines are discarded during import.
- Each request results in a distribution and a sync time to the managed devices.
- For improved performance, limit the number of entries in a file to between 1,000 and 10,000.
- CSV files are imported using HTTP POST requests.
Definition
repEntries/import
Parameters
| Parameter | Type | Description |
| type | string | Optional. Address type of the Reputation entry. Only one type is allowed within a
file.
|
Examples
curl -v -X POST -k --header "X-SMS-API-KEY: <string>" -F "requestFile=@./repEntries-ipv4.csv" "https://<sms_server>/repEntries/import?type=ipv4"
curl -v -X POST -k --header "X-SMS-API-KEY: <string>" -F "requestFile=@./repEntries-ipv6.csv" "https://<sms_server>/repEntries/import?type=ipv6"
curl -v -X POST -k --header "X-SMS-API-KEY: <string>" -F "requestFile=@./repEntries-dns.csv" "https://<sms_server>/repEntries/import?type=dns"
curl -v -X POST -k --header "X-SMS-API-KEY: <string>" -F "requestFile=@./repEntries-url.csv" "https://<sms_server>/repEntries/import?type=url"
curl -v -X POST -k --header "X-SMS-API-KEY: <string>" -F "requestFile=@./repEntries-sha1.csv" "https://<sms_server>/repEntries/import?type=filehash-sha1"
curl -v -X POST -k --header "X-SMS-API-KEY: <string>" -F "requestFile=@./repEntries-sha256.csv" "https://<sms_server>/repEntries/import?type=filehash-sha256"
TipWhen you import large files through the SMS or a Web API, the SMS uses an import process
to queue the files that will be imported. This process begins after the Web API has
returned. An HTTP Status code of
200 indicates that a file was queued for import. View the SMS audit log for the results
of the import request.
If a file contains duplicate values for the first (address) field, the row with the
first of the duplicates found is the one that gets imported. A duplicate record found
in a file will not keep the remaining records in the file from being processed.
|
Syntax rules for import files
Except for files with URL entries, an import file must be in a comma-separated value
(CSV) format with each line representing a reputation entry without any blank lines.
Each line is made up of one or more fields separated by commas. The import discards
any comment lines.
For URL entries, the import file must be delimited by pipe (|) instead of commas,
and entries can be URLs only or URLs associated with one or more tags. Each line is
made up of one or more fields separated by pipes. For more information about the URL
import guidelines, refer to the URL Reputation Filtering Deployment and Best Practices Guide.
Use the fields described in the following table for the entries in your file.
| Field | Required | Description |
| Address | Yes |
The first field on each line must be the IPv4 address, IPv6 address, domain name,
URL, or file hash for that entry. The remaining fields on a line are optional. If
present, remaining fields are processed as tag category/tag value pairs.
|
| Tag category/tag value pair | No | If the reputation entry within the file does not have tags, the imported entry merges
with the values of the existing entry. If the reputation entry within the file does
have tags, the imported entry merges and overwrites the values of the existing entry.
|
Import file example
For this example, the following tag categories are defined:
- Country (List)
- Approved (Yes/No)
- Comment (Text)
For the Country tag category, the following tag values are defined:
- China
- Mexico
- United States
The following example shows a file with IPv4 Reputation entries.
1.2.3.0/24,Country,United States,Approved,yes
2.3.0.0/16,Country,Mexico,Approved,no
3.4.5.0/24,Approved,yes,Country,China
1.2.3.0/24,Country,United States,Approved,yes,Comment,"This
comment, contains a comma"
1.2.3.0/24,Country,United States,Approved,yes,Comment,"This
comment ""contains"" quotes"
2.3.0.0/16
3.4.5.0/24,,,,
The following example shows a file with URL Reputation entries. It contains a user-defined
tag category,
Source, which must be created before attempting to import the file.
https://www.cnn.com|Source|URL https://www.google.com|Source|URL https://www.facebook.com|Source|URL https://www.trendmicro.com|Source|URL https://www.ebay.com|Source|URL https://www.amazon.com|Source|URL
The following example shows a file with SHA-1 file hash entries that has no defined
tags. Note that SHA-1 file hashes should be exactly 40 characters in length in the
appropriate range. (A file with SHA-256 file hash entries would have hashes 64 characters
long in the appropriate character range.)
0047ec317c28baa9b6a4b5ee3e8c78abfe2d0c61 0dfc9caaef84a33795541655ae0a0bb76c27f9b3 0fe995653b91dc4760d4b12f1464414b5dbe1747 11bb0c64cccba49ed249b526d9c3563087248625 2b91418b6f9e75231db1f4a8a0046dbf6ec9d9ab 2fed31e9687a49127676ea2f60a1bda38538cca8 4474703263bc73015ba83d39dbd3211baee37b4c
NoteWhen you request back-to-back imports with files that have 10 or less Reputation entries,
the SMS groups those entries to use the
add method instead to reduce the number of distributions. |
