In a scenario where you need to create new source or target connections for cataloging in AWS Glue, describe the process you would follow to set up a connection to an external PostgreSQL database, including the necessary configurations and security considerations.