Skip to content

Commit 8aaaf1d

Browse files
authored
fix: byocdn-imperva shows correct config (#1529)
Please ensure your pull request adheres to the following guidelines: - [ ] make sure to link the related issues in this description - [ ] when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes ## Related Issues Thanks for contributing!
1 parent 78df8f9 commit 8aaaf1d

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

packages/spacecat-shared-utils/src/cdn-helpers.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,12 @@ const CDN_TRANSFORMATIONS = {
189189
'byocdn-imperva': (payload) => ({
190190
'Log integration mode': 'Push mode',
191191
'Delivery method': 'Amazon S3 ARN',
192-
'Bucket Name': payload.bucketName,
193192
Region: payload.region,
194-
Path: payload.allowedPaths?.[0] || '',
193+
Path: `${payload.bucketName}/${payload.allowedPaths?.[0] || ''}`.replace(/\/$/, ''),
195194
'Log types': 'Cloud WAF',
196195
'Log level': 'Access logs',
197196
Format: 'W3C',
198-
'Compress logs': 'Yes',
197+
'Compress logs': 'No',
199198
HelpUrl: 'https://docs-cybersec.thalesgroup.com/bundle/cloud-application-security/page/siem-log-configuration.htm',
200199
}),
201200
'byocdn-other': (payload) => ({

packages/spacecat-shared-utils/test/cdn-helpers.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,20 @@ describe('CDN Helper Functions', () => {
293293
it('should handle byocdn-imperva', () => {
294294
const impervaPayload = {
295295
...mockPayload,
296+
bucketName: 'cdn-logs-abc123xyz',
296297
logSource: 'byocdn-imperva',
297-
allowedPaths: ['9E1005A551ED61CA0A490D45@AdobeOrg/raw/byocdn-imperva/'],
298+
allowedPaths: ['ABC123XYZAdobeOrg_raw_byocdn-imperva'],
298299
};
299300
const result = prettifyLogForwardingConfig(impervaPayload);
300301
expect(result).to.deep.equal({
301302
'Log integration mode': 'Push mode',
302303
'Delivery method': 'Amazon S3 ARN',
303-
'Bucket Name': 'cdn-logs-adobe-dev',
304304
Region: 'us-east-1',
305-
Path: '9E1005A551ED61CA0A490D45@AdobeOrg/raw/byocdn-imperva/',
305+
Path: 'cdn-logs-abc123xyz/ABC123XYZAdobeOrg_raw_byocdn-imperva',
306306
'Log types': 'Cloud WAF',
307307
'Log level': 'Access logs',
308308
Format: 'W3C',
309-
'Compress logs': 'Yes',
309+
'Compress logs': 'No',
310310
HelpUrl: 'https://docs-cybersec.thalesgroup.com/bundle/cloud-application-security/page/siem-log-configuration.htm',
311311
});
312312
});

0 commit comments

Comments
 (0)