Enables preventing access to internal APIs (#156935)

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Christiane (Tina) Heiligers 2023-05-10 04:25:15 -07:00 committed by GitHub
parent ed3941d45e
commit 7bbe92f085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 438 additions and 18 deletions

View file

@ -38,6 +38,7 @@ export const httpConfigSchema = schema.object(
}),
}),
ssl: sslSchema,
restrictInternalApis: schema.boolean({ defaultValue: false }),
},
{ unknowns: 'ignore' }
);
@ -54,6 +55,7 @@ export class HttpConfig implements IHttpConfig {
socketTimeout: number;
cors: ICorsConfig;
ssl: ISslConfig;
restrictInternalApis: boolean;
constructor(rawConfig: HttpConfigType) {
this.basePath = rawConfig.basePath;
@ -65,5 +67,6 @@ export class HttpConfig implements IHttpConfig {
this.socketTimeout = rawConfig.socketTimeout;
this.cors = rawConfig.cors;
this.ssl = new SslConfig(rawConfig.ssl);
this.restrictInternalApis = rawConfig.restrictInternalApis;
}
}

View file

@ -46,6 +46,7 @@ describe('BasePathProxyServer', () => {
},
ssl: { enabled: false },
maxPayload: new ByteSizeValue(1024),
restrictInternalApis: false,
};
const serverOptions = getServerOptions(config);