Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/go-playground/webhooks
Library webhooks allows for easy receiving and parsing of GitHub, Bitbucket and GitLab Webhook Events
Features:
Notes:
Use go get.
go get -u gopkg.in/go-playground/webhooks.v5
Then import the package into your own code.
import "gopkg.in/go-playground/webhooks.v5"
Please see http://godoc.org/gopkg.in/go-playground/webhooks.v5 for detailed usage docs.
package main
import (
"fmt"
"net/http"
"gopkg.in/go-playground/webhooks.v5/github"
)
const (
path = "/webhooks"
)
func main() {
hook, _ := github.New(github.Options.Secret("MyGitHubSuperSecretSecrect...?"))
http.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) {
payload, err := hook.Parse(r, github.ReleaseEvent, github.PullRequestEvent)
if err != nil {
if err == github.ErrEventNotFound {
// ok event wasn;t one of the ones asked to be parsed
}
}
switch payload.(type) {
case github.ReleasePayload:
release := payload.(github.ReleasePayload)
// Do whatever you want from here...
fmt.Printf("%+v", release)
case github.PullRequestPayload:
pullRequest := payload.(github.PullRequestPayload)
// Do whatever you want from here...
fmt.Printf("%+v", pullRequest)
}
})
http.ListenAndServe(":3000", nil)
}
Pull requests for other services are welcome!
If the changes being proposed or requested are breaking changes, please create an issue for discussion.
Distributed under MIT License, please see license file in code for more details.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.