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/pseudomuto/protokit
A starter kit for building protoc-plugins. Rather than write your own, you can just use an existing one.
See the examples directory for uh...examples.
package main
import (
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/protoc-gen-go/plugin"
"github.com/pseudomuto/protokit"
_ "google.golang.org/genproto/googleapis/api/annotations" // Support (google.api.http) option (from google/api/annotations.proto).
"log"
)
func main() {
// all the heavy lifting done for you!
if err := protokit.RunPlugin(new(plugin)); err != nil {
log.Fatal(err)
}
}
// plugin is an implementation of protokit.Plugin
type plugin struct{}
func (p *plugin) Generate(in *plugin_go.CodeGeneratorRequest) (*plugin_go.CodeGeneratorResponse, error) {
descriptors := protokit.ParseCodeGenRequest(req)
resp := new(plugin_go.CodeGeneratorResponse)
for _, d := range descriptors {
// TODO: YOUR WORK HERE
fileName := // generate a file name based on d.GetName()
content := // generate content for the output file
resp.File = append(resp.File, &plugin_go.CodeGeneratorResponse_File{
Name: proto.String(fileName),
Content: proto.String(content),
})
}
return resp, nil
}
Then invoke your plugin via protoc
. For example (assuming your app is called thingy
):
protoc --plugin=protoc-gen-thingy=./thingy -I. --thingy_out=. rpc/*.proto
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.