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: pass ip version to blocklist check to ensure ipv6 accepted #34

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

Jafferwaffer
Copy link
Contributor

Issue: https://brandwatch.atlassian.net/browse/AS-454

> const blockList = new net.BlockList();
> blockList.addSubnet('10.0.0.0', 8);
> blockList.check('::ffff:10.220.73.9')
false
> blockList.check('::ffff:10.220.73.9', 'ipv6')
true
> blockList.check('::ffff:10.220.73.9', 'ipv4')
false
> net.isIPv6('::ffff:10.220.73.9');
true
> net.isIPv4('::ffff:10.220.73.9');
false

@Jafferwaffer
Copy link
Contributor Author

Jafferwaffer commented Aug 1, 2024

IPs from kubelet (which does healthz checks) are ipv6 in the stage apps cluster & likely the other clusters too.

For example...

│ auth-oidc-provider Blocking request from ::ffff:10.220.73.9                                                                                                                                                                                                                                      │
│ auth-oidc-provider Blocking request from ::ffff:10.220.61.107                                                                                                                                                                                                                                    │
│ auth-oidc-provider Blocking request from ::ffff:10.220.61.107                                                                                                                                                                                                                                    │
│ auth-oidc-provider Blocking request from ::ffff:10.220.61.107                                                                                                                                                                                                                                    │
│ auth-oidc-provider Blocking request from ::ffff:10.220.61.107

@Jafferwaffer
Copy link
Contributor Author

Copy link

@SeaOfTea SeaOfTea left a comment

Choose a reason for hiding this comment

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

:eliot:

src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
@Jafferwaffer Jafferwaffer force-pushed the AS-454-ip-version-check branch from 33a27bf to ada0950 Compare August 1, 2024 13:16
@Jafferwaffer Jafferwaffer merged commit 94eb9e8 into master Aug 1, 2024
2 checks passed
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.

2 participants