mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
postgresql_ping: add session_role and trust_input parameters (#312)
* postgresql_ping: add session_role and trust_input parameters * add changelog fragment
This commit is contained in:
parent
fce150fcf7
commit
31085fffb7
3 changed files with 42 additions and 0 deletions
|
@ -45,6 +45,7 @@
|
|||
login_port: 5432
|
||||
ssl_mode: require
|
||||
ca_cert: '{{ ssl_rootcert }}'
|
||||
trust_input: yes
|
||||
register: result
|
||||
when:
|
||||
- ansible_os_family == 'Debian'
|
||||
|
@ -56,3 +57,19 @@
|
|||
when:
|
||||
- ansible_os_family == 'Debian'
|
||||
- postgres_version_resp.stdout is version('9.4', '>=')
|
||||
|
||||
- name: postgresql_ping - check trust_input
|
||||
become_user: "{{ pg_user }}"
|
||||
become: yes
|
||||
postgresql_ping:
|
||||
db: "{{ db_default }}"
|
||||
login_user: "{{ pg_user }}"
|
||||
trust_input: no
|
||||
session_role: 'curious.anonymous"; SELECT * FROM information_schema.tables; --'
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is failed
|
||||
- result.msg is search('is potentially dangerous')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue