Skip to content

Commit

Permalink
enumerations use the in-memory graph database
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed May 9, 2023
1 parent 8039ece commit cc2f09e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 5 additions & 4 deletions cmd/amass/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ func runEnumCommand(clArgs []string) {
// Expand data source category names into the associated source names
initializeSourceTags(sys.DataSources())
cfg.SourceFilter.Sources = expandCategoryNames(cfg.SourceFilter.Sources, generateCategoryMap(sys))

graph := sys.GraphDatabases()[0]
// Create the in-memory graph database used to store enumeration findings
graph := netmap.NewGraph(netmap.NewCayleyGraphMemory())
defer graph.Close()
// Setup the new enumeration
e := enum.NewEnumeration(cfg, sys, graph)
if e == nil {
Expand Down Expand Up @@ -261,7 +262,7 @@ func runEnumCommand(clArgs []string) {
wg.Wait()
fmt.Fprintf(color.Error, "\n%s\n", green("The enumeration has finished"))
// If necessary, handle graph database migration
if len(e.Sys.GraphDatabases()) > 1 {
if len(e.Sys.GraphDatabases()) > 0 {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Monitor for cancellation by the user
Expand All @@ -274,7 +275,7 @@ func runEnumCommand(clArgs []string) {
c()
}(cancel)
// Copy the graph of findings into the system graph databases
for _, g := range e.Sys.GraphDatabases()[1:] {
for _, g := range e.Sys.GraphDatabases() {
fmt.Fprintf(color.Error, "%s%s%s\n",
yellow("Discoveries are being migrated into the "), yellow(g.String()), yellow(" database"))

Expand Down
3 changes: 0 additions & 3 deletions systems/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ func (l *LocalSystem) setupGraphDBs() error {
}
dbs = append(dbs, cfg.GraphDBs...)

if cfg.Passive {
l.graphs = append(l.graphs, netmap.NewGraph(netmap.NewCayleyGraphMemory()))
}
for _, db := range dbs {
cayley := netmap.NewCayleyGraph(db.System, db.URL, db.Options)
if cayley == nil {
Expand Down

0 comments on commit cc2f09e

Please sign in to comment.