Skip to content

Audit Webhook: Update Auth_token documentation #407

@mshanmu

Description

@mshanmu

https://docs.min.io/minio/baremetal/monitoring/logging/minio-logging.html#id2

When publishing audits through webhook, the above documentation mentions

"Replace TOKEN with a JSON Web Token (JWT) to use for authenticating to the webhook endpoints. Omit for endpoints which do not require authentication."

This information is incorrect.

Try doing "mc admin config set minio audit_webhook:elastic endpoint="" auth_token="". This will never work, every time failing with 401 error.

The reason is in, https://github.com/minio/minio/blob/master/internal/logger/target/http/http.go#L89 , it sets the Authorization header without "Bearer" keyword. I think this was a oversight.

But it is a good oversight :), thereby, allows the customer to set any type of authorization, which is very much desired, like below,

$ echo -n 'user:password' | base64
dXNlcjpwYXNzd29yZA==
$
$ mc admin config set minio audit_webhook:elastic endpoint="" auth_token="Basic dXNlcjpwYXNzd29yZA=="

I confirmed that this works well.

Similarly, for JWT token, it will be like below,

$ mc admin config set minio audit_webhook:elastic endpoint="" auth_token="Bearer token"

Tried through the environment variables MINIO_AUDIT_WEBHOOK_AUTH_TOKEN_ and it did not work.

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

  1. Setup an audit webhook with auth token
  2. Notice it does not work

Context

Regression

Your Environment

  • Version used (minio --version):
  • Server setup and configuration:
  • Operating System and version (uname -a):
    minio/minio:RELEASE.2021-11-03T03-36-36Z

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions