Whitelist
To create, modify, delete, or retrieve import whitelist entries from the ThreatStream platform.
Request
/api/v1/orgwhitelist/
HTTP Methods:
Attributes: See the table below
Request Attributes
| Attribute | Definition |
|---|---|
| file | Path to the CSV file containing the whitelist entries you want to add. |
| format |
Format of whitelist exports. Specify |
| limit |
The If |
| remove_existing |
Whether you want to replace existing whitelist entries with the entries specified in the request.
Default: |
| showNote |
Whether contextual notes are included in the response.
Default: |
| whitelist |
Whitelist entries can be specified in a list, as in the following example:
Whitelist Attributes
You can also specify whitelist entries in a CSV file. The CSV file must adhere to the following requirements:
The following is an example of a valid CSV file: value_type,value,notes domain,*wildcard-example.com,this is a valid domain email,account@example.com,example note ip,1.2.3.4, md5,fe01ce2a7fbac8fafaed7c982a04e229, url,http://example.com, user-agent,myagent1, cidr,192.0.2.0/24, |
Response
Format: JSON
Attributes: See the table below
Response Attributes
| Attribute | Definition |
|---|---|
| created_ts | Timestamp of when the entry was created. |
| id | Unique ID associated with the whitelist entry. |
| modified_ts | Timestamp of when the entry was most recently modified. |
| notes | Contextual note associated with the entry |
| value | Value of the entry. |
| value_type | Type of entry—cidr, domain, email, ip, md5 url, user-agent |
Examples
-
To return a list of your 10 most recently added whitelist entries:
Copycurl -X GET 'https://api.threatstream.com/api/v1/orgwhitelist/?format=json' -H 'Content-Type:application/json' -H 'Authorization: apikey <username>:<api_key>' -
To add an entry to your import whitelist:
Copycurl -X POST 'https://api.threatstream.com/api/v1/orgwhitelist/bulk/' -d '{"whitelist":[{"value_type": "domain", "value": "example44.org", "notes": "example domain"}]}' -H 'Content-Type:application/json' -H 'Authorization: apikey <username>:<api_key>' -
To add entries to your import whitelist from a CSV file:
Copycurl -X POST 'https://api.threatstream.com/api/v1/orgwhitelist/upload/?remove_existing=false' -F "file=@whitelist.csv" -H 'Authorization: apikey <username>:<api_key>'where the
whitelist.csvfile contains the following data:value_type,value,notes domain,*foo.wildcarddomain.com,some notes on foo domain,*wildcarddomain.com, email,test@email.com, ip,8.8.8.8,notes on ip address md5,fe01ce2a7fbac8fafaed7c982a04e229,this is a test md5 hash url,http://gooddomain.com/,
-
To replace your existing import whitelist with entries from a CSV file:
Copycurl -X POST 'https://api.threatstream.com/api/v1/orgwhitelist/upload/?remove_existing=true' -F "file=@whitelist.csv" -H 'Authorization: apikey <username>:<api_key>' -
To export your import whitelist in CSV format:
Copycurl -X GET 'https://api.threatstream.com/api/v1/orgwhitelist/?showNote=True&format=csv' -H "Content-Type:application/json" -H 'Authorization: apikey <username>:<api_key>' -
To export your import whitelist in JSON format:
Copycurl -X GET 'https://api.threatstream.com/api/v1/orgwhitelist/?showNote=True&format=json' -H "Content-Type:application/json" -H 'Authorization: apikey <username>:<api_key>' -
To remove an entry from your import whitelist:
Copycurl -X DELETE 'https://api.threatstream.com/api/v1/orgwhitelist/<Entry_ID>/' -H 'Authorization: apikey <username>:<api_key>'where <Entry_ID> is the ID associated with the whitelist entry you want to delete. To determine the entry ID, execute return a list of your current whitelist entries and note the ID value associated with the entry of interest.
-
To edit the note associated with an import whitelist entry:
Copycurl -X PATCH 'https://api.threatstream.com/api/v1/orgwhitelist/<Entry_ID>/' -d '{"notes":"updated note text"}' -H "Content-Type:application/json" -H 'Authorization: apikey <username>:<api_key>'where <Entry_ID> is the ID associated with the whitelist entry you want to modify. To determine the entry ID, return a list of your current whitelist entries and note the ID value associated with the entry of interest.