diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2dfc270afdb..73b0b5252ab 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -152,6 +152,7 @@ /packages/radware @elastic/security-external-integrations /packages/redis @elastic/obs-service-integrations /packages/redisenterprise @elastic/obs-service-integrations +/packages/salesforce @elastic/obs-service-integrations /packages/santa @elastic/security-external-integrations /packages/security_detection_engine @elastic/protections /packages/sentinel_one @elastic/security-external-integrations diff --git a/packages/salesforce/_dev/build/build.yml b/packages/salesforce/_dev/build/build.yml new file mode 100644 index 00000000000..8d9e4bf7ac8 --- /dev/null +++ b/packages/salesforce/_dev/build/build.yml @@ -0,0 +1,3 @@ +dependencies: + ecs: + reference: git@v8.4.0 diff --git a/packages/salesforce/_dev/build/docs/README.md b/packages/salesforce/_dev/build/docs/README.md new file mode 100644 index 00000000000..d7bfca510c2 --- /dev/null +++ b/packages/salesforce/_dev/build/docs/README.md @@ -0,0 +1,169 @@ +# Salesforce Integration + +## Overview + +The Salesforce integration allows you to monitor a [Salesforce](https://www.salesforce.com/) instance. Salesforce is a customer relationship management (CRM) platform. It provides an ecosystem for businesses to manage marketing, sales, commerce, service, and IT teams from anywhere with one integrated CRM platform. + +Use the Salesforce integration to: +- Gain insights into login and other operational activities by the users of your organization. +- Create visualizations to monitor, measure and analyze the usage trend and key data, and derive business insights. +- Create alerts to reduce the MTTD and also the MTTR by referencing relevant logs when troubleshooting an issue. + +As an example, you can use the data from this integration to understand the activity patterns of users based on region or the distribution of users by license type. + +## Data streams + +The Salesforce integration collects log events using the REST API of Salesforce. + +**Logs** help you keep a record of events happening in Salesforce. +Log data streams collected by the Salesforce integration include [Login](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_eventlogfile_login.htm). + +Data streams: +- `login_rest`: Tracks login activity of users who log in to Salesforce. + +## Compatibility + +This integration has been tested against Salesforce `Spring '22 (v54.0) release`. + +In order to find out the Salesforce version of your Instance, see below: + +1. On the Home tab in Salesforce Classic, in the top right corner of the screen is a link to releases like `Summer '22`. This indicates your release. + +2. An alternative way to find out the version of Salesforce is by hitting the following URL: + - Format: (Salesforce Instance URL)/services/data + - Example: https://elastic1234-dev-ed.my.salesforce.com/services/data + +Example response: +```xml + + + + /services/data/v53.0 + 53.0 + + + + /services/data/v54.0 + 54.0 + + + + /services/data/v55.0 + 55.0 + + +``` +The last one on the list is the release of your instance. In the example above, the version is `Summer '22` i.e. `v55.0`. + +## Prerequisites + +You need Elasticsearch for storing and searching your data and Kibana for visualizing and managing it. +You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommended or self-manage the Elastic Stack on your own hardware. + +In your Salesforce instance, ensure that `API Enabled permission` is selected for the user profile. Follow the below steps to enable the same: + +1. Go to `Setup` > `Quick Find` > `Users`, and Click on `Users`. +2. Click on the profile link associated with the `User Account` used for data collection. +3. Search for `API Enabled` permission on the same page. In case it’s not present, search it under `System Permissions` and check if `API Enabled` privilege is selected. If not, enable it for data collection. + +## Set Up + +For step-by-step instructions on how to set up an integration, see the [Getting started](https://www.elastic.co/guide/en/welcome-to-elastic/current/getting-started-observability.html) guide. + +## Configuration + +You need the following information from your Salesforce instance to configure this integration in Elastic: + +### Salesforce Instance URL + +The instance your Salesforce Organization uses is indicated in the URL of your browser's address bar in Salesforce Classic. The value before 'salesforce.com' is your Salesforce Instance. + +Example URL: https://na9.salesforce.com/home/home.jsp + +In the above example, the value before 'salesforce.com' is your Salesforce Instance. In this example, the Salesforce Organization is located on NA9. + +The Salesforce Instance URL is: https://na9.salesforce.com + +In Salesforce Lightning, it is available under the user name in the “View Profile” tab. + +### Client Key and Client Secret for Authentication + +In order to use this integration, you need to create a new Salesforce Application using OAuth. Follow the steps below to create a connected application in Salesforce: + +1. Login to [Salesforce](https://login.salesforce.com/) with the same user credentials that you want to collect data with. +2. Click on Setup on the top right menu bar. On the Setup page search `App Manager` in the `Search Setup` search box at the top of the page, then select `App Manager`. +3. Click *New Connected App*. +4. Provide a name for the connected application. This will be displayed in the App Manager and on its App Launcher tile. +5. Enter the API name. The default is a version of the name without spaces. Only letters, numbers, and underscores are allowed. If the original app name contains any other characters, edit the default name. +6. Enter the contact email for Salesforce. +7. Under the API (Enable OAuth Settings) section of the page, select *Enable OAuth Settings*. +8. In the Callback URL enter the Instance URL (Please refer to `Salesforce Instance URL`) +9. Select the following OAuth scopes to apply to the connected app: + - Manage user data via APIs (api). + - Perform requests at any time (refresh_token, offline_access). + - (Optional) In case of data collection, if any permission issues arise, add the Full access (full) scope. +10. Select *Require Secret for the Web Server Flow* to require the app's client secret in exchange for an access token. +11. Select *Require Secret for Refresh Token Flow* to require the app's client secret in the authorization request of a refresh token and hybrid refresh token flow. +12. Click Save. It may take approximately 10 minutes for the changes to take effect. +13. Click Continue and then under API details click Manage Consumer Details, Verify the user account using Verification Code. +14. Copy `Consumer Key` and `Consumer Secret` from the Consumer Details section, which should be populated as value to Client ID and Client Secret respectively in the configuration. + +For more details on how to Create a Connected App refer to the salesforce documentation [here](https://help.salesforce.com/apex/HTViewHelpDoc?id=connected_app_create.htm). + +### Username + +User Id of the registered user in Salesforce. + +### Password + +Password used for authenticating the above user. + +## Additional Information + +Follow the steps below, in case you need to find the API version: + +1. Go to `Setup` > `Quick Find` > `Apex Classes`. +2. Click the `New` button. +3. Click the `Version Settings` tab. +4. Refer to the `Version` dropdown for the API Version number. + +## Validation + +After the integration is successfully configured, clicking on the Assets tab of the Salesforce Integration should display a list of available dashboards. Click on the dashboard available for your configured datastream. It should be populated with the required data. + +## Troubleshooting + +- In case of data ingestion if the user finds the following type of error logs: +``` +{ + "log.level": "error", + "@timestamp": "2022-11-24T12:59:36.835+0530", + "log.logger": "input.httpjson-cursor", + "log.origin": { + "[file.name](http://file.name/)": "compat/compat.go", + "file.line": 124 + }, + "message": "Input 'httpjson-cursor' failed with: input.go:130: input 8A049E17A5CA661D failed (id=8A049E17A5CA661D)\n\toauth2 client: error loading credentials using user and password: oauth2: cannot fetch token: 400 Bad Request\n\tResponse: {\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}", + "[service.name](http://service.name/)": "filebeat", + "id": "8A049E17A5CA661D", + "ecs.version": "1.6.0" +} +``` +Please check if the `API Enabled permission` is provided to the `profile` associated with the `username` used as part of the integration. +Please refer to the Prerequisites section above for more information. + +If the error continues follow these steps: + +1. Go to `Setup` > `Quick Find` > `Manage Connected Apps`. +2. Click on the Connected App name created by you to generate the client id and client secret (Refer to Client Key and Client Secret for Authentication) under the Master Label. +3. Click on Edit Policies, and select `Relax IP restrictions` from the dropdown for IP Relaxation. + +## Logs reference + +### Login Rest + +This is the `login_rest` data stream. It represents events containing details about your organization's user login history. + +{{event "login_rest"}} + +{{fields "login_rest"}} diff --git a/packages/salesforce/_dev/deploy/docker/docker-compose.yml b/packages/salesforce/_dev/deploy/docker/docker-compose.yml new file mode 100644 index 00000000000..8694c1084de --- /dev/null +++ b/packages/salesforce/_dev/deploy/docker/docker-compose.yml @@ -0,0 +1,15 @@ +version: '2.3' +services: + salesforce: + image: docker.elastic.co/observability/stream:v0.8.0 + hostname: salesforce + ports: + - 8010 + volumes: + - ./files:/files:ro + environment: + PORT: 8010 + command: + - http-server + - --addr=:8010 + - --config=/files/config.yml diff --git a/packages/salesforce/_dev/deploy/docker/files/config.yml b/packages/salesforce/_dev/deploy/docker/files/config.yml new file mode 100644 index 00000000000..cd5b3ca88e8 --- /dev/null +++ b/packages/salesforce/_dev/deploy/docker/files/config.yml @@ -0,0 +1,71 @@ +rules: + - path: /services/oauth2/token + methods: ["POST"] + responses: + - status_code: 200 + headers: + content-type: ['application/json'] + body: '{"access_token":"access_token","instance_url":"https://temporary-intance-url","id":"https://login.salesforce.com/id/temp_id/temp_token","token_type":"Bearer","issued_at":"1633689089545","signature":"signature"}' + - path: /services/data/v54.0/query + methods: ["GET"] + query_params: + q: ["SELECT Id,CreatedDate,LogDate,LogFile FROM EventLogFile WHERE Interval = 'Hourly' AND EventType = 'Login' ORDER BY LogDate ASC NULLS FIRST"] + responses: + - status_code: 200 + body: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"EventLogFile","url":"/services/data/v54.0/sobjects/EventLogFile/0AT5j00002GVrfnGAD"},"Id":"0AT5j00002GVrfnGAD","CreatedDate":"2022-09-14T21:43:41.000+0000","LogDate":"2022-09-13T00:00:00.000+0000","LogFile":"/services/data/v54.0/sobjects/EventLogFile/0AT5j00002GVrfnGAD/LogFile"}]}' + headers: + content-type: ["text/json"] + - path: /services/data/v54.0/query + methods: ["GET"] + query_params: + q: ["SELECT Action,CreatedByContext,CreatedById,CreatedByIssuer,CreatedDate,DelegateUser,Display,Id,ResponsibleNamespacePrefix,Section FROM SetupAuditTrail ORDER BY CreatedDate ASC NULLS FIRST"] + responses: + - status_code: 200 + body: '{"done":true,"records":[{"Action":"insertConnectedApplication","CreatedByContext":"Einstein","CreatedById":"0055j000000utlPAAQ","CreatedByIssuer":null,"CreatedDate":"2022-08-16T09:26:38.000+0000","DelegateUser":"user1","Display":"For user user@elastic.co, the User Verified Email status changed to verified","Id":"0Ym5j000019nwonCAA","ResponsibleNamespacePrefix":"namespaceprefix","Section":"Connected Apps","attributes":{"type":"SetupAuditTrail","url":"/services/data/v54.0/sobjects/SetupAuditTrail/0Ym5j000019nwonCAA"}}],"totalSize":160}' + headers: + content-type: ["text/json"] + - path: /services/data/v54.0/sobjects/EventLogFile/0AT5j00002GVrfnGAD/LogFile + methods: ["GET"] + responses: + - status_code: 200 + headers: + content-type: ["text/csv"] + body: |- + "EVENT_TYPE","TIMESTAMP","REQUEST_ID","ORGANIZATION_ID","USER_ID","RUN_TIME","CPU_TIME","URI","SESSION_KEY","LOGIN_KEY","USER_TYPE","REQUEST_STATUS","DB_TOTAL_TIME","BROWSER_TYPE","API_TYPE","API_VERSION","USER_NAME","TLS_PROTOCOL","CIPHER_SUITE","AUTHENTICATION_METHOD_REFERENCE","TIMESTAMP_DERIVED","USER_ID_DERIVED","CLIENT_IP","URI_ID_DERIVED","LOGIN_STATUS","SOURCE_IP" + "Login","20221122044615.591","4ehU_U-nbQyAPFl1cJILm-","00D5j000000VI3n","0055j000000utlP","83","30","/index.jsp","","QfNecrLXSII6fsBq","Standard","Success","52435102","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36","f","9998.0","user@elastic.co","TLSv1.2","ECDHE-RSA-AES256-GCM-SHA384","","2022-11-22T04:46:15.591Z","0055j000000utlPAAQ","81.2.69.142","s4heK3WbH-lcJIL3-n","LOGIN_NO_ERROR","81.2.69.142" + - path: /services/data/v54.0/query + methods: ["GET"] + query_params: + q: ["SELECT Id,CreatedDate,LogDate,LogFile FROM EventLogFile WHERE Interval = 'Hourly' AND EventType = 'Logout' ORDER BY LogDate ASC NULLS FIRST"] + responses: + - status_code: 200 + body: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"EventLogFile","url":"/services/data/v54.0/sobjects/EventLogFile/0AT5j00002GWEsRGAX"},"Id":"0AT5j00002GWEsRGAX","CreatedDate":"2022-09-19T21:03:41.000+0000","LogDate":"2022-09-18T00:00:00.000+0000","LogFile":"/services/data/v54.0/sobjects/EventLogFile/0AT5j00002GWEsRGAX/LogFile"}]}' + headers: + content-type: ["text/json"] + - path: /services/data/v54.0/sobjects/EventLogFile/0AT5j00002GWEsRGAX/LogFile + methods: ["GET"] + responses: + - status_code: 200 + headers: + content-type: ["text/csv"] + body: |- + "EVENT_TYPE","TIMESTAMP","REQUEST_ID","ORGANIZATION_ID","USER_ID","USER_TYPE","SESSION_TYPE","SESSION_LEVEL","BROWSER_TYPE","PLATFORM_TYPE","RESOLUTION_TYPE","APP_TYPE","CLIENT_VERSION","API_TYPE","API_VERSION","USER_INITIATED_LOGOUT","SESSION_KEY","LOGIN_KEY","TIMESTAMP_DERIVED","USER_ID_DERIVED","CLIENT_IP" + "Logout","20221122073725.779","4exLFFQZ1234xFl1cJNwOV","00D5j001234VI3n","0055j000000utlP","S","O","1","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36","1015","9999","1000","9998","f","54.0","0","WvtsJ1235oW24EbH","Obv9123BzbaxqCo1","2022-11-22T07:37:25.779Z","0055j000000utlPAAQ","81.2.69.142" + - path: /services/data/v54.0/query + methods: ["GET"] + query_params: + q: ["SELECT Id,CreatedDate,LogDate,LogFile FROM EventLogFile WHERE Interval = 'Hourly' AND (EventType = 'ApexCallout' OR EventType = 'ApexExecution' OR EventType = 'ApexRestApi' OR EventType = 'ApexSoap' OR EventType = 'ApexTrigger' OR EventType = 'ExternalCustomApexCallout') ORDER BY LogDate ASC NULLS FIRST"] + responses: + - status_code: 200 + body: '{"done":true,"records":[{"CreatedDate":"2022-10-01T23:22:27.000+0000","Id":"0AT5j00002GWEsRGAY","LogDate":"2022-09-30T00:00:00.000+0000","LogFile":"/services/data/v54.0/sobjects/EventLogFile/0AT5j00002GWEsRGAY/LogFile","attributes":{"type":"EventLogFile","url":"/services/data/v54.0/sobjects/EventLogFile/0AT5j00002GWEsRGAY"}}],"totalSize":1}' + headers: + content-type: ["text/json"] + - path: /services/data/v54.0/sobjects/EventLogFile/0AT5j00002GWEsRGAY/LogFile + methods: ["GET"] + responses: + - status_code: 200 + headers: + content-type: ["text/csv"] + body: |- + "EVENT_TYPE","TIMESTAMP","REQUEST_ID","ORGANIZATION_ID","USER_ID","RUN_TIME","CPU_TIME","URI","SESSION_KEY","LOGIN_KEY","TYPE","METHOD","SUCCESS","TIME","REQUEST_SIZE","RESPONSE_SIZE","URL","TIMESTAMP_DERIVED","USER_ID_DERIVED","CLIENT_IP","URI_ID_DERIVED" + "ApexCallout","20221122044615.591","ABCDE","00D5j000000VABC","0055j000000ABCD","1305","10","CALLOUT-LOG","ABCDEF","ABCDEFGH","OData","GET","1","1293","10","256","https://temp.sh/odata/Accounts","2022-11-22T04:46:15.591Z","0055j012345utlPAAQ","127.0.0.1","0055j000000utlPABCD" diff --git a/packages/salesforce/changelog.yml b/packages/salesforce/changelog.yml new file mode 100644 index 00000000000..ec74a94dd89 --- /dev/null +++ b/packages/salesforce/changelog.yml @@ -0,0 +1,7 @@ +# newer versions go on top + +- version: 0.1.0 + changes: + - description: Salesforce integration package with "login_rest" data stream. + link: https://github.com/elastic/integrations/pull/4261 + type: enhancement diff --git a/packages/salesforce/data_stream/login_rest/_dev/test/pipeline/test-common-config.yml b/packages/salesforce/data_stream/login_rest/_dev/test/pipeline/test-common-config.yml new file mode 100644 index 00000000000..5622947e4b8 --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/_dev/test/pipeline/test-common-config.yml @@ -0,0 +1,5 @@ +dynamic_fields: + event.ingested: ".*" +fields: + tags: + - preserve_original_event diff --git a/packages/salesforce/data_stream/login_rest/_dev/test/pipeline/test-login-rest.log b/packages/salesforce/data_stream/login_rest/_dev/test/pipeline/test-login-rest.log new file mode 100644 index 00000000000..b7757c8f524 --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/_dev/test/pipeline/test-login-rest.log @@ -0,0 +1 @@ +{"API_TYPE":"f","API_VERSION":"9998.0","AUTHENTICATION_METHOD_REFERENCE":"","BROWSER_TYPE":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/IP_ADDRESS_REMOVED Safari/537.36","CIPHER_SUITE":"ECDHE-RSA-AES256-GCM-SHA384","CLIENT_IP":"175.16.199.0","CPU_TIME":"63","DB_TOTAL_TIME":"93531912","EVENT_TYPE":"Login","LOGIN_KEY":"NK2oPJrJze8tH+vC","LOGIN_STATUS":"LOGIN_NO_ERROR","ORGANIZATION_ID":"00D5j000000VI3n","REQUEST_ID":"4lGJ1R0ZSWVXwFl1cJIRH-","REQUEST_STATUS":"Success","RUN_TIME":"156","SESSION_KEY":"","SOURCE_IP":"175.16.199.0","TIMESTAMP":"20220913052243.429","TIMESTAMP_DERIVED":"2022-09-13T05:22:43.429Z","TLS_PROTOCOL":"TLSv1.2","URI":"/index.jsp","URI_ID_DERIVED":"s4heK3WbH-lcJIL3-n","USER_ID":"0055j000000utlP","USER_ID_DERIVED":"0055j000000utlPAAQ","USER_NAME":"user@elastic.co","USER_TYPE":"Standard"} \ No newline at end of file diff --git a/packages/salesforce/data_stream/login_rest/_dev/test/pipeline/test-login-rest.log-expected.json b/packages/salesforce/data_stream/login_rest/_dev/test/pipeline/test-login-rest.log-expected.json new file mode 100644 index 00000000000..af62ddb50f1 --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/_dev/test/pipeline/test-login-rest.log-expected.json @@ -0,0 +1,83 @@ +{ + "expected": [ + { + "@timestamp": "2022-09-13T05:22:43.429Z", + "ecs": { + "version": "8.4.0" + }, + "event": { + "action": "login-attempt", + "category": [ + "authentication" + ], + "dataset": "salesforce.login_rest", + "kind": "event", + "module": "salesforce", + "original": "{\"API_TYPE\":\"f\",\"API_VERSION\":\"9998.0\",\"AUTHENTICATION_METHOD_REFERENCE\":\"\",\"BROWSER_TYPE\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/IP_ADDRESS_REMOVED Safari/537.36\",\"CIPHER_SUITE\":\"ECDHE-RSA-AES256-GCM-SHA384\",\"CLIENT_IP\":\"175.16.199.0\",\"CPU_TIME\":\"63\",\"DB_TOTAL_TIME\":\"93531912\",\"EVENT_TYPE\":\"Login\",\"LOGIN_KEY\":\"NK2oPJrJze8tH+vC\",\"LOGIN_STATUS\":\"LOGIN_NO_ERROR\",\"ORGANIZATION_ID\":\"00D5j000000VI3n\",\"REQUEST_ID\":\"4lGJ1R0ZSWVXwFl1cJIRH-\",\"REQUEST_STATUS\":\"Success\",\"RUN_TIME\":\"156\",\"SESSION_KEY\":\"\",\"SOURCE_IP\":\"175.16.199.0\",\"TIMESTAMP\":\"20220913052243.429\",\"TIMESTAMP_DERIVED\":\"2022-09-13T05:22:43.429Z\",\"TLS_PROTOCOL\":\"TLSv1.2\",\"URI\":\"/index.jsp\",\"URI_ID_DERIVED\":\"s4heK3WbH-lcJIL3-n\",\"USER_ID\":\"0055j000000utlP\",\"USER_ID_DERIVED\":\"0055j000000utlPAAQ\",\"USER_NAME\":\"user@elastic.co\",\"USER_TYPE\":\"Standard\"}", + "outcome": "success", + "type": [ + "info" + ], + "url": "/index.jsp" + }, + "related": { + "ip": [ + "175.16.199.0" + ] + }, + "salesforce": { + "login": { + "access_mode": "rest", + "api": { + "type": "Feed", + "version": "9998.0" + }, + "client_ip": "175.16.199.0", + "cpu_time": 63.0, + "db_time": { + "total": 93.53191 + }, + "event_type": "Login", + "key": "NK2oPJrJze8tH+vC", + "organization_id": "00D5j000000VI3n", + "request_id": "4lGJ1R0ZSWVXwFl1cJIRH-", + "request_status": "Success", + "run_time": 156.0, + "uri_derived_id": "s4heK3WbH-lcJIL3-n", + "user_id": "0055j000000utlP" + } + }, + "source": { + "geo": { + "city_name": "Changchun", + "continent_name": "Asia", + "country_iso_code": "CN", + "country_name": "China", + "location": { + "lat": 43.88, + "lon": 125.3228 + }, + "region_iso_code": "CN-22", + "region_name": "Jilin Sheng" + }, + "ip": "175.16.199.0" + }, + "tags": [ + "preserve_original_event" + ], + "tls": { + "cipher": "ECDHE-RSA-AES256-GCM-SHA384", + "version": "1.2", + "version_protocol": "TLS" + }, + "user": { + "email": "user@elastic.co", + "id": "0055j000000utlPAAQ", + "roles": "Standard" + }, + "user_agent": { + "name": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/IP_ADDRESS_REMOVED Safari/537.36" + } + } + ] +} \ No newline at end of file diff --git a/packages/salesforce/data_stream/login_rest/_dev/test/system/test-default-config.yml b/packages/salesforce/data_stream/login_rest/_dev/test/system/test-default-config.yml new file mode 100644 index 00000000000..c6aa6813ff0 --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/_dev/test/system/test-default-config.yml @@ -0,0 +1,12 @@ +input: httpjson +service: salesforce +vars: + instance_url: http://{{Hostname}}:{{Port}} + client_id: temp_client_id + client_secret: forty_characters_long_secret_key + username: temp_user + password: temp_password + token_url: http://{{Hostname}}:{{Port}}/services/oauth2/token +data_stream: + vars: + preserve_original_event: true diff --git a/packages/salesforce/data_stream/login_rest/agent/stream/httpjson.yml.hbs b/packages/salesforce/data_stream/login_rest/agent/stream/httpjson.yml.hbs new file mode 100644 index 00000000000..52dd53ff459 --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/agent/stream/httpjson.yml.hbs @@ -0,0 +1,44 @@ +config_version: 2 +interval: {{period}} +request.method: GET +auth.oauth2: + enabled: true + client.id: {{client_id}} + client.secret: {{client_secret}} + token_url: {{token_url}} + user: {{username}} + password: {{password}} +request.url: {{instance_url}}/services/data/v54.0/query?q=login+rest +request.transforms: + - set: + target: url.params.q + value: "SELECT Id,CreatedDate,LogDate,LogFile FROM EventLogFile WHERE Interval = 'Hourly' AND EventType = 'Login' AND LogDate > [[.cursor.last_published_login]] ORDER BY LogDate ASC NULLS FIRST" + default: "SELECT Id,CreatedDate,LogDate,LogFile FROM EventLogFile WHERE Interval = 'Hourly' AND EventType = 'Login' ORDER BY LogDate ASC NULLS FIRST" +response.split: + target: body.records +chain: + - step: + request.url: {{instance_url}}/services/data/v54.0/sobjects/EventLogFile/$.records[:].Id/LogFile + request.method: GET + replace: $.records[:].Id +cursor: + last_published_login: + value: '[[.last_event.LogDate]]' +tags: +{{#if preserve_original_event}} + - preserve_original_event +{{/if}} +{{#each tags as |tag|}} + - {{tag}} +{{/each}} +{{#contains "forwarded" tags}} +publisher_pipeline.disable_host: true +{{/contains}} +processors: +- add_fields: + target: salesforce + fields: + instance_url: {{instance_url}} +{{#if processors}} +{{processors}} +{{/if}} diff --git a/packages/salesforce/data_stream/login_rest/elasticsearch/ingest_pipeline/default.yml b/packages/salesforce/data_stream/login_rest/elasticsearch/ingest_pipeline/default.yml new file mode 100644 index 00000000000..12e54c0d480 --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/elasticsearch/ingest_pipeline/default.yml @@ -0,0 +1,291 @@ +--- +description: Pipeline for parsing Salesforce Login (REST) logs. +processors: +- json: + field: message + target_field: json + ignore_failure: true +- set: + field: event.original + value: '{{{message}}}' + ignore_failure: true + ignore_empty_value: true +- fingerprint: + fields: + - json.REQUEST_ID + - json.SESSION_KEY + - json.TIMESTAMP_DERIVED + - json.USER_ID + target_field: _id + ignore_missing: true +- set: + field: salesforce.login.access_mode + value: "rest" + ignore_failure: true + ignore_empty_value: true +- set: + field: ecs.version + value: "8.4.0" + ignore_failure: true + ignore_empty_value: true +- date: + field: json.TIMESTAMP_DERIVED + target_field: "@timestamp" + formats: + - ISO8601 + ignore_failure: true +- rename: + field: json.API_TYPE + target_field: salesforce.login.api.type + ignore_failure: true + ignore_missing: true +- rename: + field: json.AUTHENTICATION_METHOD_REFERENCE + target_field: salesforce.login.auth.service_id + ignore_failure: true + ignore_missing: true +- rename: + field: json.REQUEST_STATUS + target_field: salesforce.login.request_status + ignore_failure: true + ignore_missing: true +- rename: + field: json.API_VERSION + target_field: salesforce.login.api.version + ignore_failure: true + ignore_missing: true +- rename: + field: json.USER_ID + target_field: salesforce.login.user_id + ignore_failure: true + ignore_missing: true +- rename: + field: json.LOGIN_KEY + target_field: salesforce.login.key + ignore_failure: true + ignore_missing: true +- rename: + field: json.EVENT_TYPE + target_field: salesforce.login.event_type + ignore_failure: true + ignore_missing: true +- rename: + field: json.REQUEST_ID + target_field: salesforce.login.request_id + ignore_failure: true + ignore_missing: true +- rename: + field: json.ORGANIZATION_ID + target_field: salesforce.login.organization_id + ignore_failure: true + ignore_missing: true +- convert: + field: json.RUN_TIME + type: float + target_field: salesforce.login.run_time + ignore_failure: true + ignore_missing: true +- convert: + field: json.CPU_TIME + type: float + target_field: salesforce.login.cpu_time + ignore_failure: true + ignore_missing: true +- convert: + field: json.DB_TOTAL_TIME + type: float + target_field: salesforce.login.db_time.total + ignore_failure: true + ignore_missing: true +- script: + description: Convert db_time.total field from nanos (nanoseconds) to ms (milliseconds). + lang: painless + ignore_failure: true + source: | + def convert(def nanos){ + def ms = (nanos/1000000); + return ms; + } + if(ctx.salesforce?.login?.db_time?.total != null || ctx.salesforce?.login?.db_time?.total != ""){ + ctx.salesforce.login.db_time.total = convert(ctx.salesforce.login.db_time.total); + } +- rename: + field: json.CLIENT_IP + target_field: salesforce.login.client_ip + ignore_failure: true + ignore_missing: true +- rename: + field: json.URI_ID_DERIVED + target_field: salesforce.login.uri_derived_id + ignore_failure: true + ignore_missing: true +- script: + description: Set request status value from request status character. + lang: painless + ignore_failure: true + source: | + Map map = new HashMap(); + map.put("S", "Success"); + map.put("F", "Failure"); + map.put("U", "Undefined"); + map.put("A", "Authorization Error"); + map.put("R", "Redirect"); + map.put("N", "Not Found"); + String temp = map.get(ctx.salesforce?.login?.request_status); + if (temp != null) { + ctx.salesforce.login.request_status = temp; + } +- script: + description: Set api type value from api type character. + lang: painless + ignore_failure: true + source: | + Map map = new HashMap(); + map.put("D", "Apex Class"); + map.put("E", "SOAP Enterprise"); + map.put("I", "SOAP Cross Instance"); + map.put("M", "SOAP Metadata"); + map.put("O", "Old SOAP"); + map.put("P", "SOAP Partner"); + map.put("S", "SOAP Apex"); + map.put("T", "SOAP Tooling"); + map.put("X", "XmlRPC"); + map.put("f", "Feed"); + map.put("l", "Live Agent"); + map.put("p", "SOAP ClientSync"); + String temp = map.get(ctx.salesforce?.login?.api?.type); + if (temp != null) { + ctx.salesforce.login.api.type = temp; + } +- rename: + field: json.URI + target_field: event.url + ignore_failure: true + ignore_missing: true +- set: + field: event.outcome + value: "success" + if: 'ctx.json?.LOGIN_STATUS == "LOGIN_NO_ERROR" && ctx.json?.LOGIN_STATUS != null' + ignore_failure: true + ignore_empty_value: true +- set: + field: event.outcome + value: "failure" + if: 'ctx.json?.LOGIN_STATUS != "LOGIN_NO_ERROR" && ctx.json?.LOGIN_STATUS != null' + ignore_failure: true + ignore_empty_value: true +- set: + field: event.type + value: ["info"] + ignore_failure: true + ignore_empty_value: true +- set: + field: event.kind + value: "event" + ignore_failure: true + ignore_empty_value: true +- set: + field: event.action + value: "login-attempt" + ignore_failure: true + ignore_empty_value: true +- set: + field: event.category + value: ["authentication"] + ignore_failure: true + ignore_empty_value: true +- set: + field: event.dataset + value: "salesforce.login_rest" + ignore_failure: true + ignore_empty_value: true +- set: + field: event.module + value: "salesforce" + ignore_failure: true + ignore_empty_value: true +- rename: + field: json.USER_NAME + target_field: user.email + ignore_missing: true + ignore_failure: true +- rename: + field: json.USER_ID_DERIVED + target_field: user.id + ignore_missing: true + ignore_failure: true +- rename: + field: json.USER_TYPE + target_field: user.roles + ignore_missing: true + ignore_failure: true +- rename: + field: json.SOURCE_IP + target_field: source.ip + ignore_missing: true + ignore_failure: true + if: 'ctx.json?.SOURCE_IP != "Salesforce.com IP"' +- geoip: + field: source.ip + target_field: source.geo + ignore_missing: true + ignore_failure: true +- append: + field: related.ip + value: '{{{source.ip}}}' + if: ctx.source?.ip != null + allow_duplicates: false + ignore_failure: true +- append: + field: related.ip + value: '{{{salesforce.login.client_ip}}}' + if: 'ctx.salesforce?.login?.client_ip != "Salesforce.com IP" && ctx.salesforce?.login?.client_ip != null' + allow_duplicates: false + ignore_failure: true +- rename: + field: json.BROWSER_TYPE + target_field: user_agent.name + ignore_missing: true + ignore_failure: true +- rename: + field: json.CIPHER_SUITE + target_field: tls.cipher + ignore_missing: true + ignore_failure: true +- dissect: + pattern: "%{tls.version_protocol}v%{tls.version}" + field: json.TLS_PROTOCOL + ignore_failure: true + ignore_missing: true +- remove: + field: event.original + if: "ctx.tags == null || !(ctx.tags.contains('preserve_original_event'))" + ignore_failure: true + ignore_missing: true +- script: + description: Drops null/empty values recursively. + lang: painless + source: | + boolean dropEmptyFields(Object object) { + if (object == null || object == "") { + return true; + } else if (object instanceof Map) { + ((Map) object).values().removeIf(value -> dropEmptyFields(value)); + return (((Map) object).size() == 0); + } else if (object instanceof List) { + ((List) object).removeIf(value -> dropEmptyFields(value)); + return (((List) object).length == 0); + } + return false; + } + dropEmptyFields(ctx); +- remove: + field: + - json + - message + ignore_failure: true + ignore_missing: true +on_failure: +- set: + field: error.message + value: '{{{_ingest.on_failure_message}}}' diff --git a/packages/salesforce/data_stream/login_rest/fields/base-fields.yml b/packages/salesforce/data_stream/login_rest/fields/base-fields.yml new file mode 100644 index 00000000000..3500f7ce8c2 --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/fields/base-fields.yml @@ -0,0 +1,15 @@ +- name: data_stream.type + type: constant_keyword + description: Data stream type. +- name: data_stream.dataset + type: constant_keyword + description: Data stream dataset. +- name: data_stream.namespace + type: constant_keyword + description: Data stream namespace. +- name: input.type + type: keyword + description: Input type. +- name: '@timestamp' + type: date + description: Event timestamp. diff --git a/packages/salesforce/data_stream/login_rest/fields/ecs.yml b/packages/salesforce/data_stream/login_rest/fields/ecs.yml new file mode 100644 index 00000000000..5824611e2fc --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/fields/ecs.yml @@ -0,0 +1,60 @@ +- external: ecs + name: ecs.version +- external: ecs + name: event.action +- external: ecs + name: event.agent_id_status +- external: ecs + name: event.category +- external: ecs + name: event.created +- external: ecs + name: event.dataset +- external: ecs + name: event.ingested +- external: ecs + name: event.kind +- external: ecs + name: event.module +- external: ecs + name: event.original +- external: ecs + name: event.outcome +- external: ecs + name: event.type +- external: ecs + name: event.url +- external: ecs + name: related.ip +- external: ecs + name: source.ip +- external: ecs + name: source.geo.city_name +- external: ecs + name: source.geo.continent_name +- external: ecs + name: source.geo.country_iso_code +- external: ecs + name: source.geo.country_name +- external: ecs + name: source.geo.location +- external: ecs + name: source.geo.region_iso_code +- external: ecs + name: source.geo.region_name +- external: ecs + name: tags +- external: ecs + name: tls.cipher +- external: ecs + name: tls.version +- external: ecs + name: tls.version_protocol +- external: ecs + name: user_agent.name +- external: ecs + name: user.email +- external: ecs + name: user.id +- external: ecs + name: user.roles diff --git a/packages/salesforce/data_stream/login_rest/fields/fields.yml b/packages/salesforce/data_stream/login_rest/fields/fields.yml new file mode 100644 index 00000000000..7cc5539ed6a --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/fields/fields.yml @@ -0,0 +1,66 @@ +- name: salesforce + type: group + fields: + - name: instance_url + type: keyword + description: The Instance URL of the Salesforce instance. + - name: login + type: group + fields: + - name: access_mode + type: keyword + description: Mode of API from which the event is collected. + - name: api + type: group + fields: + - name: type + type: keyword + description: The type of API request. + - name: version + type: keyword + description: The version of the API that's being used. + - name: auth + type: group + fields: + - name: service_id + type: keyword + description: The authentication method used by a third-party identification provider for an OpenID Connect single sign-on protocol. + - name: client_ip + type: keyword + description: The IP address of the client that's using Salesforce services. + - name: cpu_time + type: float + description: The CPU time in milliseconds used to complete the request. This field indicates the amount of activity taking place in the app server layer. + metric_type: gauge + unit: ms + - name: db_time.total + type: float + description: The time in milliseconds for a database round trip. Includes time spent in the JDBC driver, network to the database, and db_time.total. Compare this field to cpu_time to determine whether performance issues are occurring in the database layer or in your own code. + metric_type: gauge + unit: ms + - name: event_type + type: keyword + description: The type of event. The value is always Login. + - name: key + type: keyword + description: The string that ties together all events in a given user's login session. It starts with a login event and ends with either a logout event or the user session expiring. + - name: organization_id + type: keyword + description: The 15-character ID of the organization. + - name: request_id + type: keyword + description: The unique ID of a single transaction. A transaction can contain one or more events. Each event in a given transaction has the same REQUEST_ID. + - name: request_status + type: keyword + description: The status of the request for a page view or user interface action. + - name: run_time + type: float + description: The amount of time that the request took in milliseconds. + metric_type: gauge + unit: ms + - name: uri_derived_id + type: keyword + description: The 18-character case insensitive ID of the URI of the page that's receiving the request. + - name: user_id + type: keyword + description: The 15-character ID of the user who's using Salesforce services through the UI or the API. diff --git a/packages/salesforce/data_stream/login_rest/manifest.yml b/packages/salesforce/data_stream/login_rest/manifest.yml new file mode 100644 index 00000000000..d80a3b7c85f --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/manifest.yml @@ -0,0 +1,40 @@ +type: logs +title: Salesforce login logs +streams: + - input: httpjson + vars: + - name: period + type: text + title: Period + description: Period of fetching logs, i.e. 1s/1m/1h. + multi: false + required: true + show_user: false + default: 1h + - name: tags + type: text + title: Tags + multi: true + required: true + show_user: false + default: + - salesforce-login_rest + - forwarded + - name: preserve_original_event + required: true + show_user: true + title: Preserve original event + description: Preserves a raw copy of the original event, added to the field `event.original`. + type: bool + multi: false + default: false + - name: processors + type: yaml + title: Processors + multi: false + required: false + show_user: false + description: Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the logs are parsed. See [Processors](https://www.elastic.co/guide/en/beats/filebeat/current/filtering-and-enhancing-data.html) for details. + template_path: httpjson.yml.hbs + title: Salesforce Login logs + description: Collect Salesforce Login logs. diff --git a/packages/salesforce/data_stream/login_rest/sample_event.json b/packages/salesforce/data_stream/login_rest/sample_event.json new file mode 100644 index 00000000000..ad0fb388df4 --- /dev/null +++ b/packages/salesforce/data_stream/login_rest/sample_event.json @@ -0,0 +1,105 @@ +{ + "@timestamp": "2022-11-22T04:46:15.591Z", + "agent": { + "ephemeral_id": "ce504617-c797-4257-845c-f1d8f57cc9bd", + "id": "4a8a40ad-666c-45db-a9d1-3b027852bef0", + "name": "docker-fleet-agent", + "type": "filebeat", + "version": "8.4.1" + }, + "data_stream": { + "dataset": "salesforce.login_rest", + "namespace": "ep", + "type": "logs" + }, + "ecs": { + "version": "8.4.0" + }, + "elastic_agent": { + "id": "4a8a40ad-666c-45db-a9d1-3b027852bef0", + "snapshot": false, + "version": "8.4.1" + }, + "event": { + "action": "login-attempt", + "agent_id_status": "verified", + "category": [ + "authentication" + ], + "created": "2022-11-29T07:28:46.257Z", + "dataset": "salesforce.login_rest", + "ingested": "2022-11-29T07:28:50Z", + "kind": "event", + "module": "salesforce", + "original": "{\"API_TYPE\":\"f\",\"API_VERSION\":\"9998.0\",\"AUTHENTICATION_METHOD_REFERENCE\":\"\",\"BROWSER_TYPE\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36\",\"CIPHER_SUITE\":\"ECDHE-RSA-AES256-GCM-SHA384\",\"CLIENT_IP\":\"81.2.69.142\",\"CPU_TIME\":\"30\",\"DB_TOTAL_TIME\":\"52435102\",\"EVENT_TYPE\":\"Login\",\"LOGIN_KEY\":\"QfNecrLXSII6fsBq\",\"LOGIN_STATUS\":\"LOGIN_NO_ERROR\",\"ORGANIZATION_ID\":\"00D5j000000VI3n\",\"REQUEST_ID\":\"4ehU_U-nbQyAPFl1cJILm-\",\"REQUEST_STATUS\":\"Success\",\"RUN_TIME\":\"83\",\"SESSION_KEY\":\"\",\"SOURCE_IP\":\"81.2.69.142\",\"TIMESTAMP\":\"20221122044615.591\",\"TIMESTAMP_DERIVED\":\"2022-11-22T04:46:15.591Z\",\"TLS_PROTOCOL\":\"TLSv1.2\",\"URI\":\"/index.jsp\",\"URI_ID_DERIVED\":\"s4heK3WbH-lcJIL3-n\",\"USER_ID\":\"0055j000000utlP\",\"USER_ID_DERIVED\":\"0055j000000utlPAAQ\",\"USER_NAME\":\"user@elastic.co\",\"USER_TYPE\":\"Standard\"}", + "outcome": "success", + "type": [ + "info" + ], + "url": "/index.jsp" + }, + "input": { + "type": "httpjson" + }, + "related": { + "ip": [ + "81.2.69.142" + ] + }, + "salesforce": { + "instance_url": "http://elastic-package-service_salesforce_1:8010", + "login": { + "access_mode": "rest", + "api": { + "type": "Feed", + "version": "9998.0" + }, + "client_ip": "81.2.69.142", + "cpu_time": 30, + "db_time": { + "total": 52.435104 + }, + "event_type": "Login", + "key": "QfNecrLXSII6fsBq", + "organization_id": "00D5j000000VI3n", + "request_id": "4ehU_U-nbQyAPFl1cJILm-", + "request_status": "Success", + "run_time": 83, + "uri_derived_id": "s4heK3WbH-lcJIL3-n", + "user_id": "0055j000000utlP" + } + }, + "source": { + "geo": { + "city_name": "London", + "continent_name": "Europe", + "country_iso_code": "GB", + "country_name": "United Kingdom", + "location": { + "lat": 51.5142, + "lon": -0.0931 + }, + "region_iso_code": "GB-ENG", + "region_name": "England" + }, + "ip": "81.2.69.142" + }, + "tags": [ + "preserve_original_event", + "salesforce-login_rest", + "forwarded" + ], + "tls": { + "cipher": "ECDHE-RSA-AES256-GCM-SHA384", + "version": "1.2", + "version_protocol": "TLS" + }, + "user": { + "email": "user@elastic.co", + "id": "0055j000000utlPAAQ", + "roles": "Standard" + }, + "user_agent": { + "name": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36" + } +} \ No newline at end of file diff --git a/packages/salesforce/docs/README.md b/packages/salesforce/docs/README.md new file mode 100644 index 00000000000..d719205417f --- /dev/null +++ b/packages/salesforce/docs/README.md @@ -0,0 +1,332 @@ +# Salesforce Integration + +## Overview + +The Salesforce integration allows you to monitor a [Salesforce](https://www.salesforce.com/) instance. Salesforce is a customer relationship management (CRM) platform. It provides an ecosystem for businesses to manage marketing, sales, commerce, service, and IT teams from anywhere with one integrated CRM platform. + +Use the Salesforce integration to: +- Gain insights into login and other operational activities by the users of your organization. +- Create visualizations to monitor, measure and analyze the usage trend and key data, and derive business insights. +- Create alerts to reduce the MTTD and also the MTTR by referencing relevant logs when troubleshooting an issue. + +As an example, you can use the data from this integration to understand the activity patterns of users based on region or the distribution of users by license type. + +## Data streams + +The Salesforce integration collects log events using the REST API of Salesforce. + +**Logs** help you keep a record of events happening in Salesforce. +Log data streams collected by the Salesforce integration include [Login](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_eventlogfile_login.htm). + +Data streams: +- `login_rest`: Tracks login activity of users who log in to Salesforce. + +## Compatibility + +This integration has been tested against Salesforce `Spring '22 (v54.0) release`. + +In order to find out the Salesforce version of your Instance, see below: + +1. On the Home tab in Salesforce Classic, in the top right corner of the screen is a link to releases like `Summer '22`. This indicates your release. + +2. An alternative way to find out the version of Salesforce is by hitting the following URL: + - Format: (Salesforce Instance URL)/services/data + - Example: https://elastic1234-dev-ed.my.salesforce.com/services/data + +Example response: +```xml + + + + /services/data/v53.0 + 53.0 + + + + /services/data/v54.0 + 54.0 + + + + /services/data/v55.0 + 55.0 + + +``` +The last one on the list is the release of your instance. In the example above, the version is `Summer '22` i.e. `v55.0`. + +## Prerequisites + +You need Elasticsearch for storing and searching your data and Kibana for visualizing and managing it. +You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommended or self-manage the Elastic Stack on your own hardware. + +In your Salesforce instance, ensure that `API Enabled permission` is selected for the user profile. Follow the below steps to enable the same: + +1. Go to `Setup` > `Quick Find` > `Users`, and Click on `Users`. +2. Click on the profile link associated with the `User Account` used for data collection. +3. Search for `API Enabled` permission on the same page. In case it’s not present, search it under `System Permissions` and check if `API Enabled` privilege is selected. If not, enable it for data collection. + +## Set Up + +For step-by-step instructions on how to set up an integration, see the [Getting started](https://www.elastic.co/guide/en/welcome-to-elastic/current/getting-started-observability.html) guide. + +## Configuration + +You need the following information from your Salesforce instance to configure this integration in Elastic: + +### Salesforce Instance URL + +The instance your Salesforce Organization uses is indicated in the URL of your browser's address bar in Salesforce Classic. The value before 'salesforce.com' is your Salesforce Instance. + +Example URL: https://na9.salesforce.com/home/home.jsp + +In the above example, the value before 'salesforce.com' is your Salesforce Instance. In this example, the Salesforce Organization is located on NA9. + +The Salesforce Instance URL is: https://na9.salesforce.com + +In Salesforce Lightning, it is available under the user name in the “View Profile” tab. + +### Client Key and Client Secret for Authentication + +In order to use this integration, you need to create a new Salesforce Application using OAuth. Follow the steps below to create a connected application in Salesforce: + +1. Login to [Salesforce](https://login.salesforce.com/) with the same user credentials that you want to collect data with. +2. Click on Setup on the top right menu bar. On the Setup page search `App Manager` in the `Search Setup` search box at the top of the page, then select `App Manager`. +3. Click *New Connected App*. +4. Provide a name for the connected application. This will be displayed in the App Manager and on its App Launcher tile. +5. Enter the API name. The default is a version of the name without spaces. Only letters, numbers, and underscores are allowed. If the original app name contains any other characters, edit the default name. +6. Enter the contact email for Salesforce. +7. Under the API (Enable OAuth Settings) section of the page, select *Enable OAuth Settings*. +8. In the Callback URL enter the Instance URL (Please refer to `Salesforce Instance URL`) +9. Select the following OAuth scopes to apply to the connected app: + - Manage user data via APIs (api). + - Perform requests at any time (refresh_token, offline_access). + - (Optional) In case of data collection, if any permission issues arise, add the Full access (full) scope. +10. Select *Require Secret for the Web Server Flow* to require the app's client secret in exchange for an access token. +11. Select *Require Secret for Refresh Token Flow* to require the app's client secret in the authorization request of a refresh token and hybrid refresh token flow. +12. Click Save. It may take approximately 10 minutes for the changes to take effect. +13. Click Continue and then under API details click Manage Consumer Details, Verify the user account using Verification Code. +14. Copy `Consumer Key` and `Consumer Secret` from the Consumer Details section, which should be populated as value to Client ID and Client Secret respectively in the configuration. + +For more details on how to Create a Connected App refer to the salesforce documentation [here](https://help.salesforce.com/apex/HTViewHelpDoc?id=connected_app_create.htm). + +### Username + +User Id of the registered user in Salesforce. + +### Password + +Password used for authenticating the above user. + +## Additional Information + +Follow the steps below, in case you need to find the API version: + +1. Go to `Setup` > `Quick Find` > `Apex Classes`. +2. Click the `New` button. +3. Click the `Version Settings` tab. +4. Refer to the `Version` dropdown for the API Version number. + +## Validation + +After the integration is successfully configured, clicking on the Assets tab of the Salesforce Integration should display a list of available dashboards. Click on the dashboard available for your configured datastream. It should be populated with the required data. + +## Troubleshooting + +- In case of data ingestion if the user finds the following type of error logs: +``` +{ + "log.level": "error", + "@timestamp": "2022-11-24T12:59:36.835+0530", + "log.logger": "input.httpjson-cursor", + "log.origin": { + "[file.name](http://file.name/)": "compat/compat.go", + "file.line": 124 + }, + "message": "Input 'httpjson-cursor' failed with: input.go:130: input 8A049E17A5CA661D failed (id=8A049E17A5CA661D)\n\toauth2 client: error loading credentials using user and password: oauth2: cannot fetch token: 400 Bad Request\n\tResponse: {\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}", + "[service.name](http://service.name/)": "filebeat", + "id": "8A049E17A5CA661D", + "ecs.version": "1.6.0" +} +``` +Please check if the `API Enabled permission` is provided to the `profile` associated with the `username` used as part of the integration. +Please refer to the Prerequisites section above for more information. + +If the error continues follow these steps: + +1. Go to `Setup` > `Quick Find` > `Manage Connected Apps`. +2. Click on the Connected App name created by you to generate the client id and client secret (Refer to Client Key and Client Secret for Authentication) under the Master Label. +3. Click on Edit Policies, and select `Relax IP restrictions` from the dropdown for IP Relaxation. + +## Logs reference + +### Login Rest + +This is the `login_rest` data stream. It represents events containing details about your organization's user login history. + +An example event for `login_rest` looks as following: + +```json +{ + "@timestamp": "2022-11-22T04:46:15.591Z", + "agent": { + "ephemeral_id": "ce504617-c797-4257-845c-f1d8f57cc9bd", + "id": "4a8a40ad-666c-45db-a9d1-3b027852bef0", + "name": "docker-fleet-agent", + "type": "filebeat", + "version": "8.4.1" + }, + "data_stream": { + "dataset": "salesforce.login_rest", + "namespace": "ep", + "type": "logs" + }, + "ecs": { + "version": "8.4.0" + }, + "elastic_agent": { + "id": "4a8a40ad-666c-45db-a9d1-3b027852bef0", + "snapshot": false, + "version": "8.4.1" + }, + "event": { + "action": "login-attempt", + "agent_id_status": "verified", + "category": [ + "authentication" + ], + "created": "2022-11-29T07:28:46.257Z", + "dataset": "salesforce.login_rest", + "ingested": "2022-11-29T07:28:50Z", + "kind": "event", + "module": "salesforce", + "original": "{\"API_TYPE\":\"f\",\"API_VERSION\":\"9998.0\",\"AUTHENTICATION_METHOD_REFERENCE\":\"\",\"BROWSER_TYPE\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36\",\"CIPHER_SUITE\":\"ECDHE-RSA-AES256-GCM-SHA384\",\"CLIENT_IP\":\"81.2.69.142\",\"CPU_TIME\":\"30\",\"DB_TOTAL_TIME\":\"52435102\",\"EVENT_TYPE\":\"Login\",\"LOGIN_KEY\":\"QfNecrLXSII6fsBq\",\"LOGIN_STATUS\":\"LOGIN_NO_ERROR\",\"ORGANIZATION_ID\":\"00D5j000000VI3n\",\"REQUEST_ID\":\"4ehU_U-nbQyAPFl1cJILm-\",\"REQUEST_STATUS\":\"Success\",\"RUN_TIME\":\"83\",\"SESSION_KEY\":\"\",\"SOURCE_IP\":\"81.2.69.142\",\"TIMESTAMP\":\"20221122044615.591\",\"TIMESTAMP_DERIVED\":\"2022-11-22T04:46:15.591Z\",\"TLS_PROTOCOL\":\"TLSv1.2\",\"URI\":\"/index.jsp\",\"URI_ID_DERIVED\":\"s4heK3WbH-lcJIL3-n\",\"USER_ID\":\"0055j000000utlP\",\"USER_ID_DERIVED\":\"0055j000000utlPAAQ\",\"USER_NAME\":\"user@elastic.co\",\"USER_TYPE\":\"Standard\"}", + "outcome": "success", + "type": [ + "info" + ], + "url": "/index.jsp" + }, + "input": { + "type": "httpjson" + }, + "related": { + "ip": [ + "81.2.69.142" + ] + }, + "salesforce": { + "instance_url": "http://elastic-package-service_salesforce_1:8010", + "login": { + "access_mode": "rest", + "api": { + "type": "Feed", + "version": "9998.0" + }, + "client_ip": "81.2.69.142", + "cpu_time": 30, + "db_time": { + "total": 52.435104 + }, + "event_type": "Login", + "key": "QfNecrLXSII6fsBq", + "organization_id": "00D5j000000VI3n", + "request_id": "4ehU_U-nbQyAPFl1cJILm-", + "request_status": "Success", + "run_time": 83, + "uri_derived_id": "s4heK3WbH-lcJIL3-n", + "user_id": "0055j000000utlP" + } + }, + "source": { + "geo": { + "city_name": "London", + "continent_name": "Europe", + "country_iso_code": "GB", + "country_name": "United Kingdom", + "location": { + "lat": 51.5142, + "lon": -0.0931 + }, + "region_iso_code": "GB-ENG", + "region_name": "England" + }, + "ip": "81.2.69.142" + }, + "tags": [ + "preserve_original_event", + "salesforce-login_rest", + "forwarded" + ], + "tls": { + "cipher": "ECDHE-RSA-AES256-GCM-SHA384", + "version": "1.2", + "version_protocol": "TLS" + }, + "user": { + "email": "user@elastic.co", + "id": "0055j000000utlPAAQ", + "roles": "Standard" + }, + "user_agent": { + "name": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36" + } +} +``` + +**Exported fields** + +| Field | Description | Type | Unit | Metric Type | +|---|---|---|---|---| +| @timestamp | Event timestamp. | date | | | +| data_stream.dataset | Data stream dataset. | constant_keyword | | | +| data_stream.namespace | Data stream namespace. | constant_keyword | | | +| data_stream.type | Data stream type. | constant_keyword | | | +| ecs.version | ECS version this event conforms to. `ecs.version` is a required field and must exist in all events. When querying across multiple indices -- which may conform to slightly different ECS versions -- this field lets integrations adjust to the schema version of the events. | keyword | | | +| event.action | The action captured by the event. This describes the information in the event. It is more specific than `event.category`. Examples are `group-add`, `process-started`, `file-created`. The value is normally defined by the implementer. | keyword | | | +| event.agent_id_status | Agents are normally responsible for populating the `agent.id` field value. If the system receiving events is capable of validating the value based on authentication information for the client then this field can be used to reflect the outcome of that validation. For example if the agent's connection is authenticated with mTLS and the client cert contains the ID of the agent to which the cert was issued then the `agent.id` value in events can be checked against the certificate. If the values match then `event.agent_id_status: verified` is added to the event, otherwise one of the other allowed values should be used. If no validation is performed then the field should be omitted. The allowed values are: `verified` - The `agent.id` field value matches expected value obtained from auth metadata. `mismatch` - The `agent.id` field value does not match the expected value obtained from auth metadata. `missing` - There was no `agent.id` field in the event to validate. `auth_metadata_missing` - There was no auth metadata or it was missing information about the agent ID. | keyword | | | +| event.category | This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy. `event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory. This field is an array. This will allow proper categorization of some events that fall in multiple categories. | keyword | | | +| event.created | event.created contains the date/time when the event was first read by an agent, or by your pipeline. This field is distinct from @timestamp in that @timestamp typically contain the time extracted from the original event. In most situations, these two timestamps will be slightly different. The difference can be used to calculate the delay between your source generating an event, and the time when your agent first processed it. This can be used to monitor your agent's or pipeline's ability to keep up with your event source. In case the two timestamps are identical, @timestamp should be used. | date | | | +| event.dataset | Name of the dataset. If an event source publishes more than one type of log or events (e.g. access log, error log), the dataset is used to specify which one the event comes from. It's recommended but not required to start the dataset name with the module name, followed by a dot, then the dataset name. | keyword | | | +| event.ingested | Timestamp when an event arrived in the central data store. This is different from `@timestamp`, which is when the event originally occurred. It's also different from `event.created`, which is meant to capture the first time an agent saw the event. In normal conditions, assuming no tampering, the timestamps should chronologically look like this: `@timestamp` \< `event.created` \< `event.ingested`. | date | | | +| event.kind | This is one of four ECS Categorization Fields, and indicates the highest level in the ECS category hierarchy. `event.kind` gives high-level information about what type of information the event contains, without being specific to the contents of the event. For example, values of this field distinguish alert events from metric events. The value of this field can be used to inform how these kinds of events should be handled. They may warrant different retention, different access control, it may also help understand whether the data coming in at a regular interval or not. | keyword | | | +| event.module | Name of the module this data is coming from. If your monitoring agent supports the concept of modules or plugins to process events of a given source (e.g. Apache logs), `event.module` should contain the name of this module. | keyword | | | +| event.original | Raw text message of entire event. Used to demonstrate log integrity or where the full log message (before splitting it up in multiple parts) may be required, e.g. for reindex. This field is not indexed and doc_values are disabled. It cannot be searched, but it can be retrieved from `_source`. If users wish to override this and index this field, please see `Field data types` in the `Elasticsearch Reference`. | keyword | | | +| event.outcome | This is one of four ECS Categorization Fields, and indicates the lowest level in the ECS category hierarchy. `event.outcome` simply denotes whether the event represents a success or a failure from the perspective of the entity that produced the event. Note that when a single transaction is described in multiple events, each event may populate different values of `event.outcome`, according to their perspective. Also note that in the case of a compound event (a single event that contains multiple logical events), this field should be populated with the value that best captures the overall success or failure from the perspective of the event producer. Further note that not all events will have an associated outcome. For example, this field is generally not populated for metric events, events with `event.type:info`, or any events for which an outcome does not make logical sense. | keyword | | | +| event.type | This is one of four ECS Categorization Fields, and indicates the third level in the ECS category hierarchy. `event.type` represents a categorization "sub-bucket" that, when used along with the `event.category` field values, enables filtering events down to a level appropriate for single visualization. This field is an array. This will allow proper categorization of some events that fall in multiple event types. | keyword | | | +| event.url | URL linking to an external system to continue investigation of this event. This URL links to another system where in-depth investigation of the specific occurrence of this event can take place. Alert events, indicated by `event.kind:alert`, are a common use case for this field. | keyword | | | +| input.type | Input type. | keyword | | | +| related.ip | All of the IPs seen on your event. | ip | | | +| salesforce.instance_url | The Instance URL of the Salesforce instance. | keyword | | | +| salesforce.login.access_mode | Mode of API from which the event is collected. | keyword | | | +| salesforce.login.api.type | The type of API request. | keyword | | | +| salesforce.login.api.version | The version of the API that's being used. | keyword | | | +| salesforce.login.auth.service_id | The authentication method used by a third-party identification provider for an OpenID Connect single sign-on protocol. | keyword | | | +| salesforce.login.client_ip | The IP address of the client that's using Salesforce services. | keyword | | | +| salesforce.login.cpu_time | The CPU time in milliseconds used to complete the request. This field indicates the amount of activity taking place in the app server layer. | float | ms | gauge | +| salesforce.login.db_time.total | The time in milliseconds for a database round trip. Includes time spent in the JDBC driver, network to the database, and db_time.total. Compare this field to cpu_time to determine whether performance issues are occurring in the database layer or in your own code. | float | ms | gauge | +| salesforce.login.event_type | The type of event. The value is always Login. | keyword | | | +| salesforce.login.key | The string that ties together all events in a given user's login session. It starts with a login event and ends with either a logout event or the user session expiring. | keyword | | | +| salesforce.login.organization_id | The 15-character ID of the organization. | keyword | | | +| salesforce.login.request_id | The unique ID of a single transaction. A transaction can contain one or more events. Each event in a given transaction has the same REQUEST_ID. | keyword | | | +| salesforce.login.request_status | The status of the request for a page view or user interface action. | keyword | | | +| salesforce.login.run_time | The amount of time that the request took in milliseconds. | float | ms | gauge | +| salesforce.login.uri_derived_id | The 18-character case insensitive ID of the URI of the page that's receiving the request. | keyword | | | +| salesforce.login.user_id | The 15-character ID of the user who's using Salesforce services through the UI or the API. | keyword | | | +| source.geo.city_name | City name. | keyword | | | +| source.geo.continent_name | Name of the continent. | keyword | | | +| source.geo.country_iso_code | Country ISO code. | keyword | | | +| source.geo.country_name | Country name. | keyword | | | +| source.geo.location | Longitude and latitude. | geo_point | | | +| source.geo.region_iso_code | Region ISO code. | keyword | | | +| source.geo.region_name | Region name. | keyword | | | +| source.ip | IP address of the source (IPv4 or IPv6). | ip | | | +| tags | List of keywords used to tag each event. | keyword | | | +| tls.cipher | String indicating the cipher used during the current connection. | keyword | | | +| tls.version | Numeric part of the version parsed from the original string. | keyword | | | +| tls.version_protocol | Normalized lowercase protocol name parsed from original string. | keyword | | | +| user.email | User email address. | keyword | | | +| user.id | Unique identifier of the user. | keyword | | | +| user.roles | Array of user roles at the time of the event. | keyword | | | +| user_agent.name | Name of the user agent. | keyword | | | + diff --git a/packages/salesforce/img/salesforce-login.png b/packages/salesforce/img/salesforce-login.png new file mode 100644 index 00000000000..dcaa4aac94e Binary files /dev/null and b/packages/salesforce/img/salesforce-login.png differ diff --git a/packages/salesforce/img/salesforce.svg b/packages/salesforce/img/salesforce.svg new file mode 100644 index 00000000000..4aaaf3ca976 --- /dev/null +++ b/packages/salesforce/img/salesforce.svg @@ -0,0 +1,25 @@ + + +Salesforce.com logo +A cloud computing company based in San Francisco, California, United States + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/packages/salesforce/kibana/dashboard/salesforce-1659aef0-574c-11ec-8f0b-05e8b06e1b10-pkg.json b/packages/salesforce/kibana/dashboard/salesforce-1659aef0-574c-11ec-8f0b-05e8b06e1b10-pkg.json new file mode 100644 index 00000000000..f0bc70edacd --- /dev/null +++ b/packages/salesforce/kibana/dashboard/salesforce-1659aef0-574c-11ec-8f0b-05e8b06e1b10-pkg.json @@ -0,0 +1,1437 @@ +{ + "attributes": { + "controlGroupInput": { + "chainingSystem": "HIERARCHICAL", + "controlStyle": "oneLine", + "ignoreParentSettingsJSON": "{\"ignoreFilters\":false,\"ignoreQuery\":false,\"ignoreTimerange\":false,\"ignoreValidations\":false}", + "panelsJSON": "{\"afac70de-aeee-46de-9b78-9e584d5c3f7e\":{\"order\":0,\"width\":\"large\",\"grow\":false,\"type\":\"optionsListControl\",\"explicitInput\":{\"fieldName\":\"salesforce.instance_url\",\"title\":\"Instance URL\",\"id\":\"afac70de-aeee-46de-9b78-9e584d5c3f7e\",\"singleSelect\":false,\"enhancements\":{},\"selectedOptions\":[]}}}" + }, + "description": "Login EventLogFile Data", + "hits": 0, + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "query": { + "language": "kuery", + "query": "" + } + } + }, + "optionsJSON": { + "hidePanelTitles": false, + "syncColors": false, + "useMargins": true + }, + "panelsJSON": [ + { + "embeddableConfig": { + "attributes": { + "references": [ + { + "id": "logs-*", + "name": "indexpattern-datasource-layer-e1b2bc2f-ba01-4998-8cf8-a20d5e2f4da5", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "39032351-9ac1-4a65-8165-a19ec20f0ace", + "type": "index-pattern" + } + ], + "state": { + "datasourceStates": { + "indexpattern": { + "layers": { + "e1b2bc2f-ba01-4998-8cf8-a20d5e2f4da5": { + "columnOrder": [ + "22579769-dcb6-457e-82b4-76eacc56deb8", + "22579769-dcb6-457e-82b4-76eacc56deb8X0", + "22579769-dcb6-457e-82b4-76eacc56deb8X1", + "22579769-dcb6-457e-82b4-76eacc56deb8X2" + ], + "columns": { + "22579769-dcb6-457e-82b4-76eacc56deb8": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Login success rate", + "operationType": "formula", + "params": { + "format": { + "id": "percent", + "params": { + "decimals": 2 + } + }, + "formula": "(count(kql='event.outcome : \"success\"')/count())", + "isFormulaBroken": false + }, + "references": [ + "22579769-dcb6-457e-82b4-76eacc56deb8X2" + ], + "scale": "ratio" + }, + "22579769-dcb6-457e-82b4-76eacc56deb8X0": { + "customLabel": true, + "dataType": "number", + "filter": { + "language": "kuery", + "query": "event.outcome : \"success\"" + }, + "isBucketed": false, + "label": "Part of ", + "operationType": "count", + "params": { + "emptyAsNull": false + }, + "scale": "ratio", + "sourceField": "___records___" + }, + "22579769-dcb6-457e-82b4-76eacc56deb8X1": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Part of ", + "operationType": "count", + "params": { + "emptyAsNull": false + }, + "scale": "ratio", + "sourceField": "___records___" + }, + "22579769-dcb6-457e-82b4-76eacc56deb8X2": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Part of ", + "operationType": "math", + "params": { + "tinymathAst": { + "args": [ + "22579769-dcb6-457e-82b4-76eacc56deb8X0", + "22579769-dcb6-457e-82b4-76eacc56deb8X1" + ], + "location": { + "max": 48, + "min": 0 + }, + "name": "divide", + "text": "(count(kql='event.outcome : \"success\"')/count())", + "type": "function" + } + }, + "references": [ + "22579769-dcb6-457e-82b4-76eacc56deb8X0", + "22579769-dcb6-457e-82b4-76eacc56deb8X1" + ], + "scale": "ratio" + } + }, + "incompleteColumns": {} + } + } + } + }, + "filters": [ + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "index": "39032351-9ac1-4a65-8165-a19ec20f0ace", + "key": "event.action", + "negate": false, + "params": { + "query": "login-attempt" + }, + "type": "phrase" + }, + "query": { + "match_phrase": { + "event.action": "login-attempt" + } + } + } + ], + "query": { + "language": "kuery", + "query": "event.dataset : salesforce.login*" + }, + "visualization": { + "accessor": "22579769-dcb6-457e-82b4-76eacc56deb8", + "layerId": "e1b2bc2f-ba01-4998-8cf8-a20d5e2f4da5", + "layerType": "data", + "size": "l", + "textAlign": "center", + "titlePosition": "bottom" + } + }, + "title": "", + "type": "lens", + "visualizationType": "lnsMetric" + }, + "enhancements": {}, + "hidePanelTitles": true + }, + "gridData": { + "h": 9, + "i": "0e854818-b5d3-4758-b099-04d68167678a", + "w": 24, + "x": 0, + "y": 0 + }, + "panelIndex": "0e854818-b5d3-4758-b099-04d68167678a", + "title": "Login success rate [Logs Salesforce]", + "type": "lens", + "version": "8.4.1" + }, + { + "embeddableConfig": { + "attributes": { + "references": [ + { + "id": "logs-*", + "name": "indexpattern-datasource-layer-e1b2bc2f-ba01-4998-8cf8-a20d5e2f4da5", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "c852551f-ae1c-4458-aa84-c1b3df007e2a", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "347ee7a5-24cf-477f-83b8-f7edeb6ed68a", + "type": "index-pattern" + } + ], + "state": { + "datasourceStates": { + "indexpattern": { + "layers": { + "e1b2bc2f-ba01-4998-8cf8-a20d5e2f4da5": { + "columnOrder": [ + "22579769-dcb6-457e-82b4-76eacc56deb8", + "22579769-dcb6-457e-82b4-76eacc56deb8X0" + ], + "columns": { + "22579769-dcb6-457e-82b4-76eacc56deb8": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Failed login attempts", + "operationType": "formula", + "params": { + "formula": "count()", + "isFormulaBroken": false + }, + "references": [ + "22579769-dcb6-457e-82b4-76eacc56deb8X0" + ], + "scale": "ratio" + }, + "22579769-dcb6-457e-82b4-76eacc56deb8X0": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Part of Failed login attempts", + "operationType": "count", + "params": { + "emptyAsNull": false + }, + "scale": "ratio", + "sourceField": "___records___" + } + }, + "incompleteColumns": {} + } + } + } + }, + "filters": [ + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "index": "c852551f-ae1c-4458-aa84-c1b3df007e2a", + "key": "event.action", + "negate": false, + "params": { + "query": "login-attempt" + }, + "type": "phrase" + }, + "query": { + "match_phrase": { + "event.action": "login-attempt" + } + } + }, + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "index": "347ee7a5-24cf-477f-83b8-f7edeb6ed68a", + "key": "event.outcome", + "negate": false, + "params": { + "query": "failure" + }, + "type": "phrase" + }, + "query": { + "match_phrase": { + "event.outcome": "failure" + } + } + } + ], + "query": { + "language": "kuery", + "query": "event.dataset : salesforce.login*" + }, + "visualization": { + "accessor": "22579769-dcb6-457e-82b4-76eacc56deb8", + "layerId": "e1b2bc2f-ba01-4998-8cf8-a20d5e2f4da5", + "layerType": "data", + "size": "l", + "textAlign": "center", + "titlePosition": "bottom" + } + }, + "title": "", + "type": "lens", + "visualizationType": "lnsMetric" + }, + "enhancements": {}, + "hidePanelTitles": true + }, + "gridData": { + "h": 9, + "i": "e75fee04-c83e-48ad-83bd-498189cabec7", + "w": 24, + "x": 24, + "y": 0 + }, + "panelIndex": "e75fee04-c83e-48ad-83bd-498189cabec7", + "title": "Failed login attempts [Logs Salesforce]", + "type": "lens", + "version": "8.4.1" + }, + { + "embeddableConfig": { + "attributes": { + "references": [ + { + "id": "logs-*", + "name": "indexpattern-datasource-layer-440fc980-229c-428f-b87b-78b25eeb6155", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "8c6366bd-21fa-4b2e-a52a-ab605cd62cec", + "type": "index-pattern" + } + ], + "state": { + "datasourceStates": { + "indexpattern": { + "layers": { + "440fc980-229c-428f-b87b-78b25eeb6155": { + "columnOrder": [ + "f352fcbd-0e4a-4370-9e73-48616c476653", + "c1ff1268-7525-4784-b979-c05c5f137e75", + "24d3e40d-dba5-477a-9c98-85d41d66c0f6" + ], + "columns": { + "24d3e40d-dba5-477a-9c98-85d41d66c0f6": { + "customLabel": true, + "dataType": "number", + "filter": { + "language": "kuery", + "query": "event.outcome : \"failure\" " + }, + "isBucketed": false, + "label": "Failure", + "operationType": "count", + "params": { + "emptyAsNull": true + }, + "scale": "ratio", + "sourceField": "___records___" + }, + "c1ff1268-7525-4784-b979-c05c5f137e75": { + "customLabel": true, + "dataType": "number", + "filter": { + "language": "kuery", + "query": "event.outcome : \"success\" " + }, + "isBucketed": false, + "label": "Success", + "operationType": "count", + "params": { + "emptyAsNull": true + }, + "scale": "ratio", + "sourceField": "___records___" + }, + "f352fcbd-0e4a-4370-9e73-48616c476653": { + "dataType": "date", + "isBucketed": true, + "label": "@timestamp", + "operationType": "date_histogram", + "params": { + "dropPartials": false, + "includeEmptyRows": true, + "interval": "auto" + }, + "scale": "interval", + "sourceField": "@timestamp" + } + }, + "incompleteColumns": {} + } + } + } + }, + "filters": [ + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "index": "8c6366bd-21fa-4b2e-a52a-ab605cd62cec", + "key": "event.action", + "negate": false, + "params": { + "query": "login-attempt" + }, + "type": "phrase" + }, + "query": { + "match_phrase": { + "event.action": "login-attempt" + } + } + } + ], + "query": { + "language": "kuery", + "query": "event.dataset : salesforce.login*" + }, + "visualization": { + "axisTitlesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "fillOpacity": 0, + "fittingFunction": "None", + "gridlinesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "labelsOrientation": { + "x": 0, + "yLeft": 0, + "yRight": 0 + }, + "layers": [ + { + "accessors": [ + "c1ff1268-7525-4784-b979-c05c5f137e75", + "24d3e40d-dba5-477a-9c98-85d41d66c0f6" + ], + "layerId": "440fc980-229c-428f-b87b-78b25eeb6155", + "layerType": "data", + "palette": { + "name": "default", + "type": "palette" + }, + "seriesType": "line", + "xAccessor": "f352fcbd-0e4a-4370-9e73-48616c476653", + "yConfig": [ + { + "axisMode": "left", + "color": "#68BC00", + "forAccessor": "c1ff1268-7525-4784-b979-c05c5f137e75" + }, + { + "color": "#e7664c", + "forAccessor": "24d3e40d-dba5-477a-9c98-85d41d66c0f6" + } + ] + } + ], + "legend": { + "isVisible": true, + "maxLines": 1, + "position": "right", + "shouldTruncate": true, + "showSingleSeries": true + }, + "preferredSeriesType": "bar_stacked", + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "valueLabels": "hide", + "valuesInLegend": true, + "yLeftExtent": { + "mode": "full" + }, + "yRightExtent": { + "mode": "full" + }, + "yTitle": "Requests" + } + }, + "title": "", + "type": "lens", + "visualizationType": "lnsXY" + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "gridData": { + "h": 15, + "i": "e780606f-6362-497e-9e17-940937ead5bf", + "w": 48, + "x": 0, + "y": 9 + }, + "panelIndex": "e780606f-6362-497e-9e17-940937ead5bf", + "title": "Login over time [Logs Salesforce]", + "type": "lens", + "version": "8.4.1" + }, + { + "embeddableConfig": { + "attributes": { + "references": [ + { + "id": "logs-*", + "name": "indexpattern-datasource-layer-9c7705b7-2344-40b4-a257-d8ced3dd0740", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "bbe6f43f-7e31-4cc5-9d5c-6377e853a172", + "type": "index-pattern" + } + ], + "state": { + "datasourceStates": { + "indexpattern": { + "layers": { + "9c7705b7-2344-40b4-a257-d8ced3dd0740": { + "columnOrder": [ + "8f42c063-bb66-4b3b-8f52-83103613cd09", + "68fb2e14-2d3c-49b3-a3d1-dadbf2e3d950" + ], + "columns": { + "68fb2e14-2d3c-49b3-a3d1-dadbf2e3d950": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Login Events", + "operationType": "count", + "params": { + "emptyAsNull": true + }, + "scale": "ratio", + "sourceField": "___records___" + }, + "8f42c063-bb66-4b3b-8f52-83103613cd09": { + "dataType": "date", + "isBucketed": true, + "label": "@timestamp", + "operationType": "date_histogram", + "params": { + "dropPartials": false, + "includeEmptyRows": true, + "interval": "auto" + }, + "scale": "interval", + "sourceField": "@timestamp" + } + }, + "incompleteColumns": {} + } + } + } + }, + "filters": [ + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "index": "bbe6f43f-7e31-4cc5-9d5c-6377e853a172", + "key": "event.action", + "negate": false, + "params": { + "query": "login-attempt" + }, + "type": "phrase" + }, + "query": { + "match_phrase": { + "event.action": "login-attempt" + } + } + } + ], + "query": { + "language": "kuery", + "query": "event.dataset : salesforce.login*" + }, + "visualization": { + "axisTitlesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "gridlinesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "layers": [ + { + "accessors": [ + "68fb2e14-2d3c-49b3-a3d1-dadbf2e3d950" + ], + "layerId": "9c7705b7-2344-40b4-a257-d8ced3dd0740", + "layerType": "data", + "position": "top", + "seriesType": "bar", + "showGridlines": false, + "xAccessor": "8f42c063-bb66-4b3b-8f52-83103613cd09" + } + ], + "legend": { + "isVisible": true, + "position": "right" + }, + "preferredSeriesType": "bar", + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "title": "Empty XY chart", + "valueLabels": "hide", + "yTitle": "" + } + }, + "title": "", + "type": "lens", + "visualizationType": "lnsXY" + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "gridData": { + "h": 17, + "i": "27d96d74-bfe5-4676-84fc-0f7e24594b5a", + "w": 48, + "x": 0, + "y": 24 + }, + "panelIndex": "27d96d74-bfe5-4676-84fc-0f7e24594b5a", + "title": "Total login events over time [Logs Salesforce]", + "type": "lens", + "version": "8.4.1" + }, + { + "embeddableConfig": { + "attributes": { + "references": [ + { + "id": "logs-*", + "name": "indexpattern-datasource-layer-c99534c3-c26a-4456-837b-3a71c0c9423e", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "aef9e94f-e863-4b02-9af2-7b1fec38873c", + "type": "index-pattern" + } + ], + "state": { + "datasourceStates": { + "indexpattern": { + "layers": { + "c99534c3-c26a-4456-837b-3a71c0c9423e": { + "columnOrder": [ + "424fcd8e-fd11-4d5b-8eec-6a20473e1134", + "9478baac-1153-4cda-a4b4-08db8af7580a" + ], + "columns": { + "424fcd8e-fd11-4d5b-8eec-6a20473e1134": { + "dataType": "string", + "isBucketed": true, + "label": "Top 10 values of user.roles", + "operationType": "terms", + "params": { + "missingBucket": false, + "orderBy": { + "columnId": "9478baac-1153-4cda-a4b4-08db8af7580a", + "type": "column" + }, + "orderDirection": "desc", + "otherBucket": true, + "parentFormat": { + "id": "terms" + }, + "secondaryFields": [], + "size": 10 + }, + "scale": "ordinal", + "sourceField": "user.roles" + }, + "9478baac-1153-4cda-a4b4-08db8af7580a": { + "dataType": "number", + "isBucketed": false, + "label": "Count of records", + "operationType": "count", + "params": { + "emptyAsNull": true + }, + "scale": "ratio", + "sourceField": "___records___" + } + }, + "incompleteColumns": {} + } + } + } + }, + "filters": [ + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "index": "aef9e94f-e863-4b02-9af2-7b1fec38873c", + "key": "event.action", + "negate": false, + "params": { + "query": "login-attempt" + }, + "type": "phrase" + }, + "query": { + "match_phrase": { + "event.action": "login-attempt" + } + } + } + ], + "query": { + "language": "kuery", + "query": "event.dataset : salesforce.login*" + }, + "visualization": { + "layers": [ + { + "categoryDisplay": "default", + "groups": [ + "424fcd8e-fd11-4d5b-8eec-6a20473e1134" + ], + "layerId": "c99534c3-c26a-4456-837b-3a71c0c9423e", + "layerType": "data", + "legendDisplay": "default", + "metric": "9478baac-1153-4cda-a4b4-08db8af7580a", + "nestedLegend": false, + "numberDisplay": "percent" + } + ], + "shape": "pie" + } + }, + "title": "", + "type": "lens", + "visualizationType": "lnsPie" + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "gridData": { + "h": 15, + "i": "9ea2b92f-5fb6-4a83-b198-5275565a4bd6", + "w": 24, + "x": 0, + "y": 41 + }, + "panelIndex": "9ea2b92f-5fb6-4a83-b198-5275565a4bd6", + "title": "Distribution of type of users [Logs Salesforce]", + "type": "lens", + "version": "8.4.1" + }, + { + "embeddableConfig": { + "enhancements": {}, + "hidePanelTitles": false, + "savedVis": { + "data": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "emptyAsNull": false + }, + "schema": "metric", + "type": "count" + }, + { + "enabled": true, + "id": "2", + "params": { + "customLabel": "User Agent", + "excludeIsRegex": true, + "field": "user_agent.name", + "includeIsRegex": true, + "missingBucket": false, + "missingBucketLabel": "Missing", + "order": "desc", + "orderBy": "1", + "otherBucket": false, + "otherBucketLabel": "Other", + "size": 5 + }, + "schema": "segment", + "type": "terms" + } + ], + "searchSource": { + "filter": [ + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "indexRefName": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index", + "key": "event.action", + "negate": false, + "params": { + "query": "login-attempt" + }, + "type": "phrase" + }, + "query": { + "match_phrase": { + "event.action": "login-attempt" + } + } + } + ], + "indexRefName": "kibanaSavedObjectMeta.searchSourceJSON.index", + "query": { + "language": "kuery", + "query": "event.dataset : salesforce.login*" + } + } + }, + "description": "", + "params": { + "addTooltip": true, + "distinctColors": false, + "emptySizeRatio": 0.3, + "isDonut": true, + "labels": { + "last_level": false, + "percentDecimals": 2, + "position": "default", + "show": true, + "truncate": 100, + "values": true, + "valuesFormat": "percent" + }, + "legendDisplay": "hide", + "legendPosition": "right", + "legendSize": "auto", + "maxLegendLines": 1, + "nestedLegend": false, + "palette": { + "name": "default", + "type": "palette" + }, + "truncateLegend": true, + "type": "pie" + }, + "title": "", + "type": "pie", + "uiState": { + "vis": { + "legendOpen": false + } + } + } + }, + "gridData": { + "h": 15, + "i": "14104c32-ddff-40b4-a924-5ca274327cc1", + "w": 24, + "x": 24, + "y": 41 + }, + "panelIndex": "14104c32-ddff-40b4-a924-5ca274327cc1", + "title": "Activity by browser/client [Logs Salesforce]", + "type": "visualization", + "version": "8.4.1" + }, + { + "embeddableConfig": { + "attributes": { + "references": [ + { + "id": "logs-*", + "name": "indexpattern-datasource-layer-26b85139-d8f7-4158-829c-eed584dc6310", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "25060248-47cb-4a2f-91f4-2a43eb8caa7e", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "80e2b839-9e4a-4780-8b3e-d4820140b05e", + "type": "index-pattern" + } + ], + "state": { + "datasourceStates": { + "indexpattern": { + "layers": { + "26b85139-d8f7-4158-829c-eed584dc6310": { + "columnOrder": [ + "65546aa1-5590-4703-b806-3b7ca0db4ba0", + "747231b5-9a00-4095-ba5c-61753b1aa507", + "ca71c67d-8417-46d4-834d-3d73268f202d", + "5fc80d7b-efe9-4629-8702-584a6dde58d3", + "3515b14c-c836-46d3-b3e3-1b27b0eca9d8" + ], + "columns": { + "3515b14c-c836-46d3-b3e3-1b27b0eca9d8": { + "customLabel": true, + "dataType": "string", + "filter": { + "language": "kuery", + "query": "event.outcome: *" + }, + "isBucketed": false, + "label": "Request status", + "operationType": "last_value", + "params": { + "sortField": "@timestamp" + }, + "scale": "ordinal", + "sourceField": "event.outcome" + }, + "5fc80d7b-efe9-4629-8702-584a6dde58d3": { + "customLabel": true, + "dataType": "number", + "filter": { + "language": "kuery", + "query": "salesforce.login.run_time: *" + }, + "isBucketed": false, + "label": "Run time (ms)", + "operationType": "last_value", + "params": { + "sortField": "@timestamp" + }, + "scale": "ratio", + "sourceField": "salesforce.login.run_time" + }, + "65546aa1-5590-4703-b806-3b7ca0db4ba0": { + "dataType": "string", + "isBucketed": true, + "label": "Top 10000 values of _id", + "operationType": "terms", + "params": { + "missingBucket": false, + "orderBy": { + "columnId": "747231b5-9a00-4095-ba5c-61753b1aa507", + "type": "column" + }, + "orderDirection": "desc", + "otherBucket": true, + "parentFormat": { + "id": "terms" + }, + "size": 10000 + }, + "scale": "ordinal", + "sourceField": "_id" + }, + "747231b5-9a00-4095-ba5c-61753b1aa507": { + "customLabel": true, + "dataType": "date", + "filter": { + "language": "kuery", + "query": "@timestamp: *" + }, + "isBucketed": false, + "label": "Timestamp", + "operationType": "last_value", + "params": { + "sortField": "@timestamp" + }, + "scale": "ratio", + "sourceField": "@timestamp" + }, + "ca71c67d-8417-46d4-834d-3d73268f202d": { + "customLabel": true, + "dataType": "number", + "filter": { + "language": "kuery", + "query": "salesforce.login.db_time.total: *" + }, + "isBucketed": false, + "label": "DB total time (ms)", + "operationType": "last_value", + "params": { + "sortField": "@timestamp" + }, + "scale": "ratio", + "sourceField": "salesforce.login.db_time.total" + } + }, + "incompleteColumns": {} + } + } + } + }, + "filters": [ + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "index": "25060248-47cb-4a2f-91f4-2a43eb8caa7e", + "key": "event.action", + "negate": false, + "params": { + "query": "login-attempt" + }, + "type": "phrase" + }, + "query": { + "match_phrase": { + "event.action": "login-attempt" + } + } + }, + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "index": "80e2b839-9e4a-4780-8b3e-d4820140b05e", + "key": "event.outcome", + "negate": false, + "type": "exists", + "value": "exists" + }, + "query": { + "exists": { + "field": "event.outcome" + } + } + } + ], + "query": { + "language": "kuery", + "query": "event.dataset: salesforce.login*" + }, + "visualization": { + "columns": [ + { + "columnId": "65546aa1-5590-4703-b806-3b7ca0db4ba0", + "hidden": true, + "isTransposed": false + }, + { + "columnId": "747231b5-9a00-4095-ba5c-61753b1aa507", + "isTransposed": false + }, + { + "alignment": "left", + "columnId": "ca71c67d-8417-46d4-834d-3d73268f202d", + "isTransposed": false + }, + { + "columnId": "3515b14c-c836-46d3-b3e3-1b27b0eca9d8", + "isTransposed": false + }, + { + "alignment": "left", + "columnId": "5fc80d7b-efe9-4629-8702-584a6dde58d3", + "isTransposed": false + } + ], + "layerId": "26b85139-d8f7-4158-829c-eed584dc6310", + "layerType": "data", + "paging": { + "enabled": true, + "size": 10 + } + } + }, + "title": "", + "type": "lens", + "visualizationType": "lnsDatatable" + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "gridData": { + "h": 17, + "i": "b2b60887-159a-4a2f-a477-eece1cda9620", + "w": 24, + "x": 0, + "y": 56 + }, + "panelIndex": "b2b60887-159a-4a2f-a477-eece1cda9620", + "title": "Login events table [Logs Salesforce]", + "type": "lens", + "version": "8.4.1" + }, + { + "embeddableConfig": { + "attributes": { + "references": [ + { + "id": "logs-*", + "name": "indexpattern-datasource-layer-21816ba6-c606-4532-9362-64890b01b81c", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "291ef01d-68cf-4c56-bc16-79b16ecb8195", + "type": "index-pattern" + } + ], + "state": { + "datasourceStates": { + "indexpattern": { + "layers": { + "21816ba6-c606-4532-9362-64890b01b81c": { + "columnOrder": [ + "20cea7a4-2d2b-4a01-8591-e8aa9a80d6c3", + "9ab68795-f5bc-485c-b0db-9e8f87d5b992" + ], + "columns": { + "20cea7a4-2d2b-4a01-8591-e8aa9a80d6c3": { + "customLabel": true, + "dataType": "ip", + "isBucketed": true, + "label": "IP Addresses", + "operationType": "terms", + "params": { + "missingBucket": false, + "orderBy": { + "columnId": "9ab68795-f5bc-485c-b0db-9e8f87d5b992", + "type": "column" + }, + "orderDirection": "desc", + "otherBucket": false, + "parentFormat": { + "id": "terms" + }, + "size": 10 + }, + "scale": "ordinal", + "sourceField": "source.ip" + }, + "9ab68795-f5bc-485c-b0db-9e8f87d5b992": { + "customLabel": true, + "dataType": "number", + "isBucketed": false, + "label": "Request count", + "operationType": "count", + "params": { + "emptyAsNull": true + }, + "scale": "ratio", + "sourceField": "___records___" + } + }, + "incompleteColumns": {} + } + } + } + }, + "filters": [ + { + "$state": { + "store": "appState" + }, + "meta": { + "alias": null, + "disabled": false, + "index": "291ef01d-68cf-4c56-bc16-79b16ecb8195", + "key": "event.action", + "negate": false, + "params": { + "query": "login-attempt" + }, + "type": "phrase" + }, + "query": { + "match_phrase": { + "event.action": "login-attempt" + } + } + } + ], + "query": { + "language": "kuery", + "query": "event.dataset : salesforce.login*" + }, + "visualization": { + "axisTitlesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "fittingFunction": "None", + "gridlinesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "labelsOrientation": { + "x": 0, + "yLeft": 0, + "yRight": 0 + }, + "layers": [ + { + "accessors": [ + "9ab68795-f5bc-485c-b0db-9e8f87d5b992" + ], + "layerId": "21816ba6-c606-4532-9362-64890b01b81c", + "layerType": "data", + "seriesType": "bar_horizontal", + "xAccessor": "20cea7a4-2d2b-4a01-8591-e8aa9a80d6c3" + } + ], + "legend": { + "isVisible": true, + "position": "right" + }, + "preferredSeriesType": "bar_horizontal", + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "valueLabels": "hide" + } + }, + "title": "", + "type": "lens", + "visualizationType": "lnsXY" + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "gridData": { + "h": 17, + "i": "4a2b88af-ad1a-416d-9553-d21b23882c22", + "w": 24, + "x": 24, + "y": 56 + }, + "panelIndex": "4a2b88af-ad1a-416d-9553-d21b23882c22", + "title": "Top 10 IP addresses by request count [Logs Salesforce]", + "type": "lens", + "version": "8.4.1" + }, + { + "embeddableConfig": { + "attributes": { + "description": "", + "layerListJSON": "[{\"locale\":\"autoselect\",\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"isAutoSelect\":true,\"lightModeDefault\":\"road_map_desaturated\"},\"id\":\"3de98652-8d42-4415-91ca-d64b26bb6972\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":1,\"visible\":true,\"style\":{\"type\":\"EMS_VECTOR_TILE\",\"color\":\"\"},\"includeInFitToBounds\":true,\"type\":\"EMS_VECTOR_TILE\"},{\"sourceDescriptor\":{\"geoField\":\"source.geo.location\",\"scalingType\":\"MVT\",\"id\":\"6d0ed8a8-d5de-4d2e-9e05-0fd4b7dc2384\",\"type\":\"ES_SEARCH\",\"applyGlobalQuery\":true,\"applyGlobalTime\":true,\"applyForceRefresh\":true,\"filterByMapBounds\":true,\"tooltipProperties\":[],\"sortField\":\"\",\"sortOrder\":\"desc\",\"topHitsSplitField\":\"\",\"topHitsSize\":1,\"indexPatternRefName\":\"layer_1_source_index_pattern\"},\"id\":\"546e11d2-db52-457b-8733-e1ee75c51fd8\",\"label\":\"Login Activity\",\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#54B399\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#41937c\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":6}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"STATIC\",\"options\":{\"value\":\"\"}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelZoomRange\":{\"options\":{\"useLayerZoomRange\":true,\"minZoom\":0,\"maxZoom\":24}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}}},\"isTimeAware\":true},\"includeInFitToBounds\":true,\"type\":\"MVT_VECTOR\",\"joins\":[]}]", + "mapStateJSON": "{\"zoom\":13.27,\"center\":{\"lon\":-0.10849,\"lat\":51.51456},\"timeFilters\":{\"from\":\"now-7d/d\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":false,\"interval\":900000},\"query\":{\"query\":\"event.dataset: salesforce.login* \",\"language\":\"kuery\"},\"filters\":[],\"settings\":{\"autoFitToDataBounds\":false,\"backgroundColor\":\"#ffffff\",\"customIcons\":[],\"disableInteractive\":false,\"disableTooltipControl\":false,\"hideToolbarOverlay\":false,\"hideLayerControl\":false,\"hideViewControl\":false,\"initialLocation\":\"LAST_SAVED_LOCATION\",\"fixedLocation\":{\"lat\":0,\"lon\":0,\"zoom\":2},\"browserLocation\":{\"zoom\":2},\"keydownScrollZoom\":false,\"maxZoom\":24,\"minZoom\":0,\"showScaleControl\":false,\"showSpatialFilters\":true,\"showTimesliderToggleButton\":true,\"spatialFiltersAlpa\":0.3,\"spatialFiltersFillColor\":\"#DA8B45\",\"spatialFiltersLineColor\":\"#DA8B45\"}}", + "title": "", + "uiStateJSON": "{\"isLayerTOCOpen\":true,\"openTOCDetails\":[]}" + }, + "enhancements": {}, + "hiddenLayers": [], + "hidePanelTitles": false, + "isLayerTOCOpen": true, + "mapBuffer": { + "maxLat": 51.53609, + "maxLon": -0.04395, + "minLat": 51.49506, + "minLon": -0.17578 + }, + "mapCenter": { + "lat": 51.51456, + "lon": -0.10849, + "zoom": 13.27 + }, + "openTOCDetails": [] + }, + "gridData": { + "h": 15, + "i": "bc6b147a-bd41-4f00-affe-4a7b7fbaab7a", + "w": 48, + "x": 0, + "y": 73 + }, + "panelIndex": "bc6b147a-bd41-4f00-affe-4a7b7fbaab7a", + "title": "Login activity by region [Logs Salesforce]", + "type": "map", + "version": "8.4.1" + } + ], + "refreshInterval": { + "pause": false, + "value": 900000 + }, + "timeFrom": "now-7d/d", + "timeRestore": true, + "timeTo": "now", + "title": "[Logs Salesforce] Login Dashboard", + "version": 1 + }, + "coreMigrationVersion": "8.4.1", + "id": "salesforce-1659aef0-574c-11ec-8f0b-05e8b06e1b10-pkg", + "migrationVersion": { + "dashboard": "8.4.0" + }, + "references": [ + { + "id": "logs-*", + "name": "0e854818-b5d3-4758-b099-04d68167678a:indexpattern-datasource-layer-e1b2bc2f-ba01-4998-8cf8-a20d5e2f4da5", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "0e854818-b5d3-4758-b099-04d68167678a:39032351-9ac1-4a65-8165-a19ec20f0ace", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "e75fee04-c83e-48ad-83bd-498189cabec7:indexpattern-datasource-layer-e1b2bc2f-ba01-4998-8cf8-a20d5e2f4da5", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "e75fee04-c83e-48ad-83bd-498189cabec7:c852551f-ae1c-4458-aa84-c1b3df007e2a", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "e75fee04-c83e-48ad-83bd-498189cabec7:347ee7a5-24cf-477f-83b8-f7edeb6ed68a", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "e780606f-6362-497e-9e17-940937ead5bf:indexpattern-datasource-layer-440fc980-229c-428f-b87b-78b25eeb6155", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "e780606f-6362-497e-9e17-940937ead5bf:8c6366bd-21fa-4b2e-a52a-ab605cd62cec", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "27d96d74-bfe5-4676-84fc-0f7e24594b5a:indexpattern-datasource-layer-9c7705b7-2344-40b4-a257-d8ced3dd0740", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "27d96d74-bfe5-4676-84fc-0f7e24594b5a:bbe6f43f-7e31-4cc5-9d5c-6377e853a172", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "9ea2b92f-5fb6-4a83-b198-5275565a4bd6:indexpattern-datasource-layer-c99534c3-c26a-4456-837b-3a71c0c9423e", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "9ea2b92f-5fb6-4a83-b198-5275565a4bd6:aef9e94f-e863-4b02-9af2-7b1fec38873c", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "14104c32-ddff-40b4-a924-5ca274327cc1:kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "14104c32-ddff-40b4-a924-5ca274327cc1:kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "b2b60887-159a-4a2f-a477-eece1cda9620:indexpattern-datasource-layer-26b85139-d8f7-4158-829c-eed584dc6310", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "b2b60887-159a-4a2f-a477-eece1cda9620:25060248-47cb-4a2f-91f4-2a43eb8caa7e", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "b2b60887-159a-4a2f-a477-eece1cda9620:80e2b839-9e4a-4780-8b3e-d4820140b05e", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "4a2b88af-ad1a-416d-9553-d21b23882c22:indexpattern-datasource-layer-21816ba6-c606-4532-9362-64890b01b81c", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "4a2b88af-ad1a-416d-9553-d21b23882c22:291ef01d-68cf-4c56-bc16-79b16ecb8195", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "bc6b147a-bd41-4f00-affe-4a7b7fbaab7a:layer_1_source_index_pattern", + "type": "index-pattern" + }, + { + "id": "logs-*", + "name": "controlGroup_afac70de-aeee-46de-9b78-9e584d5c3f7e:optionsListDataView", + "type": "index-pattern" + } + ], + "type": "dashboard" +} \ No newline at end of file diff --git a/packages/salesforce/manifest.yml b/packages/salesforce/manifest.yml new file mode 100644 index 00000000000..0e1552012d4 --- /dev/null +++ b/packages/salesforce/manifest.yml @@ -0,0 +1,70 @@ +format_version: 1.0.0 +name: salesforce +title: Salesforce +version: 0.1.0 +license: basic +description: Collect logs from Salesforce with Elastic Agent. +type: integration +categories: + - crm +conditions: + kibana.version: ^8.4.0 +screenshots: + - src: /img/salesforce-login.png + title: Salesforce Login Dashboard + size: 1366x1912 + type: image/png +icons: + - src: /img/salesforce.svg + title: Salesforce + size: 32x32 + type: image/svg+xml +policy_templates: + - name: salesforce + title: Salesforce logs + description: Collect logs from Salesforce instances. + inputs: + - type: httpjson + vars: + - name: instance_url + type: text + title: Instance URL + description: The Instance URL of the Salesforce instance. + required: true + show_user: true + default: https://instance-url.salesforce.com + - name: client_id + type: text + title: Client ID + description: OAuth 2.0 client ID. + required: true + show_user: true + - name: client_secret + type: password + title: Client Secret + description: OAuth 2.0 client secret. + required: true + show_user: true + - name: username + type: text + title: Username + description: Email Id used while registering salesforce, (i.e. my.email@here.com). + required: true + show_user: true + - name: password + type: password + title: Password + description: The password used as part of the authentication flow. + required: true + show_user: true + - name: token_url + type: text + title: Token URL + description: The OAuth 2.0 token URL for Salesforce. + required: true + show_user: false + default: https://login.salesforce.com/services/oauth2/token + title: Collect Salesforce logs + description: Collecting logs from Salesforce instances. +owner: + github: elastic/obs-service-integrations