Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filebeat][O365 Module] client_secret produces error if secret starts with @ #25058

Closed
P1llus opened this issue Apr 13, 2021 · 2 comments · Fixed by #25215
Closed

[Filebeat][O365 Module] client_secret produces error if secret starts with @ #25058

P1llus opened this issue Apr 13, 2021 · 2 comments · Fixed by #25215
Assignees
Labels

Comments

@P1llus
Copy link
Member

P1llus commented Apr 13, 2021

Seems like there might be an issue with the configuration mapping (mustache?) for certain fields starting with @.

Looking at: https://discuss.elastic.co/t/yaml-found-character-that-cannot-start-any-token-when-value-starts-with/269778

The following example:

- module: o365
  audit:
    enabled: true
    var.application_id: "xxx"
    var.tenants:
      - id: "xxx"
        name: "xxx"
    var.client_secret: "@/xxx"

Would produce an error like:
cfgfile/list.go:99 Error creating runner from config: Error getting config for fileset o365/audit: Error reading input config: yaml: line 12: found character that cannot start any token.

Will update this issue once I have looked into it.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@andrewkroh
Copy link
Member

The issue is that within the generated configuration (the rendered config template) the password is missing single quotes.

{{ if .client_secret }}client_secret: {{ .client_secret }}{{ end }}

andrewkroh added a commit to andrewkroh/beats that referenced this issue Apr 21, 2021
Values passed in by users that are expected to be strings should be single-quoted.

Also, this fixes the `tojson` function to not escape &, <, and > to to \u0026, \u003c, and \u003e. This
caused problems if the value is an api keys or password that contained one of those characters.

Fixes elastic#25058
andrewkroh added a commit that referenced this issue Apr 22, 2021
Values passed in by users that are expected to be strings should be single-quoted.

Also, this fixes the `tojson` function to not escape &, <, and > to to \u0026, \u003c, and \u003e. This
caused problems if the value is an api keys or password that contained one of those characters.

Fixes #25058
mergify bot pushed a commit that referenced this issue Apr 22, 2021
Values passed in by users that are expected to be strings should be single-quoted.

Also, this fixes the `tojson` function to not escape &, <, and > to to \u0026, \u003c, and \u003e. This
caused problems if the value is an api keys or password that contained one of those characters.

Fixes #25058

(cherry picked from commit eed1cbb)
mergify bot pushed a commit that referenced this issue Apr 22, 2021
Values passed in by users that are expected to be strings should be single-quoted.

Also, this fixes the `tojson` function to not escape &, <, and > to to \u0026, \u003c, and \u003e. This
caused problems if the value is an api keys or password that contained one of those characters.

Fixes #25058

(cherry picked from commit eed1cbb)
andrewkroh added a commit that referenced this issue Apr 23, 2021
…25231)

Values passed in by users that are expected to be strings should be single-quoted.

Also, this fixes the `tojson` function to not escape &, <, and > to to \u0026, \u003c, and \u003e. This
caused problems if the value is an api keys or password that contained one of those characters.

Fixes #25058

(cherry picked from commit eed1cbb)

Co-authored-by: Andrew Kroh <[email protected]>
andrewkroh added a commit that referenced this issue Apr 23, 2021
Values passed in by users that are expected to be strings should be single-quoted.

Also, this fixes the `tojson` function to not escape &, <, and > to to \u0026, \u003c, and \u003e. This
caused problems if the value is an api keys or password that contained one of those characters.

Fixes #25058

(cherry picked from commit eed1cbb)
andrewkroh added a commit that referenced this issue Apr 25, 2021
…5 (backport #25215) (#25232)

* Add single quotes around configurable string values in O365 (#25215)

Values passed in by users that are expected to be strings should be single-quoted.

Also, this fixes the `tojson` function to not escape &, <, and > to to \u0026, \u003c, and \u003e. This
caused problems if the value is an api keys or password that contained one of those characters.

Fixes #25058

(cherry picked from commit eed1cbb)

* Fix changelog

Co-authored-by: Andrew Kroh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants