Skip to content

Commit 1209085

Browse files
Changes for v1.1.12 (#1596)
1 parent 37b2d0a commit 1209085

File tree

13 files changed

+11
-201
lines changed

13 files changed

+11
-201
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.12] - 2025-05-13
9+
10+
### Security
11+
12+
* Removed CloudWatch Alarm toggling to improve security posture
13+
814
## [1.1.11] - 2025-03-12
915

1016
### Security

frontend/public/locales/en-US/common.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@
180180
"upgrade": "Upgrade",
181181
"confirm": "Confirm",
182182
"addPlugin": "Add Plugin",
183-
"enableAll": "Enable All",
184-
"disableAll": "Disable All",
185183
"viewAlarms": "View Alarms",
186184
"refreshMetadata": "Refresh Metadata",
187185
"clearFilters": "Clear filters",

frontend/public/locales/zh-CN/common.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@
180180
"upgrade": "升级",
181181
"confirm": "确认",
182182
"addPlugin": "添加插件",
183-
"enableAll": "全部启用",
184-
"disableAll": "全部禁用",
185183
"viewAlarms": "查看告警",
186184
"refreshMetadata": "刷新元数据",
187185
"clearFilters": "清理筛选",

frontend/src/apis/resource.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -131,27 +131,6 @@ const getAlarmList = async (params: {
131131
return result;
132132
};
133133

134-
const disableAlarms = async (data: {
135-
region: string;
136-
alarmNames: string[];
137-
}) => {
138-
const result: any = await apiRequest(
139-
'post',
140-
`/env/cloudwatch/alarms/disable`,
141-
data
142-
);
143-
return result;
144-
};
145-
146-
const enableAlarms = async (data: { region: string; alarmNames: string[] }) => {
147-
const result: any = await apiRequest(
148-
'post',
149-
`/env/cloudwatch/alarms/enable`,
150-
data
151-
);
152-
return result;
153-
};
154-
155134
const checkServicesAvailable = async (params: { region: string }) => {
156135
const result: any = await apiRequest(
157136
'get',
@@ -182,7 +161,5 @@ export {
182161
getVPCList,
183162
getSTSUploadRole,
184163
getAlarmList,
185-
disableAlarms,
186-
enableAlarms,
187164
checkServicesAvailable,
188165
};

frontend/src/pages/pipelines/detail/comps/AlarmTable.tsx

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
StatusIndicatorProps,
2323
Table,
2424
} from '@cloudscape-design/components';
25-
import { disableAlarms, enableAlarms, getAlarmList } from 'apis/resource';
25+
import {getAlarmList } from 'apis/resource';
2626
import React, { useEffect, useState } from 'react';
2727
import { useTranslation } from 'react-i18next';
2828
import { buildAlarmsLink } from 'ts/url';
@@ -49,8 +49,6 @@ const AlarmTable: React.FC<AlarmTableProps> = (props: AlarmTableProps) => {
4949
const [currentPage, setCurrentPage] = useState(1);
5050
const [totalCount, setTotalCount] = useState(0);
5151
const [alarmList, setAlarmList] = useState<IAlarm[]>([]);
52-
const [loadingEnable, setLoadingEnable] = useState(false);
53-
const [loadingDisable, setLoadingDisable] = useState(false);
5452

5553
const listAlarms = async () => {
5654
setLoadingData(true);
@@ -71,46 +69,6 @@ const AlarmTable: React.FC<AlarmTableProps> = (props: AlarmTableProps) => {
7169
}
7270
};
7371

74-
const enableAlarm = async (item?: IAlarm) => {
75-
setLoadingEnable(true);
76-
try {
77-
const alarmNames = item
78-
? [item?.AlarmName]
79-
: selectedItems.map((item) => item.AlarmName);
80-
const resData: ApiResponse<null> = await enableAlarms({
81-
region,
82-
alarmNames,
83-
});
84-
if (resData.success) {
85-
setSelectedItems([]);
86-
listAlarms();
87-
setLoadingEnable(false);
88-
}
89-
} catch (error) {
90-
setLoadingEnable(false);
91-
}
92-
};
93-
94-
const disableAlarm = async (item?: IAlarm) => {
95-
setLoadingDisable(true);
96-
try {
97-
const alarmNames = item
98-
? [item?.AlarmName]
99-
: selectedItems.map((item) => item.AlarmName);
100-
const resData: ApiResponse<null> = await disableAlarms({
101-
region,
102-
alarmNames,
103-
});
104-
if (resData.success) {
105-
setSelectedItems([]);
106-
listAlarms();
107-
setLoadingDisable(false);
108-
}
109-
} catch (error) {
110-
setLoadingDisable(false);
111-
}
112-
};
113-
11472
useEffect(() => {
11573
listAlarms();
11674
}, [currentPage]);
@@ -234,24 +192,6 @@ const AlarmTable: React.FC<AlarmTableProps> = (props: AlarmTableProps) => {
234192
listAlarms();
235193
}}
236194
/>
237-
<Button
238-
loading={loadingEnable}
239-
disabled={selectedItems.length <= 0}
240-
onClick={() => {
241-
enableAlarm();
242-
}}
243-
>
244-
{t('button.enableAll')}
245-
</Button>
246-
<Button
247-
loading={loadingDisable}
248-
disabled={selectedItems.length <= 0}
249-
onClick={() => {
250-
disableAlarm();
251-
}}
252-
>
253-
{t('button.disableAll')}
254-
</Button>
255195
<Button
256196
href={buildAlarmsLink(region, projectId)}
257197
iconAlign="right"

solution-manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: SO0219
33
name: clickstream-analytics-on-aws
4-
version: v1.1.11
4+
version: v1.1.12
55
cloudformation_templates:
66
- template: cloudfront-s3-control-plane-stack-global.template.json
77
main_template: true

src/control-plane/backend/click-stream-api.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,6 @@ export class ClickStreamApiConstruct extends Construct {
481481
'secretsmanager:ListSecrets',
482482
'secretsmanager:GetSecretValue',
483483
'cloudwatch:DescribeAlarms',
484-
'cloudwatch:EnableAlarmActions',
485-
'cloudwatch:DisableAlarmActions',
486484
'events:PutRule',
487485
'events:ListTargetsByRule',
488486
'events:PutTargets',

src/control-plane/backend/lambda/api/config/dictionary.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dist_output_bucket": "solutions-reference",
77
"target": "latest",
88
"prefix": "",
9-
"version": "v1.1.11"
9+
"version": "v1.1.12"
1010
}
1111
},
1212
{

src/control-plane/backend/lambda/api/router/environment.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
import express from 'express';
15-
import { body, header, query } from 'express-validator';
15+
import { header, query } from 'express-validator';
1616
import { defaultAssumeRoleTypeValid, defaultPageValueValid, defaultRegionValueValid, defaultSubnetTypeValid, isRequestIdExisted, isValidEmpty, validate } from '../common/request-valid';
1717
import { EnvironmentServ } from '../service/environment';
1818

@@ -220,24 +220,6 @@ router_env.get(
220220
return environmentServ.alarms(req, res, next);
221221
});
222222

223-
router_env.post(
224-
'/cloudwatch/alarms/disable',
225-
validate([
226-
body('region').custom(isValidEmpty),
227-
]),
228-
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
229-
return environmentServ.alarmsDisable(req, res, next);
230-
});
231-
232-
router_env.post(
233-
'/cloudwatch/alarms/enable',
234-
validate([
235-
body('region').custom(isValidEmpty),
236-
]),
237-
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
238-
return environmentServ.alarmsEnable(req, res, next);
239-
});
240-
241223
router_env.get(
242224
'/ping',
243225
async (req: express.Request, res: express.Response, next: express.NextFunction) => {

src/control-plane/backend/lambda/api/service/environment.ts

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { paginateData } from '../common/utils';
2020
import { CPipeline } from '../model/pipeline';
2121
import { ListCertificates } from '../store/aws/acm';
2222
import { pingServiceResource } from '../store/aws/cloudformation';
23-
import { describeAlarmsByProjectId, disableAlarms, enableAlarms } from '../store/aws/cloudwatch';
23+
import { describeAlarmsByProjectId } from '../store/aws/cloudwatch';
2424
import { describeVpcs, listRegions, describeSubnetsWithType, describeVpcs3AZ, describeVpcSecurityGroups } from '../store/aws/ec2';
2525
import { listRoles } from '../store/aws/iam';
2626
import { listMSKCluster } from '../store/aws/kafka';
@@ -260,32 +260,6 @@ export class EnvironmentServ {
260260
}
261261
}
262262

263-
public async alarmsDisable(req: any, res: any, next: any) {
264-
try {
265-
const {
266-
region,
267-
alarmNames,
268-
} = req.body;
269-
const result = await disableAlarms(region, alarmNames);
270-
return res.json(new ApiSuccess(result));
271-
} catch (error) {
272-
next(error);
273-
}
274-
}
275-
276-
public async alarmsEnable(req: any, res: any, next: any) {
277-
try {
278-
const {
279-
region,
280-
alarmNames,
281-
} = req.body;
282-
const result = await enableAlarms(region, alarmNames);
283-
return res.json(new ApiSuccess(result));
284-
} catch (error) {
285-
next(error);
286-
}
287-
}
288-
289263
public async servicesPing(req: any, res: any, next: any) {
290264
try {
291265
const {

0 commit comments

Comments
 (0)