/srv/irclogs.ubuntu.com/2018/02/14/#ubuntu-server.txt

mbffHello! Ubuntu seems to be preventing port forwarded traffic (I've tried Nginx and a python web server). Clients on the lan get a response. I've tried disabling UFW and I am seeing logs in tcp dump so the traffic seems to be getting to server.03:25
mbffOne note would be that the port forwarded traffic isn't "internet" traffic but local traffic from the router "above" my router.03:26
masonmbff: iptables -n --list03:26
masonmbff: Also worth mentioning if this box is sitting on a LAN, is a gateway, is otherwise doing something interesting.03:27
mbffhttps://gist.github.com/marshallford/fb968423928a945dcb2a452f130ddd1603:28
masonSo, yeah, that's a bunch of rules with a default policy of "drop".03:29
mbffthe ubuntu server running the web server is on a LAN inside a LAN. The inner network is 10.0.X, the outer 192.168.X. I am trying to hit the webserver from the 192.168.X ip, one NAT "up"03:29
mbffmason, I can disable ufw to help narrow down things03:30
masonmbff: I'm not immediately clear on what all the docker rules are accomplishing, but in general, clear your iptables rules out and slowly build up.03:30
masonIf you're using random tools to build firewalls for you, make sure you understand how to tell them what you want.03:31
mbffI do know how to tell ufw what I want. I am very explict in my setup script/automation03:32
mbffthe docker rules are added by, well docker03:32
mbffwith ufw disabled: https://gist.github.com/marshallford/872911698f1eba780d47df57087dc63503:32
masonThat's not a cleared out list of iptables. :P03:33
mbffright...03:33
masonThat said, maybe reassert all the rules, like what you'd get freshly booting, and look at hit counts. But since something is setting you up as default-drop, it might not be explicit rules knocking down packets.03:33
masonSo, iptables -n -v --list03:34
masonor -L - not sure why I default to the long argument for list. =cough=03:34
masonBeing a dinosaur, I build explicit rules and invoke them from /etc/network/interfaces, and it ends up never being mysterious, which I see as a win.03:35
mbff"Being a dinosaur" :)03:36
mbffiptables with verbose flag: https://gist.github.com/marshallford/e9edd9699f7869aaaaea6ea8f94135f403:37
mbffhow would I check hit counts?03:38
masonmbff: Anyway, here's what I'd do. Maybe someone will have a better idea. Reboot, get all your rules up as normal, and see some traffic knocked down. Then pick one of iptables -v -n -L to see what rules are hitting. If none, change your default policy to ACCEPT with iptables -P and see if that lets traffic in. If it does, you'll have to craft rules to explicitly accept the stuff that's otherwise being03:38
masondropped.03:38
masonSorry, you get the hit counts from the -v03:41
mbffmkay03:42
mbffmason, this ufw-not-local chain seems suspicious03:46
masonmbff: Yeah, it has a couple hits.03:46
masonYou want to generate the traffic that's being blocked and see if the hit count rises.03:47
mbffshould I look up the pkts or bytes number?03:48
mbffADDRTYPE match dst-type BROADCAST seems to be going up03:49
masonmbff: I'd think packets, because bytecount will vary based on how big the packets are.03:53
mbffMy guess is one of the ufw auto generated rules is blocking requests from IPS that are class A,B,C that aren't the in the range of it's own ip class.03:53
masonmbff: Generate that traffic and watch the packet counts. No need to guess! :)03:53
mbffCan I get iptables to show me the change in traffic packets between rules? I have no idea which rule it is03:54
mbffLike can iptables narrow down output based on change03:54
masonmbff: save a series of outputs, and use diff to see what changed03:57
masonYou can turn on logging to see hits logged, but that's too much work for this.03:58
mbffthe diff is helping, but still a lot has changed04:01
mbffWould target RETURN cause the issue I am having?04:02
masonmbff: https://unix.stackexchange.com/questions/191607/iptables-and-return-target#19161404:06
masonso it's not a target as such04:06
masonmbff: But if nothing explicitly accepts the traffic, your default DROP will get it.04:06
mbffAfter looking at the diff, I don't see anything that stands out.04:08
mbffHow can I completly reset iptables, back to the system default before ufw was installed04:09
masonmbff: I'd reboot and get whatever comes up on boot, and try your blocked traffic after manually changing the policies to ACCEPT.04:11
masonThat'll tell you if it's the default getting you.04:12
qman__mbff: you can clear chains with iptables -F (must do nat and mangle separately, iptables -t nat -F, ...)04:13
qman__and you can remove chains with iptables -X04:13
masonqman__: He needs to be careful with this, because flushing tables with a default DROP will lock him out if he's not on the console.04:13
qman__yep, was about to mention setting policy04:13
qman__iptables -P OUTPUT ACCEPT; iptables -P INPUT ACCEPT04:14
mbffhere is the thing, this worked traffic worked earlier today on a base install of ubuntu server that was up to date.04:14
mbffSo something in my ansible scripts (including ufw scripts) caused this, most likely04:15
masonmbff: A base install doesn't have a default DROP does it? Then again, I don't run ufw.04:15
mbffufw isn't in the base install04:15
qman__no, the base install has no rules and ACCEPT policies04:16
mbffso mostly likely ufw has some default rules it doesn't tell you about that are screwing me over04:17
mbffcan I safetly run iptables -X ? I'm worried about docker rules coming back properly, since I didn04:18
mbffdidn't write those04:18
masonmbff: Well. If you don't see a specific rule going up as that traffic is dropped, you'll want to add rules to explicitly allow the profile of whatever traffic you need to come in.04:18
masonmbff: That stuff will come back on boot if it's set up properly.04:18
mbffI do though, my script runs ufw allow 8004:19
masonReboot and see the world from that perspective, and see if changing policy temporarily fixes you.04:19
masonIf it does, do whatever ufw requires to allow the specific traffic you want.04:19
mbffi have done that, `ufw allow 80`04:19
qman__no, if you're running docker, it's not safe to flush iptables out or delete chains04:20
qman__docker does its own mangling of iptables04:20
masonA blanket allow like that might be too wide.04:20
mbffI'm not really using it atm, I don't care about docker short term04:20
mbffusing docker*04:20
qman__if you don't care about breaking running apps, then yes, you can flush everything out; set policies to accept first, then flush, then delete chains04:21
mbffStill not working, my iptables look like https://gist.github.com/marshallford/a00d38d0ad02eabe0cc074974538d4d604:26
mbffI'm wondering if this isn't a firewall issue04:26
qman__that is effectively no firewall, so I'd say so04:26
masonmbff: If it's not working with that, then it might not be a firewall issue. Look at your routing tables next...04:26
masonnetstat -rn04:27
masonmake sure you have a way to reply I guess?04:27
masonmaybe use wireshark/tshark and make sure what's hitting your server is sane04:27
qman__yeap04:27
qman__also check your nat table04:27
masonmaybe use wireshark on the other end of the connection and verify both ends at once04:27
qman__iptables -nvL -t nat04:27
qman__it shouldn't have anything in it, but if it does, it could break things04:28
mbffwep I am overwhelmed by advice, not a bad thing I guess haha04:28
masonmbff: Just save it all for later reference. :)04:29
mbffI figured it out!04:31
masonWhat was it?04:32
masonAnd congrats. :)04:32
mbffWhen openvpn is running, it doesn't work04:32
mbffwhen I run service openvpn stop && service nginx restart, It works04:32
masonmbff: Ah. I bet if you dig further you'll see routing tables telling you what was wrong.04:32
mbffthe question is now how I get it to work when openvpn is running04:32
masonLike, you were taking your replies and trying to throw them back over the VPN.04:32
mbffyep04:33
sarnoldtry ip route get 8.8.8.8   or something similar04:33
masonmbff: Well. Check your routing tables, and if you can, add specific routes to do the right thing and tie the traffic that shouldn't go over OpenVPN to a real interface.04:33
mbffmason, I understand those words...04:33
mbffI have not done any route work before04:34
sarnoldoh you are in for a treat^Wfrustrating evening! :)04:34
mbfflol04:34
mbffThat's the reason I have this homelab04:34
masonmbff: netstat -rn or whatever the mystical new ip equivalent is to start04:34
mbffto learn04:34
sarnoldseriously though, 'ip route get' is amazing stuff.04:34
masonmbff: In essence, what you're going to find is that your OpenVPN wants to grab traffic that matches the stuff coming in from your nat.04:35
masonIs there an 'ip route discard' to go with it?04:35
sarnoldhaha :D04:36
masonmbff: So, as an example here, I have a VPN that's greedy and wants to grab a big range, so I shove in a more-specific rule in front of that to save local traffic from being gobbled up.04:36
masonThis way, my local traffic doesn't get sucked into a black hole, but I don't have to deal with a conflict with the VPN either.04:36
masonIf there were systems on the other side of the VPN that used my local range I'd be stuck, but there aren't, so it works. You might end up wanting to do something similar.04:37
masonAnd if it's confusing, I apologize. Just be glad you're dealing with static routes. :)04:37
mbffI don't even know how to filter my problem04:37
mbffout04:37
mbffthis guy has my same problem https://ubuntuforums.org/showthread.php?t=229661804:40
masonmbff: FWIW, use sarnold's ip route get foo syntax to be compliant with the modern world, but try netstat -rn for more human-parseable view of what's going on.04:40
sarnoldmbff: be careful with forum posts .. it's too easy to find similar symptoms and get dragged off into the weeds chasing someone else's advice ..04:41
qman__mbff: openvpn client? if so, make sure your openvpn config is not adding a default route over the VPN - this is most likely the issue04:42
sarnoldmbff: in this case it might actually be perfect :) has your openvpn been configured to send *all* traffic on the machine through the pipe? that might be ideal if you're trying to get out from the great wall of china or something but rough if you just want a few systems linked together..04:42
mbffI'm looking at it, I just don't understand how to parse it, I don't fully understand the terms and how they related to form the "story" X traffic goes to Y if Z" for example04:42
mbffsarnold, the vpn is not for connecting sites, strictly for ip masking, privacy, etc04:43
sarnoldthis might not be easy to fix04:44
qman__it may not be fixable, they're essentially incompatible configurations04:44
qman__it's possible in theory to convince the kernel to return the incoming traffic locally instead of following the default route, but it depends on the VPN's implementation04:45
mbffthis guy solved the problem with a change the openvpn config https://serverfault.com/questions/614281/openvpn-client-breaks-remote-access-to-web-server04:46
sarnoldhe probably did not want to use openvpn for ip masking and privacy in the same way that you do.04:49
* mbff shrugs04:51
qman__that might actually be the config you're looking for, it effectively sets routes for all outbound traffic over the VPN without disrupting the default route and without using the redirect-gateway feature04:51
qman__you'll have to test it though04:52
mbffwhat does 128.0.0.0 mean? It seems arbitrary?04:53
qman__it is arbitrary04:53
qman__normally, a default route is set for 0.0.0.0/004:53
qman__this configuration is setting routes for 0.0.0.0/1 and 128.0.0.0/104:53
qman__they're narrower, scopes, splitting all address space in half04:53
sarnoldhah I'd argue that is very much NOT arbitrary :)04:54
qman__because they're narrower, they're preferred over the default route04:54
sarnoldI mean you could achieve similar things with dozens of other configs .. but this is the simplest04:54
mbffso how would I figure out what routes/numbers I need?04:54
qman__those are the exact routes you'd need04:55
qman__it doesn't change04:55
mbffie: why not 122.0.0.0/104:55
sarnoldbecause that's not a well-formed CIDR input04:55
qman__because 0.0.0.0/1 covers from 0.0.0.0 to 127.255.255.255, while 128.0.0.0/1 covers 128.0.0.0-255.255.255.25504:55
sarnold(seriously, some tools have such a panic with that, security problems and all..)04:55
mbffI worried I'm exposing my real ip to sites that start with 128.X04:56
sarnoldit'd be 128.x-255.255.255.254...04:56
qman__those two routes cover the entirety of the ipv4 address space04:56
mbfflike I said, I'm new to some of this networking stuff outside the typically lan world04:56
qman__so, provided it works at all, it will work for all destination IPs04:56
mbffI'll trust yall... :)04:57
sarnoldif it matters, it'd be worth *testing* this on non-hostile services first..04:57
qman__yes04:57
qman__change the config, reconnect, and test with an IP checking service, like ipof.me04:58
mbffcurl ifconfig.co gives me my real ip, but openvpn is running and the port forwarded traffic is getting though04:59
lordievaderGood morning07:12
jamespagecoreycb: ok where I got to was we should patch msgpack -> msgpack-python11:14
jamespagekeystone and oslo.* done11:15
jamespagecoreycb: keystone done; moving onto barbican for rc111:41
jamespageand congress and designate-*11:45
jamespageand then heat11:50
jamespagecoreycb: I've moved branch builds over to stable/queens as well12:24
jamespagenot sure all projects have cut those yet but its easier to mass move and then deal with excpetions12:24
jamespagecoreycb: oging to horizon next12:30
coreycbjamespage: great, thanks12:57
coreycbjamespage: ok going to start on what's left. i'll work backward from z*.13:34
jamespagecoreycb: okies14:51
jamespagecoreycb: did you have a barbicanclient update in the works?15:11
joophello15:11
coreycbjamespage: nope, that must be new15:12
jamespagecoreycb: yeah heat needs it15:12
joopi would like to ask you some couple of question setting up a ubuntu server15:12
jamespagecoreycb: lemme sort that out15:12
joopi need to run a php web app15:12
joopi installed apache215:12
joopbut it doest not show only a blank page,afterall i installed xampp,which use apache15:13
joopso they have conflict with apache215:13
joopbut main question is,i tried to intall webmin15:13
joopbut the requested jcameron-key.asc file is not found anymore15:14
coreycbjamespage: oh i see, it's not in the upstream report for some reason. i'll figure out why.15:14
joopmy question is how can i install webmin,and do i need actually or xampp do the same15:14
coreycbjamespage: done back to sahara. getting trove and vpnaas next.15:29
rbasaknacc: I don't see sssd in http://people.canonical.com/~ubuntu-archive/component-mismatches-proposed.svg ?16:46
rbasakI'd expect to see it there.16:46
rbasakThough it is in excuses16:46
nacchttp://people.canonical.com/~ubuntu-archive/component-mismatches-proposed16:46
naccrbasak: the svg doesn't show everything, aiui16:46
coreycbjamespage: working on the m* pkgs17:06
administrador_hi17:07
administrador_im trying to do wake on lan with nagios17:07
jamespagecoreycb: horizon, designate and barbican done17:07
dpb1rbasak: looking at that https everywhere bug, the one that carries the most weight is hiding the packages you are downloading.  that is hard to refute.17:29
rbasakdpb1: HTTPS doesn't really hide that though. The package sizes, the dependency tree and recently published updates are all well known. That's enough to infer what you just downloaded.17:33
rbasakdpb1: if I had the time, I could write the tool to do it.17:33
dpb1hm17:34
dpb1rbasak: thanks, yes, interesting discussion17:37
sdezielI suppose the above discussion is about HTTPS mirrors for apt, right?17:41
dpb1sdeziel: yes17:41
sdezieldpb1: there is one paper including a security analysis of various package manager: https://isis.poly.edu/~jcappos/papers/cappos_mirror_ccs_08.pdf17:42
sdezieldpb1: rbasak: one of the benefit of using HTTPS was to defeat replay attacks and I believe this could happen when the connection to  security.ubuntu.com is MITM17:43
sdezieldpb1: rbasak: presumably having HTTPS on just security.ubuntu.com would prevent this without the nightmare associated with HTTPS mirrors17:43
sdezielwould be nice for the PPAs to also get HTTPS because they are only signed with a 1024 bit GPG key IIRC17:44
dpb1sdeziel: ya, all the attacks in 3.1 seem relavent actually17:45
sdezieldpb1: the "arbitrary package" and "extraneous dependencies" would fail GPG validation IMHO17:48
sdezielbut I haven't read the paper carefully17:48
sdezieldpb1: could you share the bug number please? I couldn't find it quickly and would like to track it17:53
sdezielhttps://www2.cs.arizona.edu/stork/packagemanagersecurity/otherattacks.html says that apt is subject to the endless data attack17:56
dpb1sdeziel: ya, I had it, one sec17:57
dpb1sdeziel: here's the main one: https://bugs.launchpad.net/ubuntu/+bug/146406417:57
ubottuLaunchpad bug 1464064 in Ubuntu "Ubuntu apt repos are not available via HTTPS" [Undecided,Confirmed]17:57
sdezieldpb1: thanks17:58
dpb1sdeziel: thx for sharing your paper.  I think freezing, endless data and replay are all very interesting and would certainly be mitigated by https+cert pinning17:58
sdezieldpb1: endless data shouldn't even be exploitable because everything is there to close it. I don't know if recent apt versions fixed that or not but it doesn't require HTTPS17:59
dpb1sdeziel: sure, the client should be proactive18:00
dpb1sdeziel: at least on trusty, I had times where I was in the gigs of transfer from a broken repo18:00
dpb1but maybe that is addressed now18:01
sdezielyeah, that's what I'd like to know :)18:01
sbeattiesdeziel: new ppa gpg keys are 4096 bits. but they are per-owner, so those of us with an existing 1024 key can't ever seem to get out from under it, without creating a whole new launchpad identity.18:34
sdezielsbeattie: hmm, that's interesting to say the least18:35
jamespagecoreycb: https://launchpadlibrarian.net/357025783/buildlog_ubuntu-bionic-amd64.heat_1%3A10.0.0~rc1-0ubuntu1~ubuntu18.04.1~ppa201802141302_BUILDING.txt.gz18:35
jamespageI think we need new sdk18:36
sbeattiesdeziel: https://bugs.launchpad.net/launchpad/+bug/1240681 is where the default got bumped to 4096.18:36
ubottuLaunchpad bug 1240681 in Launchpad itself "New GPG generated keys are 1024 bits" [High,Fix released]18:36
coreycbjamespage: i can get that18:37
jamespagecoreycb: ta18:37
jamespagecoreycb: the min barbicanclient version in global-requirements is to low as well18:37
sdezielsbeattie: I sure would have hope for a way to transition to a newer key18:38
sbeattie+118:39
sdezielhttps://bugs.launchpad.net/launchpad/+bug/133191418:40
ubottuLaunchpad bug 1331914 in Launchpad itself "Allow users to re-generate a PPA signing key" [High,Triaged]18:40
=== transcend is now known as strive
rbasaksdeziel: yeah, already noted. Valid-Until and Check-Valid-Until can mitigate that, but in the HTTPS case it'd be noticed quicker.19:43

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!