Skip to content

Commit 5ae066d

Browse files
remove support for enrollment password setting
Stops referencing or validating the enrollment password configuration by eliminating related code, tests, and constants. Simplifies agent registration flow to rely solely on the existing authentication method.
1 parent ab67ab0 commit 5ae066d

File tree

4 files changed

+1
-32
lines changed

4 files changed

+1
-32
lines changed

plugins/main/public/components/endpoints-summary/register-agent/containers/register-agent/register-agent.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,7 @@ export const RegisterAgent = compose(
142142
let wazuhPassword = '';
143143
const needsPassword = authConfig?.auth?.use_password === 'yes';
144144
if (needsPassword) {
145-
wazuhPassword =
146-
configuration?.['enrollment.password'] ||
147-
authConfig?.['authd.pass'] ||
148-
'';
145+
wazuhPassword = authConfig?.['authd.pass'] || '';
149146
}
150147
const groups = await getGroups();
151148
setNeedsPassword(needsPassword);

plugins/main/server/routes/wazuh-utils/wazuh-utils.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,6 @@ describe.skip('[endpoint] PUT /utils/configuration', () => {
413413
${'enrollment.dns'} | ${''} | ${200} | ${null}
414414
${'enrollment.dns'} | ${'test space'} | ${400} | ${'[request body.enrollment.dns]: No whitespaces allowed.'}
415415
${'enrollment.dns'} | ${true} | ${400} | ${'[request body.enrollment.dns]: expected value of type [string] but got [boolean]'}
416-
${'enrollment.password'} | ${'test'} | ${200} | ${null}
417-
${'enrollment.password'} | ${''} | ${400} | ${'[request body.enrollment.password]: Value can not be empty.'}
418-
${'enrollment.password'} | ${'test space'} | ${200} | ${null}
419-
${'enrollment.password'} | ${true} | ${400} | ${'[request body.enrollment.password]: expected value of type [string] but got [boolean]'}
420416
${'fim.pattern'} | ${'test'} | ${200} | ${null}
421417
${'fim.pattern'} | ${'test*'} | ${200} | ${null}
422418
${'fim.pattern'} | ${''} | ${400} | ${'[request body.pattern]: Value can not be empty.'}

plugins/wazuh-core/common/constants.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,27 +1673,6 @@ export const PLUGIN_SETTINGS: { [key: string]: TPluginSetting } = {
16731673
SettingsValidator.serverAddressHostnameFQDNIPv4IPv6,
16741674
),
16751675
},
1676-
'enrollment.password': {
1677-
title: 'Enrollment password',
1678-
description:
1679-
'Specifies the password used to authenticate during the agent enrollment.',
1680-
store: {
1681-
file: {
1682-
configurableManaged: true,
1683-
},
1684-
},
1685-
category: SettingCategory.GENERAL,
1686-
type: EpluginSettingType.text,
1687-
defaultValue: '',
1688-
isConfigurableFromSettings: false,
1689-
validateUIForm: function (value) {
1690-
return this.validate(value);
1691-
},
1692-
validate: SettingsValidator.compose(
1693-
SettingsValidator.isString,
1694-
SettingsValidator.isNotEmptyString,
1695-
),
1696-
},
16971676
'fim.pattern': {
16981677
title: 'Index pattern',
16991678
description: 'Default index pattern to use for file integrity monitoring.',

plugins/wazuh-core/common/plugin-settings.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ describe('[settings] Input validation', () => {
138138
${'enrollment.dns'} | ${'2001:0db8:85a3:0000:0000:8a2e:0370:7334:KL12'} | ${'It should be a valid hostname, FQDN, IPv4 or uncompressed IPv6'}
139139
${'enrollment.dns'} | ${'example.'} | ${'It should be a valid hostname, FQDN, IPv4 or uncompressed IPv6'}
140140
${'enrollment.dns'} | ${'127.0.0.1'} | ${undefined}
141-
${'enrollment.password'} | ${'test'} | ${undefined}
142-
${'enrollment.password'} | ${''} | ${'Value can not be empty.'}
143-
${'enrollment.password'} | ${'test space'} | ${undefined}
144141
${'fim.pattern'} | ${'test'} | ${undefined}
145142
${'fim.pattern'} | ${'test*'} | ${undefined}
146143
${'fim.pattern'} | ${''} | ${'Value can not be empty.'}

0 commit comments

Comments
 (0)