Skip to content

Commit

Permalink
[Backport 4.5.2-7.16] Fix broken GitHub documentation link (#5798)
Browse files Browse the repository at this point in the history
Fix broken GitHub documentation link (#5796)

* Fix github monitor broken link

* Fix github monitor broken link

* Fix cloud-security broken link

* Fixed documentation broken links in Management - Configuration

* Update snapshots

* Fix changelog

---------

Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
(cherry picked from commit db246ee)

Co-authored-by: JuanGarriuz <juan.garcia@wazuh.com>
  • Loading branch information
github-actions[bot] and JuanGarriuz authored Aug 23, 2023
1 parent 78ae8e1 commit 109452f
Show file tree
Hide file tree
Showing 12 changed files with 192 additions and 134 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to the Wazuh app project will be documented in this file.
### Fixed

- Fixed an error with the commands in the Deploy new agent section for Oracle Linux 6+ agents [#5764](https://github.com/wazuh/wazuh-kibana-app/pull/5764)
- Fixed broken documentation links in `Management/Configuration` section [#5796](https://github.com/wazuh/wazuh-kibana-app/pull/5796)

## Wazuh v4.5.1 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 01

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
*
* Find more information about this on the LICENSE file.
*/
import { webDocumentationLink } from "../../../../../../../common/services/web_documentation";
import { webDocumentationLink } from '../../../../../../../common/services/web_documentation';

export default [
{
text: 'Using Wazuh to monitor AWS',
href: webDocumentationLink('amazon/index.html')
href: webDocumentationLink('cloud-security/amazon/index.html'),
},
{
text: 'Amazon S3 module reference',
href: webDocumentationLink('user-manual/reference/ossec-conf/wodle-s3.html')
}
href: webDocumentationLink(
'user-manual/reference/ossec-conf/wodle-s3.html',
),
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ import { webDocumentationLink } from '../../../../../../../common/services/web_d
const helpLinks = [
{
text: 'Using Wazuh to monitor Azure',
href: webDocumentationLink('azure/index.html')
href: webDocumentationLink('cloud-security/azure/index.html'),
},
{
text: 'Azure reference',
href: webDocumentationLink('user-manual/reference/ossec-conf/wodle-azure-logs.html')
}
href: webDocumentationLink(
'user-manual/reference/ossec-conf/wodle-azure-logs.html',
),
},
];

const mainSettings = [
Expand All @@ -40,8 +42,8 @@ const mainSettings = [
{ field: 'interval', label: 'Interval between Azure-Logs executions' },
{
field: 'run_on_start',
label: 'Run evaluation immediately when service is started'
}
label: 'Run evaluation immediately when service is started',
},
];

const contentSettings = [
Expand All @@ -54,8 +56,8 @@ const contentSettings = [
{
field: 'auth_path',
label:
'Path of the file that contains the application identifier and the application key'
}
'Path of the file that contains the application identifier and the application key',
},
];

class WzConfigurationAzure extends Component {
Expand Down Expand Up @@ -87,12 +89,12 @@ class WzConfigurationAzure extends Component {
{currentConfig &&
!this.wodleConfig['azure-logs'] &&
!isString(currentConfig['wmodules-wmodules']) && (
<WzNoConfig error="not-present" help={helpLinks} />
<WzNoConfig error='not-present' help={helpLinks} />
)}
{currentConfig && this.wodleConfig['azure-logs'] && (
<WzConfigurationSettingsTabSelector
title="Main settings"
description="Configuration for the Azure logs wodle"
title='Main settings'
description='Configuration for the Azure logs wodle'
currentConfig={this.wodleConfig}
minusHeight={260}
helpLinks={helpLinks}
Expand All @@ -115,7 +117,7 @@ class WzConfigurationAzure extends Component {
/>
)}
</Fragment>
)
),
)}
</Fragment>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
isString,
renderValueOrDefault,
renderValueNoThenEnabled,
renderValueOrYes
renderValueOrYes,
} from '../utils/utils';

import withWzConfig from '../util-hocs/wz-config';
Expand All @@ -28,43 +28,47 @@ import { webDocumentationLink } from '../../../../../../../common/services/web_d
const helpLinks = [
{
text: 'Monitoring containers activity',
href: webDocumentationLink('container-security/docker-monitor/monitoring-containers-activity.html')
href: webDocumentationLink(
'user-manual/capabilities/container-security/use-cases.html',
),
},
{
text: 'Docker listener module reference',
href: webDocumentationLink('user-manual/reference/ossec-conf/wodle-docker.html')
}
href: webDocumentationLink(
'user-manual/reference/ossec-conf/wodle-docker.html',
),
},
];

const mainSettings = [
{
field: 'disabled',
label: 'Docker listener status',
render: renderValueNoThenEnabled
render: renderValueNoThenEnabled,
},
{
field: 'attempts',
label: 'Number of attempts to execute the listener',
render: renderValueOrDefault('5')
render: renderValueOrDefault('5'),
},
{
field: 'interval',
label: 'Waiting time to rerun the listener in case it fails',
render: renderValueOrDefault('10m')
render: renderValueOrDefault('10m'),
},
{
field: 'run_on_start',
label: 'Run the listener immediately when service is started',
render: renderValueOrYes
}
render: renderValueOrYes,
},
];

class WzConfigurationDockerListener extends Component {
constructor(props) {
super(props);
this.wodleConfig = wodleBuilder(
this.props.currentConfig,
'docker-listener'
'docker-listener',
);
}
componentDidMount() {
Expand All @@ -91,12 +95,12 @@ class WzConfigurationDockerListener extends Component {
{currentConfig &&
!this.wodleConfig['docker-listener'] &&
!isString(currentConfig['wmodules-wmodules']) && (
<WzNoConfig error="not-present" help={helpLinks} />
<WzNoConfig error='not-present' help={helpLinks} />
)}
{currentConfig && this.wodleConfig['docker-listener'] && (
<WzConfigurationSettingsTabSelector
title="Main settings"
description="General Docker listener settings"
title='Main settings'
description='General Docker listener settings'
currentConfig={this.wodleConfig}
minusHeight={this.props.agent.id === '000' ? 240 : 355}
helpLinks={helpLinks}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import WzConfigurationSettingsTabSelector from '../util-components/configuration
import WzConfigurationSettingsGroup from '../util-components/configuration-settings-group';
import WzConfigurationSettingsListSelector from '../util-components/configuration-settings-list-selector';
import WzTabSelector, {
WzTabSelectorTab
WzTabSelectorTab,
} from '../util-components/tab-selector';
import WzNoConfig from '../util-components/no-config';
import { isString, renderValueYesThenEnabled } from '../utils/utils';
Expand All @@ -29,83 +29,125 @@ import { webDocumentationLink } from '../../../../../../../common/services/web_d
const sections = [{ component: 'wmodules', configuration: 'wmodules' }];

const mainSettings = [
{ field: 'enabled', label: 'Service status', render: renderValueYesThenEnabled },
{ field: 'only_future_events', label: 'Collect events generated since Wazuh agent was started' },
{ field: 'time_delay', label: 'Time in seconds that each scan will monitor until that delay backwards' },
{ field: 'curl_max_size', label: 'Maximum size allowed for the GitHub API response' },
{ field: 'interval', label: 'Interval between GitHub wodle executions in seconds' },
{
field: 'enabled',
label: 'Service status',
render: renderValueYesThenEnabled,
},
{
field: 'only_future_events',
label: 'Collect events generated since Wazuh agent was started',
},
{
field: 'time_delay',
label:
'Time in seconds that each scan will monitor until that delay backwards',
},
{
field: 'curl_max_size',
label: 'Maximum size allowed for the GitHub API response',
},
{
field: 'interval',
label: 'Interval between GitHub wodle executions in seconds',
},
{ field: 'event_type', label: 'Event type' },
];

const columns = [
{ field: 'org_name', label: 'Organization' },
{ field: 'api_token', label: 'Token' }
{ field: 'api_token', label: 'Token' },
];

const helpLinks = [
{
text: 'Using Wazuh to monitor GitHub',
href: webDocumentationLink('github/index.html')
href: webDocumentationLink('cloud-security/github/index.html'),
},
{
text: 'GitHub module reference',
href: webDocumentationLink('user-manual/reference/ossec-conf/github-module.html')
}
href: webDocumentationLink(
'user-manual/reference/ossec-conf/github-module.html',
),
},
];

export const WzConfigurationGitHub = withWzConfig(sections)(({currentConfig, updateBadge, ...rest }) => {
const wodleConfiguration = useMemo(() => wodleBuilder(currentConfig, 'github'), [currentConfig]);

useEffect(() => {
updateBadge(currentConfig &&
wodleConfiguration &&
wodleConfiguration['github'] &&
wodleConfiguration['github'].enabled === 'yes');
}, [currentConfig]);
export const WzConfigurationGitHub = withWzConfig(sections)(
({ currentConfig, updateBadge, ...rest }) => {
const wodleConfiguration = useMemo(
() => wodleBuilder(currentConfig, 'github'),
[currentConfig],
);

return (
<WzTabSelector>
<WzTabSelectorTab label="General">
<GeneralTab wodleConfiguration={wodleConfiguration} currentConfig={currentConfig} {...rest}/>
</WzTabSelectorTab>
<WzTabSelectorTab label="Credentials">
<CredentialsTab wodleConfiguration={wodleConfiguration} currentConfig={currentConfig} {...rest}/>
</WzTabSelectorTab>
</WzTabSelector>
)
});
useEffect(() => {
updateBadge(
currentConfig &&
wodleConfiguration &&
wodleConfiguration['github'] &&
wodleConfiguration['github'].enabled === 'yes',
);
}, [currentConfig]);

return (
<WzTabSelector>
<WzTabSelectorTab label='General'>
<GeneralTab
wodleConfiguration={wodleConfiguration}
currentConfig={currentConfig}
{...rest}
/>
</WzTabSelectorTab>
<WzTabSelectorTab label='Credentials'>
<CredentialsTab
wodleConfiguration={wodleConfiguration}
currentConfig={currentConfig}
{...rest}
/>
</WzTabSelectorTab>
</WzTabSelector>
);
},
);

const tabWrapper = compose(
withGuard(({currentConfig}) => currentConfig['wmodules-wmodules'] && isString(currentConfig['wmodules-wmodules']), ({currentConfig}) => <WzNoConfig error={currentConfig['wmodules-wmodules']} help={helpLinks}/>),
withGuard(({wodleConfiguration}) => !wodleConfiguration['github'], (props) => <WzNoConfig error='not-present' help={helpLinks}/>),
withGuard(
({ currentConfig }) =>
currentConfig['wmodules-wmodules'] &&
isString(currentConfig['wmodules-wmodules']),
({ currentConfig }) => (
<WzNoConfig error={currentConfig['wmodules-wmodules']} help={helpLinks} />
),
),
withGuard(
({ wodleConfiguration }) => !wodleConfiguration['github'],
props => <WzNoConfig error='not-present' help={helpLinks} />,
),
);

const GeneralTab = tabWrapper(({agent, wodleConfiguration}) => (
const GeneralTab = tabWrapper(({ agent, wodleConfiguration }) => (
<WzConfigurationSettingsTabSelector
title="Main settings"
description="Configuration for the GitHub module"
title='Main settings'
description='Configuration for the GitHub module'
currentConfig={wodleConfiguration}
minusHeight={agent.id === '000' ? 370 : 420} //TODO: Review the minusHeight for the agent case
helpLinks={helpLinks}
>
<WzConfigurationSettingsGroup
config={wodleConfiguration['github']}
items={mainSettings}
/>
/>
</WzConfigurationSettingsTabSelector>
));



const CredentialsTab = tabWrapper(({agent, wodleConfiguration}) => {
const credentials = useMemo(() => settingsListBuilder(
wodleConfiguration['github'].api_auth,
'org_name'
), [wodleConfiguration]);
const CredentialsTab = tabWrapper(({ agent, wodleConfiguration }) => {
const credentials = useMemo(
() =>
settingsListBuilder(wodleConfiguration['github'].api_auth, 'org_name'),
[wodleConfiguration],
);
return (
<WzConfigurationSettingsTabSelector
title="List of organizations to auditing"
title='List of organizations to auditing'
currentConfig={wodleConfiguration}
minusHeight={agent.id === '000' ? 370 : 420} //TODO: Review the minusHeight for the agent case
helpLinks={helpLinks}
Expand All @@ -115,5 +157,5 @@ const CredentialsTab = tabWrapper(({agent, wodleConfiguration}) => {
settings={columns}
/>
</WzConfigurationSettingsTabSelector>
)
);
});
Loading

0 comments on commit 109452f

Please sign in to comment.