support adding a CA cert to http collector (#1624)

* add a TLS parameter for cacert

* pass a ca cert into http request

* test preflight

* make schemas

* log extra information from http request

* pass a proxy into the collector spec

* hitting a segfault; breakpoint

* accept a dir, file, or a string-literal as CA

* move tls params into get, put, post methods

* test for cert untrusted response

* make generate

* make schemas

* more test cases

* make schemas

* dont include system certs

* make generate && make schemas

* resolve gosec G402 warning

* remove old check for system certs

* ignore errcheck "return value not checked" linter errors
This commit is contained in:
ada mancini
2024-10-23 18:15:08 -04:00
committed by GitHub
parent 7ed2f4bff2
commit eacff7112f
17 changed files with 1561 additions and 25 deletions

View File

@@ -408,11 +408,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -430,11 +453,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -450,11 +496,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -17054,11 +17123,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -17074,11 +17166,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -17094,11 +17209,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:

View File

@@ -1400,11 +1400,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -1420,11 +1443,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -1440,11 +1486,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:

View File

@@ -1400,11 +1400,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -1420,11 +1443,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -1440,11 +1486,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -1888,11 +1957,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -1908,11 +2000,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -1928,11 +2043,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:

View File

@@ -2137,11 +2137,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -2159,11 +2182,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -2179,11 +2225,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -18737,11 +18806,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -18757,11 +18849,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -18777,11 +18892,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:

View File

@@ -221,11 +221,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -241,11 +264,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -261,11 +307,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:

View File

@@ -2168,11 +2168,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -2190,11 +2213,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -2210,11 +2256,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -19978,11 +20047,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -19998,11 +20090,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required:
@@ -20018,11 +20133,34 @@ spec:
type: object
insecureSkipVerify:
type: boolean
proxy:
type: string
timeout:
description: |-
Timeout is the time to wait for a server's response. Its a duration e.g 15s, 2h30m.
Missing value or empty string or means no timeout.
type: string
tls:
properties:
cacert:
type: string
clientCert:
type: string
clientKey:
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
skipVerify:
type: boolean
type: object
url:
type: string
required: