Commit 8879733
committed
[ctm360] Avoid empty breached-credential Indicator pattern
In breached_credentials_to_stix, `indicator_value = email or username` is truthy when an email is present but invalid (no "@") and the username is empty. The else-branch then built the user-account pattern/name from the empty username, producing `[user-account:account_login = '']` — an empty, constant pattern that collapses unrelated records onto a single `Indicator.generate_id(pattern)` id and breaks ingestion expectations.
Fall back to `username or email` for the account-login pattern and name (mirroring the UserAccount `account_login` already built above), so the pattern is never empty when an Indicator is created. Add regression tests asserting the non-empty pattern and that distinct invalid emails map to distinct Indicators.1 parent dd55ae0 commit 8879733
2 files changed
Lines changed: 35 additions & 2 deletions
File tree
- external-import/ctm360-cyberblindspot-feed
- src/connector
- tests/test_connector
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
333 | 340 | | |
334 | 341 | | |
335 | | - | |
| 342 | + | |
336 | 343 | | |
337 | | - | |
| 344 | + | |
338 | 345 | | |
339 | 346 | | |
340 | 347 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
446 | 472 | | |
447 | 473 | | |
448 | 474 | | |
| |||
0 commit comments