Skip to content

Commit 95796dc

Browse files
authored
[ResponseOps] SSL settings misconfiguration (#239972)
Resolves elastic/response-ops-team#451 ## Summary This PR updates `getSSLSettingsFromConfig` to return a stricter `verificationMode` by default. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
1 parent 827774e commit 95796dc

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

x-pack/platform/plugins/shared/actions/server/lib/get_node_ssl_options.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,11 @@ describe('getSSLSettingsFromConfig', () => {
181181
verificationMode: 'certificate',
182182
});
183183
});
184+
185+
test('get verificationMode eql "full", if both values eql undefined', () => {
186+
const nodeOption = getSSLSettingsFromConfig(undefined, undefined);
187+
expect(nodeOption).toMatchObject({
188+
verificationMode: 'full',
189+
});
190+
});
184191
});

x-pack/platform/plugins/shared/actions/server/lib/get_node_ssl_options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ export function getSSLSettingsFromConfig(
7373
} else if (rejectUnauthorized !== undefined) {
7474
return { verificationMode: rejectUnauthorized ? 'full' : 'none' };
7575
}
76-
return {};
76+
return { verificationMode: 'full' };
7777
}

x-pack/platform/plugins/shared/stack_connectors/server/connector_types/email/send_email.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ describe('send_email module', () => {
804804
"secure": false,
805805
"tls": Object {
806806
"ca": "ca cert data goes here",
807-
"rejectUnauthorized": false,
807+
"rejectUnauthorized": true,
808808
},
809809
},
810810
]
@@ -851,7 +851,7 @@ describe('send_email module', () => {
851851
"secure": false,
852852
"tls": Object {
853853
"ca": "ca cert data goes here",
854-
"rejectUnauthorized": false,
854+
"rejectUnauthorized": true,
855855
},
856856
},
857857
]
@@ -901,6 +901,7 @@ describe('send_email module', () => {
901901
"secure": false,
902902
"tls": Object {
903903
"ca": "ca cert data goes here",
904+
"rejectUnauthorized": true,
904905
},
905906
},
906907
]

0 commit comments

Comments
 (0)