natureco-cli 4.5.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/doctor.js +24 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "OpenClaw'dan daha güvenli, daha hızlı, daha ucuz AI agent CLI. Multi-agent, self-evolving skills, audit log, maliyet optimizasyonu ve NatureCo platform-native.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"natureco": "bin/natureco.js"
|
package/src/commands/doctor.js
CHANGED
|
@@ -238,16 +238,33 @@ function runCheck(name) {
|
|
|
238
238
|
|
|
239
239
|
case 'secretsClean': {
|
|
240
240
|
try {
|
|
241
|
-
// Mevcut çalışma dizinini tara —
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
// Mevcut çalışma dizinini tara — sadece kritik bulguları rapor et
|
|
242
|
+
// Whitelist: .git, node_modules, .DS_Store, dist, build, *.md (dokümanlar),
|
|
243
|
+
// *.example, *.test, package-lock.json, audit-*.jsonl
|
|
244
|
+
// SKIP_DIRS secret-scanner.js'de zaten var (.git, node_modules, dist, build)
|
|
245
|
+
// Ama .DS_Store, .env.example gibi dosyaları atlamamız gerek
|
|
246
|
+
const findings = secrets.scanDir(process.cwd(), { maxFiles: 500 });
|
|
247
|
+
// False positive azaltma: sadece severity critical VEYA (.env/.key/secret içeren dosyalar)
|
|
248
|
+
const realSecrets = findings.filter(f => {
|
|
249
|
+
// .DS_Store, .md, .txt gibi dokümanları atla
|
|
250
|
+
const fname = (f.file || '').toLowerCase();
|
|
251
|
+
if (fname.endsWith('.md') || fname.endsWith('.txt')) return false;
|
|
252
|
+
if (fname.includes('.ds_store') || fname.includes('package-lock')) return false;
|
|
253
|
+
if (fname.includes('changelog') || fname.includes('readme')) return false;
|
|
254
|
+
// 'high' severity çoğunlukla false positive (40-char hex gibi)
|
|
255
|
+
// Sadece 'critical' VEYA bilinen provider pattern'i kabul et
|
|
256
|
+
if (f.severity === 'critical') return true;
|
|
257
|
+
// .env dosyalarında yüksek severity kabul
|
|
258
|
+
if (fname.includes('.env') && !fname.includes('.example')) return true;
|
|
259
|
+
return false;
|
|
260
|
+
});
|
|
261
|
+
if (realSecrets.length === 0) {
|
|
262
|
+
return { pass: true, message: 'Çalışma dizininde gerçek secret bulunamadı ✓' };
|
|
246
263
|
}
|
|
247
|
-
const sample =
|
|
264
|
+
const sample = realSecrets.slice(0, 3).map(f => `${f.type}@${path.basename(f.file || '?')}`).join(', ');
|
|
248
265
|
return {
|
|
249
266
|
pass: false,
|
|
250
|
-
message: `${
|
|
267
|
+
message: `${realSecrets.length} gerçek secret: ${sample}${realSecrets.length > 3 ? '...' : ''}`,
|
|
251
268
|
};
|
|
252
269
|
} catch (e) {
|
|
253
270
|
return { pass: false, message: e.message };
|