Skip to content

Test monitor fails to authenticate #512

Description

@vivian-rook

Deploying a test cluster with:

helm install core core --namespace neuvector --create-namespace --repo https://neuvector.github.io/neuvector-helm --wait --wait-for-jobs --timeout 5m
helm install monitor monitor --namespace neuvector --create-namespace --repo https://neuvector.github.io/neuvector-helm --wait --wait-for-jobs --timeout 5m --values monitor-values.json

monitor-values.json contains:

{"exporter":{"apiSvc":"neuvector-svc-controller:10443"}}

Results in the monitor crashlooping on login:

NAME                                                 READY   STATUS             RESTARTS      AGE
neuvector-cert-upgrader-job-hbl28                    0/1     Completed          0             6m56s
neuvector-controller-pod-647f8d69c5-8jdc5            1/1     Running            0             6m57s
neuvector-controller-pod-647f8d69c5-n652j            1/1     Running            0             6m57s
neuvector-controller-pod-647f8d69c5-qx6hp            1/1     Running            0             6m57s
neuvector-enforcer-pod-pphcm                         1/1     Running            0             6m57s
neuvector-manager-pod-66f865dc7c-vmxgp               1/1     Running            0             6m57s
neuvector-prometheus-exporter-pod-66c569f568-86vn7   0/1     CrashLoopBackOff   6 (52s ago)   6m27s
neuvector-scanner-pod-6b45987549-7ppkq               1/1     Running            0             6m57s
neuvector-scanner-pod-6b45987549-rgcdm               1/1     Running            0             6m57s
neuvector-scanner-pod-6b45987549-zfz85               1/1     Running            0             6m57s

logs from neuvector-prometheus-exporter:

Login to controller ...
Authentication failed

Eventually it turns to:

Login to controller ...
Temporarily blocked because of too many login failures

If I add:

{
  "bootstrapPassword": "admin"
}

As a values file for core and redeploy as above neuvector-prometheus-exporter still crashloops and I get an error:

Login to controller ...
Traceback (most recent call last):
  File "/usr/local/bin/nv_exporter.py", line 645, in <module>
    if _login("https://" + CTRL_SVC, CTRL_USER, CTRL_PASS) < 0:
       ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/nv_exporter.py", line 58, in _login
    token = json.loads(response.text)["token"]["token"]
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

neuvector/neuvector#2085 just merged as part of the latest version (https://github.com/neuvector/neuvector/releases/tag/v5.4.6) maybe it's related?

Deploying a test cluster with a default password for testing seemed to work as of a few days ago, so the change seems recent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions