Earlier, we have shown you how to send the Findings data to Slack. Here is an example of how to send data over to JIRA.

Similar to previous examples, here is how we can convert the Findings data

FINDINGID=`cat $1 | grep -v Finding | sed s/" "/""/g | sed s/","/" "/g | awk '{print $1}' | sed s/'"'/""/g`

SOURCE=`cat $1 | grep -v Finding | sed s/" "/""/g | sed s/","/" "/g | awk '{print $6}' | sed s/'"'/""/g`

HOST=`cat $1 | grep -v Finding | sed s/" "/""/g | sed s/","/" "/g | awk '{print $7}' | sed s/'"'/""/g`

KB=`cat $1 | grep -v Finding | sed s/" "/""/g | sed s/","/" "/g | awk '{print $13}' | sed s/'"'/""/g`

With the variables, we can now post it on JIRA. In order to do that, we will need the desired JIRA information:

  • Project key (we are using "SKYLNE")
  • IssueType id (we are using "3")

The path of creating JIRA is always the same and it is:

https://jira.eng.vmware.com/rest/api/latest/issue/

To make it easier, we added the variables to the summary. For JIRA, you can use a user account or token. For this example, we have used a user account "nguyenso". For production deployment, we would recommend using a token. The result is the following:

1

curl -u nguyenso -D- -X POST -H "Content-Type: application/json" https://jira.eng.vmware.com/rest/api/latest/issue/ --data '{"fields":{"project":{"key":"SKYLINE"},"summary":"Skyline - Findings","description":"'"$FINDINGID, $SOURCE, $HOST, $KB"'","issuetype":{"id":"3"}}}'

If you inserted the correct "Project key" and "IssueType id", the new ticket will appear in JIRA.

Attachments

  • Original Link
  • Original Document
  • Permalink

Disclaimer

VMware Inc. published this content on 12 January 2022 and is solely responsible for the information contained therein. Distributed by Public, unedited and unaltered, on 12 January 2022 16:15:08 UTC.