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

Replace secret vars for arrays #3083

Closed
juliaElastic opened this issue Nov 7, 2023 · 1 comment · Fixed by #3086
Closed

Replace secret vars for arrays #3083

juliaElastic opened this issue Nov 7, 2023 · 1 comment · Fixed by #3086
Assignees
Labels
bug Something isn't working

Comments

@juliaElastic
Copy link
Contributor

juliaElastic commented Nov 7, 2023

When implementing replacement of secret vars in agent policies here, we left out a scenario when the variables can have array values.

See thread here for more info.

Expected fix: check if vars have array values, replace secrets in them.

To reproduce:

  • Add secret: true to the manifest locally:
      - name: api_token
        type: text
        title: API Token
        multi: false
        required: true
        show_user: true
        description: The Alienvault OTX API token
        secret: true
  • Add AlienVault OTX integration and populate the API token/key.
  • Enroll an agent and check the agent policy sent to the agent.
  • The secrets in request.transforms should be replaced.
    streams:
      - id: httpjson-ti_otx.threat-a520c8d4-1c8e-48c6-8525-d046ab1b8bda
        data_stream:
          dataset: ti_otx.threat
          type: logs
        config_version: '2'
        interval: 5m
        request.method: GET
        request.tracer.filename: ../../logs/httpjson/http-request-trace-*.ndjson
        request.url: 'https://otx.alienvault.com/api/v1/indicators/export'
        request.timeout: 30s
        request.transforms:
          - set:
              target: header.Content-Type
              value: application/json
          - set:
              target: header.X-OTX-API-KEY
              value: '${SECRET_0}'
@jen-huang
Copy link

Moving into current sprint as I think @michel-laterman has some time. Michel, would you please take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants