Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken GitHub documentation link #5796

Merged
merged 7 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 - OpenSearch Dashboards 2.6.0 - 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