@@ -575,6 +575,43 @@ func TestSecretScanner(t *testing.T) {
575
575
},
576
576
},
577
577
}
578
+ wantFindingMinimumAsymmSecretKey := types.SecretFinding {
579
+ RuleID : "private-key" ,
580
+ Category : secret .CategoryAsymmetricPrivateKey ,
581
+ Title : "Asymmetric Private Key" ,
582
+ Severity : "HIGH" ,
583
+ StartLine : 6 ,
584
+ EndLine : 6 ,
585
+ Match : "-----BEGIN PRIVATE KEY-----********************************-----END PRIVATE KEY-----" ,
586
+ Code : types.Code {
587
+ Lines : []types.Line {
588
+ {
589
+ Number : 4 ,
590
+ Content : "" ,
591
+ Highlighted : "" ,
592
+ IsCause : false ,
593
+ FirstCause : false ,
594
+ LastCause : false ,
595
+ },
596
+ {
597
+ Number : 5 ,
598
+ Content : "## Theoretically Asymmetric Private Key of minimum length (RSA 128 bits)" ,
599
+ Highlighted : "## Theoretically Asymmetric Private Key of minimum length (RSA 128 bits)" ,
600
+ IsCause : false ,
601
+ FirstCause : false ,
602
+ LastCause : false ,
603
+ },
604
+ {
605
+ Number : 6 ,
606
+ Content : "-----BEGIN PRIVATE KEY-----********************************-----END PRIVATE KEY-----" ,
607
+ Highlighted : "-----BEGIN PRIVATE KEY-----********************************-----END PRIVATE KEY-----" ,
608
+ IsCause : true ,
609
+ FirstCause : true ,
610
+ LastCause : true ,
611
+ },
612
+ },
613
+ },
614
+ }
578
615
wantFindingAlibabaAccessKeyId := types.SecretFinding {
579
616
RuleID : "alibaba-access-key-id" ,
580
617
Category : secret .CategoryAlibaba ,
@@ -1300,7 +1337,7 @@ func TestSecretScanner(t *testing.T) {
1300
1337
inputFilePath : "testdata/asymmetric-private-key.txt" ,
1301
1338
want : types.Secret {
1302
1339
FilePath : "testdata/asymmetric-private-key.txt" ,
1303
- Findings : []types.SecretFinding {wantFindingAsymmSecretKey },
1340
+ Findings : []types.SecretFinding {wantFindingMinimumAsymmSecretKey , wantFindingAsymmSecretKey },
1304
1341
},
1305
1342
},
1306
1343
{
0 commit comments