WSO2-EMM Problems Registering Windows Clients - wso2-iot

I've been having trouble getting Windows clients to register with the system. I've added this to the SSL Reverse Proxy Server:
ProxyPass /emm-web-agent http://172.16.1.82:9763/emm-web-agent
ProxyPassReverse /emm-web-agent http://172.16.1.82:9763/emm-web-agent
Where 172.16.1.82 is the IP address of my MDM server.
In the Apache log's I'm seeing this:
172.16.1.149 - - [21/Jun/2016:16:35:02 -0500] "GET /EnrollmentServer/Discovery.svc HTTP/1.1" 200 3961 "-" "ENROLLClient"
172.16.1.149 - - [21/Jun/2016:16:35:02 -0500] "GET /EnrollmentServer/Discovery.svc HTTP/1.1" 200 181 "-" "ENROLLClient"
172.16.1.149 - - [21/Jun/2016:16:35:02 -0500] "POST /EnrollmentServer/Discovery.svc HTTP/1.1" 200 1578 "-" "ENROLLClient"
172.16.1.149 - - [21/Jun/2016:16:35:04 -0500] "GET /emm-web-agent/enrollments/windows/login-agent?appru=ms-app%3A%2F%2Fwindows.immersivecontrolpanel&login_hint=JeffR%40mydomain.com&username=JeffR%40mydomain.com HTTP/1.1" 302 4281 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; MSAuthHost/1.0/In-Domain; rv:11.0) like Gecko"
172.16.1.149 - - [21/Jun/2016:16:35:04 -0500] "GET /emm-web-agent/enrollments/error/unintentional-request HTTP/1.1" 302 389 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; MSAuthHost/1.0/In-Domain; rv:11.0) like Gecko"
Where 172.16.1.149 is the client computer.
I've tried various things, including rewriting the URL. I'm not sure why it is giving the 302 error back from the emm-web-agent server.
Am I missing something in my configuration? Thanks....

There should be issue in your server certificate.The server SSL certificate must be domain specific.The wildcard SSL certificate (for
example, a certificate for *.hutchgov.com instead of enterpriseenrollment.hutchgov.com) is not accepted by the device.This Web authentication broker request(WAB) url is first https request which is coming from the device.If you can take a CA singed certificate for your domain(enterpriseenrollment.hutchgov.com),It would be resolved the issue.

Related

NGINX rewrites and proxy_pass explanation from the client side

I have the following NGINX configuration:
location ~* ^/([a-zA-Z0-9]+)$ {
set $upstream_endpoint http://10.0.0.31;
proxy_pass $upstream_endpoint;
rewrite ^/(.*) /?discount=$1 break;
}
And I can see the following logs from NGINX
172.21.0.1 - - [27/Jun/2022:07:23:11 +0000] "GET /?discount=prom HTTP/1.0" 200 161 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0"
Which means the NGINX forwarded the client request as expected. However, from the client side cannot the "discount" parameter.
I am expecting the address to change from http://10.0.0.31/promo22 to http://10.0.0.31/?discount=promo22.
What is missing? Thanks for your time

Deploying gridsome app to apache 2 server

I have a Static Site written with Gridsome that I would like to deploy to my LAMP server running Apache 2.4. Looking on line I have tried several solutions including a 200.html in the directory and adding a .htacces file in the directory with contents -
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
But site does not load correctly(no css, js) and all Product pages come back 404 Not Found. I see in console that css and js files are all coming back 404 codes.
Here are Apache logs:
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /furniture/ HTTP/1.1" 200 3894 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /assets/css/0.styles.be923654.css HTTP/1.1" 404 490 "http://172.16.178.9/furniture/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /assets/js/app.f3ee1f73.js HTTP/1.1" 404 490 "http://172.16.178.9/furniture/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /assets/js/page--src-pages-index-vue.aca59de8.js HTTP/1.1" 404 491 "http://172.16.178.9/furniture/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /assets/js/app.f3ee1f73.js HTTP/1.1" 404 490 "http://172.16.178.9/furniture/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /assets/js/page--src-pages-index-vue.aca59de8.js HTTP/1.1" 404 490 "http://172.16.178.9/furniture/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /assets/static/favicon.ac8d93a.5667663fadd9573f98b6a9c36dd676aa.png HTTP/1.1" 404 490 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /assets/js/page--node-modules-gridsome-app-pages-404-vue.0ed1ba31.js HTTP/1.1" 404 490 "http://172.16.178.9/furniture/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /assets/js/page--src-pages-about-vue.de5a1202.js HTTP/1.1" 404 490 "http://172.16.178.9/furniture/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:07 -0500] "GET /assets/js/page--src-templates-product-vue.05ad6ad3.js HTTP/1.1" 404 491 "http://172.16.178.9/furniture/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
And when I try to go to one of the Product Pages -
172.16.178.62 - - [16/Jan/2020:13:24:52 -0500] "GET /products/strul-rug/ HTTP/1.1" 404 491 "http://172.16.178.9/furniture/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
172.16.178.62 - - [16/Jan/2020:13:24:52 -0500] "GET /favicon.ico HTTP/1.1" 404 490 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
Update: I see the problem. When looking at dev console network all the URI requests are:
Request URL:http://172.16.178.9/assets/css/0.styles.be923654.css
Request Method:GET
They should be
http://172.16.178.9/furniture/some/asset/to/get
How can one rectify this? thanks..
If it's just a html file, there is no reason that apache would not be able to serve it, but as you have modified .htaccess make sure that apache .conf file allows you to override to directory level htaccess files.
I mean does your server's conf allow you to oberride the htaccess? there should be a line similar to following in your main apache conf file (located by default at /etc/apache2/apache2.conf):
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
In general I am not sure why you even need htaccess file if all you are trying to serve are static HTML and CSS,JS files.
Turns out real simple. I needed to add pathPrefix property to gridsome.config.js to make build include /furniture in URI's.
// gridsome.config.js
module.exports = {
siteName: "Ecommerce & Gridsome",
pathPrefix: "/furniture",
templates: {
Product: "/products/:title" // Set route for allProduct node's
}
};

add SSL to dropwizard with jetty

i have spend a lifetime while traying to configurate SSL for Dropwizard
what i do is to start the dropwizard application with java -jar command in my console
NOT : i'am working right now on windows , but i'am planning to deploy the solution on linux after .
when i start my application , all works fine :
INFO [2018-10-16 16:23:26,739] org.eclipse.jetty.server.handler.ContextHandler: Started i.d.j.MutableServletContextHandler#24dc150c{/,null,AVAILABLE}
INFO [2018-10-16 16:23:26,759] org.eclipse.jetty.server.AbstractConnector: Started application#20231384{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
INFO [2018-10-16 16:23:26,762] org.eclipse.jetty.server.AbstractConnector: Started admin#3ba97962{HTTP/1.1,[http/1.1]}{0.0.0.0:8081}
INFO [2018-10-16 16:23:26,762] org.eclipse.jetty.server.Server: Started #3071ms
when i hit on my browser/or my android client a normal request the server show me this :
0:0:0:0:0:0:0:1 - - [16/oct./2018:16:30:25 +0000] "GET /robots.txt HTTP/1.1" 404 43 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" 69
0:0:0:0:0:0:0:1 - - [16/oct./2018:16:30:25 +0000] "GET / HTTP/1.1" 404 43 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" 69
0:0:0:0:0:0:0:1 - - [16/oct./2018:16:30:30 +0000] "GET /robots.txt HTTP/1.1" 404 242 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" 8
0:0:0:0:0:0:0:1 - - [16/oct./2018:16:30:30 +0000] "GET / HTTP/1.1" 200 553 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" 4
0:0:0:0:0:0:0:1 - - [16/oct./2018:16:30:31 +0000] "GET /favicon.ico HTTP/1.1" 404 243 "http://localhost:8081/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" 1
but i have an other client who is configurate to work with SSL ( and it's the mean client, the others is just for the test )
when i hit the same request with HTTPS , that what happen :
WARN [2018-10-16 16:32:29,216] org.eclipse.jetty.http.HttpParser: Illegal character 0x16 in state=START for buffer HeapByteBuffer#12404fb3[p=1,l=517,c=8192,r=516]={\x16<<<\x03\x01\x02\x00\x01\x00\x01\xFc\x03\x036\xD2T\xFd5\xF9\xCd...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
googing this error i get tat is an problem with my server , he is not prepared to communicat with SSL
so how i can work with SSL or configurate SSL on jetty ?
i fix this by adding the the https params under server area on the yml config file
but i got some errors on ssl handshake so i fixed by creating the keystore .

Apache Reverse Proxying CGI scripts

I have a web application called routers2.cgi which I am trying to proxy via an Apache 2.4 proxy server which does not work at the moment.
Direct URL to the web application server
http://lab.server.com/cgi-bin/routers2.cgi
Reverse proxy URL
https://prod.server.com/routers2
Configuration vhosts.conf from prod.server.com
# routes2.cgi
ProxyPass "/routers2" "http://lab.server.com/cgi-bin/routers2.cgi"
ProxyPassReverse "/routers2" "http://lab.server.com/cgi-bin/routers2.cgi"
ProxyPass "/rrdicons" "http://lab.server.com/routers2/rrdicons"
ProxyPassReverse "/rrdicons" "http://lab.server.com/routers2/rrdicons"
ProxyPass "/graphs" "http://lab.server.com/routers2/graphs"
ProxyPassReverse "/graphs" "http://lab.server.com/routers2/graphs"
Reverse proxy log samples
192.168.1.10 - - [13/Jun/2017:06:40:37 +0000] "GET /routers2 HTTP/1.1" 200 3481
192.168.1.10 - - [13/Jun/2017:06:40:37 +0000] "GET /rrdicons/routers2.css HTTP/1.1" 304 -
192.168.1.10 - - [13/Jun/2017:06:45:57 +0000] "GET /routers2 HTTP/1.1" 200 3481
192.168.1.10 - - [13/Jun/2017:06:45:57 +0000] "GET /rrdicons/routers2.css HTTP/1.1" 304 -
Sample URL from web application access log when accessing directly (no reverse proxy)
192.168.1.9 - - [13/Jun/2017:05:50:46 +0000] "GET /routers2/graphs/devicessystem1.cfg-10.10.1.1_13-ws-x3.png HTTP/1.1" 200 27025 "http://lab.server.com/cgi-bin/routers2.cgi?rtr=devices%2Fsystem1.cfg&bars=Cami&xgtype=w&page=graph&xgstyle=x3&xmtype=routers" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
192.168.1.9 - - [13/Jun/2017:05:50:46 +0000] "GET /cgi-bin/routers2.cgi?rtr=devices%2Fsystem1.cfg&bars=Cami&xgtype=w&page=menub&xgstyle=x3&if=_summary_&xmtype=options HTTP/1.1" 200 12437 "http://lab.server.com/cgi-bin/routers2.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
192.168.1.9 - - [13/Jun/2017:05:50:46 +0000] "GET /cgi-bin/routers2.cgi?rtr=devices%2Fsystem1.cfg&bars=Cami&xgtype=w&page=menu&xgstyle=x3&xmtype=routers HTTP/1.1" 200 7847 "http://lab.server.com/cgi-bin/routers2.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
Web application log via reverse proxy
prod.server.com - - [13/Jun/2017:07:21:58 +0000] "GET /cgi-bin/routers2.cgi/ HTTP/1.1" 200 3481 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
prod.server.com - - [13/Jun/2017:07:21:58 +0000] "GET /routers2/rrdicons/routers2.css HTTP/1.1" 304 - "https://prod.server.com/routers2/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"
Does my vhosts ProxyPass and ProxyPassReverse configuration look correct?
Do I need something extra since we are proxying a cgi script?

Fedora cannot log into phppgadmin, but to psql

I have fedora 21 and I want to access postgresql db using phpPgAdmin. To do it I have installed httpd and phppgadmin, postgresql too.
I can log with no problem to pgql using for example
psql -U learning -W template1
or
psql -W template1
but when I enter localhost/phpPgAdmin I cannot log in
the diff between to log in attempts in
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "POST /phpPgAdmin/redirect.php HTTP/1.1" 200 2268 "http://localhost/phpPgAdmin/redirect.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/browser.php HTTP/1.1" 200 3005 "http://localhost/phpPgAdmin/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/themes/default/global.css HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/libraries/js/jquery.js HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/xloadtree/xtree2.js HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/themes/global.css HTTP/1.1" 304 - "http://localhost/phpPgAdmin/themes/default/global.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/xloadtree/xloadtree2.js HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/title.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/Refresh.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/Servers.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/L.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/Loading.gif HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/I.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/servers.php?action=tree HTTP/1.1" 200 275 "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/DisconnectedServer.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
my /var/lib/pgsql/data/pg_hba.conf is
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 ident
host all all 192.168.1.0/24 ident
# IPv6 local connections:
host all all ::1/128 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
my /etc/phpPgAdmin/config.inc.php
$conf['extra_login_security'] = false;
this is as far as I found how to make it work, but I do not how to do it
phpPgAdmin at fail log in tells me "Próba zalogowania nie powiodła się.", which probably is something like "Attemt to log in has failed"
localhost/phpMyAdmin works normally
Can I somehow get reason why I was not logged in? Wrong password, no server etc?
SOLUTION
I have gone easy way, reinstalled fedora and now everything works, but that is actually not a solution :P
Try this.
If this is your IP address range that is accessing your computer then change
host all all 192.168.1.0/24 ident
to this
host all all 192.168.1.0/24 trust
Reload Postgres after you change it. And see if you can login.
You may also need to enable networking by changing this in the postgres conf.
from
listen_addresses='localhost'
to
listen_addresses='*'
Also be sure you have granted all the appropriate priviliges to the user to be able to access that database or any databases your are wanting to manage.
Edit:
It might be an SELinux issue. You can temporarily turn off SELinux for testing by using this command.
setenforce 0
Then test the login and see if it works. If it does work that means selinux is preventing access, you should run this command to allow httpd to continue to work after reboot.
setsebool -P httpd_can_network_connect_db 1