[Cloud Security] [Fleet] Adding new agentless-api url config for Fleet plugin (#186338)

This commit is contained in:
seanrathier 2024-06-21 15:12:49 -04:00 committed by GitHub
parent 66c56629ba
commit 9c1799cd0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 0 deletions

View file

@ -261,6 +261,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
'xpack.discoverEnhanced.actions.exploreDataInChart.enabled (boolean)',
'xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled (boolean)',
'xpack.fleet.agents.enabled (boolean)',
'xpack.fleet.agentless.api.url (string)',
'xpack.fleet.enableExperimental (array)',
'xpack.fleet.internal.activeAgentsSoftLimit (number)',
'xpack.fleet.internal.fleetServerStandalone (boolean)',

View file

@ -30,6 +30,11 @@ export interface FleetConfigType {
hosts?: string[];
};
};
agentless?: {
api: {
url: string;
};
};
agentPolicies?: PreconfiguredAgentPolicy[];
packages?: PreconfiguredPackage[];
outputs?: PreconfiguredOutput[];

View file

@ -102,6 +102,14 @@ describe('Config schema', () => {
});
}).not.toThrow();
});
it('should allow to specify a URL in xpack.fleet.agentless.api.url ', () => {
expect(() => {
config.schema.validate({
agentless: { api: { url: 'https://agentless.api.url' } },
});
}).not.toThrow();
});
describe('deprecations', () => {
it('should add a depreciations when trying to enable a non existing experimental feature', () => {
const res = applyConfigDeprecations({

View file

@ -33,6 +33,7 @@ export const config: PluginConfigDescriptor = {
agents: {
enabled: true,
},
agentless: true,
enableExperimental: true,
developer: {
maxAgentPoliciesWithInactivityTimeout: true,
@ -141,6 +142,13 @@ export const config: PluginConfigDescriptor = {
})
),
}),
agentless: schema.maybe(
schema.object({
api: schema.object({
url: schema.maybe(schema.uri({ scheme: ['http', 'https'] })),
}),
})
),
packages: PreconfiguredPackagesSchema,
agentPolicies: PreconfiguredAgentPoliciesSchema,
outputs: PreconfiguredOutputsSchema,