diff --git a/.github/workflows/release-current-version.yml b/.github/workflows/release-current-version.yml index c3dea28..6d6faae 100644 --- a/.github/workflows/release-current-version.yml +++ b/.github/workflows/release-current-version.yml @@ -1,58 +1,11 @@ -# This workflow will run on merge of a PR or push to master -# It will run the integration developement checklist and if that passes -# creates a new release with the Release and Tag name both being the -# package.json version and will with a created tgz file and the SHA256 has in the release body - - name: Release Current Version on: push: - branches: [ master ] + branches: [ master, main ] jobs: - release-current-version: - runs-on: ubuntu-latest - container: 'centos:7' - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - - name: Get NPM Version - id: package-version - uses: martinbeentjes/npm-get-version-action@95bc31c6dd3145896c110e382f840bb1e750d09c - - name: Create Build - id: create_build - run: | - npm install && - cd .. && - tar --exclude="./${{ github.event.repository.name }}/.git" --exclude="./${{ github.event.repository.name }}/.gitignore" --exclude="./${{ github.event.repository.name }}/package-lock.json" --exclude="./${{ github.event.repository.name }}/.github" -czvf "${{ github.event.repository.name }}-${{ steps.package-version.outputs.current-version }}.tgz" "./${{ github.event.repository.name }}" && - echo "::set-output name=build_hash::$(sha256sum '${{ github.event.repository.name }}-${{ steps.package-version.outputs.current-version }}.tgz' | grep -oE '^[^ ]*' )" && - cd ${{ github.event.repository.name }} - - name: Polarity Integration Development Checklist - id: int-dev-checklist - uses: polarityio/polarity-integration-development-checklist@v1.0.0 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create Versioned Release - id: create_versioned_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.package-version.outputs.current-version}} - release_name: ${{ steps.package-version.outputs.current-version}} - body: | - SHA256: ${{ steps.create_build.outputs.build_hash }} - draft: false - prerelease: false - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_versioned_release.outputs.upload_url }} - asset_path: ../${{ github.event.repository.name }}-${{ steps.package-version.outputs.current-version}}.tgz - asset_name: ${{ github.event.repository.name }}-${{ steps.package-version.outputs.current-version}}.tgz - asset_content_type: application/gzip + Run: + uses: polarityio/polarity-github-actions/.github/workflows/release-server-versions-for-int-store.yml@master + # with: + # use-integration-development-checklist: false diff --git a/.github/workflows/run-int-dev-checklist.yml b/.github/workflows/run-int-dev-checklist.yml index 546fdfe..ffa86d7 100644 --- a/.github/workflows/run-int-dev-checklist.yml +++ b/.github/workflows/run-int-dev-checklist.yml @@ -1,12 +1,8 @@ -# This workflow will run on a Pull Request is created on both master develop -# It run as series of checks from the Integration Developement Checklist - - name: Run Integration Development Checklist on: pull_request: - branches: [ master, develop ] + branches: [ master, main, develop ] jobs: run-integration-development-checklist: @@ -19,9 +15,9 @@ jobs: - name: Test NPM Install id: test-npm-install run: | - npm install + npm ci - name: Polarity Integration Development Checklist id: int-dev-checklist - uses: polarityio/polarity-integration-development-checklist@v1.0.0 + uses: polarityio/polarity-integration-development-checklist@main with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/block/maxmind.js b/block/maxmind.js deleted file mode 100644 index 2de36bd..0000000 --- a/block/maxmind.js +++ /dev/null @@ -1,133 +0,0 @@ -'use strict'; - -polarity.export = IntegrationBlock.extend({ - maxmindMergeNetworks: true, - ipAddresses: null, - init: function() { - this._super(...arguments); - this.set('ipAddresses', Ember.A()); - this.set('ipAddressesSet', new Set()); - }, - notificationGroupingKey: Ember.computed( - 'data.details.network', - 'entity.value', - 'maxmindMergeNetworks', - 'ipAddresses.@each', - function() { - let key; - - if (this.get('maxmindMergeNetworks') === true && this.get('ipAddresses.length') <= 1) { - key = this.get('entity.value'); - } else if (this.get('maxmindMergeNetworks') === true && this.get('ipAddresses.length') > 1) { - key = this.get('data.details.network'); - } else { - key = this.get('entity.value'); - } - - this.set('displayValue', key); - return key; - } - ), - entityValues: Ember.computed('data.details.network', 'entity.value', function() { - return [this.get('entity.value'), this.get('data.details.network')]; - }), - /** - * We should add the maxmind block to an existing entityNotification if the - * maxmind entity (IP) matches the entityName (e.g., an exact match between IP addresses) - * or if the entityName is a CIDR in which case we would match on the maxmind network - * - * This allows maxmind blocks to be added both to the existing maxmind rollup and to any existing - * notifications for the specific maxmind IP. - * @param entityName - * @returns {boolean} - */ - belongsToNotification: function(notificationGroupingKey, entityValues, entityNotificationsDict) { - let entityName = entityValues[0]; - let network = entityValues[1]; - - if (this.get('maxmindMergeNetworks') === true) { - if ( - (this.get('data.details.network') === network && - entityNotificationsDict.has(this.get('entity.value')) === false) || - this.get('entity.value').toLowerCase() === entityName.toLowerCase() - ) { - return true; - } - } else { - if (this.get('entity.value').toLowerCase() === entityName.toLowerCase()) { - return true; - } - } - - return false; - }, - /** - * This event is triggered anytime an integrationBlock is inserted in the notification window. For the MaxMind - * integration we want to see if the newly inserted entityNotification - * - * @param entityNotification entityNotificationBlock into which it was inserted - * @param integrationBlock integrationBlock that has been inserted - */ - onNotificationWindowBlockInserted: function(entityNotification, integrationBlock) { - // Don't do anything if the event is for this block - if (integrationBlock.get('id') === this.get('id')) { - return; - } - - // Don't do anything if the inserted block is a maxmind block with the same network - if ( - integrationBlock.get('type') === this.get('type') && - integrationBlock.get('data.details.network') === this.get('data.details.network') - ) { - return; - } - - let insertedEntityObj = integrationBlock.get('entity'); - let insertedEntityValue = integrationBlock.get('entity.value'); - let ipAddressesSet = this.get('ipAddressesSet'); - let ipAddresses = this.get('ipAddresses'); - - // If the inserted block has an entityValue that matches one of the IP addresses in our maxmind block - // and our maxmind block has more than one IP in it, then we want to create a new integrationBlock that - // gets inserted into the updated entityNotificationBlock. At the same time we need to remove the IP address - // - // Essentially, we are "unrolling" an IP address out of our rolled up maxmind notification block - if (ipAddressesSet.has(insertedEntityValue) && ipAddresses.length > 1) { - let clonedBlock = this.deepCloneIntegrationBlock(this); - clonedBlock.set('entity', insertedEntityObj); - clonedBlock.set('isCollapsed', integrationBlock.get('isCollapsed')); - entityNotification.addBlock(clonedBlock); - - ipAddressesSet.delete(insertedEntityValue); - this.set('ipAddresses', Array.from(ipAddressesSet)); - - // If there is only one IP address left then we need to set the entity value for this block - // to that IP address as it might have changed. For example, if a maxmind block has IP A then IP B - // the entity value will be IP A. If IP A gets removed then we need to change the entity value to IP B - if (this.get('ipAddresses').length === 1) { - this.set('entity.value', this.get('ipAddresses')[0]); - } - } - }, - /** - * This method is called every time the properties for this integrationBlock are set to include - * when the integration block is first created. Note that this method is very similar to the `update` - * method but the `update` method is not called when the integrationBlock is first created. - * - * If the properties for this integrationBlock are being set then it means that a new IP address could be - * added to the network block. We want to track all individual IP Addresses added to this block so - * we display them in the details. - * - * @param integrationBlockSource - */ - onPropertiesSet: function(integrationBlockSource) { - // there is no default action for this method but it can be overridden to track block information - var entity = integrationBlockSource.get('entity.value'); - var ipAddressesSet = this.get('ipAddressesSet'); - - if (ipAddressesSet.has(entity) === false) { - this.get('ipAddressesSet').add(entity); - this.get('ipAddresses').pushObject(entity); - } - } -}); diff --git a/components/maxmind-block.js b/components/maxmind-block.js index 845a347..1050479 100644 --- a/components/maxmind-block.js +++ b/components/maxmind-block.js @@ -1,5 +1,48 @@ 'use strict'; polarity.export = PolarityComponent.extend({ - details: Ember.computed.alias('block.data.details') + details: Ember.computed.alias('block.data.details'), + showCopyMessage: false, + uniqueIdPrefix: '', + init () { + let array = new Uint32Array(5); + this.set('uniqueIdPrefix', window.crypto.getRandomValues(array).join('')); + + this._super(...arguments); + }, + actions: { + copyData: function () { + Ember.run.scheduleOnce( + 'afterRender', + this, + this.copyElementToClipboard, + `maxmind-container-${this.get('uniqueIdPrefix')}` + ); + + Ember.run.scheduleOnce('destroy', this, this.restoreCopyState); + } + }, + copyElementToClipboard (element) { + window.getSelection().removeAllRanges(); + let range = document.createRange(); + + range.selectNode(typeof element === 'string' ? document.getElementById(element) : element); + window.getSelection().addRange(range); + document.execCommand('copy'); + window.getSelection().removeAllRanges(); + }, + getElementRance (element) { + let range = document.createRange(); + range.selectNode(typeof element === 'string' ? document.getElementById(element) : element); + return range; + }, + restoreCopyState () { + this.set('showCopyMessage', true); + + setTimeout(() => { + if (!this.isDestroyed) { + this.set('showCopyMessage', false); + } + }, 2000); + } }); diff --git a/config/config.js b/config/config.js index 31bf2eb..dc4d102 100644 --- a/config/config.js +++ b/config/config.js @@ -1,173 +1,659 @@ -const Papa = require('papaparse'); -const fs = require('fs'); - -const csvAsString = fs.readFileSync('./assets/country-codes/iso3166.csv', 'utf8'); -let countryCodes = Papa.parse(csvAsString, { - header: false, - skipEmptyLines: true, - delimiter: ',', - quoteChar: '"' -}); -if (countryCodes.errors.length > 0) { - throw new Error({ errors: countryCodes.errors, msg: 'Encountered Errors Parsing Country Codes File' }); -} - -module.exports = { - /** - * Name of the integration which is displayed in the Polarity integrations user interface - * - * @type String - * @required - */ - name: 'MaxMind', - /** - * The acronym that appears in the notification window when information from this integration - * is displayed. Note that the acronym is included as part of each "tag" in the summary information - * for the integration. As a result, it is best to keep it to 4 or less characters. The casing used - * here will be carried forward into the notification window. - * - * @type String - * @required - */ - acronym: 'MM', - logging: { level: 'info' }, - entityTypes: ['IPv4', 'IPv6'], - /** - * Description for this integration which is displayed in the Polarity integrations user interface - * - * @type String - * @optional - */ - description: 'Polarity integration that connects to the MaxMind GeoLite2 database.', - /** - * An array of style files (css or less) that will be included for your integration. Any styles specified in - * the below files can be used in your custom template. - * - * @type Array - * @optional - */ - styles: ['./styles/maxmind.less'], - /** - * Provide custom component logic and template for rendering the integration details block. If you do not - * provide a custom template and/or component then the integration will display data as a table of key value - * pairs. - * - * @type Object - * @optional - */ - defaultColor: 'light-gray', - block: { - component: { - file: './components/maxmind-block.js' - }, - template: { - file: './templates/maxmind-block.hbs' - } - }, - summary: { - component: { - file: './components/maxmind-summary.js' - }, - template: { - file: './templates/maxmind-summary.hbs' - } - }, - integrationBlock: { - file: './block/maxmind.js' - }, - settings: { - /** - * Directory path to the GeoLiteCity 2 database. If a relative path is chosen, the path will be relative - * to this integration's root directory. The GeoLite2-City database can be downloaded from: - * https://dev.maxmind.com/geoip/geoip2/geolite2/ - */ - geoLite2CityDatabasePath: 'database/GeoLite2-City.mmdb', - /** - * Directory path to the GeoLiteASN 2 database. If a relative path is chosen, the path will be relative - * to this integration's root directory. The GeoLite2-ASN database can be downloaded from: - * https://dev.maxmind.com/geoip/geoip2/geolite2/ - */ - geoLite2AsnDatabasePath: 'database/GeoLite2-ASN.mmdb' - }, - /** - * Options that are displayed to the user/admin in the Polarity integration user-interface. Should be structured - * as an array of option objects. - * - * @type Array - * @optional - */ - options: [ - { - key: 'countryBlacklist', - name: 'Country Blacklist', - description: - 'A blacklist of countries to hide results from (i.e., no results will be shown for selected countries). You cannot provide both a Country Blacklist and a Country Whitelist.', - default: [], - type: 'select', - options: countryCodes.data.map((row) => { - return { - value: row[0], - display: row[1] - }; - }), - multiple: true, - userCanEdit: true, - adminOnly: false - }, - { - key: 'countryWhitelist', - name: 'Country Whitelist', - description: - 'A whitelist of countries that results should be shown for (i.e., results will only be shown for selected countries). You cannot provide both a Country Blacklist and a Country Whitelist.', - default: [], - type: 'select', - options: countryCodes.data.map((row) => { - return { - value: row[0], - display: row[1] - }; - }), - multiple: true, - userCanEdit: true, - adminOnly: false - }, - { - key: 'fullResultsForOnDemand', - name: 'Return all Countries for On-Demand Lookups', - description: 'If checked, the integration will return results for all countries when an On-demand search is run (i.e., Country Whitelist and Country Blacklist settings will be ignored for On-Demand lookups).', - default: false, - type: 'boolean', - userCanEdit: true, - adminOnly: false - }, - { - key: 'showFullCountryName', - name: 'Show Full Country Name in Summary', - description: - 'If checked, integration will always display the full country name rather than just the country ISO Code in the MaxMind notification summary', - default: true, - type: 'boolean', - userCanEdit: true, - adminOnly: false - }, - { - key: 'showState', - name: 'Show State in Summary', - description: - 'If checked, the integration will display the state or subdivision information when available in the MaxMind notification summary', - default: true, - type: 'boolean', - userCanEdit: true, - adminOnly: false - }, - { - key: 'showAsnTag', - name: 'Show ASN and Org Info in Summary', - description: 'If checked, the integration will display the ASN and organization information as a summary tag', - default: true, - type: 'boolean', - userCanEdit: true, - adminOnly: false - } - ] -}; +module.exports = { + /** + * Name of the integration which is displayed in the Polarity integrations user interface + * + * @type String + * @required + */ + name: 'MaxMind', + /** + * The acronym that appears in the notification window when information from this integration + * is displayed. Note that the acronym is included as part of each "tag" in the summary information + * for the integration. As a result, it is best to keep it to 4 or less characters. The casing used + * here will be carried forward into the notification window. + * + * @type String + * @required + */ + acronym: 'MM', + logging: { level: 'info' }, + entityTypes: ['IPv4', 'IPv6'], + /** + * Description for this integration which is displayed in the Polarity integrations user interface + * + * @type String + * @optional + */ + description: 'Polarity integration that connects to the MaxMind GeoLite2 database.', + /** + * An array of style files (css or less) that will be included for your integration. Any styles specified in + * the below files can be used in your custom template. + * + * @type Array + * @optional + */ + styles: ['./styles/maxmind.less'], + /** + * Provide custom component logic and template for rendering the integration details block. If you do not + * provide a custom template and/or component then the integration will display data as a table of key value + * pairs. + * + * @type Object + * @optional + */ + defaultColor: 'light-gray', + block: { + component: { + file: './components/maxmind-block.js' + }, + template: { + file: './templates/maxmind-block.hbs' + } + }, + summary: { + component: { + file: './components/maxmind-summary.js' + }, + template: { + file: './templates/maxmind-summary.hbs' + } + }, + request: { + cert: '', + key: '', + passphrase: '', + ca: '', + proxy: '', + rejectUnauthorized: true + }, + settings: { + /** + * Directory path to the GeoLiteCity 2 database. If a relative path is chosen, the path will be relative + * to this integration's root directory. The GeoLite2-City database can be downloaded from: + * https://dev.maxmind.com/geoip/geoip2/geolite2/ + */ + geoLite2CityDatabasePath: 'database/GeoLite2-City.mmdb', + /** + * Directory path to the GeoLiteASN 2 database. If a relative path is chosen, the path will be relative + * to this integration's root directory. The GeoLite2-ASN database can be downloaded from: + * https://dev.maxmind.com/geoip/geoip2/geolite2/ + */ + geoLite2AsnDatabasePath: 'database/GeoLite2-ASN.mmdb' + }, + /** + * Options that are displayed to the user/admin in the Polarity integration user-interface. Should be structured + * as an array of option objects. + * + * @type Array + * @optional + */ + options: [ + { + key: 'countryBlacklist', + name: 'Country Block List', + description: + 'A block list of countries to hide results from (i.e., no results will be shown for selected countries). You cannot provide both a Country Blacklist and a Country Whitelist.', + default: [], + type: 'select', + options: [ + { value: 'AD', display: 'Andorra' }, + { value: 'AE', display: 'United Arab Emirates' }, + { value: 'AF', display: 'Afghanistan' }, + { value: 'AG', display: 'Antigua and Barbuda' }, + { value: 'AI', display: 'Anguilla' }, + { value: 'AL', display: 'Albania' }, + { value: 'AM', display: 'Armenia' }, + { value: 'AO', display: 'Angola' }, + { value: 'AP', display: 'Asia/Pacific Region' }, + { value: 'AQ', display: 'Antarctica' }, + { value: 'AR', display: 'Argentina' }, + { value: 'AS', display: 'American Samoa' }, + { value: 'AT', display: 'Austria' }, + { value: 'AU', display: 'Australia' }, + { value: 'AW', display: 'Aruba' }, + { value: 'AX', display: 'Aland Islands' }, + { value: 'AZ', display: 'Azerbaijan' }, + { value: 'BA', display: 'Bosnia and Herzegovina' }, + { value: 'BB', display: 'Barbados' }, + { value: 'BD', display: 'Bangladesh' }, + { value: 'BE', display: 'Belgium' }, + { value: 'BF', display: 'Burkina Faso' }, + { value: 'BG', display: 'Bulgaria' }, + { value: 'BH', display: 'Bahrain' }, + { value: 'BI', display: 'Burundi' }, + { value: 'BJ', display: 'Benin' }, + { value: 'BL', display: 'Saint Barthelemey' }, + { value: 'BM', display: 'Bermuda' }, + { value: 'BN', display: 'Brunei Darussalam' }, + { value: 'BO', display: 'Bolivia' }, + { value: 'BQ', display: 'Bonaire, Saint Eustatius and Saba' }, + { value: 'BR', display: 'Brazil' }, + { value: 'BS', display: 'Bahamas' }, + { value: 'BT', display: 'Bhutan' }, + { value: 'BV', display: 'Bouvet Island' }, + { value: 'BW', display: 'Botswana' }, + { value: 'BY', display: 'Belarus' }, + { value: 'BZ', display: 'Belize' }, + { value: 'CA', display: 'Canada' }, + { value: 'CC', display: 'Cocos (Keeling) Islands' }, + { value: 'CD', display: 'Congo, The Democratic Republic of the' }, + { value: 'CF', display: 'Central African Republic' }, + { value: 'CG', display: 'Congo' }, + { value: 'CH', display: 'Switzerland' }, + { value: 'CI', display: "Cote d'Ivoire" }, + { value: 'CK', display: 'Cook Islands' }, + { value: 'CL', display: 'Chile' }, + { value: 'CM', display: 'Cameroon' }, + { value: 'CN', display: 'China' }, + { value: 'CO', display: 'Colombia' }, + { value: 'CR', display: 'Costa Rica' }, + { value: 'CU', display: 'Cuba' }, + { value: 'CV', display: 'Cape Verde' }, + { value: 'CW', display: 'Curacao' }, + { value: 'CX', display: 'Christmas Island' }, + { value: 'CY', display: 'Cyprus' }, + { value: 'CZ', display: 'Czech Republic' }, + { value: 'DE', display: 'Germany' }, + { value: 'DJ', display: 'Djibouti' }, + { value: 'DK', display: 'Denmark' }, + { value: 'DM', display: 'Dominica' }, + { value: 'DO', display: 'Dominican Republic' }, + { value: 'DZ', display: 'Algeria' }, + { value: 'EC', display: 'Ecuador' }, + { value: 'EE', display: 'Estonia' }, + { value: 'EG', display: 'Egypt' }, + { value: 'EH', display: 'Western Sahara' }, + { value: 'ER', display: 'Eritrea' }, + { value: 'ES', display: 'Spain' }, + { value: 'ET', display: 'Ethiopia' }, + { value: 'EU', display: 'Europe' }, + { value: 'FI', display: 'Finland' }, + { value: 'FJ', display: 'Fiji' }, + { value: 'FK', display: 'Falkland Islands (Malvinas)' }, + { value: 'FM', display: 'Micronesia, Federated States of' }, + { value: 'FO', display: 'Faroe Islands' }, + { value: 'FR', display: 'France' }, + { value: 'GA', display: 'Gabon' }, + { value: 'GB', display: 'United Kingdom' }, + { value: 'GD', display: 'Grenada' }, + { value: 'GE', display: 'Georgia' }, + { value: 'GF', display: 'French Guiana' }, + { value: 'GG', display: 'Guernsey' }, + { value: 'GH', display: 'Ghana' }, + { value: 'GI', display: 'Gibraltar' }, + { value: 'GL', display: 'Greenland' }, + { value: 'GM', display: 'Gambia' }, + { value: 'GN', display: 'Guinea' }, + { value: 'GP', display: 'Guadeloupe' }, + { value: 'GQ', display: 'Equatorial Guinea' }, + { value: 'GR', display: 'Greece' }, + { value: 'GS', display: 'South Georgia and the South Sandwich Islands' }, + { value: 'GT', display: 'Guatemala' }, + { value: 'GU', display: 'Guam' }, + { value: 'GW', display: 'Guinea-Bissau' }, + { value: 'GY', display: 'Guyana' }, + { value: 'HK', display: 'Hong Kong' }, + { value: 'HM', display: 'Heard Island and McDonald Islands' }, + { value: 'HN', display: 'Honduras' }, + { value: 'HR', display: 'Croatia' }, + { value: 'HT', display: 'Haiti' }, + { value: 'HU', display: 'Hungary' }, + { value: 'ID', display: 'Indonesia' }, + { value: 'IE', display: 'Ireland' }, + { value: 'IL', display: 'Israel' }, + { value: 'IM', display: 'Isle of Man' }, + { value: 'IN', display: 'India' }, + { value: 'IO', display: 'British Indian Ocean Territory' }, + { value: 'IQ', display: 'Iraq' }, + { value: 'IR', display: 'Iran, Islamic Republic of' }, + { value: 'IS', display: 'Iceland' }, + { value: 'IT', display: 'Italy' }, + { value: 'JE', display: 'Jersey' }, + { value: 'JM', display: 'Jamaica' }, + { value: 'JO', display: 'Jordan' }, + { value: 'JP', display: 'Japan' }, + { value: 'KE', display: 'Kenya' }, + { value: 'KG', display: 'Kyrgyzstan' }, + { value: 'KH', display: 'Cambodia' }, + { value: 'KI', display: 'Kiribati' }, + { value: 'KM', display: 'Comoros' }, + { value: 'KN', display: 'Saint Kitts and Nevis' }, + { value: 'KP', display: "Korea, Democratic People's Republic of" }, + { value: 'KR', display: 'Korea, Republic of' }, + { value: 'KW', display: 'Kuwait' }, + { value: 'KY', display: 'Cayman Islands' }, + { value: 'KZ', display: 'Kazakhstan' }, + { value: 'LA', display: "Lao People's Democratic Republic" }, + { value: 'LB', display: 'Lebanon' }, + { value: 'LC', display: 'Saint Lucia' }, + { value: 'LI', display: 'Liechtenstein' }, + { value: 'LK', display: 'Sri Lanka' }, + { value: 'LR', display: 'Liberia' }, + { value: 'LS', display: 'Lesotho' }, + { value: 'LT', display: 'Lithuania' }, + { value: 'LU', display: 'Luxembourg' }, + { value: 'LV', display: 'Latvia' }, + { value: 'LY', display: 'Libyan Arab Jamahiriya' }, + { value: 'MA', display: 'Morocco' }, + { value: 'MC', display: 'Monaco' }, + { value: 'MD', display: 'Moldova, Republic of' }, + { value: 'ME', display: 'Montenegro' }, + { value: 'MF', display: 'Saint Martin' }, + { value: 'MG', display: 'Madagascar' }, + { value: 'MH', display: 'Marshall Islands' }, + { value: 'MK', display: 'Macedonia' }, + { value: 'ML', display: 'Mali' }, + { value: 'MM', display: 'Myanmar' }, + { value: 'MN', display: 'Mongolia' }, + { value: 'MO', display: 'Macao' }, + { value: 'MP', display: 'Northern Mariana Islands' }, + { value: 'MQ', display: 'Martinique' }, + { value: 'MR', display: 'Mauritania' }, + { value: 'MS', display: 'Montserrat' }, + { value: 'MT', display: 'Malta' }, + { value: 'MU', display: 'Mauritius' }, + { value: 'MV', display: 'Maldives' }, + { value: 'MW', display: 'Malawi' }, + { value: 'MX', display: 'Mexico' }, + { value: 'MY', display: 'Malaysia' }, + { value: 'MZ', display: 'Mozambique' }, + { value: 'NA', display: 'Namibia' }, + { value: 'NC', display: 'New Caledonia' }, + { value: 'NE', display: 'Niger' }, + { value: 'NF', display: 'Norfolk Island' }, + { value: 'NG', display: 'Nigeria' }, + { value: 'NI', display: 'Nicaragua' }, + { value: 'NL', display: 'Netherlands' }, + { value: 'NO', display: 'Norway' }, + { value: 'NP', display: 'Nepal' }, + { value: 'NR', display: 'Nauru' }, + { value: 'NU', display: 'Niue' }, + { value: 'NZ', display: 'New Zealand' }, + { value: 'OM', display: 'Oman' }, + { value: 'PA', display: 'Panama' }, + { value: 'PE', display: 'Peru' }, + { value: 'PF', display: 'French Polynesia' }, + { value: 'PG', display: 'Papua New Guinea' }, + { value: 'PH', display: 'Philippines' }, + { value: 'PK', display: 'Pakistan' }, + { value: 'PL', display: 'Poland' }, + { value: 'PM', display: 'Saint Pierre and Miquelon' }, + { value: 'PN', display: 'Pitcairn' }, + { value: 'PR', display: 'Puerto Rico' }, + { value: 'PS', display: 'Palestinian Territory' }, + { value: 'PT', display: 'Portugal' }, + { value: 'PW', display: 'Palau' }, + { value: 'PY', display: 'Paraguay' }, + { value: 'QA', display: 'Qatar' }, + { value: 'RE', display: 'Reunion' }, + { value: 'RO', display: 'Romania' }, + { value: 'RS', display: 'Serbia' }, + { value: 'RU', display: 'Russian Federation' }, + { value: 'RW', display: 'Rwanda' }, + { value: 'SA', display: 'Saudi Arabia' }, + { value: 'SB', display: 'Solomon Islands' }, + { value: 'SC', display: 'Seychelles' }, + { value: 'SD', display: 'Sudan' }, + { value: 'SE', display: 'Sweden' }, + { value: 'SG', display: 'Singapore' }, + { value: 'SH', display: 'Saint Helena' }, + { value: 'SI', display: 'Slovenia' }, + { value: 'SJ', display: 'Svalbard and Jan Mayen' }, + { value: 'SK', display: 'Slovakia' }, + { value: 'SL', display: 'Sierra Leone' }, + { value: 'SM', display: 'San Marino' }, + { value: 'SN', display: 'Senegal' }, + { value: 'SO', display: 'Somalia' }, + { value: 'SR', display: 'Suriname' }, + { value: 'SS', display: 'South Sudan' }, + { value: 'ST', display: 'Sao Tome and Principe' }, + { value: 'SV', display: 'El Salvador' }, + { value: 'SX', display: 'Sint Maarten' }, + { value: 'SY', display: 'Syrian Arab Republic' }, + { value: 'SZ', display: 'Swaziland' }, + { value: 'TC', display: 'Turks and Caicos Islands' }, + { value: 'TD', display: 'Chad' }, + { value: 'TF', display: 'French Southern Territories' }, + { value: 'TG', display: 'Togo' }, + { value: 'TH', display: 'Thailand' }, + { value: 'TJ', display: 'Tajikistan' }, + { value: 'TK', display: 'Tokelau' }, + { value: 'TL', display: 'Timor-Leste' }, + { value: 'TM', display: 'Turkmenistan' }, + { value: 'TN', display: 'Tunisia' }, + { value: 'TO', display: 'Tonga' }, + { value: 'TR', display: 'Turkey' }, + { value: 'TT', display: 'Trinidad and Tobago' }, + { value: 'TV', display: 'Tuvalu' }, + { value: 'TW', display: 'Taiwan' }, + { value: 'TZ', display: 'Tanzania, United Republic of' }, + { value: 'UA', display: 'Ukraine' }, + { value: 'UG', display: 'Uganda' }, + { value: 'UM', display: 'United States Minor Outlying Islands' }, + { value: 'US', display: 'United States' }, + { value: 'UY', display: 'Uruguay' }, + { value: 'UZ', display: 'Uzbekistan' }, + { value: 'VA', display: 'Holy See (Vatican City State)' }, + { value: 'VC', display: 'Saint Vincent and the Grenadines' }, + { value: 'VE', display: 'Venezuela' }, + { value: 'VG', display: 'Virgin Islands, British' }, + { value: 'VI', display: 'Virgin Islands, U.S.' }, + { value: 'VN', display: 'Vietnam' }, + { value: 'VU', display: 'Vanuatu' }, + { value: 'WF', display: 'Wallis and Futuna' }, + { value: 'WS', display: 'Samoa' }, + { value: 'YE', display: 'Yemen' }, + { value: 'YT', display: 'Mayotte' }, + { value: 'ZA', display: 'South Africa' }, + { value: 'ZM', display: 'Zambia' }, + { value: 'ZW', display: 'Zimbabwe' } + ], + multiple: true, + userCanEdit: true, + adminOnly: false + }, + { + key: 'countryWhitelist', + name: 'Country Allow List', + description: + 'An allow list of countries that results should be shown for (i.e., results will only be shown for selected countries). You cannot provide both a Country Blacklist and a Country Whitelist.', + default: [], + type: 'select', + options: [ + { value: 'AD', display: 'Andorra' }, + { value: 'AE', display: 'United Arab Emirates' }, + { value: 'AF', display: 'Afghanistan' }, + { value: 'AG', display: 'Antigua and Barbuda' }, + { value: 'AI', display: 'Anguilla' }, + { value: 'AL', display: 'Albania' }, + { value: 'AM', display: 'Armenia' }, + { value: 'AO', display: 'Angola' }, + { value: 'AP', display: 'Asia/Pacific Region' }, + { value: 'AQ', display: 'Antarctica' }, + { value: 'AR', display: 'Argentina' }, + { value: 'AS', display: 'American Samoa' }, + { value: 'AT', display: 'Austria' }, + { value: 'AU', display: 'Australia' }, + { value: 'AW', display: 'Aruba' }, + { value: 'AX', display: 'Aland Islands' }, + { value: 'AZ', display: 'Azerbaijan' }, + { value: 'BA', display: 'Bosnia and Herzegovina' }, + { value: 'BB', display: 'Barbados' }, + { value: 'BD', display: 'Bangladesh' }, + { value: 'BE', display: 'Belgium' }, + { value: 'BF', display: 'Burkina Faso' }, + { value: 'BG', display: 'Bulgaria' }, + { value: 'BH', display: 'Bahrain' }, + { value: 'BI', display: 'Burundi' }, + { value: 'BJ', display: 'Benin' }, + { value: 'BL', display: 'Saint Barthelemey' }, + { value: 'BM', display: 'Bermuda' }, + { value: 'BN', display: 'Brunei Darussalam' }, + { value: 'BO', display: 'Bolivia' }, + { value: 'BQ', display: 'Bonaire, Saint Eustatius and Saba' }, + { value: 'BR', display: 'Brazil' }, + { value: 'BS', display: 'Bahamas' }, + { value: 'BT', display: 'Bhutan' }, + { value: 'BV', display: 'Bouvet Island' }, + { value: 'BW', display: 'Botswana' }, + { value: 'BY', display: 'Belarus' }, + { value: 'BZ', display: 'Belize' }, + { value: 'CA', display: 'Canada' }, + { value: 'CC', display: 'Cocos (Keeling) Islands' }, + { value: 'CD', display: 'Congo, The Democratic Republic of the' }, + { value: 'CF', display: 'Central African Republic' }, + { value: 'CG', display: 'Congo' }, + { value: 'CH', display: 'Switzerland' }, + { value: 'CI', display: "Cote d'Ivoire" }, + { value: 'CK', display: 'Cook Islands' }, + { value: 'CL', display: 'Chile' }, + { value: 'CM', display: 'Cameroon' }, + { value: 'CN', display: 'China' }, + { value: 'CO', display: 'Colombia' }, + { value: 'CR', display: 'Costa Rica' }, + { value: 'CU', display: 'Cuba' }, + { value: 'CV', display: 'Cape Verde' }, + { value: 'CW', display: 'Curacao' }, + { value: 'CX', display: 'Christmas Island' }, + { value: 'CY', display: 'Cyprus' }, + { value: 'CZ', display: 'Czech Republic' }, + { value: 'DE', display: 'Germany' }, + { value: 'DJ', display: 'Djibouti' }, + { value: 'DK', display: 'Denmark' }, + { value: 'DM', display: 'Dominica' }, + { value: 'DO', display: 'Dominican Republic' }, + { value: 'DZ', display: 'Algeria' }, + { value: 'EC', display: 'Ecuador' }, + { value: 'EE', display: 'Estonia' }, + { value: 'EG', display: 'Egypt' }, + { value: 'EH', display: 'Western Sahara' }, + { value: 'ER', display: 'Eritrea' }, + { value: 'ES', display: 'Spain' }, + { value: 'ET', display: 'Ethiopia' }, + { value: 'EU', display: 'Europe' }, + { value: 'FI', display: 'Finland' }, + { value: 'FJ', display: 'Fiji' }, + { value: 'FK', display: 'Falkland Islands (Malvinas)' }, + { value: 'FM', display: 'Micronesia, Federated States of' }, + { value: 'FO', display: 'Faroe Islands' }, + { value: 'FR', display: 'France' }, + { value: 'GA', display: 'Gabon' }, + { value: 'GB', display: 'United Kingdom' }, + { value: 'GD', display: 'Grenada' }, + { value: 'GE', display: 'Georgia' }, + { value: 'GF', display: 'French Guiana' }, + { value: 'GG', display: 'Guernsey' }, + { value: 'GH', display: 'Ghana' }, + { value: 'GI', display: 'Gibraltar' }, + { value: 'GL', display: 'Greenland' }, + { value: 'GM', display: 'Gambia' }, + { value: 'GN', display: 'Guinea' }, + { value: 'GP', display: 'Guadeloupe' }, + { value: 'GQ', display: 'Equatorial Guinea' }, + { value: 'GR', display: 'Greece' }, + { value: 'GS', display: 'South Georgia and the South Sandwich Islands' }, + { value: 'GT', display: 'Guatemala' }, + { value: 'GU', display: 'Guam' }, + { value: 'GW', display: 'Guinea-Bissau' }, + { value: 'GY', display: 'Guyana' }, + { value: 'HK', display: 'Hong Kong' }, + { value: 'HM', display: 'Heard Island and McDonald Islands' }, + { value: 'HN', display: 'Honduras' }, + { value: 'HR', display: 'Croatia' }, + { value: 'HT', display: 'Haiti' }, + { value: 'HU', display: 'Hungary' }, + { value: 'ID', display: 'Indonesia' }, + { value: 'IE', display: 'Ireland' }, + { value: 'IL', display: 'Israel' }, + { value: 'IM', display: 'Isle of Man' }, + { value: 'IN', display: 'India' }, + { value: 'IO', display: 'British Indian Ocean Territory' }, + { value: 'IQ', display: 'Iraq' }, + { value: 'IR', display: 'Iran, Islamic Republic of' }, + { value: 'IS', display: 'Iceland' }, + { value: 'IT', display: 'Italy' }, + { value: 'JE', display: 'Jersey' }, + { value: 'JM', display: 'Jamaica' }, + { value: 'JO', display: 'Jordan' }, + { value: 'JP', display: 'Japan' }, + { value: 'KE', display: 'Kenya' }, + { value: 'KG', display: 'Kyrgyzstan' }, + { value: 'KH', display: 'Cambodia' }, + { value: 'KI', display: 'Kiribati' }, + { value: 'KM', display: 'Comoros' }, + { value: 'KN', display: 'Saint Kitts and Nevis' }, + { value: 'KP', display: "Korea, Democratic People's Republic of" }, + { value: 'KR', display: 'Korea, Republic of' }, + { value: 'KW', display: 'Kuwait' }, + { value: 'KY', display: 'Cayman Islands' }, + { value: 'KZ', display: 'Kazakhstan' }, + { value: 'LA', display: "Lao People's Democratic Republic" }, + { value: 'LB', display: 'Lebanon' }, + { value: 'LC', display: 'Saint Lucia' }, + { value: 'LI', display: 'Liechtenstein' }, + { value: 'LK', display: 'Sri Lanka' }, + { value: 'LR', display: 'Liberia' }, + { value: 'LS', display: 'Lesotho' }, + { value: 'LT', display: 'Lithuania' }, + { value: 'LU', display: 'Luxembourg' }, + { value: 'LV', display: 'Latvia' }, + { value: 'LY', display: 'Libyan Arab Jamahiriya' }, + { value: 'MA', display: 'Morocco' }, + { value: 'MC', display: 'Monaco' }, + { value: 'MD', display: 'Moldova, Republic of' }, + { value: 'ME', display: 'Montenegro' }, + { value: 'MF', display: 'Saint Martin' }, + { value: 'MG', display: 'Madagascar' }, + { value: 'MH', display: 'Marshall Islands' }, + { value: 'MK', display: 'Macedonia' }, + { value: 'ML', display: 'Mali' }, + { value: 'MM', display: 'Myanmar' }, + { value: 'MN', display: 'Mongolia' }, + { value: 'MO', display: 'Macao' }, + { value: 'MP', display: 'Northern Mariana Islands' }, + { value: 'MQ', display: 'Martinique' }, + { value: 'MR', display: 'Mauritania' }, + { value: 'MS', display: 'Montserrat' }, + { value: 'MT', display: 'Malta' }, + { value: 'MU', display: 'Mauritius' }, + { value: 'MV', display: 'Maldives' }, + { value: 'MW', display: 'Malawi' }, + { value: 'MX', display: 'Mexico' }, + { value: 'MY', display: 'Malaysia' }, + { value: 'MZ', display: 'Mozambique' }, + { value: 'NA', display: 'Namibia' }, + { value: 'NC', display: 'New Caledonia' }, + { value: 'NE', display: 'Niger' }, + { value: 'NF', display: 'Norfolk Island' }, + { value: 'NG', display: 'Nigeria' }, + { value: 'NI', display: 'Nicaragua' }, + { value: 'NL', display: 'Netherlands' }, + { value: 'NO', display: 'Norway' }, + { value: 'NP', display: 'Nepal' }, + { value: 'NR', display: 'Nauru' }, + { value: 'NU', display: 'Niue' }, + { value: 'NZ', display: 'New Zealand' }, + { value: 'OM', display: 'Oman' }, + { value: 'PA', display: 'Panama' }, + { value: 'PE', display: 'Peru' }, + { value: 'PF', display: 'French Polynesia' }, + { value: 'PG', display: 'Papua New Guinea' }, + { value: 'PH', display: 'Philippines' }, + { value: 'PK', display: 'Pakistan' }, + { value: 'PL', display: 'Poland' }, + { value: 'PM', display: 'Saint Pierre and Miquelon' }, + { value: 'PN', display: 'Pitcairn' }, + { value: 'PR', display: 'Puerto Rico' }, + { value: 'PS', display: 'Palestinian Territory' }, + { value: 'PT', display: 'Portugal' }, + { value: 'PW', display: 'Palau' }, + { value: 'PY', display: 'Paraguay' }, + { value: 'QA', display: 'Qatar' }, + { value: 'RE', display: 'Reunion' }, + { value: 'RO', display: 'Romania' }, + { value: 'RS', display: 'Serbia' }, + { value: 'RU', display: 'Russian Federation' }, + { value: 'RW', display: 'Rwanda' }, + { value: 'SA', display: 'Saudi Arabia' }, + { value: 'SB', display: 'Solomon Islands' }, + { value: 'SC', display: 'Seychelles' }, + { value: 'SD', display: 'Sudan' }, + { value: 'SE', display: 'Sweden' }, + { value: 'SG', display: 'Singapore' }, + { value: 'SH', display: 'Saint Helena' }, + { value: 'SI', display: 'Slovenia' }, + { value: 'SJ', display: 'Svalbard and Jan Mayen' }, + { value: 'SK', display: 'Slovakia' }, + { value: 'SL', display: 'Sierra Leone' }, + { value: 'SM', display: 'San Marino' }, + { value: 'SN', display: 'Senegal' }, + { value: 'SO', display: 'Somalia' }, + { value: 'SR', display: 'Suriname' }, + { value: 'SS', display: 'South Sudan' }, + { value: 'ST', display: 'Sao Tome and Principe' }, + { value: 'SV', display: 'El Salvador' }, + { value: 'SX', display: 'Sint Maarten' }, + { value: 'SY', display: 'Syrian Arab Republic' }, + { value: 'SZ', display: 'Swaziland' }, + { value: 'TC', display: 'Turks and Caicos Islands' }, + { value: 'TD', display: 'Chad' }, + { value: 'TF', display: 'French Southern Territories' }, + { value: 'TG', display: 'Togo' }, + { value: 'TH', display: 'Thailand' }, + { value: 'TJ', display: 'Tajikistan' }, + { value: 'TK', display: 'Tokelau' }, + { value: 'TL', display: 'Timor-Leste' }, + { value: 'TM', display: 'Turkmenistan' }, + { value: 'TN', display: 'Tunisia' }, + { value: 'TO', display: 'Tonga' }, + { value: 'TR', display: 'Turkey' }, + { value: 'TT', display: 'Trinidad and Tobago' }, + { value: 'TV', display: 'Tuvalu' }, + { value: 'TW', display: 'Taiwan' }, + { value: 'TZ', display: 'Tanzania, United Republic of' }, + { value: 'UA', display: 'Ukraine' }, + { value: 'UG', display: 'Uganda' }, + { value: 'UM', display: 'United States Minor Outlying Islands' }, + { value: 'US', display: 'United States' }, + { value: 'UY', display: 'Uruguay' }, + { value: 'UZ', display: 'Uzbekistan' }, + { value: 'VA', display: 'Holy See (Vatican City State)' }, + { value: 'VC', display: 'Saint Vincent and the Grenadines' }, + { value: 'VE', display: 'Venezuela' }, + { value: 'VG', display: 'Virgin Islands, British' }, + { value: 'VI', display: 'Virgin Islands, U.S.' }, + { value: 'VN', display: 'Vietnam' }, + { value: 'VU', display: 'Vanuatu' }, + { value: 'WF', display: 'Wallis and Futuna' }, + { value: 'WS', display: 'Samoa' }, + { value: 'YE', display: 'Yemen' }, + { value: 'YT', display: 'Mayotte' }, + { value: 'ZA', display: 'South Africa' }, + { value: 'ZM', display: 'Zambia' }, + { value: 'ZW', display: 'Zimbabwe' } + ], + multiple: true, + userCanEdit: true, + adminOnly: false + }, + { + key: 'fullResultsForOnDemand', + name: 'Return all Countries for On-Demand Lookups', + description: + 'If checked, the integration will return results for all countries when an On-demand search is run (i.e., Country Whitelist and Country Blacklist settings will be ignored for On-Demand lookups).', + default: false, + type: 'boolean', + userCanEdit: true, + adminOnly: false + }, + { + key: 'showFullCountryName', + name: 'Show Full Country Name in Summary', + description: + 'If checked, integration will always display the full country name rather than just the country ISO Code in the MaxMind notification summary', + default: true, + type: 'boolean', + userCanEdit: true, + adminOnly: false + }, + { + key: 'showState', + name: 'Show State in Summary', + description: + 'If checked, the integration will display the state or subdivision information when available in the MaxMind notification summary', + default: true, + type: 'boolean', + userCanEdit: true, + adminOnly: false + }, + { + key: 'showAsnTag', + name: 'Show ASN and Org Info in Summary', + description: 'If checked, the integration will display the ASN and organization information as a summary tag', + default: true, + type: 'boolean', + userCanEdit: true, + adminOnly: false + } + ] +}; diff --git a/config/config.json b/config/config.json new file mode 100644 index 0000000..c7cecc5 --- /dev/null +++ b/config/config.json @@ -0,0 +1,2142 @@ +{ + "name": "MaxMind", + "acronym": "MM", + "logging": { + "level": "info" + }, + "entityTypes": [ + "IPv4", + "IPv6" + ], + "description": "Polarity integration that connects to the MaxMind GeoLite2 database.", + "styles": [ + "./styles/maxmind.less" + ], + "defaultColor": "light-gray", + "block": { + "component": { + "file": "./components/maxmind-block.js" + }, + "template": { + "file": "./templates/maxmind-block.hbs" + } + }, + "summary": { + "component": { + "file": "./components/maxmind-summary.js" + }, + "template": { + "file": "./templates/maxmind-summary.hbs" + } + }, + "request": { + "cert": "", + "key": "", + "passphrase": "", + "ca": "", + "proxy": "" + }, + "settings": { + "geoLite2CityDatabasePath": "database/GeoLite2-City.mmdb", + "geoLite2AsnDatabasePath": "database/GeoLite2-ASN.mmdb" + }, + "options": [ + { + "key": "_integrationChannels", + "name": "Channels", + "description": "Entities from the listed channels will be sent to the integration", + "default": { + "IPv4": { + "enabled": true, + "whitelist": [], + "display-name": "IPv4" + }, + "IPv6": { + "enabled": true, + "whitelist": [], + "display-name": "IPv6" + } + }, + "type": "json", + "userCanEdit": true, + "adminOnly": false + }, + { + "key": "_onDemand", + "name": "On-demand only", + "description": "If checked, the integration will only run when an On-demand request is made (i.e., Search my clipboard) and will not run in other modes.", + "default": false, + "type": "boolean", + "userCanEdit": true, + "adminOnly": false + }, + { + "key": "countryBlacklist", + "name": "Country Block List", + "description": "A block list of countries to hide results from (i.e., no results will be shown for selected countries). You cannot provide both a Country Blacklist and a Country Whitelist.", + "default": [], + "type": "select", + "options": [ + { + "value": "AD", + "display": "Andorra" + }, + { + "value": "AE", + "display": "United Arab Emirates" + }, + { + "value": "AF", + "display": "Afghanistan" + }, + { + "value": "AG", + "display": "Antigua and Barbuda" + }, + { + "value": "AI", + "display": "Anguilla" + }, + { + "value": "AL", + "display": "Albania" + }, + { + "value": "AM", + "display": "Armenia" + }, + { + "value": "AO", + "display": "Angola" + }, + { + "value": "AP", + "display": "Asia/Pacific Region" + }, + { + "value": "AQ", + "display": "Antarctica" + }, + { + "value": "AR", + "display": "Argentina" + }, + { + "value": "AS", + "display": "American Samoa" + }, + { + "value": "AT", + "display": "Austria" + }, + { + "value": "AU", + "display": "Australia" + }, + { + "value": "AW", + "display": "Aruba" + }, + { + "value": "AX", + "display": "Aland Islands" + }, + { + "value": "AZ", + "display": "Azerbaijan" + }, + { + "value": "BA", + "display": "Bosnia and Herzegovina" + }, + { + "value": "BB", + "display": "Barbados" + }, + { + "value": "BD", + "display": "Bangladesh" + }, + { + "value": "BE", + "display": "Belgium" + }, + { + "value": "BF", + "display": "Burkina Faso" + }, + { + "value": "BG", + "display": "Bulgaria" + }, + { + "value": "BH", + "display": "Bahrain" + }, + { + "value": "BI", + "display": "Burundi" + }, + { + "value": "BJ", + "display": "Benin" + }, + { + "value": "BL", + "display": "Saint Barthelemey" + }, + { + "value": "BM", + "display": "Bermuda" + }, + { + "value": "BN", + "display": "Brunei Darussalam" + }, + { + "value": "BO", + "display": "Bolivia" + }, + { + "value": "BQ", + "display": "Bonaire, Saint Eustatius and Saba" + }, + { + "value": "BR", + "display": "Brazil" + }, + { + "value": "BS", + "display": "Bahamas" + }, + { + "value": "BT", + "display": "Bhutan" + }, + { + "value": "BV", + "display": "Bouvet Island" + }, + { + "value": "BW", + "display": "Botswana" + }, + { + "value": "BY", + "display": "Belarus" + }, + { + "value": "BZ", + "display": "Belize" + }, + { + "value": "CA", + "display": "Canada" + }, + { + "value": "CC", + "display": "Cocos (Keeling) Islands" + }, + { + "value": "CD", + "display": "Congo, The Democratic Republic of the" + }, + { + "value": "CF", + "display": "Central African Republic" + }, + { + "value": "CG", + "display": "Congo" + }, + { + "value": "CH", + "display": "Switzerland" + }, + { + "value": "CI", + "display": "Cote d'Ivoire" + }, + { + "value": "CK", + "display": "Cook Islands" + }, + { + "value": "CL", + "display": "Chile" + }, + { + "value": "CM", + "display": "Cameroon" + }, + { + "value": "CN", + "display": "China" + }, + { + "value": "CO", + "display": "Colombia" + }, + { + "value": "CR", + "display": "Costa Rica" + }, + { + "value": "CU", + "display": "Cuba" + }, + { + "value": "CV", + "display": "Cape Verde" + }, + { + "value": "CW", + "display": "Curacao" + }, + { + "value": "CX", + "display": "Christmas Island" + }, + { + "value": "CY", + "display": "Cyprus" + }, + { + "value": "CZ", + "display": "Czech Republic" + }, + { + "value": "DE", + "display": "Germany" + }, + { + "value": "DJ", + "display": "Djibouti" + }, + { + "value": "DK", + "display": "Denmark" + }, + { + "value": "DM", + "display": "Dominica" + }, + { + "value": "DO", + "display": "Dominican Republic" + }, + { + "value": "DZ", + "display": "Algeria" + }, + { + "value": "EC", + "display": "Ecuador" + }, + { + "value": "EE", + "display": "Estonia" + }, + { + "value": "EG", + "display": "Egypt" + }, + { + "value": "EH", + "display": "Western Sahara" + }, + { + "value": "ER", + "display": "Eritrea" + }, + { + "value": "ES", + "display": "Spain" + }, + { + "value": "ET", + "display": "Ethiopia" + }, + { + "value": "EU", + "display": "Europe" + }, + { + "value": "FI", + "display": "Finland" + }, + { + "value": "FJ", + "display": "Fiji" + }, + { + "value": "FK", + "display": "Falkland Islands (Malvinas)" + }, + { + "value": "FM", + "display": "Micronesia, Federated States of" + }, + { + "value": "FO", + "display": "Faroe Islands" + }, + { + "value": "FR", + "display": "France" + }, + { + "value": "GA", + "display": "Gabon" + }, + { + "value": "GB", + "display": "United Kingdom" + }, + { + "value": "GD", + "display": "Grenada" + }, + { + "value": "GE", + "display": "Georgia" + }, + { + "value": "GF", + "display": "French Guiana" + }, + { + "value": "GG", + "display": "Guernsey" + }, + { + "value": "GH", + "display": "Ghana" + }, + { + "value": "GI", + "display": "Gibraltar" + }, + { + "value": "GL", + "display": "Greenland" + }, + { + "value": "GM", + "display": "Gambia" + }, + { + "value": "GN", + "display": "Guinea" + }, + { + "value": "GP", + "display": "Guadeloupe" + }, + { + "value": "GQ", + "display": "Equatorial Guinea" + }, + { + "value": "GR", + "display": "Greece" + }, + { + "value": "GS", + "display": "South Georgia and the South Sandwich Islands" + }, + { + "value": "GT", + "display": "Guatemala" + }, + { + "value": "GU", + "display": "Guam" + }, + { + "value": "GW", + "display": "Guinea-Bissau" + }, + { + "value": "GY", + "display": "Guyana" + }, + { + "value": "HK", + "display": "Hong Kong" + }, + { + "value": "HM", + "display": "Heard Island and McDonald Islands" + }, + { + "value": "HN", + "display": "Honduras" + }, + { + "value": "HR", + "display": "Croatia" + }, + { + "value": "HT", + "display": "Haiti" + }, + { + "value": "HU", + "display": "Hungary" + }, + { + "value": "ID", + "display": "Indonesia" + }, + { + "value": "IE", + "display": "Ireland" + }, + { + "value": "IL", + "display": "Israel" + }, + { + "value": "IM", + "display": "Isle of Man" + }, + { + "value": "IN", + "display": "India" + }, + { + "value": "IO", + "display": "British Indian Ocean Territory" + }, + { + "value": "IQ", + "display": "Iraq" + }, + { + "value": "IR", + "display": "Iran, Islamic Republic of" + }, + { + "value": "IS", + "display": "Iceland" + }, + { + "value": "IT", + "display": "Italy" + }, + { + "value": "JE", + "display": "Jersey" + }, + { + "value": "JM", + "display": "Jamaica" + }, + { + "value": "JO", + "display": "Jordan" + }, + { + "value": "JP", + "display": "Japan" + }, + { + "value": "KE", + "display": "Kenya" + }, + { + "value": "KG", + "display": "Kyrgyzstan" + }, + { + "value": "KH", + "display": "Cambodia" + }, + { + "value": "KI", + "display": "Kiribati" + }, + { + "value": "KM", + "display": "Comoros" + }, + { + "value": "KN", + "display": "Saint Kitts and Nevis" + }, + { + "value": "KP", + "display": "Korea, Democratic People's Republic of" + }, + { + "value": "KR", + "display": "Korea, Republic of" + }, + { + "value": "KW", + "display": "Kuwait" + }, + { + "value": "KY", + "display": "Cayman Islands" + }, + { + "value": "KZ", + "display": "Kazakhstan" + }, + { + "value": "LA", + "display": "Lao People's Democratic Republic" + }, + { + "value": "LB", + "display": "Lebanon" + }, + { + "value": "LC", + "display": "Saint Lucia" + }, + { + "value": "LI", + "display": "Liechtenstein" + }, + { + "value": "LK", + "display": "Sri Lanka" + }, + { + "value": "LR", + "display": "Liberia" + }, + { + "value": "LS", + "display": "Lesotho" + }, + { + "value": "LT", + "display": "Lithuania" + }, + { + "value": "LU", + "display": "Luxembourg" + }, + { + "value": "LV", + "display": "Latvia" + }, + { + "value": "LY", + "display": "Libyan Arab Jamahiriya" + }, + { + "value": "MA", + "display": "Morocco" + }, + { + "value": "MC", + "display": "Monaco" + }, + { + "value": "MD", + "display": "Moldova, Republic of" + }, + { + "value": "ME", + "display": "Montenegro" + }, + { + "value": "MF", + "display": "Saint Martin" + }, + { + "value": "MG", + "display": "Madagascar" + }, + { + "value": "MH", + "display": "Marshall Islands" + }, + { + "value": "MK", + "display": "Macedonia" + }, + { + "value": "ML", + "display": "Mali" + }, + { + "value": "MM", + "display": "Myanmar" + }, + { + "value": "MN", + "display": "Mongolia" + }, + { + "value": "MO", + "display": "Macao" + }, + { + "value": "MP", + "display": "Northern Mariana Islands" + }, + { + "value": "MQ", + "display": "Martinique" + }, + { + "value": "MR", + "display": "Mauritania" + }, + { + "value": "MS", + "display": "Montserrat" + }, + { + "value": "MT", + "display": "Malta" + }, + { + "value": "MU", + "display": "Mauritius" + }, + { + "value": "MV", + "display": "Maldives" + }, + { + "value": "MW", + "display": "Malawi" + }, + { + "value": "MX", + "display": "Mexico" + }, + { + "value": "MY", + "display": "Malaysia" + }, + { + "value": "MZ", + "display": "Mozambique" + }, + { + "value": "NA", + "display": "Namibia" + }, + { + "value": "NC", + "display": "New Caledonia" + }, + { + "value": "NE", + "display": "Niger" + }, + { + "value": "NF", + "display": "Norfolk Island" + }, + { + "value": "NG", + "display": "Nigeria" + }, + { + "value": "NI", + "display": "Nicaragua" + }, + { + "value": "NL", + "display": "Netherlands" + }, + { + "value": "NO", + "display": "Norway" + }, + { + "value": "NP", + "display": "Nepal" + }, + { + "value": "NR", + "display": "Nauru" + }, + { + "value": "NU", + "display": "Niue" + }, + { + "value": "NZ", + "display": "New Zealand" + }, + { + "value": "OM", + "display": "Oman" + }, + { + "value": "PA", + "display": "Panama" + }, + { + "value": "PE", + "display": "Peru" + }, + { + "value": "PF", + "display": "French Polynesia" + }, + { + "value": "PG", + "display": "Papua New Guinea" + }, + { + "value": "PH", + "display": "Philippines" + }, + { + "value": "PK", + "display": "Pakistan" + }, + { + "value": "PL", + "display": "Poland" + }, + { + "value": "PM", + "display": "Saint Pierre and Miquelon" + }, + { + "value": "PN", + "display": "Pitcairn" + }, + { + "value": "PR", + "display": "Puerto Rico" + }, + { + "value": "PS", + "display": "Palestinian Territory" + }, + { + "value": "PT", + "display": "Portugal" + }, + { + "value": "PW", + "display": "Palau" + }, + { + "value": "PY", + "display": "Paraguay" + }, + { + "value": "QA", + "display": "Qatar" + }, + { + "value": "RE", + "display": "Reunion" + }, + { + "value": "RO", + "display": "Romania" + }, + { + "value": "RS", + "display": "Serbia" + }, + { + "value": "RU", + "display": "Russian Federation" + }, + { + "value": "RW", + "display": "Rwanda" + }, + { + "value": "SA", + "display": "Saudi Arabia" + }, + { + "value": "SB", + "display": "Solomon Islands" + }, + { + "value": "SC", + "display": "Seychelles" + }, + { + "value": "SD", + "display": "Sudan" + }, + { + "value": "SE", + "display": "Sweden" + }, + { + "value": "SG", + "display": "Singapore" + }, + { + "value": "SH", + "display": "Saint Helena" + }, + { + "value": "SI", + "display": "Slovenia" + }, + { + "value": "SJ", + "display": "Svalbard and Jan Mayen" + }, + { + "value": "SK", + "display": "Slovakia" + }, + { + "value": "SL", + "display": "Sierra Leone" + }, + { + "value": "SM", + "display": "San Marino" + }, + { + "value": "SN", + "display": "Senegal" + }, + { + "value": "SO", + "display": "Somalia" + }, + { + "value": "SR", + "display": "Suriname" + }, + { + "value": "SS", + "display": "South Sudan" + }, + { + "value": "ST", + "display": "Sao Tome and Principe" + }, + { + "value": "SV", + "display": "El Salvador" + }, + { + "value": "SX", + "display": "Sint Maarten" + }, + { + "value": "SY", + "display": "Syrian Arab Republic" + }, + { + "value": "SZ", + "display": "Swaziland" + }, + { + "value": "TC", + "display": "Turks and Caicos Islands" + }, + { + "value": "TD", + "display": "Chad" + }, + { + "value": "TF", + "display": "French Southern Territories" + }, + { + "value": "TG", + "display": "Togo" + }, + { + "value": "TH", + "display": "Thailand" + }, + { + "value": "TJ", + "display": "Tajikistan" + }, + { + "value": "TK", + "display": "Tokelau" + }, + { + "value": "TL", + "display": "Timor-Leste" + }, + { + "value": "TM", + "display": "Turkmenistan" + }, + { + "value": "TN", + "display": "Tunisia" + }, + { + "value": "TO", + "display": "Tonga" + }, + { + "value": "TR", + "display": "Turkey" + }, + { + "value": "TT", + "display": "Trinidad and Tobago" + }, + { + "value": "TV", + "display": "Tuvalu" + }, + { + "value": "TW", + "display": "Taiwan" + }, + { + "value": "TZ", + "display": "Tanzania, United Republic of" + }, + { + "value": "UA", + "display": "Ukraine" + }, + { + "value": "UG", + "display": "Uganda" + }, + { + "value": "UM", + "display": "United States Minor Outlying Islands" + }, + { + "value": "US", + "display": "United States" + }, + { + "value": "UY", + "display": "Uruguay" + }, + { + "value": "UZ", + "display": "Uzbekistan" + }, + { + "value": "VA", + "display": "Holy See (Vatican City State)" + }, + { + "value": "VC", + "display": "Saint Vincent and the Grenadines" + }, + { + "value": "VE", + "display": "Venezuela" + }, + { + "value": "VG", + "display": "Virgin Islands, British" + }, + { + "value": "VI", + "display": "Virgin Islands, U.S." + }, + { + "value": "VN", + "display": "Vietnam" + }, + { + "value": "VU", + "display": "Vanuatu" + }, + { + "value": "WF", + "display": "Wallis and Futuna" + }, + { + "value": "WS", + "display": "Samoa" + }, + { + "value": "YE", + "display": "Yemen" + }, + { + "value": "YT", + "display": "Mayotte" + }, + { + "value": "ZA", + "display": "South Africa" + }, + { + "value": "ZM", + "display": "Zambia" + }, + { + "value": "ZW", + "display": "Zimbabwe" + } + ], + "multiple": true, + "userCanEdit": true, + "adminOnly": false + }, + { + "key": "countryWhitelist", + "name": "Country Allow List", + "description": "An allow list of countries that results should be shown for (i.e., results will only be shown for selected countries). You cannot provide both a Country Blacklist and a Country Whitelist.", + "default": [], + "type": "select", + "options": [ + { + "value": "AD", + "display": "Andorra" + }, + { + "value": "AE", + "display": "United Arab Emirates" + }, + { + "value": "AF", + "display": "Afghanistan" + }, + { + "value": "AG", + "display": "Antigua and Barbuda" + }, + { + "value": "AI", + "display": "Anguilla" + }, + { + "value": "AL", + "display": "Albania" + }, + { + "value": "AM", + "display": "Armenia" + }, + { + "value": "AO", + "display": "Angola" + }, + { + "value": "AP", + "display": "Asia/Pacific Region" + }, + { + "value": "AQ", + "display": "Antarctica" + }, + { + "value": "AR", + "display": "Argentina" + }, + { + "value": "AS", + "display": "American Samoa" + }, + { + "value": "AT", + "display": "Austria" + }, + { + "value": "AU", + "display": "Australia" + }, + { + "value": "AW", + "display": "Aruba" + }, + { + "value": "AX", + "display": "Aland Islands" + }, + { + "value": "AZ", + "display": "Azerbaijan" + }, + { + "value": "BA", + "display": "Bosnia and Herzegovina" + }, + { + "value": "BB", + "display": "Barbados" + }, + { + "value": "BD", + "display": "Bangladesh" + }, + { + "value": "BE", + "display": "Belgium" + }, + { + "value": "BF", + "display": "Burkina Faso" + }, + { + "value": "BG", + "display": "Bulgaria" + }, + { + "value": "BH", + "display": "Bahrain" + }, + { + "value": "BI", + "display": "Burundi" + }, + { + "value": "BJ", + "display": "Benin" + }, + { + "value": "BL", + "display": "Saint Barthelemey" + }, + { + "value": "BM", + "display": "Bermuda" + }, + { + "value": "BN", + "display": "Brunei Darussalam" + }, + { + "value": "BO", + "display": "Bolivia" + }, + { + "value": "BQ", + "display": "Bonaire, Saint Eustatius and Saba" + }, + { + "value": "BR", + "display": "Brazil" + }, + { + "value": "BS", + "display": "Bahamas" + }, + { + "value": "BT", + "display": "Bhutan" + }, + { + "value": "BV", + "display": "Bouvet Island" + }, + { + "value": "BW", + "display": "Botswana" + }, + { + "value": "BY", + "display": "Belarus" + }, + { + "value": "BZ", + "display": "Belize" + }, + { + "value": "CA", + "display": "Canada" + }, + { + "value": "CC", + "display": "Cocos (Keeling) Islands" + }, + { + "value": "CD", + "display": "Congo, The Democratic Republic of the" + }, + { + "value": "CF", + "display": "Central African Republic" + }, + { + "value": "CG", + "display": "Congo" + }, + { + "value": "CH", + "display": "Switzerland" + }, + { + "value": "CI", + "display": "Cote d'Ivoire" + }, + { + "value": "CK", + "display": "Cook Islands" + }, + { + "value": "CL", + "display": "Chile" + }, + { + "value": "CM", + "display": "Cameroon" + }, + { + "value": "CN", + "display": "China" + }, + { + "value": "CO", + "display": "Colombia" + }, + { + "value": "CR", + "display": "Costa Rica" + }, + { + "value": "CU", + "display": "Cuba" + }, + { + "value": "CV", + "display": "Cape Verde" + }, + { + "value": "CW", + "display": "Curacao" + }, + { + "value": "CX", + "display": "Christmas Island" + }, + { + "value": "CY", + "display": "Cyprus" + }, + { + "value": "CZ", + "display": "Czech Republic" + }, + { + "value": "DE", + "display": "Germany" + }, + { + "value": "DJ", + "display": "Djibouti" + }, + { + "value": "DK", + "display": "Denmark" + }, + { + "value": "DM", + "display": "Dominica" + }, + { + "value": "DO", + "display": "Dominican Republic" + }, + { + "value": "DZ", + "display": "Algeria" + }, + { + "value": "EC", + "display": "Ecuador" + }, + { + "value": "EE", + "display": "Estonia" + }, + { + "value": "EG", + "display": "Egypt" + }, + { + "value": "EH", + "display": "Western Sahara" + }, + { + "value": "ER", + "display": "Eritrea" + }, + { + "value": "ES", + "display": "Spain" + }, + { + "value": "ET", + "display": "Ethiopia" + }, + { + "value": "EU", + "display": "Europe" + }, + { + "value": "FI", + "display": "Finland" + }, + { + "value": "FJ", + "display": "Fiji" + }, + { + "value": "FK", + "display": "Falkland Islands (Malvinas)" + }, + { + "value": "FM", + "display": "Micronesia, Federated States of" + }, + { + "value": "FO", + "display": "Faroe Islands" + }, + { + "value": "FR", + "display": "France" + }, + { + "value": "GA", + "display": "Gabon" + }, + { + "value": "GB", + "display": "United Kingdom" + }, + { + "value": "GD", + "display": "Grenada" + }, + { + "value": "GE", + "display": "Georgia" + }, + { + "value": "GF", + "display": "French Guiana" + }, + { + "value": "GG", + "display": "Guernsey" + }, + { + "value": "GH", + "display": "Ghana" + }, + { + "value": "GI", + "display": "Gibraltar" + }, + { + "value": "GL", + "display": "Greenland" + }, + { + "value": "GM", + "display": "Gambia" + }, + { + "value": "GN", + "display": "Guinea" + }, + { + "value": "GP", + "display": "Guadeloupe" + }, + { + "value": "GQ", + "display": "Equatorial Guinea" + }, + { + "value": "GR", + "display": "Greece" + }, + { + "value": "GS", + "display": "South Georgia and the South Sandwich Islands" + }, + { + "value": "GT", + "display": "Guatemala" + }, + { + "value": "GU", + "display": "Guam" + }, + { + "value": "GW", + "display": "Guinea-Bissau" + }, + { + "value": "GY", + "display": "Guyana" + }, + { + "value": "HK", + "display": "Hong Kong" + }, + { + "value": "HM", + "display": "Heard Island and McDonald Islands" + }, + { + "value": "HN", + "display": "Honduras" + }, + { + "value": "HR", + "display": "Croatia" + }, + { + "value": "HT", + "display": "Haiti" + }, + { + "value": "HU", + "display": "Hungary" + }, + { + "value": "ID", + "display": "Indonesia" + }, + { + "value": "IE", + "display": "Ireland" + }, + { + "value": "IL", + "display": "Israel" + }, + { + "value": "IM", + "display": "Isle of Man" + }, + { + "value": "IN", + "display": "India" + }, + { + "value": "IO", + "display": "British Indian Ocean Territory" + }, + { + "value": "IQ", + "display": "Iraq" + }, + { + "value": "IR", + "display": "Iran, Islamic Republic of" + }, + { + "value": "IS", + "display": "Iceland" + }, + { + "value": "IT", + "display": "Italy" + }, + { + "value": "JE", + "display": "Jersey" + }, + { + "value": "JM", + "display": "Jamaica" + }, + { + "value": "JO", + "display": "Jordan" + }, + { + "value": "JP", + "display": "Japan" + }, + { + "value": "KE", + "display": "Kenya" + }, + { + "value": "KG", + "display": "Kyrgyzstan" + }, + { + "value": "KH", + "display": "Cambodia" + }, + { + "value": "KI", + "display": "Kiribati" + }, + { + "value": "KM", + "display": "Comoros" + }, + { + "value": "KN", + "display": "Saint Kitts and Nevis" + }, + { + "value": "KP", + "display": "Korea, Democratic People's Republic of" + }, + { + "value": "KR", + "display": "Korea, Republic of" + }, + { + "value": "KW", + "display": "Kuwait" + }, + { + "value": "KY", + "display": "Cayman Islands" + }, + { + "value": "KZ", + "display": "Kazakhstan" + }, + { + "value": "LA", + "display": "Lao People's Democratic Republic" + }, + { + "value": "LB", + "display": "Lebanon" + }, + { + "value": "LC", + "display": "Saint Lucia" + }, + { + "value": "LI", + "display": "Liechtenstein" + }, + { + "value": "LK", + "display": "Sri Lanka" + }, + { + "value": "LR", + "display": "Liberia" + }, + { + "value": "LS", + "display": "Lesotho" + }, + { + "value": "LT", + "display": "Lithuania" + }, + { + "value": "LU", + "display": "Luxembourg" + }, + { + "value": "LV", + "display": "Latvia" + }, + { + "value": "LY", + "display": "Libyan Arab Jamahiriya" + }, + { + "value": "MA", + "display": "Morocco" + }, + { + "value": "MC", + "display": "Monaco" + }, + { + "value": "MD", + "display": "Moldova, Republic of" + }, + { + "value": "ME", + "display": "Montenegro" + }, + { + "value": "MF", + "display": "Saint Martin" + }, + { + "value": "MG", + "display": "Madagascar" + }, + { + "value": "MH", + "display": "Marshall Islands" + }, + { + "value": "MK", + "display": "Macedonia" + }, + { + "value": "ML", + "display": "Mali" + }, + { + "value": "MM", + "display": "Myanmar" + }, + { + "value": "MN", + "display": "Mongolia" + }, + { + "value": "MO", + "display": "Macao" + }, + { + "value": "MP", + "display": "Northern Mariana Islands" + }, + { + "value": "MQ", + "display": "Martinique" + }, + { + "value": "MR", + "display": "Mauritania" + }, + { + "value": "MS", + "display": "Montserrat" + }, + { + "value": "MT", + "display": "Malta" + }, + { + "value": "MU", + "display": "Mauritius" + }, + { + "value": "MV", + "display": "Maldives" + }, + { + "value": "MW", + "display": "Malawi" + }, + { + "value": "MX", + "display": "Mexico" + }, + { + "value": "MY", + "display": "Malaysia" + }, + { + "value": "MZ", + "display": "Mozambique" + }, + { + "value": "NA", + "display": "Namibia" + }, + { + "value": "NC", + "display": "New Caledonia" + }, + { + "value": "NE", + "display": "Niger" + }, + { + "value": "NF", + "display": "Norfolk Island" + }, + { + "value": "NG", + "display": "Nigeria" + }, + { + "value": "NI", + "display": "Nicaragua" + }, + { + "value": "NL", + "display": "Netherlands" + }, + { + "value": "NO", + "display": "Norway" + }, + { + "value": "NP", + "display": "Nepal" + }, + { + "value": "NR", + "display": "Nauru" + }, + { + "value": "NU", + "display": "Niue" + }, + { + "value": "NZ", + "display": "New Zealand" + }, + { + "value": "OM", + "display": "Oman" + }, + { + "value": "PA", + "display": "Panama" + }, + { + "value": "PE", + "display": "Peru" + }, + { + "value": "PF", + "display": "French Polynesia" + }, + { + "value": "PG", + "display": "Papua New Guinea" + }, + { + "value": "PH", + "display": "Philippines" + }, + { + "value": "PK", + "display": "Pakistan" + }, + { + "value": "PL", + "display": "Poland" + }, + { + "value": "PM", + "display": "Saint Pierre and Miquelon" + }, + { + "value": "PN", + "display": "Pitcairn" + }, + { + "value": "PR", + "display": "Puerto Rico" + }, + { + "value": "PS", + "display": "Palestinian Territory" + }, + { + "value": "PT", + "display": "Portugal" + }, + { + "value": "PW", + "display": "Palau" + }, + { + "value": "PY", + "display": "Paraguay" + }, + { + "value": "QA", + "display": "Qatar" + }, + { + "value": "RE", + "display": "Reunion" + }, + { + "value": "RO", + "display": "Romania" + }, + { + "value": "RS", + "display": "Serbia" + }, + { + "value": "RU", + "display": "Russian Federation" + }, + { + "value": "RW", + "display": "Rwanda" + }, + { + "value": "SA", + "display": "Saudi Arabia" + }, + { + "value": "SB", + "display": "Solomon Islands" + }, + { + "value": "SC", + "display": "Seychelles" + }, + { + "value": "SD", + "display": "Sudan" + }, + { + "value": "SE", + "display": "Sweden" + }, + { + "value": "SG", + "display": "Singapore" + }, + { + "value": "SH", + "display": "Saint Helena" + }, + { + "value": "SI", + "display": "Slovenia" + }, + { + "value": "SJ", + "display": "Svalbard and Jan Mayen" + }, + { + "value": "SK", + "display": "Slovakia" + }, + { + "value": "SL", + "display": "Sierra Leone" + }, + { + "value": "SM", + "display": "San Marino" + }, + { + "value": "SN", + "display": "Senegal" + }, + { + "value": "SO", + "display": "Somalia" + }, + { + "value": "SR", + "display": "Suriname" + }, + { + "value": "SS", + "display": "South Sudan" + }, + { + "value": "ST", + "display": "Sao Tome and Principe" + }, + { + "value": "SV", + "display": "El Salvador" + }, + { + "value": "SX", + "display": "Sint Maarten" + }, + { + "value": "SY", + "display": "Syrian Arab Republic" + }, + { + "value": "SZ", + "display": "Swaziland" + }, + { + "value": "TC", + "display": "Turks and Caicos Islands" + }, + { + "value": "TD", + "display": "Chad" + }, + { + "value": "TF", + "display": "French Southern Territories" + }, + { + "value": "TG", + "display": "Togo" + }, + { + "value": "TH", + "display": "Thailand" + }, + { + "value": "TJ", + "display": "Tajikistan" + }, + { + "value": "TK", + "display": "Tokelau" + }, + { + "value": "TL", + "display": "Timor-Leste" + }, + { + "value": "TM", + "display": "Turkmenistan" + }, + { + "value": "TN", + "display": "Tunisia" + }, + { + "value": "TO", + "display": "Tonga" + }, + { + "value": "TR", + "display": "Turkey" + }, + { + "value": "TT", + "display": "Trinidad and Tobago" + }, + { + "value": "TV", + "display": "Tuvalu" + }, + { + "value": "TW", + "display": "Taiwan" + }, + { + "value": "TZ", + "display": "Tanzania, United Republic of" + }, + { + "value": "UA", + "display": "Ukraine" + }, + { + "value": "UG", + "display": "Uganda" + }, + { + "value": "UM", + "display": "United States Minor Outlying Islands" + }, + { + "value": "US", + "display": "United States" + }, + { + "value": "UY", + "display": "Uruguay" + }, + { + "value": "UZ", + "display": "Uzbekistan" + }, + { + "value": "VA", + "display": "Holy See (Vatican City State)" + }, + { + "value": "VC", + "display": "Saint Vincent and the Grenadines" + }, + { + "value": "VE", + "display": "Venezuela" + }, + { + "value": "VG", + "display": "Virgin Islands, British" + }, + { + "value": "VI", + "display": "Virgin Islands, U.S." + }, + { + "value": "VN", + "display": "Vietnam" + }, + { + "value": "VU", + "display": "Vanuatu" + }, + { + "value": "WF", + "display": "Wallis and Futuna" + }, + { + "value": "WS", + "display": "Samoa" + }, + { + "value": "YE", + "display": "Yemen" + }, + { + "value": "YT", + "display": "Mayotte" + }, + { + "value": "ZA", + "display": "South Africa" + }, + { + "value": "ZM", + "display": "Zambia" + }, + { + "value": "ZW", + "display": "Zimbabwe" + } + ], + "multiple": true, + "userCanEdit": true, + "adminOnly": false + }, + { + "key": "fullResultsForOnDemand", + "name": "Return all Countries for On-Demand Lookups", + "description": "If checked, the integration will return results for all countries when an On-demand search is run (i.e., Country Whitelist and Country Blacklist settings will be ignored for On-Demand lookups).", + "default": false, + "type": "boolean", + "userCanEdit": true, + "adminOnly": false + }, + { + "key": "showFullCountryName", + "name": "Show Full Country Name in Summary", + "description": "If checked, integration will always display the full country name rather than just the country ISO Code in the MaxMind notification summary", + "default": true, + "type": "boolean", + "userCanEdit": true, + "adminOnly": false + }, + { + "key": "showState", + "name": "Show State in Summary", + "description": "If checked, the integration will display the state or subdivision information when available in the MaxMind notification summary", + "default": true, + "type": "boolean", + "userCanEdit": true, + "adminOnly": false + }, + { + "key": "showAsnTag", + "name": "Show ASN and Org Info in Summary", + "description": "If checked, the integration will display the ASN and organization information as a summary tag", + "default": true, + "type": "boolean", + "userCanEdit": true, + "adminOnly": false + } + ] +} \ No newline at end of file diff --git a/database/GeoLite2-ASN.mmdb b/database/GeoLite2-ASN.mmdb index 847e45c..9ec7a6d 100644 Binary files a/database/GeoLite2-ASN.mmdb and b/database/GeoLite2-ASN.mmdb differ diff --git a/database/GeoLite2-City.mmdb b/database/GeoLite2-City.mmdb index a9c60fb..74651c7 100644 Binary files a/database/GeoLite2-City.mmdb and b/database/GeoLite2-City.mmdb differ diff --git a/integration.js b/integration.js index 9d22d6a..7e6e1a8 100644 --- a/integration.js +++ b/integration.js @@ -3,45 +3,32 @@ const async = require('async'); const config = require('./config/config'); const maxmind = require('maxmind'); -const ipaddr = require('ipaddr.js'); -const cloneDeep = require('lodash.clonedeep'); let Logger; let cityLookup = null; let asnLookup = null; -let startupErr = null; function startup(logger) { Logger = logger; - maxmind.open(config.settings.geoLite2CityDatabasePath, (err, lookup) => { - if (err) { - startupErr = err; - } else { - cityLookup = lookup; + return async function (cb) { + try { + cityLookup = await maxmind.open(config.settings.geoLite2CityDatabasePath); + asnLookup = await maxmind.open(config.settings.geoLite2AsnDatabasePath); + cb(null); + } catch (error) { + Logger.error(error, 'Error loading maxmind databases'); + cb(parseErrorToReadableJSON(error)); } - }); - - maxmind.open(config.settings.geoLite2AsnDatabasePath, (err, lookup) => { - if (err) { - startupErr = err; - } else { - asnLookup = lookup; - } - }); + }; } +const parseErrorToReadableJSON = (error) => JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error))); + function doLookup(entities, options, cb) { let lookupResults = []; - Logger.trace({entities, options}, 'doLookup'); - - if (startupErr) { - Logger.error({ startupError: startupErr }, 'Error loading maxmind databases'); - cb(startupErr); - startupErr = null; - return; - } + Logger.trace({ entities, options }, 'doLookup'); if (asnLookup === null || cityLookup === null) { // can't do lookup yet because we are still loading the databases @@ -56,16 +43,16 @@ function doLookup(entities, options, cb) { async.each( entities, - function(entity, next) { - if (ipaddr.isValid(entity.value)) { - _lookupIp(entity, countryBlacklist, countryWhitelist, options, function(err, result) { + function (entity, next) { + if (maxmind.validate(entity.value)) { + _lookupIp(entity, countryBlacklist, countryWhitelist, options, function (err, result) { if (err) { next(err); return; } if (result) { - lookupResults.push(cloneDeep(result)); + lookupResults.push(result); } next(null); @@ -74,7 +61,7 @@ function doLookup(entities, options, cb) { next(null); } }, - function(err) { + function (err) { if (err) { cb(err); } else { @@ -84,26 +71,6 @@ function doLookup(entities, options, cb) { ); } -/** - * Given an IP address and routingPrefix returns the CIDR network for that IP. - * - * @param address - * @param routingPrefix - * @returns {string} - * @private - */ -function _getNetworkAddress(address, routingPrefix) { - let bytes = ipaddr.parse(address).toByteArray(); - for (let i = routingPrefix; i < bytes.length * 8; ++i) { - bytes[Math.floor(i / 8)] &= ~(0x80 >> i % 8); - } - - let network = ipaddr.fromByteArray(bytes).toString() + '/' + routingPrefix; - Logger.debug({ address: address, routingPrefix: routingPrefix, bytes: bytes, network: network }, 'Bytes'); - - return network; -} - function _createWhitelistLookup(options) { let whitelist = new Set(); options.countryWhitelist.forEach((country) => { @@ -121,7 +88,7 @@ function _createBlacklistLookup(options) { } function isCountryFiltered(countryIsoCode, countryBlacklist, countryWhitelist, entity, options) { - if(options.fullResultsForOnDemand && entity.requestContext.requestType === "OnDemand"){ + if (options.fullResultsForOnDemand && entity.requestContext.requestType === 'OnDemand') { return false; } @@ -149,8 +116,8 @@ function _getCountryCode(cityData) { } function _lookupIp(entityObj, countryBlacklist, countryWhitelist, options, cb) { - let cityData = cityLookup.getWithRoutingPrefix(entityObj.value); - let asnData = asnLookup.getWithRoutingPrefix(entityObj.value); + let cityData = cityLookup.get(entityObj.value); + let asnData = asnLookup.get(entityObj.value); Logger.debug({ maxmindCityResult: cityData }, 'City Data'); Logger.debug({ maxmindAsnResult: asnData }, 'ASN Data'); @@ -167,7 +134,6 @@ function _lookupIp(entityObj, countryBlacklist, countryWhitelist, options, cb) { Logger.trace({ isoCode: countryCode }, 'Checking data isocode'); if (!isCountryFiltered(countryCode, countryBlacklist, countryWhitelist, entityObj, options)) { cityData.asn = asnData; - cityData.network = _getNetworkAddress(entityObj.value, cityData.routingPrefix); Logger.trace({ cityData: cityData }, 'Checking city data'); cb(null, { // Required: This is the entity object passed into the integration doLookup method diff --git a/package-lock.json b/package-lock.json index 5ded4b5..19532c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,60 +1,32 @@ -{ - "name": "MaxMind", - "version": "3.3.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" - }, - "big-integer": { - "version": "1.6.51", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", - "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==" - }, - "ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "maxmind": { - "version": "git+https://github.com/polarityio/node-maxmind.git#904ff7bb26691b2b83fb88cad522a5b213b43438", - "from": "git+https://github.com/polarityio/node-maxmind.git#master", - "requires": { - "big-integer": "^1.6.22", - "lru-cache": "^4.0.2" - } - }, - "papaparse": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.3.2.tgz", - "integrity": "sha512-6dNZu0Ki+gyV0eBsFKJhYr+MdQYAzFUGlBMNj3GNrmHxmz1lfRa24CjFObPXtjcetlOv5Ad299MhIK0znp3afw==" - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - } - } -} +{ + "name": "MaxMind", + "version": "3.4.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + }, + "maxmind": { + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/maxmind/-/maxmind-4.3.8.tgz", + "integrity": "sha512-HrfxEu5yPBPtTy/OT+W5bPQwEfLUX0EHqe2EbJiB47xQMumHqXvSP7PAwzV8Z++NRCmQwy4moQrTSt0+dH+Jmg==", + "requires": { + "mmdb-lib": "2.0.2", + "tiny-lru": "9.0.3" + } + }, + "mmdb-lib": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mmdb-lib/-/mmdb-lib-2.0.2.tgz", + "integrity": "sha512-shi1I+fCPQonhTi7qyb6hr7hi87R7YS69FlfJiMFuJ12+grx0JyL56gLNzGTYXPU7EhAPkMLliGeyHer0K+AVA==" + }, + "tiny-lru": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-9.0.3.tgz", + "integrity": "sha512-/i9GruRjXsnDgehxvy6iZ4AFNVxngEFbwzirhdulomMNPGPVV3ECMZOWSw0w4sRMZ9Al9m4jy08GPvRxRUGYlw==" + } + } +} diff --git a/package.json b/package.json index 953eebc..a13aee1 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,11 @@ -{ - "main": "./integration.js", - "name": "MaxMind", - "description": "Polarity MaxMind Integration", - "version": "3.3.1", - "private": true, - "dependencies": { - "async": "^3.2.0", - "maxmind": "https://github.com/polarityio/node-maxmind.git#master", - "ipaddr.js": "^1.9.1", - "papaparse": "^5.1.1", - "lodash.clonedeep": "^4.5.0" - } -} +{ + "name": "MaxMind", + "version": "3.4.0", + "main": "./integration.js", + "description": "Polarity MaxMind Integration", + "private": true, + "dependencies": { + "async": "^3.2.0", + "maxmind": "^4.3.8" + } +} diff --git a/styles/maxmind.less b/styles/maxmind.less index 3ba669f..7632f9c 100644 --- a/styles/maxmind.less +++ b/styles/maxmind.less @@ -19,3 +19,46 @@ .words { word-break: break-word !important; } + +.copy-btn-container { + flex: 1 1 auto; + position: absolute; + right: 10px; + top: 7px; + + .copy-btn { + font-size: 12px; + padding: 0px; + height: 20px; + + :active { + color: darken(#388e3c, 5%); + } + } + + .copy-success-message { + position: absolute; + top: 20px; + right: 0px; + background-color: rgb(222, 226, 230); + min-width: max-content; + padding: 5px; + border-radius: 3px; + + .copy-success-icon { + color: #aaa; + } + + &.visible { + visibility: visible; + opacity: 1; + transition: opacity 0.25s linear; + } + + &.hidden { + visibility: hidden; + opacity: 0; + transition: visibility 0s 0.25s, opacity 0.25s linear; + } + } +} diff --git a/templates/maxmind-block.hbs b/templates/maxmind-block.hbs index f524ccb..8467555 100644 --- a/templates/maxmind-block.hbs +++ b/templates/maxmind-block.hbs @@ -1,93 +1,100 @@