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(core-p2p): Restrict internal routes to whitelisted IPs #3853

Merged
merged 3 commits into from
Jun 30, 2020

Conversation

bertiespell
Copy link
Contributor

Summary

This PR introduces a plugin to restrict internal p2p route access to whitelisted IPs only. It returns a 403 forbidden response for all other IP addresses.

These changes lead to enhanced security.

A WhitelistForgerPlugin has been added which hooks into Hapi's onPreHandler hook and which utilises the core-kernel Util's isWhitelisted method, to check against all configured remoteAccess IPs. As per #3838

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@codecov
Copy link

codecov bot commented Jun 29, 2020

Codecov Report

❗ No coverage uploaded for pull request base (develop@ed8a0e8). Click here to learn what that means.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #3853   +/-   ##
==========================================
  Coverage           ?   88.72%           
==========================================
  Files              ?      621           
  Lines              ?    14833           
  Branches           ?     1854           
==========================================
  Hits               ?    13160           
  Misses             ?     1405           
  Partials           ?      268           
Flag Coverage Δ
#functional 6.07% <0.00%> (?)
#integration 9.56% <0.00%> (?)
#unit 84.65% <88.88%> (?)
Impacted Files Coverage Δ
...-p2p/src/socket-server/plugins/whitelist-forger.ts 85.71% <85.71%> (ø)
packages/core-p2p/src/peer-processor.ts 91.11% <100.00%> (ø)
packages/core-p2p/src/socket-server/server.ts 100.00% <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 ed8a0e8...899e938. Read the comment docs.

@air1one air1one merged commit 3467289 into develop Jun 30, 2020
@ghost ghost deleted the restrict-internal-routes branch June 30, 2020 14:33
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