Skip to content

[Sensitive Information] US Passport Number#58

Open
v1ktor0t wants to merge 1 commit into
mainfrom
veles-us-passport-number
Open

[Sensitive Information] US Passport Number#58
v1ktor0t wants to merge 1 commit into
mainfrom
veles-us-passport-number

Conversation

@v1ktor0t

@v1ktor0t v1ktor0t commented Jul 3, 2026

Copy link
Copy Markdown
Member

Related to #57

I merged the behavior of both branches. Once this one is reviewed, the other PR/branch can be removed.

Comment thread binary/proto/scan_result.proto Outdated
string key = 2; // OAuth Application Secret (prefix: sq0csp-)
}

message USPassportNumber {

@alessandro-Doyensec alessandro-Doyensec Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to create a proto type for these, since the type is always sensitiveinformation.SensitiveInformation

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oversight from the merge. i'll remove it now

@alessandro-Doyensec

alessandro-Doyensec commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

I think this collides with #57

Yes it does, beside the .proto looks ready to be merged

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the proto changes required?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was a letf-over proto object that was not needed, but compiled in. the new version contains the up-to-date compiled proto objects

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that proto objects are not modified by the PR after all, can't we just leave them as-is?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i had a wrong assumption about this. reverted the file to the version in main,

Comment thread docs/supported_inventory_types.md
FromMatch: func(blob []byte, keywordMatch bool) (sensitiveinformation.SensitiveInformation, bool) {
likelihood := sensitiveinformation.LikelihoodUnlikely
if keywordMatch {
likelihood = sensitiveinformation.LikelihoodVeryLikely

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am willing to bet they'll want to downgrade it to LikelihoodLikely. VeryLikely is rather for stuff we were able to verify checksum, or something similar.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch.


var (
keywordsRe = simpleregex.KeywordsRe([]string{
`\b\w*passport\w*\b`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is \b\w*passport\w*\b different from just passport ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the basic idea is to match passport within a boundary with an arbitrary prefix and/or suffix. for example, that regex will match all of these:

  • passport
  • passport_no
  • us_passport
  • us_passport_num

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. But isn't the same achieved by just using passport?
In other words: can you point out what is filtered out by this construction?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically yes, with the exception that i'd need to remove the boundary (\b). let me see if there's any space for some optimization

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SzymonDrosdzol made some updates. i'd appreciate a look when you get the chance

@SzymonDrosdzol SzymonDrosdzol mentioned this pull request Jul 6, 2026

@alessandro-Doyensec alessandro-Doyensec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Nit: you can rebase the whole PR to completely remove any changes done to the proto files inside commits, that way you don't have merge conflicts

@SzymonDrosdzol SzymonDrosdzol left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@v1ktor0t
v1ktor0t force-pushed the veles-us-passport-number branch from 7bd9574 to 0274912 Compare July 13, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants