Skip to content

Commit dd96045

Browse files
committed
add paths when creating NAP instance
1 parent 4c8f21b commit dd96045

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/watcher/instance/nginx-app-protect-instance-watcher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ type NginxAppProtectInstanceWatcher struct {
5050
}
5151

5252
func NewNginxAppProtectInstanceWatcher(agentConfig *config.Config) *NginxAppProtectInstanceWatcher {
53-
agentConfig.AllowedDirectories = append(agentConfig.AllowedDirectories, napDirPath)
5453
return &NginxAppProtectInstanceWatcher{
5554
agentConfig: agentConfig,
5655
filesBeingWatched: make(map[string]bool),
@@ -235,6 +234,8 @@ func (w *NginxAppProtectInstanceWatcher) createInstance(ctx context.Context) {
235234
}
236235

237236
slog.InfoContext(ctx, "Discovered a new NGINX App Protect instance")
237+
w.agentConfig.AllowedDirectories = append(w.agentConfig.AllowedDirectories, napDirPath)
238+
slog.InfoContext(ctx, "Added NAP directory to allowed directories", "directories", w.agentConfig.AllowedDirectories)
238239

239240
w.instancesChannel <- InstanceUpdatesMessage{
240241
CorrelationID: logger.CorrelationIDAttr(ctx),

0 commit comments

Comments
 (0)