Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Amazon EC2 ID getting matched a lot #229

Merged
merged 3 commits into from Nov 7, 2021
Merged

fix: Amazon EC2 ID getting matched a lot #229

merged 3 commits into from Nov 7, 2021

Conversation

amadejpapez
Copy link
Collaborator

⚠ Pull Requests not made with this template will be automatically closed 🔥

Prerequisites

Why do we need this pull request?

The EC2 regex was getting matched to almost everything that had hyphen in-between. Even bee-san was EC2 ID. :)

I have made it more specific. According to Amazon they all start with i-. Until 2016 there were 8 characters after the hyphen and since 2016 there are 17 characters.
Source: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html

I also think characters are a-f but I am not 100% sure about it.

What GitHub issues does this fix?

Copy / paste of output

Please copy and paste the output of PyWhat with your new addition using an example that tests this addition below:

$ poetry run pywhat i-1234567890abcdef0

Matched on: -1234567890
Name: Phone Number

Matched on: 123456789
Name: American Social Security Number
Description: An American Identification Number

Matched on: i-12345678
Name: Amazon Web Services EC2 Instance ID

@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2021

Codecov Report

Merging #229 (9ae9fcb) into main (5b29165) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #229   +/-   ##
=======================================
  Coverage   92.60%   92.60%           
=======================================
  Files          15       15           
  Lines        1217     1217           
=======================================
  Hits         1127     1127           
  Misses         90       90           
Impacted Files Coverage Δ
pywhat/what.py 81.72% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b29165...9ae9fcb. Read the comment docs.

@bee-san
Copy link
Owner

bee-san commented Nov 7, 2021

Matched on: -1234567890
Name: Phone Number

false positive ⏰

@bee-san bee-san merged commit 071a962 into main Nov 7, 2021
@bee-san bee-san deleted the fix-ec2 branch November 7, 2021 10:46
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.

Amazon Web Services EC2 Instance identifier matches incorrectly
3 participants