File tree Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change 1
- import { Agent } from 'undici ' ;
1
+ import { Agent } from 'https ' ;
2
2
import {
3
3
HookEventType ,
4
4
PluginContext ,
@@ -83,11 +83,12 @@ export const handler: PluginHandler<{
83
83
84
84
let agent : Agent | null = null ;
85
85
// privatelink doesn't contain a valid certificate, skipping verification if it's customHost.
86
+ // SECURITY NOTE: The following disables SSL certificate validation for custom hosts.
87
+ // This is necessary for Azure Private Link endpoints that may use self-signed certificates,
88
+ // but should only be used with trusted private endpoints.
86
89
if ( credentials . customHost ) {
87
90
agent = new Agent ( {
88
- connect : {
89
- rejectUnauthorized : false ,
90
- } ,
91
+ rejectUnauthorized : false ,
91
92
} ) ;
92
93
}
93
94
@@ -111,12 +112,7 @@ export const handler: PluginHandler<{
111
112
const timeout = parameters . timeout || 5000 ;
112
113
let response ;
113
114
try {
114
- response = await post (
115
- url ,
116
- request ,
117
- { headers, dispatcher : agent } ,
118
- timeout
119
- ) ;
115
+ response = await post ( url , request , { headers } , timeout ) ;
120
116
} catch ( e ) {
121
117
return { error : e , verdict : true , data } ;
122
118
}
Original file line number Diff line number Diff line change 1
- import { Agent } from 'undici ' ;
1
+ import { Agent } from 'https ' ;
2
2
import {
3
3
HookEventType ,
4
4
PluginContext ,
@@ -56,19 +56,20 @@ const redact = async (
56
56
57
57
let agent : Agent | null = null ;
58
58
// privatelink doesn't contain a valid certificate, skipping verification if it's customHost.
59
+ // SECURITY NOTE: The following disables SSL certificate validation for custom hosts.
60
+ // This is necessary for Azure Private Link endpoints that may use self-signed certificates,
61
+ // but should only be used with trusted private endpoints.
59
62
if ( credentials ?. customHost ) {
60
63
agent = new Agent ( {
61
- connect : {
62
- rejectUnauthorized : false ,
63
- } ,
64
+ rejectUnauthorized : false ,
64
65
} ) ;
65
66
}
66
67
67
68
const timeout = parameters . timeout || 5000 ;
68
69
const response = await post (
69
70
url ,
70
71
body ,
71
- { headers, dispatcher : agent } ,
72
+ { headers, dispatcher : undefined } ,
72
73
timeout
73
74
) ;
74
75
return response ;
You can’t perform that action at this time.
0 commit comments