I have an instance of PostgreSQL 11 in GCP as Cloud SQL.
I want to connect pgAdmin to the server but I don't know to what port. Where can I see that?
I don't want to specify my ip adress for the server and I whitelisted all the connections to the server by putting 0.0.0.0/0 as an ip in the gcp console.
Multiple methods can be used to connect Cloud SQL to external applications such as pgAdmin. Here is the documentation covering all the methods and the steps to follow. Since you do not wish to specify your ip address, then using the proxy might be a good alternative. Documentation guidelines for that method can be found here, but here is a quick summary:
Enable the API
Install the proxy client on your local machine
Determine how you will authenticate the proxy
If required by your authentication method, create a service account
Determine how you will specify your instances for the proxy
Start the proxy
Update your application to connect to Cloud SQL using the proxy
Related
How to connect Google Cloud Sql from Local Python code?I am using Pycharm IDE.So I need the detail process to establish connection with google cloud mysql
You can find the detailed process here :
Connecting to Cloud SQL - MySQL
1.If you haven't already, set up a Python Development Environment by following the python setup guide and create a project.
2.Create a 2nd Gen Cloud SQL Instance by following these instructions. Note the connection string, database user, and database password that
you create.
3.Create a database for your application by following these instructions. Note the database name.
4.Create a service account with the 'Cloud SQL Client' permissions by following these instructions. Download a JSON key to use to
authenticate your connection.
5.Running locally : Launch proxy with TCP or Launch proxy with Unix Domain Socket
I have my splunk instance hosted azure and i wanted to connect to it via splunkSDK but it is giving timeout error for 8089 port and 443 it is giving connection reset.
import splunklib.client as client
service = client.connect(host='IP-Address', port=8089,
username='admin', password='...')
I have checked firewall and also tried executing this in azure databricks, still issue is present and HTTPS on 443 is also enabled in azure hosted splunk instance.
In web browser the ip is accessible via https like.. https://ip-address But http://ip-address:443 is giving no response. Can someone help solve this issue.
Try https://ip-address:8089 . If its not accessible, you will need to contact Splunk Cloud support and request they enable port 8089 access.
Refer to https://docs.splunk.com/Documentation/Splunk/7.3.1/RESTREF/RESTsystem#Splunk_Cloud_URL_for_REST_API_access
Managed Splunk Cloud deployments
https://deployment-name.splunkcloud.com:8089
Self-service Splunk Cloud deployments
To get the required credentials, submit a support case on the Support Portal. After installing the credentials, use the following URL.
https://input-deployment-name.cloud.splunk.com:8089
I'm creating a Python 3 spider that scrapes Tor hidden services for useful data. I'm storing this data in a PostgreSQL database using the psycopg2 library. Currently, the spider script and the database are hosted on the same network, so they have no trouble communicating. However, I plan to migrate the database to a remote server on a VPS so that I can have a team of users running the spider script from a number of remote locations, all contributing to the same database. For example, I could be running the script at my house, my friend could run it from his VPS, and my professor could run the script from a few different systems in the lab at the university, and all of these individual systems could synchronize with the PostgreSQL server runnning on my remote VPS.
This would be easy enough if I simply opened the database VPS to accept connections from anywhere, making the database public. However, I do not want to do this, for security reasons. I know I could tunnel the connection through SSH, but that would require giving each person a username and password that would grant them access to the server itself. I don't wish to do this. I'd prefer simply giving them access to the database without granting access to a shell account.
I'd prefer to limit connections to the local system 127.0.0.1 and create a Tor hidden service .onion address for the database, so that my remote spider clients can connect to the database .onion through Tor.
The problem is, I don't know how to connect to a remote database through a proxy using psycopg2. I can connect to remote databases, but I don't see any option for connecting through a proxy.
Does anyone know how this might be done?
This would be easy enough if I simply opened the database VPS to accept connections from anywhere
Here lies your issue. Just simply lock down your VPS using fail2ban and ufw. Create a ufw role to only allow connection to your Postgres port from the IP address you want to give access from to that VPS ip address.
This way, you don't open your Postgres port to anyone (from *) but only to a specific other server or servers that you control. This is how you do it. Don't run an onion service to connect Postgres content because that will only complicate things and slow down the reads to your Postgres database that I am assuming an API will be consuming eventually to get to the "useful data" you will be scraping.
I hope that at least points you in the right direction. Your question was pretty general, so I am keeping my answer along the same vein.
I've got a django project using django-redis 3.8.0 to connect to an aws instance of redis. However, I receive ConnectionError: Error 111 connecting to None:6379. Connection refused. when trying to connect. If I ssh into my ec2 and use redis-py from the shell, I am able to read and write from the cache just fine, so I don't believe it's a security policy issue.
Ok, figured it out. What I needed to do was prefix my location with redis://. This is specific to the django-redis library and how it parses the location url. That explains why when I manually set up a StrictRedis connection using the python redis library I was able to connect.
If you are running elastic-cache redis, you can't access it from outside AWS - that is why you are getting the error.
From AWS FAQ:
Please note that IP-range based access control is currently not
enabled for Cache Clusters. All clients to a Cache Cluster must be
within the EC2 network, and authorized via security groups as
described above.
http://aws.amazon.com/elasticache/faqs/
I am trying ldap authentication. My ldap server is located at x.x.x.x . I am using python-ldap. Connection on server locally doing:
ldap.initialize('ldap://localhost:389')
works fine,
but when i try to connect to the server from another machine, doing:
ldap.initialize('ldap://x.x.x.x:389')
it doesnt work.
What is it that I should do?
This was resolved by way of lifting firewall-based restrictions.