acessing the Sonarqube with http://xyz.abc.com:9000 - java

We are working in project where we wanted to customized the rule. To customized the rule, we need to upload a file to sonar server. As we are working in a restricted environment where we can't upload the file to unknown server. We can only upload the file only if server url end with abc.com.
is there any way to change the url http://localhost:9000 to http://xyz.abc.com:9000..??

Your question is completely independent from SonarQube as it boils down to hostname management, mapping xyz.abc.com to localhost (and/or to SonarQube server's IP). Changing sonar.web.host (as per your above comment) won't help at all as it is for SonarQube to bind on a specific interface, something unrelated to your situation here.
Approach your problem from a network connectivity (and name resolution) perspective. Your goal can be summed up in: xyz.abc.com must resolve to the IP of the server which hosts SonarQube.
If all work is only done locally for now then per comment from #snakecharmerb you can update your /etc/hosts with a new mapping, otherwise update your DNS with a new entry.

Related

Change of IP address has stopped OWASP CSRF from triggering

We are using the owasp csrf tool in our application. It is quite an old java8 / Tomcat application but this aspect has worked without a problem for a long time. We have 3 environments -
dev - local machine test
runs on remote servers as production
production
runs on remote servers
We recently changed the ip address of the test server and the OWASP protection no longer seems to trigger on this environment. I don't believe there is anything in the code base to cause this change as it still works on dev. I have checked and there is no hard coded reference to the old ip address in the code.
The token is still being injected into the form on test, and changes between initial set up and 2nd logon & submit.
The owasp_csrf.js file is still active as I put some alerts in there to check and they fire (I noticed on dev our warning message appears before the alerts so I don't think this is where the main part of the token checking is happening).
Everything seems to work as expected except the csrf check doesn't seem to fire.
So, my test is
log in and enter data into a data entry form
log out before submitting
log back in (different user, although this isn't necessary on production)
use back button to get to previous filled in form and submit
on test this allows submission (on dev and production it triggers csrf alert).
I don't think this has been tested on test for a while but but I know it as been in the past. I believe the only significant difference is the IP address change but I can't find anywhere in the code base or Tomcat configs where this looks relevant. (I've double checked the hosts files and rebooted in case any aspect of (linux) server setup had missed the ip change).
Apologies if this is a little vague but I wondered if anyone had any ideas about where the ip address may be relevant to the OWASP csrf set up ?

How can i share klov reports with other people?

Klov reports are working fine. My question is how can i share klov reports with other users?
I have tried running on the local host but if i want share this report how can i ?
ExtentKlovReporter klovReporter = new ExtentKlovReporter();
klovReporter.initMongoDbConnection("localhost", 32017);
You can share it by using your ipaddress. If suppose your ip address is 192.168.55.69, then other recipients can access it by "192.168.55.69:32017" (your ip : port no).
you can share the report link directly, but it may ask the recipient to select project from drop down menu based on your klov version
Actually there're several there're several options.
Run your tests on CI server (like Jenkins) and then publish it as HTML report;
Install an http server (IMHO the simplest is NGINX) and put your files inside, you can use a docker container and deploy it anywhere, locally on the cloud vm, on-prem server and so on.
Create an AWS S3 bucket (or alternatives on other clouds), allow hosting option and then upload your files.
And so, so on...

Java program is unable to write on mounted system in linux

I am currently working a scenario where we have to create a file in a shared directory in Linux as well as Windows.
I have gone through the following link to achieve it :
https://www.journaldev.com/878/java-write-to-file
https://it.toolbox.com/question/how-to-write-a-file-in-a-network-folder-without-using-ftp-031208
I was able to achieve it in windows network like giving the file name as (\\198.168.1.1\data\files)
But for the Linux first I used NFS to share a particular directory using below links :
https://alvinsim.wordpress.com/2012/06/21/mounting-nfs-from-linux-to-aix/
https://www.tecmint.com/how-to-setup-nfs-server-in-linux/
But got the following exception :
java.io.FileNotFoundException: /data/files (Read-only file system)
I found the following issue resolved in following thread, but I could not succeed :
https://askubuntu.com/questions/197459/how-to-fix-sudo-unable-to-open-read-only-file-system
Any advice is appreciated.
So finally I was able to figure what the problem was.
The entry which I made as per link in /etc/exports file is not sufficient.
We would need to use some options as well like (sync,rw,etc..) for allowing any manual modifications or modifications using any java program.
In my case, I should have used the options (rw,no_root_squash).
And it worked.
As very well explained in :
https://serverfault.com/questions/611007/unable-to-write-to-mount-point-nfs-server-getting-permission-denied/611013#611013?newreg=ce76e9417ca645da9487a5d9ccbf0371
From Docs on :
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/deployment_guide/s1-nfs-server-config-exports
root_squash — Prevents root users connected remotely from having root privileges and assigns them the user ID for the user nfsnobody. This effectively "squashes" the power of the remote root user to the lowest local user, preventing unauthorized alteration of files on the remote server. Alternatively, the no_root_squash option turns off root squashing. To squash every remote user, including root, use the all_squash option.

How to configure Eclipse Market place in Spring Tool Suite 3.8.1-64?

In spring Tool suite there is no tab for Eclipse Market Place to search any new plugin for install..so i am trying to configure eclipse market place in my sts IDE
Below is the step:
1) go to help
2) select Install New Software Tab
3) After that i am getting window for location select but what location i have to put for market place configure in sts
i try with different kind of location from google but not any work for sts
so anyone having idea regarding this solution then please suggest?
Considering this as a general programming problem, some possible causes are:
The service could be temporarily broken
You could have a problem with a firewall. These could be local or they could be implemented by your ISPs.
Your proxy HTTP settings (if you need one) could be incorrect. This Answer explains how to adjust the Eclipse-internal proxy settings ... if that is where the problem lies.
It is possible that your access may be blocked by over-active antivirus software.
The service could have blacklisted some net range and your hosts IP address is "collateral damage".
Try connecting to that URL with a web browser to try to see if it is just Eclipse that is affected ... or a broader problem.
Considering this in the context of the Eclipse Marketplace service, first address any local proxy / firewall / AV issues, if they apply. If that doesn't help, the best thing that you can do is to be patient.
It has been observed that the Eclipse Marketplace service does sometimes go down. It doesn't happen often, and when it does happen the problem does get fixed relatively quickly. (Hours, not days ...)
I can't find a "service status" page or feed or similar for the Eclipse services. (If you know of one, please add it as a comment below.)
There may be an "outage" notice on the Eclipse front page. Check for that.
Try to connect to the service URL (refer to the exception message!) using a web browser and/or from other locations. If you succeed, the real problem may be a networking issue at your end.
If you feel the need to complain about Eclipse's services, please don't do it here!! (It is off topic.)

Domino server 7.0.3FP1 Proxy settings with java agent

First, this is not the first time I ask a question related to this problem, but now that we have talked with the network admin guys and we know we absolutely HAVE to get through that proxy, I will ask again the question but with further details.
So here is the deal. We have an application built for Lotus Notes. That application needs to talk with a web service that is located outside the network of our client, but nothing can get out of the network without going through a proxy server. Since the Agent is running on the server, we need to tell the server to go through the proxy first. That can be achieved in Java using the System's properties (http.proxyHost, etc). That being said, I set all the properties related to the proxy settings in my Java Agent, and then I try getting the XML file from the web service. What I get is a connection time out exception. So, I was wondering why? We did a network analysis with WireShark, and the application is not trying to go through the proxy. Here is what it STRANGELY does.
I built the application and set the proxy host to a dummy address, just for the time I get the real proxy address and my credentials. Let's say proxy.mydomain.com
I get my credentials, so I change the proxy config with the real ones, say webproxy.ca.mydomain.net
Nothing works, so we restart the Domino server and do a clearcache, thinking it might be related to this
We did a network analysis with WireShark and the application queries the DNS for this:
proxy.mydomain.com
proxy.mydomain.com.ca.mydomain.com
proxy.mydomain.com.eu.mydomain.com
proxy.mydomain.com.anotherknowdomain.com
And that goes for a while. BUT, I can see it's still using the dummy address. Where does it get it. It's not in notes.ini, it's not in the server's cache, it's not in my source code, it's not in java.properties, it not in the JVM (since we restarted the machine). Any idea? We're at the end of a project and we need this to work to deliver it and preassure is building!!! I searched the WHOLE WEB!!!
One more thing I would say, when I set my properties in java code, I tryied to print them before to see if it was ok and everything is fine...
For your information, even though it was a web proxy going through HTTP, the JVM setting sockProxyHost was set and preceds on the other. That was our problem...

Categories