Celebrating 700K+ Installs Up to 35% OFF! View Details →

[Bug] v9.4.3 regression: Detector rejects internal FVM/Luigi requests with HTTP 401, preventing rule compilation

Discussion Closed

Published 25 days ago

# Github Issue
# question

Published 25 days ago

profile_photo

Spew6412

Updated 25 days ago

0

Bug description

SafeLine CE v9.4.3 appears to introduce an internal service authentication regression that prevents the management service from successfully compiling and publishing WAF rules.

The detector rejects internal requests from FVM and Luigi with HTTP 401 Unauthorized, reporting that detector management authentication is enabled but no management token is configured.

The issue occurs with the official v9.4.3 Docker Compose deployment.

The same deployment works correctly with v9.4.2.

The problem has been reproduced using both a fresh installation of v9.4.3 and an in-place upgrade from a functioning v9.4.2 installation.

Environment

ComponentConfiguration
SafeLine editionCommunity Edition
Affected versionv9.4.3
Last verified working versionv9.4.2
DeploymentDocker Compose
Host OSUbuntu Server 24.04 LTS
Architecturex86_64
VirtualizationKVM, host CPU passthrough
CPU2 vCPU
RAM4 GB
Storage60 GB
PostgreSQL imagechaitin/safeline-postgres:15.2
SafeLine imagesOfficial chaitin/safeline-*-g:9.4.3

All seven SafeLine containers start successfully. The management, detector, and PostgreSQL containers report healthy status.

No custom detector authentication settings were added to the official Compose configuration.

The official compose.yaml files for tags v9.4.2 and v9.4.3 are identical, and were used for the tests below. This suggests the regression originates in the container images or their initialization behavior rather than changes to the Compose configuration.

Steps to reproduce (if available)

Test A: Fresh v9.4.3 installation

  1. Deploy SafeLine CE v9.4.3 using the official Docker Compose configuration.

  2. Initialize the management console.

  3. Configure a protected HTTPS application with a valid certificate and an HTTP upstream.

  4. Attempt to save the application configuration.

Actual result:

The management interface displays:

rules compile error, please check your params

No individual configuration field is highlighted.

Management logs show:

FVM AppendFSL Close Error
error="rpc error: code = Unknown desc = push fsl failed: Push FSL response(401 unauthorized\n)"

compile and push fsl error
error="rpc error: code = Unknown desc = push fsl failed: Push FSL response(401 unauthorized\n)"

Test B: Fresh v9.4.2 installation

  1. Remove the v9.4.3 containers and initialize a clean deployment using v9.4.2 images and the corresponding tagged Compose configuration.

  2. Configure the same HTTPS application and upstream.

  3. Save the application.

Actual result:

  • Application saves successfully.

  • HTTPS termination works.

  • Reverse proxy successfully forwards requests to the upstream application.

  • Direct HTTPS testing succeeds.

Test C: Upgrade v9.4.2 → v9.4.3

  1. Take a snapshot of the working v9.4.2 installation.

  2. Upgrade all SafeLine application images to v9.4.3.

  3. Preserve the existing application configuration and PostgreSQL data.

  4. Start the upgraded containers.

  5. Inspect detector logs and attempt to update WAF configuration.

Actual result:

The original HTTP 401 failures return, including rejections of FVM requests to /update/policy.

This reproduces the failure even when upgrading from a correctly initialized, functioning v9.4.2 installation.

Relevant logs

safeline-detector

At startup:

WARN DETECTOR_MGMT_AUTH=on but DETECTOR_MGMT_TOKEN is empty;
non-loopback requests will be rejected

WARN DETECTOR_UPDATE_VERIFY=on without a valid public key;
/update/library will be rejected

During normal operation:

WARN reject detector management request without valid token
path=/stat
module=mgmtproxy
source=/work/mgmt_proxy.go:163

WARN reject detector management request without valid token
path=/update/policy
module=mgmtproxy
source=/work/mgmt_proxy.go:163

The rejected requests originate from the FVM and Luigi containers on the internal Docker network.

safeline-fvm

ERROR get stat error

ERROR AppendFSL: push fsl failed:
Push FSL response(401 unauthorized\n)

ERROR AppendFSL: update failed:
update framework failed

safeline-mgt

ERROR FVM AppendFSL Close Error
error="rpc error: code = Unknown desc = push fsl failed: Push FSL response(401 unauthorized\n)"

ERROR compile and push fsl error
error="rpc error: code = Unknown desc = push fsl failed: Push FSL response(401 unauthorized\n)"

ERROR genrate fsl failed
error="rules compile error, please check your params"

safeline-luigi

Repeated failures were also observed:

request qps failed
error="http status error: 401 Unauthorized"

Investigation performed

The following checks were completed:

1. Container versions

All SafeLine application containers were running matching v9.4.3 images. No mixed-version deployment was present.

2. Docker networking

Management, detector, FVM, and Luigi were connected to the same Docker network.

Container-to-container communication was functional.

3. Management API connectivity

The internal management health endpoint was reachable from Tengine and returned HTTP 200.

4. Management/Tengine authentication

The following environment variables were confirmed to contain matching nonempty tokens:

MGT_GRPC_TOKEN
TCD_MGT_TOKEN

The management API URL matched the official Compose configuration.

5. Detector authentication

The detector container did not receive any of the following variables:

DETECTOR_MGMT_TOKEN
DETECTOR_UPDATE_VERIFY

The detector startup logs nevertheless indicated that both authentication and update verification were enabled.

6. Detector configuration

The persistent detector.yml contained only the default commented examples:

# bind_addr: x.x.x.x 

# listen_port: 8000

The detector entrypoint copies its bundled configuration and applies overrides from the persistent YAML file. No detector authentication tokens or signing keys were found in the inspected configuration.

7. Database connectivity

PostgreSQL connectivity was verified as healthy during the reproduced FVM authentication failures.

8. Container restart

Restarting detector, FVM, and Luigi after management initialization did not resolve the authentication failures.

9. Version comparison

A fresh v9.4.2 deployment successfully saved and served the same application configuration.

Upgrading that functioning deployment to v9.4.3 reproduced the detector authentication failures.

Expected behavior

The official SafeLine CE Compose deployment should provision compatible internal authentication settings across the detector, FVM, Luigi, and management components.

The detector should accept authenticated requests from authorized internal services, allowing WAF rules to compile and publish successfully.

Suspected cause

The v9.4.3 release appears to enable or enforce detector management authentication and signed-update verification without supplying the corresponding authentication material to the relevant components through the published deployment configuration.

This is a hypothesis based on the startup warnings, HTTP 401 responses, and successful v9.4.2 comparison.

It has not been established whether the underlying issue is:

  • Missing authentication configuration in the tagged Compose release.

  • An incomplete initialization or credential-provisioning mechanism.

  • A compatibility problem between the v9.4.3 detector and its internal clients.

  • A regression in the detector management proxy authentication implementation.

Questions for maintainers

  1. Is DETECTOR_MGMT_TOKEN expected to be configured explicitly in SafeLine CE v9.4.3?

  2. If so, how should FVM and Luigi receive and present the corresponding authentication credential?

  3. Is a signing public key required for DETECTOR_UPDATE_VERIFY in Community Edition, and how should it be provisioned?

  4. Are these authentication settings intended to be initialized automatically by the official Compose deployment?

  5. Is there a supported workaround or patched release that restores internal service communication without disabling detector authentication or update verification?

Impact

The management interface remains accessible and containers may report healthy status, but WAF rule compilation and policy delivery fail.

This prevents the affected installation from reliably configuring or enforcing application protection rules.

Due to the security implications, the affected v9.4.3 deployment was not placed into public production service.

Additional information

Reproduction has been confirmed with both clean installation and upgrade paths. Additional sanitized diagnostics can be provided if needed.

Logs or screenshots (optional)

No response

profile_photo

Spew6412

Updated 25 days ago

0

Update: Working workaround identified for v9.4.3

After further investigation, I was able to resolve the detector's HTTP 401 authentication failures.

Binary inspection confirmed that both the FVM and Luigi v9.4.3 executables contain references to DETECTOR_MGMT_TOKEN and the X-Safeline-Internal-Token HTTP header.

I created a shared, randomly generated token and supplied it to all three services using a Docker Compose override:

1services:
2  detect:
3    env_file:
4      - .env.detector
5
6  fvm:
7    env_file:
8      - .env.detector
9
10  luigi:
11    env_file:
12      - .env.detector

The .env.detector file contains:

1DETECTOR_MGMT_TOKEN=<shared-secret>

Results:

  • Detector no longer reports repeated invalid-token rejections.
  • FVM reports Push FSL success.
  • Luigi no longer reports the previous authentication errors.
  • Initial application testing appears successful.

This suggests that v9.4.3 requires detector authentication credentials that are not supplied by the official tagged Compose configuration.

One remaining warning:

1DETECTOR_UPDATE_VERIFY=on without a valid public key; /update/library will be rejected

Could the maintainers clarify how the signing public key should be provisioned and whether the official Compose deployment will be updated to include the required authentication settings?

The workaround appears effective, but the official configuration still requires correction.

profile_photo

Windsley

Updated 25 days ago

0

Thank you for your feedback! In v9.4.3, some .env configurations have been updated. If you're upgrading manually, please refer to the deployment and upgrade documentation and update the relevant configuration accordingly.

For details, see the Upgrade Guide.

profile_photo

basti4557

Updated 25 days ago

0

@Windsley Thats indeed a little bit unclear also over the linked documentation. If i reference the in the documentation listed ENV section

DETECTOR_MGMT_TOKEN=<64-char hex>
MGT_INTERNAL_TOKEN=<64-char hex>
DETECTOR_AES_KEY=<16 alphanumeric characters>
DETECTOR_MGMT_AUTH=on
DETECTOR_UPDATE_VERIFY=on
DETECTOR_UPDATE_PUBLIC_KEY=
POSTGRES_IMAGE=chaitin/safeline-postgres:15.18

and looking into the main official compose file https://github.com/chaitin/safeline/blob/main/compose.yaml there is no real point to know how to configurate that how @Spew6412 mentioned. Got the same behaviour on my site and rolled back to 9.4.2

profile_photo

Spew6412

Updated 25 days ago

0

Thanks for the documentation @Windsley .

I previously reproduced the issue using both a fresh v9.4.3 installation and an upgrade from a working v9.4.2 deployment.

I also confirmed that the official v9.4.2 and v9.4.3 compose.yaml files are identical.

The issue was resolved by explicitly providing a shared DETECTOR_MGMT_TOKEN to the detect, fvm, and luigi services using a Compose override. FVM now reports Push FSL success, and the HTTP 401 authentication failures have stopped.

Does the documented upgrade procedure automatically provision these detector authentication credentials through an additional migration or initialization step?

If so, could you identify that step? If not, it appears the official Compose deployment is missing required configuration for v9.4.3.

I also continue to receive the warning about DETECTOR_UPDATE_VERIFY being enabled without a valid public key. Is that key provisioned by the official upgrade process?

profile_photo

andros-ua

Updated 24 days ago

0

@Spew6412 looks like github repo has an outdated compose.yaml
Checkout https://waf.chaitin.com/release/latest/compose.yaml

profile_photo

Spew6412

Updated 23 days ago

0

6. @Spew6412 looks like github repo has an outdated compose.yaml
Checkout https://waf.chaitin.com/release/latest/compose.yaml

Thanks @andros-ua , will review this evening.

profile_photo

Spew6412

Updated 23 days ago

0

Thanks @andros-ua for pointing me at that compose file. It fixes most of the issues I described above.

One remaining warning is:

DETECTOR_UPDATE_VERIFY=on without a valid public key; /update/library will be rejected

The updated Compose file has DETECTOR_UPDATE_PUBLIC_KEY, but I couldn't find documentation explaining how to obtain the trusted signing key.

Is this intended to verify Chaitin-signed detector-library updates, and if so, where can I get and authenticate the official public key?

Or is this functionality intended only for custom, administrator-signed library updates?

profile_photo

Windsley

Updated 22 days ago

0

8. Thanks @andros-ua for pointing me at that compose file. It fixes most of the issues I described above.
One remaining warning is:
DETECTOR_UPDATE_VERIFY=on without a valid public key; /update/library will be rejected

The updated Compose file has `DETECTOR_UPDATE_PUBLIC_KEY`, but I couldn't find documentation explaining how to obtain the trusted signing key.
Is this intended to verify Chaitin-signed detector-library updates, and if so, where can I get and authenticate the official public key?
Or is this functionality intended only for custom, administrator-signed library updates?

Maybe you could try following the secret generation and permission steps shown in the attached screenshot.

Image