cuckoosandbox / cuckoo

Cuckoo Sandbox is an automated dynamic malware analysis system
http://www.cuckoosandbox.org
Other
5.54k stars 1.7k forks source link

{ "message": "Authentication in the form of an 'Authorization: Bearer <TOKEN>' header is required" } #3079

Open Natruel opened 4 years ago

Natruel commented 4 years ago

Thanks for creating an issue! But first: did you read our community guidelines? https://cuckoo.sh/docs/introduction/community.html

My issue is:

When i run the cuckoo api and accessed by browser, the browser prompt { "message": "Authentication in the form of an 'Authorization: Bearer ' header is required" }

My Cuckoo version and operating system are: cuckoo 2.0.7 ubuntu 16.04 LTS
This can be reproduced by:
The log, error, files etc can be found at:
vinceplayer commented 4 years ago

You have specified in the header the token?

Natruel commented 4 years ago

I don't know how to specified in the header the token? i just run the cuckoo in the default setting: $ sudo service uwsgi start cuckoo-api

$ sudo service nginx start

(venv)$ cuckoo api -p 8091

can you tell hwo to specify? Thank you!

vinceplayer commented 4 years ago

i not used nginx but only cuckoo api

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/list

In S4MPL3 you need specify the token of API "/home/cuckoo/.cuckoo/conf/cuckoo.conf"

Natruel commented 4 years ago

Thank you,i will try it.

Natruel commented 4 years ago

By the way, i want to know that you means that i need to replace the "S4MPL3" by the token that i specified in the cuckoo.conf? And after i start the cuckoo api, i run the: curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/list

vinceplayer commented 4 years ago

you have to replace SAMPLE, with the value of your token which is included in cuckoo.conf

Natruel commented 4 years ago

Sorry,I had something to do some time ago that delayed this question. And not long ago, I retried the question. After i specified the token by run the: curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/list But I access "http://www.localhost/8090" from a browser, it still shows: message "Authentication in the form of an 'Authorization: Bearer ' header is required" Although it can be submited the task and return the task_id, i can't save the result and it shows there is no such file existed. I don't know if this is an easy question, but I have no other way to solve it because I am a rookie to use the cuckoo, so I still plan to ask you. I hope it won't bother you.

rleal124 commented 3 years ago

Hi, I have the same issue.

Some ideia how can solve?

Natruel commented 3 years ago

Actually, i did't solve the problem. And i use the curl to submit my samples by the terminal.

gggggyw yw_gong@qq.com

 

------------------ 原始邮件 ------------------ 发件人: "cuckoosandbox/cuckoo" <notifications@github.com>; 发送时间: 2020年11月13日(星期五) 晚上8:18 收件人: "cuckoosandbox/cuckoo"<cuckoo@noreply.github.com>; 抄送: "吃才是快乐的"<1119470580@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [cuckoosandbox/cuckoo] { "message": "Authentication in the form of an 'Authorization: Bearer <TOKEN>' header is required" } (#3079)

Hi, I have the same issue.

Some ideia how can solve?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

rleal124 commented 3 years ago

Thanks @Natruel,

I try using the curl curl -H 'Authorization: Bearer TOKEN from cuckoo.config' http://CUCKOOIP:8090/machines/list And the result is: "message": "Authentication in the form of an 'Authorization: Bearer ' header is required"

I have other way to check the cuckoo REST API ? Or what troubleshooting steps I can flow?

Natruel commented 3 years ago

You need to run you cuckoo at the same time.Then you submit your samples by curl and obtain the result which is storaged in the  /home/.../.cuckoo/storage/analyses/(Attachments have pictures to help you)

gggggyw yw_gong@qq.com

 

------------------ 原始邮件 ------------------ 发件人: "cuckoosandbox/cuckoo" <notifications@github.com>; 发送时间: 2020年11月13日(星期五) 晚上9:35 收件人: "cuckoosandbox/cuckoo"<cuckoo@noreply.github.com>; 抄送: "吃才是快乐的"<1119470580@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [cuckoosandbox/cuckoo] { "message": "Authentication in the form of an 'Authorization: Bearer <TOKEN>' header is required" } (#3079)

Thanks @Natruel,

I try using the curl curl -H 'Authorization: Bearer TOKEN from cuckoo.config' http://CUCKOOIP:8090/machines/list And the result is: "message": "Authentication in the form of an 'Authorization: Bearer ' header is required"

I have other way to check the cuckoo REST API ? Or what troubleshooting steps I can flow?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.