opensearch-project / reporting-cli

Apache License 2.0
4 stars 13 forks source link

[BUG] Invalid username or password #55

Closed liamhess closed 7 months ago

liamhess commented 11 months ago

What is the bug?

I can not authenticate, no matter what I do it returns an error.

How can one reproduce the bug?

Create dashboard and try to export report with cli

What is the expected behavior?

I should be authenticated

What is your host/environment?

MacOS, OpenSearch 2.10.0 in Docker. I cloned the repo so it should be the latest version of the cli.

Do you have any screenshots?

image
mimugmail commented 10 months ago

Same here:

root@siem-master:~# /root/node_modules/.bin/opensearch-reporting-cli -u https://10.24.80.101:4443/goto/23768a6a46b414c006ced25acb3b9102 -a basic -c user:pw -e smtp -s sender -r receiver -f png --subject Report
✔ Fetched argument values
⠋ Connecting to url https://10.24.80.101:4443/goto/23768a6a46b414c006ced25acb3b9102(node:1477071) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
✖ Invalid username or password
✖ Downloading report failed. TypeError: exit is not a function

Debian 12.2 npm 9.2.0

I'm using Wazuh, maybe this is of interest?

JumpyWizard404 commented 10 months ago

same issue just on Debian 11 npm 10.2.5

also using the wazuh version of Opensearch Further information: Wazuh is built on Opensearch 2.8 This Was also tested on the following Debian 12 npm 10.2.5 Pure Opensearch 2.11 On the setup above (Pure opensearch 2.11 no wazuh) the reporting CLI works fine

NodeJS on both was setup as v21.5.0

JumpyWizard404 commented 9 months ago

Same here:

root@siem-master:~# /root/node_modules/.bin/opensearch-reporting-cli -u https://10.24.80.101:4443/goto/23768a6a46b414c006ced25acb3b9102 -a basic -c user:pw -e smtp -s sender -r receiver -f png --subject Report
✔ Fetched argument values
⠋ Connecting to url https://10.24.80.101:4443/goto/23768a6a46b414c006ced25acb3b9102(node:1477071) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
✖ Invalid username or password
✖ Downloading report failed. TypeError: exit is not a function

Debian 12.2 npm 9.2.0

I'm using Wazuh, maybe this is of interest?

Did you ever find a solution for this one? I tested it on a pure opensearch 2.11 on Debian12 and have downloaded reports fine

mimugmail commented 9 months ago

Not yet, I'm quite sure it's the "uiSettings.overrides.defaultRoute: /app/wazuh" .. I'll raise an issue at wazuh

JumpyWizard404 commented 9 months ago

Not yet, I'm quite sure it's the "uiSettings.overrides.defaultRoute: /app/wazuh" .. I'll raise an issue at wazuh

ive tried working around that and commented out that line the only thing that does is it doesnt auto forward you to the wazuh plugin page but allows you to open the classic opensearch homepage, but even with that out of the way it was still bugged.

piotrb710 commented 7 months ago

try to generate the full path for the report.

rupal-bq commented 7 months ago

This might be due to tenant selection. Fix is merged in https://github.com/opensearch-project/reporting-cli/pull/65

JumpyWizard404 commented 7 months ago

Hi rupal tested just now

also using the Wazuh version of Opensearch Further information: Wazuh is built on Opensearch 2.8 This Was also tested on the following Debian 11 npm 10.2.5 Pure Opensearch 2.11 On the setup above (Opensearch 2.8 + wazuh)

NodeJS on both was setup as v21.11.0

this is the command i used

/root/node_modules/.bin/opensearch-reporting-cli --url https://server_name:443/app/dashboards#/view/ce76b220-6803-11ee-8d25-7b18287bc2bf --format pdf --auth basic --credentials admin:password

i also tried

/root/node_modules/.bin/opensearch-reporting-cli --url https://server_name:443/app/dashboards#/view/ce76b220-6803-11ee-8d25-7b18287bc2bf --format pdf --auth basic --credentials admin:"password"

and

/root/node_modules/.bin/opensearch-reporting-cli --url https://server_name:443/app/dashboards#/view/ce76b220-6803-11ee-8d25-7b18287bc2bf --format pdf --auth basic --credentials admin:"password" --tenant global /root/node_modules/.bin/opensearch-reporting-cli --url https://server_name:443/app/dashboards#/view/ce76b220-6803-11ee-8d25-7b18287bc2bf --format pdf --auth basic --credentials admin:password --tenant global i have also tried the shorturl version

/root/node_modules/.bin/opensearch-reporting-cli --url https://server_name:443//app/dashboards?security_tenant=global#/view/ce76b220-6803-11ee-8d25-7b18287bc2bf--format pdf --auth basic --credentials admin:password --tenant global but the message

(Use node --trace-warnings ... to show where the warning was created) ✖ Invalid username or password ✖ Downloading report failed. TypeError: exit is not a function

is there a way to maybe run this in debug mode to get more output information?

rupal-bq commented 7 months ago

Hi @JumpyWizard404, the fix is merged but it isn't part of v1.0.0. We'll release patch v1.1.0 for the bug fixes.

rupal-bq commented 7 months ago

Closing this as it's resolved in v1.1.0. Please create issue if you are still getting any errors.