ing
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
uuid "github.com/satori/go.uuid"
|
||||
|
||||
ocsm "git.loafle.net/overflow/commons-go/sensorconfig/model"
|
||||
ocmsc "git.loafle.net/overflow/commons-go/model/sensorconfig"
|
||||
"git.loafle.net/overflow/container_network/crawler/ssh/client"
|
||||
"git.loafle.net/overflow/container_network/crawler/ssh/parser"
|
||||
crawler "git.loafle.net/overflow/crawler-go"
|
||||
@@ -29,7 +29,7 @@ func (c *SSHCrawler) Auth(auth map[string]interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *SSHCrawler) Get(config *ocsm.SensorConfig) (map[string]string, error) {
|
||||
func (c *SSHCrawler) Get(config *ocmsc.SensorConfig) (map[string]string, error) {
|
||||
sshClient, err := client.New(config.Target)
|
||||
if nil != err {
|
||||
return nil, err
|
||||
@@ -73,7 +73,7 @@ func (c *SSHCrawler) Get(config *ocsm.SensorConfig) (map[string]string, error) {
|
||||
}
|
||||
|
||||
if nil != rm {
|
||||
mm := ocsm.KeysToMap(item.Keys)
|
||||
mm := ocmsc.KeysToMap(item.Keys)
|
||||
for key, value := range mm {
|
||||
results[value] = rm[key]
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ import (
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
ocsm "git.loafle.net/overflow/commons-go/sensorconfig/model"
|
||||
ocmsc "git.loafle.net/overflow/commons-go/model/sensorconfig"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestMatch(t *testing.T) {
|
||||
config := &ocsm.SensorConfig{}
|
||||
config := &ocmsc.SensorConfig{}
|
||||
data, err := ioutil.ReadFile("./SSHCrawler_test.json")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"git.loafle.net/commons_go/logging"
|
||||
cuej "git.loafle.net/commons_go/util/encoding/json"
|
||||
ocsm "git.loafle.net/overflow/commons-go/sensorconfig/model"
|
||||
ocmsc "git.loafle.net/overflow/commons-go/model/sensorconfig"
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
||||
@@ -88,7 +88,7 @@ func parsePrivateKey(keyPath, pw string) (ssh.Signer, error) {
|
||||
return ssh.ParsePrivateKeyWithPassphrase(buff, []byte(pw))
|
||||
}
|
||||
|
||||
func New(target *ocsm.Target) (*SSHClient, error) {
|
||||
func New(target *ocmsc.Target) (*SSHClient, error) {
|
||||
connection := target.Connection
|
||||
auth := target.Auth
|
||||
|
||||
|
||||
Reference in New Issue
Block a user