diff --git a/firewall/master.go b/firewall/master.go index 1bad4fb2..bd7a9c7d 100644 --- a/firewall/master.go +++ b/firewall/master.go @@ -71,7 +71,10 @@ func DecideOnConnection(ctx context.Context, conn *network.Connection, pkt packe // Check if the layered profile needs updating. if layeredProfile.NeedsUpdate() { // Update revision counter in connection. - conn.ProfileRevisionCounter = layeredProfile.Update() + conn.ProfileRevisionCounter = layeredProfile.Update( + conn.Process().MatchingData(), + conn.Process().CreateProfileCallback, + ) conn.SaveWhenFinished() // Reset verdict for connection. diff --git a/firewall/prompt.go b/firewall/prompt.go index 0356516a..18ef160b 100644 --- a/firewall/prompt.go +++ b/firewall/prompt.go @@ -177,9 +177,11 @@ func createPrompt(ctx context.Context, conn *network.Connection, pkt packet.Pack EventData: &promptData{ Entity: entity, Profile: promptProfile{ - Source: string(localProfile.Source), - ID: localProfile.ID, - LinkedPath: localProfile.LinkedPath, + Source: string(localProfile.Source), + ID: localProfile.ID, + // LinkedPath is used to enhance the display of the prompt in the UI. + // TODO: Using the process path is a workaround. Find a cleaner solution. + LinkedPath: conn.Process().Path, }, }, Expires: expires, @@ -259,7 +261,7 @@ func saveResponse(p *profile.Profile, entity *intel.Entity, promptResponse strin // Update the profile if necessary. if p.IsOutdated() { var err error - p, err = profile.GetProfile(p.Source, p.ID, p.LinkedPath, false) + p, err = profile.GetLocalProfile(p.ID, nil, nil) if err != nil { return err } diff --git a/firewall/tunnel.go b/firewall/tunnel.go index 232636f6..e062512c 100644 --- a/firewall/tunnel.go +++ b/firewall/tunnel.go @@ -70,7 +70,10 @@ func checkTunneling(ctx context.Context, conn *network.Connection) { // Update profile. if layeredProfile.NeedsUpdate() { // Update revision counter in connection. - conn.ProfileRevisionCounter = layeredProfile.Update() + conn.ProfileRevisionCounter = layeredProfile.Update( + conn.Process().MatchingData(), + conn.Process().CreateProfileCallback, + ) conn.SaveWhenFinished() } else { // Check if the revision counter of the connection needs updating.