Comments (35)
Thank you so much for your answers! I think discussion can be closed :)
from sentrypeer.
@ghenry I did not try oracle cloud but did re-installing of simple docker version at new linode VPS. Old linode VPS was tested with different ways to install sentrypeer and I thought something could be the reason of my issue.
But... I had not luck.
'Your Linode, SentryPeer1, has exceeded the notification threshold (10) for outbound traffic rate by averaging 19.82 Mb/s for the last 2 hours. '
Wow...
I am pretty sure it's related with OpenDHT and still don't understand how to use p2p in this case.
I don't think I will get different result with oracle cloud.
May be you have some special iptables rules that prevent OpenDHT to use so many traffic ?
Please advice.
from sentrypeer.
Hi @ynasida
If you re-run ./configure
and check this part:
checking for opendht-c... yes
checking we have opendht-c >= 2.3.5... yes
it probably says no
. I should either disable the -p option if OPENDHT_C is not detected or issue an error. What do you think works best as a user?
If you'd like p2p mode, you should use the Docker container or install opendht from source first or via Homebrew.
The message:
'Failed to prepare statement: no such table: honey'
is just because there are no bad_actors yet, so the table hasn't been created in sentrypeer.db
. I should squash that message.
Thanks,
Gavin.
from sentrypeer.
How did you get on @ynasida ?
from sentrypeer.
Hi @ghenry
Thanks a lot for your response!
Yes opendht is not installed it it's the reason. Some error message would be very useful but the best option would be to have good instruction how to compile opendht :) I tried but had not luck.
I am not so familiar with docker but have to use this way because I need p2p mode.
Can you please advice a bit here ? I would like to see work logs of SentryPeer like i see when i start ./sentrypeer -drawps without docker. A log of useful information like:
'SentryPeer node id: 8ae32230-d9d8-4a04-9f83-9bb00f16735f
Starting sentrypeer...
API mode enabled, starting http daemon...
Web GUI mode enabled...
SIP mode enabled...
Peer to Peer DHT mode enabled...
Starting peer to peer DHT mode...
Configuring local address...
Creating socket...
Binding socket to local address...
Listening for incoming connections...'
How can I see same things with docker variant? I already set env variables you mentioned on the page but can see sentrypeer_json.log only (almost nothing)
from sentrypeer.
Thanks for replying. If you're using the Docker hub one and not doing https://github.com/SentryPeer/SentryPeer#docker then you'd need to rebuild the container and just add a -d
to the CMD section in the Dockerfile.
I'd install OpenDHT via Homebrew and rebuilt SentryPeer:
https://brew.sh/
then set your env like in https://docs.brew.sh/Homebrew-on-Linux
What OS are you on? I'm still working on rpms and debs for v1.4.0 as OpenDHT needs to be updated for the C libs.
Thanks.
from sentrypeer.
Sorry, I forget the issue subject says Debian 11 :-D
from sentrypeer.
Thanks again @ghenry !
I added -d to the CMD section in the Dockerfile and did rebuild. Now I see that sentrypeer process (in docker container) is started with -d flag but... I still not sure where I should see logs I need ( like 'Peer to Peer DHT mode enabled', etc )? sentrypeer_json.log has not this. In general I would like to see logs like 'connected to p2p node - ip address, downloading, etc'
The main goal is - p2p mode and I still can not be sure if it is enabled and working.
Btw, can you please advice how many p2p members SentryPeer currently have ?
I also tried to install OpenDHT via Homebrew.
useradd ynasida
usermod -a -G sudo ynasida
su ynasida
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/ynasida/.linuxbrew/bin/brew shellenv)"' >> /home/ynasida/.profile
eval "$(/home/ynasida/.linuxbrew/bin/brew shellenv)"
cd /home/ynasida
brew install opendht
It download many things and get stuck here (please look at picture).
from sentrypeer.
Hmm, that is strange for Homebrew.
For your container, check out this post - https://stackoverflow.com/a/41147654/1072411
from sentrypeer.
Thanks for good advice about container's logs!
I did like you said and also disabled SIP mode to see p2p logs only.
Please look at logs below. I wait several minutes but do not see p2p connections so far. Should I do something else ?
root@sentrypeer:/usr/src/SentryPeer-git# tail -f docker inspect --format='{{.LogPath}}' 65cf0a45b63e
{"log":"Starting sentrypeer...\n","stream":"stderr","time":"2022-04-27T14:12:28.660215746Z"}
{"log":"API mode enabled, starting http daemon...\n","stream":"stderr","time":"2022-04-27T14:12:28.660220296Z"}
{"log":"Web GUI mode enabled...\n","stream":"stderr","time":"2022-04-27T14:12:28.660224646Z"}
{"log":"Peer to Peer DHT mode enabled...\n","stream":"stderr","time":"2022-04-27T14:12:28.660228806Z"}
{"log":"Starting peer to peer DHT mode...\n","stream":"stderr","time":"2022-04-27T14:12:28.660233226Z"}
{"log":"Peer to peer DHT mode started.\n","stream":"stderr","time":"2022-04-27T14:12:28.672485113Z"}
{"log":"DHT InfoHash for key 'bad_actors' is: 14d30143330e2e0e922ed4028a60ff96a59800ad\n","stream":"stderr","time":"2022-04-27T14:12:28.672515183Z"}
{"log":"Bootstrapping the DHT\n","stream":"stderr","time":"2022-04-27T14:12:28.672520393Z"}
{"log":"Waiting 5 seconds for bootstrapping to bootstrap.sentrypeer.org...\n","stream":"stderr","time":"2022-04-27T14:12:28.672524743Z"}
{"log":"Listening for changes to the bad_actors DHT key\n","stream":"stderr","time":"2022-04-27T14:12:33.672280064Z"}
{"log":"GET /ip-addresses from Client IP: My_IP\n","stream":"stderr","time":"2022-04-27T14:18:10.594584098Z"}
{"log":"Checking url: /ip-addresses, against route: /health-check\n","stream":"stderr","time":"2022-04-27T14:18:10.594706519Z"}
{"log":"Checking url: /ip-addresses, against route: /\n","stream":"stderr","time":"2022-04-27T14:18:10.594715699Z"}
{"log":"Checking url: /ip-addresses, against route: /ip-addresses\n","stream":"stderr","time":"2022-04-27T14:18:10.594721759Z"}
{"log":"Route is an exact match.\n","stream":"stderr","time":"2022-04-27T14:18:10.594727529Z"}
{"log":"Failed to prepare statement: no such table: honey\n","stream":"stderr","time":"2022-04-27T14:18:10.598949438Z"}
{"log":"Failed to select bad actors from database\n","stream":"stderr","time":"2022-04-27T14:18:10.599016448Z"}
May be some iptables settings ?
I have these:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8082 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp --dport 8082 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp --dport 4222 -j ACCEPT
from sentrypeer.
Hi @ynasida
If any other SentryPeer nodes are online, enabled with p2p mode and connected bootstrap.sentrypeer.org or other nodes, then when they get a probe, you will get their bad_actor.
p2p mode is best effort replication, i.e. you get bad_actors from other peers if they are online and you are too. No catch up like blockchain etc. The data would be too stale otherwise.
In the unreleased version of SentryPeer (main branch) is the new -b
flag, where you can run your own bootstrap node.
Does this all make sense and read OK?
Thanks,
Gavin.
from sentrypeer.
We do store bad actors permanently on the DHT, so we could get them on start up. I've just done it so we listen on that key and get other nodes data when they PUT it. So we could catch up somewhat, to build an historic database.
from sentrypeer.
Thanks, @ghenry !
I think I understood but still have two questions.
'If any other SentryPeer nodes are online, enabled with p2p mode and connected bootstrap.sentrypeer.org or other nodes, then when they get a probe, you will get their bad_actor.'
I see that node I have is connected to bootstrap.sentrypeer.org. Thus I should get bad_actor from others nodes when they get a probe. But I do not see any activity during the night. Does it means that there is not nodes online that wants to share ?
'In the unreleased version of SentryPeer (main branch) is the new -b flag, where you can run your own bootstrap node.'
I probably can set like -b bootstrap.mydomain.com. But I am not sure how should I configure bootstrap.mydomain.com node itself. That should be just one more SentryPeer node ? What flags I should use at bootstrap instance ? Without -b my own bootstrap node will be connected to bootstrap.sentrypeer.org.
Please advice.
from sentrypeer.
Thanks, @ghenry ! I think I understood but still have two questions.
My pleasure.
'If any other SentryPeer nodes are online, enabled with p2p mode and connected bootstrap.sentrypeer.org or other nodes, then when they get a probe, you will get their bad_actor.'
I see that node I have is connected to bootstrap.sentrypeer.org. Thus I should get bad_actor from others nodes when they get a probe. But I do not see any activity during the night. Does it means that there is not nodes online that wants to share ?
Yeah, maybe no one online. This is a new project. My node is usually on sharing things, but it's down just now as I'm working on TCP mode. I'm speaking at various places to get others online like https://chat.uknof.org.uk/public/channels/uknof49ops and Comms Council (this Friday)
'In the unreleased version of SentryPeer (main branch) is the new -b flag, where you can run your own bootstrap node.' I probably can set like -b bootstrap.mydomain.com. But I am not sure how should I configure bootstrap.mydomain.com node itself. That should be just one more SentryPeer node ? What flags I should use at bootstrap instance ? Without -b my own bootstrap node will be connected to bootstrap.sentrypeer.org.
Just apt-get install dhtnode
then run it as dhtnode -p 4222
. I'm running the vanilla node from OpenDHT on bootstrap.sentrypeer.org:
https://github.com/savoirfairelinux/opendht/wiki/Running-a-node-with-dhtnode
Please advice.
from sentrypeer.
Trying running two nodes on different IP addresses and then using sipsak against one. You should see the replication on the other node.
from sentrypeer.
Going to close for now. Get back in touch with any other questions @ynasida
Thanks!
from sentrypeer.
Thanks @ghenry !
Seems like I got extra questions.
I have sentrypeer installed (docker version) at Linode and got Linode Alert - Outbound Transfer Quota.
It has used 3265GB of 4000GB. Wow... 3265GB.
I see that sentrypeer process does something (htop) but not sure that exactly.
tail -f docker inspect --format='{{.LogPath}}' 5a09f5a1a858
but almost nothing in logs. Just some new fraud attempts that sentrypeer noted and saved. Really few of them.
sngrep also shows few attempts only.
I checked by iftop and see a lot of weird traffic. Please look at some screens and advice.
The traffic gradually disappeared when I stopped the container and docker.
from sentrypeer.
It will be all the peer to peer traffic. As we're listening on port 4222, you start to become part of the main OpenDHT (https://jami.net) DHT - which you can see in your iftop.
from sentrypeer.
I see but... 3265GB.. I expected I would send and receive fraud ip addresses and numbers. I have 200+ ip addresses and about 1000+ numbers in the database. Is it possible to use opendht for traffic we need only ?
from sentrypeer.
Yeah, good point!
I'll ask the team, but I don't think so. You're part of a public DHT and that means all bad_actors will get distributed and HA/DR is fantastic for that.
Running it on your own private VLAN and with your own bootstrap node firewalled off would probably be the best way to limit that.
Thanks.
from sentrypeer.
Was discussing this here too savoirfairelinux/opendht#589
from sentrypeer.
Hello, @ghenry
Thanks again for you answers!
'Running it on your own private VLAN and with your own bootstrap node firewalled off would probably be the best way to limit that.'
But I think p2p will work between my opendht nodes only ?
I have read discussion you mentioned but looks like they have not problem I mentioned. 3265GB..
from sentrypeer.
Are you sure that figure is right? I'm running our public bootstrap node on the free Oracle Cloud tier.
from sentrypeer.
@ghenry I got alert from Linode and it is the only software installed. You think I should try re-install at oracle cloud ?
from sentrypeer.
from sentrypeer.
I'll get some udp nftables or iptables examples to you and maybe see if I can bake it into the Docker container.
from sentrypeer.
In your logs, do you see anything like this:
from sentrypeer.
from sentrypeer.
from sentrypeer.
I see. Can we fix ? Or we should wait till opendth will fix ?
from sentrypeer.
from sentrypeer.
Hello, @ghenry, do we have any news ?
from sentrypeer.
Looking at new designs...:
savoirfairelinux/opendht#599 (comment)
d4b2a66#commitcomment-75714036
Thanks.
from sentrypeer.
Hello @ghenry ,
Just would like to ask if it is possible to use sentrypeer with p2p currently.
Thanks
from sentrypeer.
from sentrypeer.
Related Issues (18)
- Call for maintainers HOT 1
- Terraform recipes to launch SentryPeer on different cloud providers - can you help? HOT 1
- Enhancement: HEPSub API client
- Fix code scanning alert - Administration services access should be restricted to specific IP addresses
- Enhancement: JSON log output for Deutsche Telekom Security T-Pot project HOT 1
- Enhancement: Improve RESTful API numbers resource checks
- Bug: /numbers resource doesn't return JSON if non-numbers have made their way into db
- Record dest_ip and being bound to multiple IPs HOT 8
- Remove Zyre from project as not needed for our use case
- Bug: Issue in documentation - Incorrect port used in docker URL
- Bug: /numbers doesn't return numbers beginning with 0
- Enhancement: Expired events should get deleted HOT 1
- Enhancement: Filter by our node for trust
- openwrt HOT 6
- Fail2ban Integration via syslog HOT 27
- Fix code scanning alert - Weak SSL/TLS protocols should not be used HOT 1
- Enhancement: support for Arch Linux HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentrypeer.