GithubHelp home page GithubHelp logo

Comments (3)

Kedae avatar Kedae commented on June 18, 2024 1

Hi @dominictory,

We indeed change the notification message as it was rather unusable within the platform.
Previously you only add the entity type and the name of the entity in the notification even in case of Description modification for example.

For your case you can do:

{
    "type": "message",
    "attachments": [
            {
                "contentType": "application/json",
                "content": {
                    "alertSubject": "<%=data[0].instance.name%>",
	            "alertOperation": "<%=content[0].events[0].operation%>",
                    "alertDescription": "<%=data[0].instance.description%>",
                    "alertPlatformUrl": "https://10.254.202.12/dashboard/id/<%=content[0].events[0].instance_id%>"
                }
            }
        ]
}

It produces:

{
  "type": "message",
  "attachments": [
    {
      "contentType": "application/json",
      "content": {
        "alertSubject": "Test for webhook",
        "alertOperation": "create",
        "alertDescription": "",
        "alertPlatformUrl": "https://octi/dashboard/id/report--7cd8e1ac-d272-544b-aecb-57dfa8653462"
      }
    }
  ]
}

This will work for any SDO, if you want relationships or observables you will have to use a different attribute from your instance based on what you want to display.

In addition, and as part of our future milestones, we will improve the documentation on this part.

from opencti.

Kedae avatar Kedae commented on June 18, 2024 1

Within the data[0].instance you should have access to any piece of information regarding your current entity. You can use
<%-JSON.stringify(data[0].instance)%> to display all the information you can access

from opencti.

dominictory avatar dominictory commented on June 18, 2024

Hi @dominictory,

We indeed change the notification message as it was rather unusable within the platform. Previously you only add the entity type and the name of the entity in the notification even in case of Description modification for example.

For your case you can do:

{
    "type": "message",
    "attachments": [
            {
                "contentType": "application/json",
                "content": {
                    "alertSubject": "<%=data[0].instance.name%>",
	            "alertOperation": "<%=content[0].events[0].operation%>",
                    "alertDescription": "<%=data[0].instance.description%>",
                    "alertPlatformUrl": "https://10.254.202.12/dashboard/id/<%=content[0].events[0].instance_id%>"
                }
            }
        ]
}

It produces:

{
  "type": "message",
  "attachments": [
    {
      "contentType": "application/json",
      "content": {
        "alertSubject": "Test for webhook",
        "alertOperation": "create",
        "alertDescription": "",
        "alertPlatformUrl": "https://octi/dashboard/id/report--7cd8e1ac-d272-544b-aecb-57dfa8653462"
      }
    }
  ]
}

This will work for any SDO, if you want relationships or observables you will have to use a different attribute from your instance based on what you want to display.

In addition, and as part of our future milestones, we will improve the documentation on this part.

Thanks Kedae! One final piece for me is including external references in the alert, how would I display this?

from opencti.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.