Commit 7989b61
authored
Redact credentials from Git URLs in logs (#184)
* Redact git credentials from logs
Git URLs with authentication tokens were leaking in logs during
clone operations. Added GitLogger wrapper to automatically sanitize
credentials from all log output.
* Use URL parsing instead of regex
* Fix credential redaction in embedded URLs
The regex-based approach now correctly handles URLs embedded in error
messages. Simplified sanitizeGitData() to use general recursion for
all fields instead of field-specific logic.
* Use URL parsing instead of regex
Replaces regex pattern with simple string scanning to eliminate
ReDoS vulnerability while maintaining credential redaction.
* Fix formatting
* Improve credential redaction completeness
URL boundary detection now stops at structural delimiters
(quotes, brackets) to handle JSON/XML formats correctly.
GitLogger now sanitizes Error objects to prevent credential
leaks when error messages contain repository URLs.
Replace 'any' with Record<string, unknown> for type safety.1 parent 2011e85 commit 7989b61
File tree
17 files changed
+528
-257
lines changed- .changeset
- .github/workflows
- packages
- sandbox-container/src
- core
- services
- sandbox
- src
- clients
- tests
- tests/integration/src
17 files changed
+528
-257
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
| |||
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
| 99 | + | |
93 | 100 | | |
94 | 101 | | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| 105 | + | |
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
| |||
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
| 115 | + | |
107 | 116 | | |
108 | 117 | | |
109 | 118 | | |
| |||
119 | 128 | | |
120 | 129 | | |
121 | 130 | | |
| 131 | + | |
122 | 132 | | |
123 | 133 | | |
124 | 134 | | |
| |||
135 | 145 | | |
136 | 146 | | |
137 | 147 | | |
| 148 | + | |
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
143 | 154 | | |
| 155 | + | |
144 | 156 | | |
145 | 157 | | |
146 | 158 | | |
| |||
150 | 162 | | |
151 | 163 | | |
152 | 164 | | |
| 165 | + | |
153 | 166 | | |
154 | 167 | | |
155 | 168 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| |||
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
111 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| |||
117 | 124 | | |
118 | 125 | | |
119 | 126 | | |
120 | | - | |
| 127 | + | |
121 | 128 | | |
122 | 129 | | |
123 | 130 | | |
| |||
0 commit comments