From 1d08a77424fab7138288226d32d33bf262008fef Mon Sep 17 00:00:00 2001 From: devamanv Date: Fri, 11 Jul 2025 15:54:51 +0530 Subject: [PATCH 1/3] Add missing SSL fields to sync it with the Prometheus package --- .../agent/input/input.yml.hbs | 16 ++++++++ packages/prometheus_input/changelog.yml | 5 +++ packages/prometheus_input/manifest.yml | 39 ++++++++++++++++++- 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/packages/prometheus_input/agent/input/input.yml.hbs b/packages/prometheus_input/agent/input/input.yml.hbs index c2ae7b1abb1..595a30a1770 100644 --- a/packages/prometheus_input/agent/input/input.yml.hbs +++ b/packages/prometheus_input/agent/input/input.yml.hbs @@ -16,12 +16,28 @@ metrics_filters.include: {{#each metrics_filters.include}} - {{this}} {{/each}} +{{#if bearer_token_file}} +bearer_token_file: {{bearer_token_file}} +{{/if}} +ssl.verification_mode: {{ssl.verification_mode}} {{#if ssl.certificate_authorities}} ssl.certificate_authorities: {{#each ssl.certificate_authorities}} - {{this}} {{/each}} {{/if}} +{{#if ssl.certificate}} +ssl.certificate: {{ssl.certificate}} +{{/if}} +{{#if ssl.key}} +ssl.key: {{ssl.key}} +{{/if}} +{{#if ssl.key_passphrase}} +ssl.key_passphrase: {{ssl.key_passphrase}} +{{/if}} +{{#if ssl.ca_trusted_fingerprint}} +ssl.ca_trusted_fingerprint: {{ssl.ca_trusted_fingerprint}} +{{/if}} data_stream: dataset: {{data_stream.dataset}} {{#if leaderelection }} diff --git a/packages/prometheus_input/changelog.yml b/packages/prometheus_input/changelog.yml index 56d87031a28..8a7dfef4302 100644 --- a/packages/prometheus_input/changelog.yml +++ b/packages/prometheus_input/changelog.yml @@ -1,4 +1,9 @@ # newer versions go on top +- version: "0.9.0" + changes: + - description: Add SSL configuration options. + type: enhancement + link: https://github.com/elastic/integrations/pull/12876 - version: "0.8.0" changes: - description: Add support for defining Leader Election and Conditions diff --git a/packages/prometheus_input/manifest.yml b/packages/prometheus_input/manifest.yml index 532ab7759c8..6802dfc86c7 100644 --- a/packages/prometheus_input/manifest.yml +++ b/packages/prometheus_input/manifest.yml @@ -1,7 +1,7 @@ format_version: "3.0.2" name: prometheus_input title: "Prometheus Input" -version: "0.8.0" +version: "0.9.0" description: "Collects metrics from Prometheus exporter." type: input categories: @@ -70,6 +70,14 @@ policy_templates: required: false show_user: false default: [] + - name: ssl.verification_mode + type: text + title: SSL Verification Mode + description: SSL verification mode. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-verification-mode) for details. + multi: false + required: false + show_user: false + default: none - name: ssl.certificate_authorities type: text title: SSL Certificate Authorities @@ -77,6 +85,27 @@ policy_templates: multi: true required: false show_user: false + - name: ssl.certificate + type: text + title: SSL Certificate + description: SSL certificate. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-certificate) for details. + show_user: true + - name: ssl.key + type: text + title: SSL Private Key + description: SSL private key. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-key) for details. + show_user: true + - name: ssl.key_passphrase + type: password + title: SSL Key Passphrase + description: SSL key passphrase. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-key-passphrase) for details. + secret: true + show_user: true + - name: ssl.ca_trusted_fingerprint + type: text + title: SSL CA Trusted Fingerprint + description: SSL CA trusted fingerprint. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#ca_trusted_fingerprint) for details. + show_user: true - name: username type: text title: Username @@ -113,6 +142,14 @@ policy_templates: multi: false required: false show_user: true + - name: bearer_token_file + type: text + title: 'HTTP config options: bearer_token_file' + description: If defined, the contents of the file will be read once at initialization and then the value will be used in an HTTP Authorization header. + multi: false + secret: false + required: false + show_user: false - name: processors type: yaml title: Processors From 2a7ab66e72c8e88c9d8c02c3db867bdf9fa87ed9 Mon Sep 17 00:00:00 2001 From: devamanv Date: Fri, 11 Jul 2025 15:57:17 +0530 Subject: [PATCH 2/3] Update PR link in the changelog --- packages/prometheus_input/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/prometheus_input/changelog.yml b/packages/prometheus_input/changelog.yml index 8a7dfef4302..63a57d8cc12 100644 --- a/packages/prometheus_input/changelog.yml +++ b/packages/prometheus_input/changelog.yml @@ -3,7 +3,7 @@ changes: - description: Add SSL configuration options. type: enhancement - link: https://github.com/elastic/integrations/pull/12876 + link: https://github.com/elastic/integrations/pull/14503 - version: "0.8.0" changes: - description: Add support for defining Leader Election and Conditions From 6462c5e418078a035f2121c5138e84c10753300a Mon Sep 17 00:00:00 2001 From: devamanv Date: Wed, 16 Jul 2025 19:13:09 +0530 Subject: [PATCH 3/3] Remove individual SSL fields in favor of using a single YAML block --- .../agent/input/input.yml.hbs | 20 +----- packages/prometheus_input/manifest.yml | 63 +++++++++---------- 2 files changed, 32 insertions(+), 51 deletions(-) diff --git a/packages/prometheus_input/agent/input/input.yml.hbs b/packages/prometheus_input/agent/input/input.yml.hbs index 595a30a1770..0b51329a50f 100644 --- a/packages/prometheus_input/agent/input/input.yml.hbs +++ b/packages/prometheus_input/agent/input/input.yml.hbs @@ -19,24 +19,8 @@ metrics_filters.include: {{#if bearer_token_file}} bearer_token_file: {{bearer_token_file}} {{/if}} -ssl.verification_mode: {{ssl.verification_mode}} -{{#if ssl.certificate_authorities}} -ssl.certificate_authorities: -{{#each ssl.certificate_authorities}} - - {{this}} -{{/each}} -{{/if}} -{{#if ssl.certificate}} -ssl.certificate: {{ssl.certificate}} -{{/if}} -{{#if ssl.key}} -ssl.key: {{ssl.key}} -{{/if}} -{{#if ssl.key_passphrase}} -ssl.key_passphrase: {{ssl.key_passphrase}} -{{/if}} -{{#if ssl.ca_trusted_fingerprint}} -ssl.ca_trusted_fingerprint: {{ssl.ca_trusted_fingerprint}} +{{#if ssl}} +ssl: {{ssl}} {{/if}} data_stream: dataset: {{data_stream.dataset}} diff --git a/packages/prometheus_input/manifest.yml b/packages/prometheus_input/manifest.yml index 6802dfc86c7..ee054dfd010 100644 --- a/packages/prometheus_input/manifest.yml +++ b/packages/prometheus_input/manifest.yml @@ -70,42 +70,39 @@ policy_templates: required: false show_user: false default: [] - - name: ssl.verification_mode - type: text - title: SSL Verification Mode - description: SSL verification mode. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-verification-mode) for details. + - name: ssl + type: yaml + title: SSL Configuration + default: | + # certificate_authorities: | + # -----BEGIN CERTIFICATE----- + # MIID+jCCAuKgAwIBAgIGAJJMzlxLMA0GCSqGSIb3DQEBCwUAMHoxCzAJBgNVBAYT + # AlVTMQwwCgYDVQQKEwNJQk0xFjAUBgNVBAsTDURlZmF1bHROb2RlMDExFjAUBgNV + # BAsTDURlZmF1bHRDZWxsMDExGTAXBgNVBAsTEFJvb3QgQ2VydGlmaWNhdGUxEjAQ + # BgNVBAMTCWxvY2FsaG9zdDAeFw0yMTEyMTQyMjA3MTZaFw0yMjEyMTQyMjA3MTZa + # MF8xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xFjAUBgNVBAsTDURlZmF1bHRO + # b2RlMDExFjAUBgNVBAsTDURlZmF1bHRDZWxsMDExEjAQBgNVBAMTCWxvY2FsaG9z + # dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMv5HCsJZIpI5zCy+jXV + # z6lmzNc9UcVSEEHn86h6zT6pxuY90TYeAhlZ9hZ+SCKn4OQ4GoDRZhLPTkYDt+wW + # CV3NTIy9uCGUSJ6xjCKoxClJmgSQdg5m4HzwfY4ofoEZ5iZQ0Zmt62jGRWc0zuxj + # hegnM+eO2reBJYu6Ypa9RPJdYJsmn1RNnC74IDY8Y95qn+WZj//UALCpYfX41hko + # i7TWD9GKQO8SBmAxhjCDifOxVBokoxYrNdzESl0LXvnzEadeZTd9BfUtTaBHhx6t + # njqqCPrbTY+3jAbZFd4RiERPnhLVKMytw5ot506BhPrUtpr2lusbN5svNXjuLeea + # MMUCAwEAAaOBoDCBnTATBgNVHSMEDDAKgAhOatpLwvJFqjAdBgNVHSUEFjAUBggr + # BgEFBQcDAQYIKwYBBQUHAwIwVAYDVR0RBE0wS4E+UHJvZmlsZVVVSUQ6QXBwU3J2 + # MDEtQkFTRS05MDkzMzJjMC1iNmFiLTQ2OTMtYWI5NC01Mjc1ZDI1MmFmNDiCCWxv + # Y2FsaG9zdDARBgNVHQ4ECgQITzqhA5sO8O4wDQYJKoZIhvcNAQELBQADggEBAKR0 + # gY/BM69S6BDyWp5dxcpmZ9FS783FBbdUXjVtTkQno+oYURDrhCdsfTLYtqUlP4J4 + # CHoskP+MwJjRIoKhPVQMv14Q4VC2J9coYXnePhFjE+6MaZbTjq9WaekGrpKkMaQA + # iQt5b67jo7y63CZKIo9yBvs7sxODQzDn3wZwyux2vPegXSaTHR/rop/s/mPk3YTS + # hQprs/IVtPoWU4/TsDN3gIlrAYGbcs29CAt5q9MfzkMmKsuDkTZD0ry42VjxjAmk + # xw23l/k8RoD1wRWaDVbgpjwSzt+kl+vJE/ip2w3h69eEZ9wbo6scRO5lCO2JM4Pr + # 7RhLQyWn2u00L7/9Omw= + # -----END CERTIFICATE----- + description: i.e. certificate_authorities, supported_protocols, verification_mode, key, passphrase etc. multi: false required: false show_user: false - default: none - - name: ssl.certificate_authorities - type: text - title: SSL Certificate Authorities - description: SSL Certificate Authorities. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-certificate-authorities) for details. - multi: true - required: false - show_user: false - - name: ssl.certificate - type: text - title: SSL Certificate - description: SSL certificate. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-certificate) for details. - show_user: true - - name: ssl.key - type: text - title: SSL Private Key - description: SSL private key. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-key) for details. - show_user: true - - name: ssl.key_passphrase - type: password - title: SSL Key Passphrase - description: SSL key passphrase. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#client-key-passphrase) for details. - secret: true - show_user: true - - name: ssl.ca_trusted_fingerprint - type: text - title: SSL CA Trusted Fingerprint - description: SSL CA trusted fingerprint. See [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-ssl.html#ca_trusted_fingerprint) for details. - show_user: true - name: username type: text title: Username