From 4b2c60fb8297b24d0ed429e04a5a68bffb2a2947 Mon Sep 17 00:00:00 2001 From: Fuyao Zhao Date: Thu, 28 Mar 2019 00:08:41 -0700 Subject: [PATCH] [Code]: raise default security level (#33956) --- x-pack/package.json | 2 +- x-pack/plugins/code/index.ts | 12 +++++++++--- x-pack/plugins/code/server/lsp/ts_launcher.ts | 1 + yarn.lock | 8 ++++---- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/x-pack/package.json b/x-pack/package.json index 44bdc765d81d0..ded576d8822d5 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -156,7 +156,7 @@ "@babel/runtime": "^7.3.4", "@elastic/datemath": "5.0.2", "@elastic/eui": "9.5.0", - "@elastic/javascript-typescript-langserver": "^0.1.19", + "@elastic/javascript-typescript-langserver": "^0.1.20", "@elastic/lsp-extension": "^0.1.1", "@elastic/node-crypto": "0.1.2", "@elastic/numeral": "2.3.2", diff --git a/x-pack/plugins/code/index.ts b/x-pack/plugins/code/index.ts index b19e568f760f2..7c17e89cc15ba 100644 --- a/x-pack/plugins/code/index.ts +++ b/x-pack/plugins/code/index.ts @@ -53,14 +53,20 @@ export const code = (kibana: any) => repos: Joi.array().default([]), security: Joi.object({ enableMavenImport: Joi.boolean().default(true), - enableGradleImport: Joi.boolean().default(true), + enableGradleImport: Joi.boolean().default(false), installNodeDependency: Joi.boolean().default(true), gitHostWhitelist: Joi.array() .items(Joi.string()) - .default([]), + .default([ + 'github.com', + 'gitlab.com', + 'bitbucket.org', + 'gitbox.apache.org', + 'eclipse.org', + ]), gitProtocolWhitelist: Joi.array() .items(Joi.string()) - .default([]), + .default(['https', 'git']), }).default(), maxWorkspace: Joi.number().default(5), // max workspace folder for each language server disableScheduler: Joi.boolean().default(true), // Temp option to disable all schedulers. diff --git a/x-pack/plugins/code/server/lsp/ts_launcher.ts b/x-pack/plugins/code/server/lsp/ts_launcher.ts index 3e10819f08ca8..e8195ce856694 100644 --- a/x-pack/plugins/code/server/lsp/ts_launcher.ts +++ b/x-pack/plugins/code/server/lsp/ts_launcher.ts @@ -106,6 +106,7 @@ export class TypescriptServerLauncher implements ILanguageServerLauncher { await proxy.connect(); return new RequestExpander(proxy, builtinWorkspace, maxWorkspace, this.options, { installNodeDependency: this.options.security.installNodeDependency, + gitHostWhitelist: this.options.security.gitHostWhitelist, }); } } diff --git a/yarn.lock b/yarn.lock index fbe7eeca39615..ef1af38512da4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -927,10 +927,10 @@ oppsy "2.x.x" pumpify "1.3.x" -"@elastic/javascript-typescript-langserver@^0.1.19": - version "0.1.19" - resolved "https://registry.yarnpkg.com/@elastic/javascript-typescript-langserver/-/javascript-typescript-langserver-0.1.19.tgz#64558f31581dabe23d33313042d7d7c586c1a683" - integrity sha512-RStwxW40Zy0Are6M0se3CiQzgDAJScVEioTk5GQgiKZkpNNJ8C+AhMMZ9CSm4fzp7vRIQ8jzHuS5o2dHv5hy2A== +"@elastic/javascript-typescript-langserver@^0.1.20": + version "0.1.20" + resolved "https://registry.yarnpkg.com/@elastic/javascript-typescript-langserver/-/javascript-typescript-langserver-0.1.20.tgz#5fee961be352d5869db47c290c2aaf5a4c047635" + integrity sha512-oc74IO+kSy12obuKY21XjKa8yl6tVqO/h3HquIWQbg4Oc5qKBalyjr9cYH9HVxT2d1fIlWJ+VN0EBqd2K+Xo7Q== dependencies: "@elastic/lsp-extension" "^0.1.1" javascript-typescript-langserver "^2.11.3"