Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(report): CERT notification to slack #767

Closed
wants to merge 11 commits into from
Closed

feat(report): CERT notification to slack #767

wants to merge 11 commits into from

Conversation

kazuminn
Copy link
Contributor

@kazuminn kazuminn commented Jan 24, 2019

Fixes #742

What did you implement:

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

2019-01-30 16 02 31

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • When there is a link, it is displayed as JPCERT.
  • When there is no link, it is not displayed as USCERT.

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

***Is this ready for review?:***YES

Reference

report/slack.go Outdated Show resolved Hide resolved
@kazuminn kazuminn changed the title [WIP]CERT notification to slack CERT notification to slack Jan 24, 2019
@kotakanbe
Copy link
Member

@kazuminn Please paste the test result.

@kazuminn
Copy link
Contributor Author

kazuminn commented Feb 1, 2019

@kotakanbe I tested it with the following pattern in the test.

  • When there is a link, it is displayed as JPCERT.
  • When there is no link, it is not displayed as USCERT.

@kazuminn kazuminn changed the title CERT notification to slack [WI]CERT notification to slack Feb 7, 2019
@kazuminn kazuminn changed the title [WI]CERT notification to slack [WIP]feat(report): CERT notification to slack Feb 7, 2019
@kazuminn kazuminn changed the title [WIP]feat(report): CERT notification to slack feat(report): CERT notification to slack Feb 7, 2019
report/slack.go Outdated
if len(jpalert) != 0 && len(usalert) == 0 {
certAlert = fmt.Sprintf("<%s|JPCERT>", jpalert)
} else if len(usalert) != 0 && len(jpalert) == 0 {
certAlert = fmt.Sprintf("<%s|USCERT", usalert)
Copy link
Member

@kotakanbe kotakanbe Feb 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kazuminn

<%s|USCERT"

You should do the test carefully

return fmt.Sprintf("*%4.1f (%s)* %s %s\n%s\n```\n%s\n```%s\n%s\n",
certAlert := ""
var jpalert string
for _, ja := range vinfo.AlertDict.Ja {
Copy link
Member

@kotakanbe kotakanbe Feb 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes, one CVE has multiple alerts.
Your code overwrites the alert, so your code can not show multiple alerts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kazuminn kazuminn closed this Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display CERT information to slack notification
2 participants