archerysec / archerysec-cli

A commandline tool that wraps the Archerysec REST API for controlling Archery and executing quick, targeted scans.
Other
11 stars 2 forks source link

Error when upload gitlabSAST report #16

Closed joywork00 closed 7 months ago

joywork00 commented 1 year ago

when I upload gitlabsast json report to archerysec is alwayserror ,I also try the document example json file ,then I got the same I try python3.9.0 and python 3.9.6 is always error ,and I use pip to install archerysec-cli pip3 install archerysec-cli


                    _                      _____
     /\            | |                    / ____|
    /  \   _ __ ___| |__   ___ _ __ _   _| (___   ___  ___
   / /\ \ | '__/ __| '_ \ / _ \ '__| | | |\___ \ / _ \/ __|
  / ____ \| | | (__| | | |  __/ |  | |_| |____) |  __/ (__
 /_/    \_\_|  \___|_| |_|\___|_|   \__, |_____/ \___|\___|
                                     __/ |
                                    |___/

Copyright (C) 2023 ArcherySec CLI v3.1.14
Traceback (most recent call last):
  File "/usr/local/bin/archerysec-cli", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/archerysec_cli/cli/cli.py", line 468, in main
    scan_action()
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/archerysec_cli/cli/cli.py", line 108, in scan_action
    upload_report(
  File "/usr/local/lib/python3.9/site-packages/archerysec_cli/cli/cli.py", line 250, in upload_report
    scan_data = archerysec.json_upload(file=report_path)
  File "/usr/local/lib/python3.9/site-packages/archerysec_cli/util/api.py", line 65, in json_upload
    return send_request.json()
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

This my command

archerysec-cli -h http://127.0.0.1:8000 -t 45F1i7ITBP24qSSKXq7HlVK_loyZszMKpRVnX0c0Y5VI_76hWNSxbtCvXET75We5 -p test.json --file-type=JSON --target=ASFLKSF --scanner=gitlabsast --project=9caa156-3b18-4815-8ee6-58bd2a036299 --upload

I need the help please~ have a good day Joy

joywork00 commented 1 year ago

additional tips ,I can create the project from use archerysec-cli command

anandtiwarics commented 7 months ago

fixed https://github.com/archerysec/archerysec/pull/630