Skip to content

Commit

Permalink
🐛 Fix issue with shodan token flag (#4408)
Browse files Browse the repository at this point in the history
The shodan token flag was not being accepted properly.

Fixes #4355
  • Loading branch information
jaym authored Jul 26, 2024
1 parent 48e2726 commit 3d40426
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions providers/shodan/resources/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func Discover(runtime *plugin.Runtime, opts map[string]string) (*inventory.Inven
assetList := []*inventory.Asset{}

addrs := resolveNetworks(networks)

for i := range addrs {
addr := addrs[i]

Expand All @@ -48,7 +49,7 @@ func Discover(runtime *plugin.Runtime, opts map[string]string) (*inventory.Inven
continue
}

assetList = append(assetList, &inventory.Asset{
a := &inventory.Asset{
Name: addr.String(),
Connections: []*inventory.Config{
{
Expand All @@ -57,9 +58,12 @@ func Discover(runtime *plugin.Runtime, opts map[string]string) (*inventory.Inven
Options: map[string]string{
"search": "host",
},
Credentials: conf.Credentials,
},
},
})
}

assetList = append(assetList, a)
}

in := &inventory.Inventory{Spec: &inventory.InventorySpec{
Expand Down

0 comments on commit 3d40426

Please sign in to comment.