Skip to content

Commit 0c25574

Browse files
authored
Merge branch 'master' into datanode-opensearch-upgrade
2 parents 10e6121 + 4aac235 commit 0c25574

21 files changed

Lines changed: 320 additions & 182 deletions

File tree

UPGRADING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,12 @@ The following REST API changes are a direct result of this rework:
8181
| `POST /plugins/org.graylog.plugins.securityapp.sigma/sigma/rules/import` | Moved to `POST /plugins/org.graylog.plugins.securityapp.sigma/sigma/import/bulk/import` |
8282
| `POST /plugins/org.graylog.plugins.securityapp.sigma/sigma/rules/upload` | Moved to `POST /plugins/org.graylog.plugins.securityapp.sigma/sigma/import/bulk/upload` |
8383
| All other `/plugins/org.graylog.plugins.securityapp.sigma/sigma/rules/...` | Deleted |
84+
85+
## Threat Coverage Percentages May Change After Upgrade
86+
87+
Due to the migration of Sigma rules to Event Definitions in 7.2, the percentages displayed in the Threat
88+
Coverage widget may be different from what they were in 7.1. Coverage is now computed directly from Event
89+
Definitions rather than from the previous Sigma rules. Every Event Definition with MITRE tactics/techniques
90+
assigned is now included, and coverage reflects how many of them are enabled versus disabled (with no log
91+
source check that was previously present for Sigma rules). Therefore, a tactic may show a higher or lower
92+
percentage than it did in 7.1, without any change to the actual installed Event Definitions.

changelog/unreleased/pr-26657.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
type = "f"
2+
message = "Fix problem in `GET /messages/{index}/{messageId}`. Permission requirements introduced by previous security fix have been too strong, they have been relaxed."
3+
4+
pulls = ["26657"]

graylog2-server/src/main/java/org/graylog2/rest/resources/messages/MessageResource.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,21 @@ public MessageResource(Messages messages, CodecFactory codecFactory, IndexSetReg
9696
@Operation(summary = "Get a single message.")
9797
@ApiResponses(value = {
9898
@ApiResponse(responseCode = "200", description = "Returns the message", useReturnTypeSchema = true),
99-
@ApiResponse(responseCode = "404", description = "Specified index does not exist."),
100-
@ApiResponse(responseCode = "404", description = "Message does not exist.")
99+
@ApiResponse(responseCode = "404", description = "Specified message does not exist or the user does not have the required permissions.")
101100
})
102101
public ResultMessage search(@Parameter(name = "index", description = "The index this message is stored in.", required = true)
103102
@PathParam("index") String index,
104103
@Parameter(name = "messageId", required = true)
105104
@PathParam("messageId") String messageId) throws IOException {
106-
checkPermission(RestPermissions.INDICES_READ, index);
107105
checkPermission(RestPermissions.MESSAGES_READ, messageId);
108106
try {
109107
final ResultMessage resultMessage = messages.get(messageId, index);
110108
final Message message = resultMessage.getMessage();
111109
checkMessageReadPermission(message);
112110

113111
return resultMessage;
114-
} catch (DocumentNotFoundException e) {
115-
throw new NotFoundException("Message " + messageId + " does not exist in index " + index, e);
116-
} catch (IndexNotFoundException e) {
117-
throw new NotFoundException("Index " + index + " does not exist.", e);
112+
} catch (DocumentNotFoundException | IndexNotFoundException | ForbiddenException e) {
113+
throw new NotFoundException("Specified message does not exist or the user does not have the required permissions");
118114
}
119115
}
120116

graylog2-web-interface/src/components/collectors/overview/onboarding/PlatformIcons.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('PlatformIcons', () => {
2323
it('renders an icon for each supported platform', () => {
2424
render(<PlatformIcons />);
2525

26-
['Linux', 'Windows', 'macOS', 'Kubernetes', 'Docker'].forEach((label) => {
26+
['Linux', 'Windows', 'macOS'].forEach((label) => {
2727
expect(screen.getByTitle(label)).toBeInTheDocument();
2828
});
2929
});

graylog2-web-interface/src/components/collectors/overview/onboarding/PlatformIcons.tsx

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
import * as React from 'react';
1818
import styled, { css } from 'styled-components';
1919

20-
import { BrandIcon, Card, Icon } from 'components/common';
20+
import { BrandIcon, Icon } from 'components/common';
21+
import IconCard from 'components/welcome/IconCard';
2122

2223
import PLATFORMS from './platforms';
2324
import type { PlatformIcon } from './platforms';
@@ -31,37 +32,12 @@ const Icons = styled.div(
3132
`,
3233
);
3334

34-
const IconContainer = styled.span`
35-
display: flex;
36-
align-items: center;
37-
justify-content: center;
38-
width: 24px;
39-
height: 24px;
40-
41-
/* BrandIcon has its own 20x20 container — scale it to match */
42-
> div {
43-
width: 24px;
44-
height: 24px;
45-
46-
svg {
47-
width: 24px;
48-
height: 24px;
49-
}
50-
}
51-
`;
52-
5335
const MaterialIcon = styled(Icon)`
5436
&& {
5537
font-size: 24px;
5638
}
5739
`;
5840

59-
const PlatformCard = styled(Card)`
60-
display: flex;
61-
align-items: center;
62-
justify-content: center;
63-
`;
64-
6541
const renderPlatformIcon = (icon: PlatformIcon) => {
6642
if (icon.type === 'brand') {
6743
return <BrandIcon name={icon.name} />;
@@ -74,9 +50,7 @@ const renderPlatformIcon = (icon: PlatformIcon) => {
7450
const PlatformIcons = () => (
7551
<Icons>
7652
{PLATFORMS.map((platform) => (
77-
<PlatformCard key={platform.id} padding="sm">
78-
<IconContainer title={platform.label}>{renderPlatformIcon(platform.icon)}</IconContainer>
79-
</PlatformCard>
53+
<IconCard key={platform.id} title={platform.label}>{renderPlatformIcon(platform.icon)}</IconCard>
8054
))}
8155
</Icons>
8256
);

graylog2-web-interface/src/components/collectors/overview/onboarding/PlatformPicker.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ describe('PlatformPicker', () => {
3333
expect(screen.getByRole('button', { name: /linux/i })).toBeInTheDocument();
3434
expect(screen.getByRole('button', { name: /windows/i })).toBeInTheDocument();
3535
expect(screen.getByRole('button', { name: /macos/i })).toBeInTheDocument();
36-
expect(screen.getByRole('button', { name: /kubernetes/i })).toBeInTheDocument();
37-
expect(screen.getByRole('button', { name: /docker/i })).toBeInTheDocument();
3836
});
3937

4038
it('calls onSelect with the platform id when a card is clicked', async () => {

graylog2-web-interface/src/components/collectors/overview/onboarding/platforms.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,6 @@ const PLATFORMS: Platform[] = [
5353
commandTemplate: (host, port, token) =>
5454
`curl -fsSL https://${host}:${port}/collectors/install | ENROLLMENT_TOKEN=${token} bash`,
5555
},
56-
{
57-
id: 'kubernetes',
58-
label: 'Kubernetes',
59-
icon: { type: 'brand', name: 'kubernetes' },
60-
commandTemplate: (host, port, token) =>
61-
`helm install graylog-collector oci://${host}:${port}/collectors/charts/collector --set enrollmentToken=${token}`,
62-
},
63-
{
64-
id: 'docker',
65-
label: 'Docker',
66-
icon: { type: 'brand', name: 'docker' },
67-
commandTemplate: (host, port, token) =>
68-
`docker run -d -e ENROLLMENT_TOKEN=${token} ${host}:${port}/collectors/collector:latest`,
69-
},
7056
];
7157

7258
export default PLATFORMS;

graylog2-web-interface/src/components/common/ExternalLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type Props = {
3434
*/
3535
const ExternalLink = ({ children, className = '', href = '', iconName = 'open_in_new', target = '_blank' }: Props) => {
3636
const content = (
37-
<span>
37+
<span className="external-link-inner">
3838
{children}
3939
&nbsp;
4040
<Icon name={iconName} />

graylog2-web-interface/src/components/common/ExternalLinkButton.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@
1515
* <http://www.mongodb.com/licensing/server-side-public-license>.
1616
*/
1717
import React from 'react';
18+
import styled from 'styled-components';
1819

1920
import { Button } from 'components/bootstrap';
2021
import ExternalLink from 'components/common/ExternalLink';
2122

23+
export const EXTERNAL_LINK_INNER_CLASS = 'external-link-inner';
24+
25+
const StyledButton = styled(Button)`
26+
.${EXTERNAL_LINK_INNER_CLASS} {
27+
display: flex;
28+
align-items: center;
29+
}
30+
`;
31+
2232
/**
2333
* Component that renders a link to an external resource as a button.
2434
*
@@ -37,9 +47,9 @@ const ExternalLinkButton = ({
3747
children = undefined,
3848
...props
3949
}: Props) => (
40-
<Button bsStyle={bsStyle} target={target} className={className} disabled={disabled} {...props}>
50+
<StyledButton bsStyle={bsStyle} target={target} className={className} disabled={disabled} {...props}>
4151
<ExternalLink iconName={iconName}>{children}</ExternalLink>
42-
</Button>
52+
</StyledButton>
4353
);
4454

4555
export default ExternalLinkButton;

graylog2-web-interface/src/components/common/PageHeader.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ const LifecycleIndicator = ({
106106
type Props = {
107107
title: React.ReactNode;
108108
children?: React.ReactElement | Array<React.ReactElement>;
109+
className?: string;
109110
actions?: React.ReactElement;
110111
topActions?: React.ReactElement;
111112
lifecycle?: 'experimental' | 'legacy';
@@ -127,12 +128,13 @@ const PageHeader = ({
127128
topActions = undefined,
128129
lifecycle = undefined,
129130
lifecycleMessage = undefined,
131+
className = undefined,
130132
documentationLink = undefined,
131133
}: Props) => {
132134
const topLevelClassNames = subpage ? '' : 'content';
133135

134136
return (
135-
<ContentHeadRow className={topLevelClassNames}>
137+
<ContentHeadRow className={`${className ?? ''} ${topLevelClassNames}`}>
136138
<Col sm={12}>
137139
<Container>
138140
<FlexRow>

0 commit comments

Comments
 (0)