
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
github.colasdn.workers.dev/magic003/alice
Advanced tools
Alice is an additive dependency injection container for Golang.
Design philosophy behind Alice:
$ go get github.com/magic003/alice
Alice is inspired by the design of Spring JavaConfig.
It usually takes 3 steps to use Alice.
The instances to be managed by the container are defined in modules. There could be multiple modules organized by the functionality of the instances. Modules are usually placed in a separate package.
A typical module looks like this:
type ExampleModule struct {
alice.BaseModule
Foo Foo `alice:""`
Bar Bar `alice:"Bar"`
Baz Baz
}
func (m *ExampleModule) InstanceX() X {
return X{m.Foo}
}
func (m *ExampleModule) InstanceY() Y {
return Y{m.Baz}
}
A module struct must embed the alice.BaseModule struct. It allows 3 types of fields:
alice:"". It will be associated with the same or assignable type of instance defined in other modules.alice:"Bar". It will be associated with the instance named Bar defined in other modules.alice tag. It will not be associated with any instance defined in other modules. It is expected to be provided when initializing the module. It is not managed by the container and could not be retrieved.It is also common that no field is defined in a module struct.
Any public method of the module struct defines one instance to be intialized and maintained by the container. It is required to use a pointer receiver. The method name will be used as the instance name. The return type will be used as the instance type. Inside the method, it could use any field of the module struct to create new instances.
During the bootstrap of the application, create a container by providing instances of modules.
m1 := &ExampleModule1{}
m2 := &ExampleModule2{...}
container := alice.CreateContainer(m1, m2)
It will panic if any module is invalid.
The container provides 2 ways to retrieve instances: by name and by type.
instanceX := container.InstanceByName("InstanceX")
instanceY := container.Instance(reflect.TypeOf((Y)(nil)))
It will panic either if no instance is found or if multiple matched types are found.
A dummy example using Alice.
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
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.