Comment 0 for bug 1930875

Revision history for this message
Aymen Frikha (aym-frikha) wrote :

After applying the cis-benchmark action to conservative using this command:
juju run-action kubernetes-master/0 cis-benchmark apply=conservative --wait

All checks are passed, but the action failed with this output:

unit-kubernetes-master-0:
  UnitId: kubernetes-master/0
  id: "16"
  message: exit status 1
  results:
    ReturnCode: 1
    Stderr: |
      Traceback (most recent call last):
        File "/var/lib/juju/agents/unit-kubernetes-master-0/charm/actions/cis-benchmark", line 368, in <module>
          apply(remediations)
        File "/var/lib/juju/agents/unit-kubernetes-master-0/charm/actions/cis-benchmark", line 201, in apply
          for test in full_json.get('tests', {}):
      AttributeError: 'list' object has no attribute 'get'
    cmd: /home/ubuntu/kube-bench/kube-bench -D /home/ubuntu/kube-bench/cfg-ck --benchmark
      cis-1.5 --noremediations --noresults run --targets master
    report: juju scp kubernetes-master/0:/home/ubuntu/kube-bench-results/results-json-iiscakal
      .
    summary: |
      == Summary ==
      45 checks PASS
      0 checks FAIL
      10 checks WARN
      10 checks INFO
  status: failed
  timing:
    completed: 2021-06-04 11:11:20 +0000 UTC
    enqueued: 2021-06-04 11:11:10 +0000 UTC
    started: 2021-06-04 11:11:11 +0000 UTC