Skip to content

security(getting-started): enforce stronger postgres password and restrict database access#3570

Merged
dimas-b merged 2 commits intoapache:mainfrom
pingtimeout:stronger-postgresql-password-in-getting-started
Feb 3, 2026
Merged

security(getting-started): enforce stronger postgres password and restrict database access#3570
dimas-b merged 2 commits intoapache:mainfrom
pingtimeout:stronger-postgresql-password-in-getting-started

Conversation

@pingtimeout
Copy link
Contributor

@pingtimeout pingtimeout commented Jan 27, 2026

This is not really a security issue in the codebase. More of an improvement on the getting started.

The getting started guide for Azure exposes a database to the entire internet, which is a problem considering that the default username and password for Postgres are used. This PR includes the following changes:

  • Add POSTGRES_PASSWORD environment variable to specify the Postgres database password.
  • Add validation to reject weak default "postgres" password.
  • Generate random 16-character password if POSTGRES_PASSWORD is not provided.
  • Replace all hardcoded "postgres" password references with $POSTGRES_PASSWORD variable.
  • Restrict Azure PostgreSQL access to VM's public IP using --public-access flag. This aligns security posture across AWS (VPC-only), Azure (IP-restricted), and GCP (authorized-networks)
  • Update documentation site to describe the POSTGRES_PASSWORD environment variable.

Full disclaimer: I cannot test the --public-access $INSTANCE_IP addition to the az command. This is because of a company policy that prevents me from instantiating any Azure instance with a public IP address. Any help to test the deploy-azure.sh script is welcome.

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

…rict database access

- Add POSTGRES_PASSWORD environment variable to specify the Postgres
  database password.
- Add validation to reject weak default "postgres" password.
- Generate random 16-character password if POSTGRES_PASSWORD is not
  provided.
- Replace all hardcoded "postgres" password references with
  $POSTGRES_PASSWORD variable.
- Restrict Azure PostgreSQL access to VM's public IP using
  `--public-access` flag. This aligns security posture across AWS
  (VPC-only), Azure (IP-restricted), and GCP (authorized-networks)
- Update documentation site to describe the POSTGRES_PASSWORD
  environment variable.
@github-project-automation github-project-automation bot moved this to PRs In Progress in Basic Kanban Board Jan 27, 2026
@pingtimeout pingtimeout marked this pull request as ready for review January 27, 2026 16:43
adutra
adutra previously approved these changes Jan 27, 2026
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Jan 27, 2026
dimas-b
dimas-b previously approved these changes Jan 27, 2026
Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with docs changes noted by @adutra 👍 Valuable improvement! Thanks, @pingtimeout !

@pingtimeout pingtimeout dismissed stale reviews from dimas-b and adutra via efa3b0d January 27, 2026 18:05
Copy link
Contributor

@singhpk234 singhpk234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @pingtimeout !
just double confirming did you run the getting started post changes ?

@pingtimeout
Copy link
Contributor Author

@singhpk234 no unfortunately, see the PR description.

Full disclaimer: I cannot test the --public-access $INSTANCE_IP addition to the az command. This is because of a company policy that prevents me from instantiating any Azure instance with a public IP address. Any help to test the deploy-azure.sh script is welcome.

@dimas-b
Copy link
Contributor

dimas-b commented Jan 28, 2026

@adnanhemani : You seem to be the original author of these scripts. Do you have capacity to re-validate them with changes in this PR? Thx!

@dimas-b dimas-b merged commit 929726c into apache:main Feb 3, 2026
23 of 26 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Feb 3, 2026
sungwy pushed a commit to sungwy/polaris that referenced this pull request Feb 7, 2026
…trict database access (apache#3570)

* security(getting-started): enforce strong postgres passwords and restrict database access

- Add POSTGRES_PASSWORD environment variable to specify the Postgres
  database password.
- Add validation to reject weak default "postgres" password.
- Generate random 16-character password if POSTGRES_PASSWORD is not
  provided.
- Replace all hardcoded "postgres" password references with
  $POSTGRES_PASSWORD variable.
- Restrict Azure PostgreSQL access to VM's public IP using
  `--public-access` flag. This aligns security posture across AWS
  (VPC-only), Azure (IP-restricted), and GCP (authorized-networks)
- Update documentation site to describe the POSTGRES_PASSWORD
  environment variable.
snazy added a commit to snazy/polaris that referenced this pull request Feb 11, 2026
* fix(site): Bump the binary distribution version. (apache#3624)

Co-authored-by: ChristopherQu <35272962+ChristopherQu@users.noreply.github.com>

* chore(deps): update actions/stale digest to dcd2b94 (apache#3643)

* security(getting-started): enforce stronger postgres password and restrict database access (apache#3570)

* security(getting-started): enforce strong postgres passwords and restrict database access

- Add POSTGRES_PASSWORD environment variable to specify the Postgres
  database password.
- Add validation to reject weak default "postgres" password.
- Generate random 16-character password if POSTGRES_PASSWORD is not
  provided.
- Replace all hardcoded "postgres" password references with
  $POSTGRES_PASSWORD variable.
- Restrict Azure PostgreSQL access to VM's public IP using
  `--public-access` flag. This aligns security posture across AWS
  (VPC-only), Azure (IP-restricted), and GCP (authorized-networks)
- Update documentation site to describe the POSTGRES_PASSWORD
  environment variable.

* OpenAPI specs: update README with detailed API specifications (apache#3629)

* CI: simplify `ci-incr-build-cache-save` action usage (apache#3626)

* CI: simplify upload-artifacts call + only on failure (apache#3627)

* CI: simplify java-setup action usage (apache#3628)

* STS roleArn: enable 3rd party STS services (apache#3619)

Certain non-AWS STS service implementations use role ARNs that look quite different from AWS ones.
This change shall enable those STS implementations.

Example role ARNs that currently fail:
* `urn:ecs:sts::s3:assumed-role/s3assumeRole/user1-105-temp`
* `urn:sgws:identity::12345:group/foo-bar-abcdef`

Related issue apache#2743

* Last merged commit 29ccdd1

---------

Co-authored-by: HJ Q. <35272962+chrisqu777@users.noreply.github.com>
Co-authored-by: ChristopherQu <35272962+ChristopherQu@users.noreply.github.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Pierre Laporte <pierre@pingtimeout.fr>
Co-authored-by: Alexandre Dutra <adutra@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants