Skip to content

Commit

Permalink
Add rel="noopener noreferrer" in documentation links (#5197)
Browse files Browse the repository at this point in the history
* add rel="noopener noreferrer"

* add changelog

* edit changelog

---------

Co-authored-by: Álex Ruiz <[email protected]>
(cherry picked from commit 39d75a7)
  • Loading branch information
yenienserrano committed Mar 8, 2023
1 parent 547327a commit 27d09eb
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All notable changes to the Wazuh app project will be documented in this file.

### Added

-
- Added rel="noopener noreferrer" in documentation links. [#5197](https://github.com/wazuh/wazuh-kibana-app/pull/5197)

### Changed

Expand Down
1 change: 1 addition & 0 deletions public/components/agents/syscollector/inventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function SyscollectorInventory({ agent }) {
'user-manual/agents/agent-connection.html',
)}
target='_blank'
rel='noopener noreferrer'
>
Checking connection with the Wazuh server
</a>
Expand Down
24 changes: 18 additions & 6 deletions public/components/common/modules/discover/row-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,20 @@ export class RowDetails extends Component {
let name = "";

value.forEach(item => {
if (item.type === 'cve')
if (item.type === 'cve'){
name = item.name;
if (item.type === 'link')
link = <a href={item.name} target="_blank">{item.name}</a>
})
return <span>{name}: {link}</span>
}
if (item.type === 'link') {
link = <a
href={item.name}
target="_blank"
rel="noopener noreferrer"
>
{item.name}
</a>;
}
});
return <span>{name}: {link}</span>;
} else {
const _value = typeof value === 'string' ? value : this.getValueAsString(value);
return (
Expand Down Expand Up @@ -545,7 +553,11 @@ export class RowDetails extends Component {
</EuiTitle>
}
extraAction={
<a href={`#/manager/rules?tab=rules&redirectRule=${id}`} target="_blank" style={{ paddingTop: 5 }}>
<a
href={`#/manager/rules?tab=rules&redirectRule=${id}`}
target="_blank" style={{ paddingTop: 5 }}
rel="noopener noreferrer"
>
<EuiIcon type="popout" color='primary' />&nbsp;
View in Rules
</a>
Expand Down
6 changes: 5 additions & 1 deletion public/components/common/welcome/agents-welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,11 @@ class AgentsWelcome extends Component {
<p>
The agent has been registered but has not yet connected to the manager.
</p>
<a href={webDocumentationLink('user-manual/agents/agent-connection.html')} target="_blank">
<a
href={webDocumentationLink('user-manual/agents/agent-connection.html')}
target="_blank"
rel="noopener noreferrer"
>
Checking connection with the Wazuh server
</a>
</Fragment>
Expand Down
4 changes: 2 additions & 2 deletions public/controllers/agent/components/register-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ apk add wazuh-agent=${this.state.wazuhVersion}-r1`,
<a
href={urlCheckConnectionDocumentation}
target='_blank'
rel='noreferrer'
rel="noopener noreferrer"
>
document.
</a>
Expand Down Expand Up @@ -1666,7 +1666,7 @@ apk add wazuh-agent=${this.state.wazuhVersion}-r1`,
serverAddress: nodeSelected,
udpProtocol: this.state.haveUdpProtocol,
connectionSecure: this.state.haveConnectionSecure
});
});
};

const steps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export const WzAgentNeverConnectedPrompt = () => (
<p>
The agent has been registered but has not yet connected to the manager.
</p>
<a href={documentationLink} target="_blank">
<a
href={documentationLink}
target="_blank"
rel="noopener noreferrer"
>
Checking connection with the Wazuh server
</a>
</Fragment>
Expand All @@ -36,4 +40,4 @@ export const WzAgentNeverConnectedPrompt = () => (
Back
</EuiButton>
}
/>)
/>)
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export default class WzRuleInfo extends Component {
const badgeList = [];
const fields = ['pci_dss', 'gpg13', 'hipaa', 'gdpr', 'nist_800_53', 'tsc', 'mitre'];
const buildBadge = (field) => {

return (
<EuiToolTip content={item[field].join(', ')} key={`${item.id}-${field}`} position="bottom">
<EuiBadge
Expand Down Expand Up @@ -348,13 +348,20 @@ export default class WzRuleInfo extends Component {
let name = '';

value.forEach((item) => {
if (item.type === 'cve') name = item.name;
if (item.type === 'link')
if (item.type === 'cve'){
name = item.name;
}
if (item.type === 'link'){
link = (
<a href={item.name} target="_blank">
<a
href={item.name}
target="_blank"
rel="noopener noreferrer"
>
{item.name}
</a>
);
}
});
return (
<span>
Expand Down
6 changes: 5 additions & 1 deletion public/utils/check-plugin-version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ const checkClientAppVersion = (appInfo: TAppInfo) => {
<p>If the error persists, restart {PLUGIN_PLATFORM_NAME} as well.</p>
<p>
For more information check our troubleshooting section{' '}
<a href={troubleshootingUrl} target="_blank">
<a
href={troubleshootingUrl}
target="_blank"
rel="noopener noreferrer"
>
here.
</a>
</p>
Expand Down

0 comments on commit 27d09eb

Please sign in to comment.