{"action":"opened","issue":{"url":"https://api.github.com/repos/future-architect/vuls/issues/755","repository_url":"https://api.github.com/repos/future-architect/vuls","labels_url":"https://api.github.com/repos/future-architect/vuls/issues/755/labels{/name}","comments_url":"https://api.github.com/repos/future-architect/vuls/issues/755/comments","events_url":"https://api.github.com/repos/future-architect/vuls/issues/755/events","html_url":"https://github.com/future-architect/vuls/issues/755","id":393457241,"node_id":"MDU6SXNzdWUzOTM0NTcyNDE=","number":755,"title":"Failed to send notification to Slack via webhook","user":{"login":"yahharo","id":4724153,"node_id":"MDQ6VXNlcjQ3MjQxNTM=","avatar_url":"https://avatars3.githubusercontent.com/u/4724153?v=4","gravatar_id":"","url":"https://api.github.com/users/yahharo","html_url":"https://github.com/yahharo","followers_url":"https://api.github.com/users/yahharo/followers","following_url":"https://api.github.com/users/yahharo/following{/other_user}","gists_url":"https://api.github.com/users/yahharo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahharo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahharo/subscriptions","organizations_url":"https://api.github.com/users/yahharo/orgs","repos_url":"https://api.github.com/users/yahharo/repos","events_url":"https://api.github.com/users/yahharo/events{/privacy}","received_events_url":"https://api.github.com/users/yahharo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-21T13:22:20Z","updated_at":"2018-12-21T13:22:20Z","closed_at":null,"author_association":"NONE","body":"# What did you do? (required. The issue will be **closed** when not provided.)\r\n\r\nRun vuls report with Docker like these:\r\n```bash\r\n$ docker run --rm \\\r\n    -v $PWD:/vuls \\\r\n    -v $PWD/vuls-log:/var/log/vuls \\\r\n    -v /etc/localtime:/etc/localtime:ro \\\r\n    vuls/vuls report \\\r\n    -cvedb-sqlite3-path /vuls/cve.sqlite3 \\\r\n    -to-slack \\\r\n    -diff \\\r\n    -config=./config.toml\r\n```\r\n\r\n# What did you expect to happen?\r\n\r\nWhen vuls detect some vulnerable libraries, notify to slack.\r\n\r\n# What happened instead?\r\n\r\nFailed to send notification to Slack via webhook\r\n\r\n```log\r\ntime=\"2018-12-21T12:47:51Z\" level=warning msg=\"Error HTTP POST error: [], url: https://hooks.slack.com/services/foo/bar, resp: &{400 Bad Request 400 HTTP/2.0 2 0 map[Server:[Apache] Strict-Transport-Security:[max-age=31536000; includeSubDomains; preload] X-Frame-Options:[SAMEORIGIN] Access-Control-Allow-Origin:[*] X-Via:[haproxy-www-g9aw] Via:[1.1 4b41f5d4002cf5daabe6e170bd619abc.cloudfront.net (CloudFront)] Date:[Fri, 21 Dec 2018 12:47:51 GMT] Referrer-Policy:[no-referrer] X-Cache:[Error from cloudfront] X-Amz-Cf-Id:[NMSfOOM_nHU5Ugx75RJAiQkRoGYLxmnZg2aPo_clmotrmME3Y9uqXw==] Retry-Count:[0] Content-Type:[text/html]] {invalid_thread_ts} -1 [] false false map[] 0xc0002d8700 0xc000b38420}, body: invalid_thread_ts\"\r\n```\r\n\r\nTry to via curl like these: It response is `ok`.\r\n```\r\ncurl -X POST \\\r\n  --data-urlencode 'payload={\"channel\": \"#some-channel\"\r\n  , \"username\": \"test_user\"\r\n  , \"text\": \"Text Message\"\r\n  , \"icon_emoji\": \":+1:\"}'  \\\r\n\"https://hooks.slack.com/services/XXXXXX\"\r\n```\r\n\r\nTry to via curl like these: It response is `ok`.\r\n```\r\ncurl -X POST \\\r\n  --data-urlencode 'payload={\"channel\": \"#some-channel\"\r\n  , \"username\": \"test_user\"\r\n  , \"text\": \"Text Message\"\r\n  , \"icon_emoji\": \":+1:\"}'  \\\r\n\"https://hooks.slack.com/services/XXXXXX\"\r\n```\r\n\r\nBut add `thread_ts` like these: Its response is `invalid_thread_ts`\r\n(Vuls send like this)\r\n```\r\ncurl -X POST \\\r\n  --data-urlencode 'payload={\"channel\": \"#some-channel\"\r\n  , \"username\": \"test_user\"\r\n  , \"text\": \"Text Message\"\r\n  , \"thread_ts\": \"\"\r\n  , \"icon_emoji\": \":+1:\"}'  \\\r\n\"https://hooks.slack.com/services/XXXXXX\"\r\n```\r\n\r\n# Steps to reproduce the behaviour\r\n\r\nTry to send notification to slack via Incoming Webhook.\r\n\r\n# Configuration (**MUST** fill this out):\r\n\r\n* Go version (`go version`):\r\n\r\nUse Docker Image from Docker Hub\r\n\r\n* Go environment (`go env`):\r\n\r\nUse Docker Image from Docker Hub\r\n\r\n* Vuls environment:\r\n\r\nHash : 7842594f538ffcafba08f8c273818081059a33f2\r\n\r\nTo check the commit hash of HEAD\r\n$ vuls -v\r\n\r\nor\r\n\r\n$ cd $GOPATH/src/github.com/future-architect/vuls \r\n$ git rev-parse --short HEAD \r\n\r\n* config.toml:\r\n\r\n```config.toml \r\n[slack]\r\nhookURL      = \"https://hooks.slack.com/services/XXXXXX\"\r\nchannel      = \"#some-channel\"\r\niconEmoji    = \":bird:\"\r\nauthUser     = \"XXXXXX\"\r\n\r\n[default]\r\nuser        = \"XXXXXX\"\r\nkeyPath     = \"XXXXXX\"\r\n```\r\n\r\n* command:\r\n\r\n```bash\r\n$ docker run --rm \\\r\n    -v $PWD:/vuls \\\r\n    -v $PWD/vuls-log:/var/log/vuls \\\r\n    -v /etc/localtime:/etc/localtime:ro \\\r\n    vuls/vuls report \\\r\n    -cvedb-sqlite3-path /vuls/cve.sqlite3 \\\r\n    -to-slack \\\r\n    -diff \\\r\n    -config=./config.toml\r\n```\r\n\r\n"}}
{"actor":{"display_login":"yahharo"}}