SOLVED

Automatic Log Upload using Docker on Ubuntu in Azure

%3CLINGO-SUB%20id%3D%22lingo-sub-228347%22%20slang%3D%22en-US%22%3EAutomatic%20Log%20Upload%20using%20Docker%20on%20Ubuntu%20in%20Azure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-228347%22%20slang%3D%22en-US%22%3E%3CP%3EA%20few%20weeks%20back%2C%20my%20perfectly%20functional%20log%20collector%20(Docker%20on%20Ubuntu%20in%20Azure)%20stopped%20receiving%20syslogs%20from%20both%20of%20my%20sources.%26nbsp%3B%20The%20reason%20for%20this%20sudden%20breakage%20is%20still%20not%20completely%20understood.%26nbsp%3B%20After%20messing%20around%20with%20the%20log%20collector%20and%20trying%20to%20reconfigure%20my%20Docker%20instance%20to%20start%20receiving%20logs%20again%2C%20I%20simply%20couldn't%20get%20it%20to%20work.%26nbsp%3B%20I%20decided%20to%20spin%20up%20a%20new%20Ubuntu%20instance%20in%20Azure%20using%20the%20direction%20provided%20here%20--%26nbsp%3B%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcloud-app-security%2Fdiscovery-docker-ubuntu-azure%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcloud-app-security%2Fdiscovery-docker-ubuntu-azure%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20short%2C%20things%20still%20aren't%20working%20and%20I'm%20not%20good%20enough%20with%20Linux%2FDocker%20to%20know%20how%20to%20troubleshoot%20this.%26nbsp%3B%20I%20do%20have%20concerns%20that%20the%20commands%20generated%20when%20adding%20new%20log%20collectors%20in%20the%20CAS%20portal%20is%20incorrect%20though.%26nbsp%3B%20The%20sources%20that%20I'm%20trying%20to%20receive%20logs%20from%20are%20sending%20to%20UDP%2F514%20and%20UDP%2F515.%26nbsp%3B%20The%20command%20that%20is%20generated%20to%20configure%20my%20Docker%20instance%20is%20the%20following%20--%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E(echo%20be178dc0a43dea3b51697e7369d616054fb260e47bb93146e5da0ccf37c96394)%20%7C%20docker%20run%20--name%20LogCollector_Azure%20-p%2021%3A21%20-p%2020000-20099%3A20000-20099%20-e%20%22PUBLICIP%3D'10.3.2.20'%22%20-e%20%22PROXY%3D%22%20-e%20%22SYSLOG%3Dfalse%22%20-e%20%22CONSOLE%3Dmycompanyname.us2.portal.cloudappsecurity.com%22%20-e%20%22COLLECTOR%3DLogCollector_Azure%22%20--security-opt%20apparmor%3Aunconfined%20--cap-add%3DSYS_ADMIN%20--restart%20unless-stopped%20-a%20stdin%20-i%20microsoft%2Fcaslogcollector%20starter%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIt%20seems%20strange%20to%20me%20that%20it%20seems%20to%20only%20be%20configuring%20for%20FTP%20but%20ignoring%20my%20UDP-based%20syslog%20ports.%26nbsp%3B%20Am%20I%20wrong%20in%20thinking%20that%20it%20should%20look%20something%20like%20the%20following%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E(echo%20e8f2683d346b4cb90e3184b7de7fd464841358808b6ff6fe19fde25b18e78a1)%20%7C%20docker%20run%20--name%20LogCollector_Azure%20-p%2021%3A21%20%3CSTRONG%3E-p%20514-515%3A514-515%2Fudp%3C%2FSTRONG%3E%20-p%2020000-20099%3A20000-20099%20-e%20%22PUBLICIP%3D'10.3.2.20'%22%20-e%20%22PROXY%3D%22%20-e%20%22SYSLOG%3Dfalse%22%20-e%20%22CONSOLE%3Dsawdustinvestments.us2.portal.cloudappsecurity.com%22%20-e%20%22COLLECTOR%3DLogCollector_Azure%22%20--security-opt%20apparmor%3Aunconfined%20--cap-add%3DSYS_ADMIN%20--restart%20unless-stopped%20-a%20stdin%20-i%20microsoft%2Fcaslogcollector%20starter%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegardless%2C%20I've%20run%20it%20both%20way%20and%20it%20doesn't%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20have%20any%20records%20of%20exactly%20what%20commands%20I%20ran%20when%20I%20initially%20configure%20this%20many%20months%20back%2C%20but%20I%20did%20have%20all%20of%20this%20running%20successfully%20at%20one%20point.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-228347%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECloud%20App%20Security%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-238248%22%20slang%3D%22en-US%22%3ERe%3A%20Automatic%20Log%20Upload%20using%20Docker%20on%20Ubuntu%20in%20Azure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-238248%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20appears%20they%20made%20some%20changes%20based%20on%20my%20comments%20because%20the%20portal%20generated%20command%20now%20appears%20as%20follows%20--%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(echo%20%3CSPAN%3Ee8f2683d346b4cb90e3184b7de7fd464841358808b6ff6fe19fde25b18e78a1%3C%2FSPAN%3E)%20%7C%20docker%20run%20--name%20LogCollector_Azure%20%3CSTRONG%3E-p%20514%3A514%2Fudp%20-p%20515%3A515%2Fudp%3C%2FSTRONG%3E%20-p%2021%3A21%20-p%2020000-20099%3A20000-20099%20-e%20%22PUBLICIP%3D'10.3.2.20'%22%20-e%20%22PROXY%3D%22%20%3CSTRONG%3E-e%20%22SYSLOG%3Dtrue%22%3C%2FSTRONG%3E%20-e%20%22CONSOLE%3Dsawdustinvestments.us2.portal.cloudappsecurity.com%22%20-e%20%22COLLECTOR%3DLogCollector_Azure%22%20--security-opt%20apparmor%3Aunconfined%20--cap-add%3DSYS_ADMIN%20--restart%20unless-stopped%20-a%20stdin%20-i%20microsoft%2Fcaslogcollector%20starter%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-236335%22%20slang%3D%22en-US%22%3ERe%3A%20Automatic%20Log%20Upload%20using%20Docker%20on%20Ubuntu%20in%20Azure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-236335%22%20slang%3D%22en-US%22%3E%3CP%3EI%20started%20a%20support%20case%20and%20by%20the%20time%20they%20got%20back%20to%20me%20I'd%20sorted%20it%20out.%26nbsp%3B%20I%20changed%26nbsp%3Bmy%20command%20as%20follows%20and%20then%20it%20worked%20--%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E(echo%20e8f2683d346b4cb90e3184b7de7fd464841358808b6ff6fe19fde25b18e78a1)%20%7C%20docker%20run%20--name%20LogCollector_Azure%20-p%2021%3A21%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E-p%20514-515%3A514-515%2Fudp%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B-p%2020000-20099%3A20000-20099%20-e%20%22PUBLICIP%3D'10.3.2.20'%22%20-e%20%22PROXY%3D%22%20-e%20%22SYSLOG%3D%3CSTRONG%3Etrue%3C%2FSTRONG%3E%22%20-e%20%22CONSOLE%3Dsawdustinvestments.us2.portal.cloudappsecurity.com%22%20-e%20%22COLLECTOR%3DLogCollector_Azure%22%20--security-opt%20apparmor%3Aunconfined%20--cap-add%3DSYS_ADMIN%20--restart%20unless-stopped%20-a%20stdin%20-i%20microsoft%2Fcaslogcollector%20starter%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20think%20the%20commands%20being%20generated%20by%20the%20portal%20during%20the%20setup%20of%20the%20collector%20are%20wrong%20when%20configuring%20syslogs.%26nbsp%3B%20I'd%20used%20them%20successfully%20in%20the%20past%2C%20but%20I%20don't%20have%20any%20record%20of%20what%20they%20looked%20like%20when%20I%20last%20set%20up%20a%20collector%20successfully.%26nbsp%3B%20The%20support%20engineer%20said%20he'd%20pass%20my%20comments%20back%20to%20the%20team%20so%20that%20they%20could%20check%20on%20the%20issue.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EPhil%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-236162%22%20slang%3D%22en-US%22%3ERe%3A%20Automatic%20Log%20Upload%20using%20Docker%20on%20Ubuntu%20in%20Azure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-236162%22%20slang%3D%22en-US%22%3EPhillip%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI've%20done%20a%20few%20Ubuntu%2FDocker%20on%20prem%20installs%20without%20issue.%20I'll%20try%20setup%20an%20Azure%20instance%20and%20let%20you%20know%20if%20I%20get%20any%20issues.%20Did%20you%20raise%20this%20with%20MS%20support%3F%3CBR%20%2F%3E%3CBR%20%2F%3EMatt%3C%2FLINGO-BODY%3E
Contributor

A few weeks back, my perfectly functional log collector (Docker on Ubuntu in Azure) stopped receiving syslogs from both of my sources.  The reason for this sudden breakage is still not completely understood.  After messing around with the log collector and trying to reconfigure my Docker instance to start receiving logs again, I simply couldn't get it to work.  I decided to spin up a new Ubuntu instance in Azure using the direction provided here -- https://docs.microsoft.com/en-us/cloud-app-security/discovery-docker-ubuntu-azure

 

In short, things still aren't working and I'm not good enough with Linux/Docker to know how to troubleshoot this.  I do have concerns that the commands generated when adding new log collectors in the CAS portal is incorrect though.  The sources that I'm trying to receive logs from are sending to UDP/514 and UDP/515.  The command that is generated to configure my Docker instance is the following --

 

(echo be178dc0a43dea3b51697e7369d616054fb260e47bb93146e5da0ccf37c96394) | docker run --name LogCollector_Azure -p 21:21 -p 20000-20099:20000-20099 -e "PUBLICIP='10.3.2.20'" -e "PROXY=" -e "SYSLOG=false" -e "CONSOLE=mycompanyname.us2.portal.cloudappsecurity.com" -e "COLLECTOR=LogCollector_Azure" --security-opt apparmor:unconfined --cap-add=SYS_ADMIN --restart unless-stopped -a stdin -i microsoft/caslogcollector starter

 

It seems strange to me that it seems to only be configuring for FTP but ignoring my UDP-based syslog ports.  Am I wrong in thinking that it should look something like the following?

 

(echo e8f2683d346b4cb90e3184b7de7fd464841358808b6ff6fe19fde25b18e78a1) | docker run --name LogCollector_Azure -p 21:21 -p 514-515:514-515/udp -p 20000-20099:20000-20099 -e "PUBLICIP='10.3.2.20'" -e "PROXY=" -e "SYSLOG=false" -e "CONSOLE=sawdustinvestments.us2.portal.cloudappsecurity.com" -e "COLLECTOR=LogCollector_Azure" --security-opt apparmor:unconfined --cap-add=SYS_ADMIN --restart unless-stopped -a stdin -i microsoft/caslogcollector starter

 

Regardless, I've run it both way and it doesn't work.

 

I don't have any records of exactly what commands I ran when I initially configure this many months back, but I did have all of this running successfully at one point.

 

3 Replies
Phillip,

I've done a few Ubuntu/Docker on prem installs without issue. I'll try setup an Azure instance and let you know if I get any issues. Did you raise this with MS support?

Matt

I started a support case and by the time they got back to me I'd sorted it out.  I changed my command as follows and then it worked --

 

(echo e8f2683d346b4cb90e3184b7de7fd464841358808b6ff6fe19fde25b18e78a1) | docker run --name LogCollector_Azure -p 21:21 -p 514-515:514-515/udp -p 20000-20099:20000-20099 -e "PUBLICIP='10.3.2.20'" -e "PROXY=" -e "SYSLOG=true" -e "CONSOLE=sawdustinvestments.us2.portal.cloudappsecurity.com" -e "COLLECTOR=LogCollector_Azure" --security-opt apparmor:unconfined --cap-add=SYS_ADMIN --restart unless-stopped -a stdin -i microsoft/caslogcollector starter

 

I think the commands being generated by the portal during the setup of the collector are wrong when configuring syslogs.  I'd used them successfully in the past, but I don't have any record of what they looked like when I last set up a collector successfully.  The support engineer said he'd pass my comments back to the team so that they could check on the issue.

 

Phil

Best Response confirmed by Philip Kluss (Contributor)
Solution

It appears they made some changes based on my comments because the portal generated command now appears as follows --

 

(echo e8f2683d346b4cb90e3184b7de7fd464841358808b6ff6fe19fde25b18e78a1) | docker run --name LogCollector_Azure -p 514:514/udp -p 515:515/udp -p 21:21 -p 20000-20099:20000-20099 -e "PUBLICIP='10.3.2.20'" -e "PROXY=" -e "SYSLOG=true" -e "CONSOLE=sawdustinvestments.us2.portal.cloudappsecurity.com" -e "COLLECTOR=LogCollector_Azure" --security-opt apparmor:unconfined --cap-add=SYS_ADMIN --restart unless-stopped -a stdin -i microsoft/caslogcollector starter