Skip to content

Commit bf514e6

Browse files
authored
Still setup key/license when neither signatures/threats are installed (#158)
1 parent 5ad1748 commit bf514e6

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.7.1 (Unreleased)
4+
5+
ENHANCEMENTS:
6+
7+
Add signing keys to a unique NGINX keyring on Debian based systems.
8+
9+
BUG FIXES:
10+
11+
License and keys should now be correctly setup when neither signatures or threat campaigns are installed.
12+
313
## 0.7.0 (October 28, 2021)
414

515
BREAKING CHANGES:

tasks/common/keys/setup-keys.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
block:
1919
- name: (Debian/Ubuntu) Add NGINX Plus signing key
2020
apt_key:
21+
keyring: /usr/share/keyrings/nginx-archive-keyring.gpg
2122
url: "{{ nginx_app_protect_signing_key.nginx_plus | default(nginx_app_protect_default_signing_key_pgp) }}"
2223

2324
- name: (Debian/Ubuntu) Add NGINX App Protect security updates signing key
2425
apt_key:
26+
keyring: /usr/share/keyrings/nginx-archive-keyring.gpg
2527
url: "{{ nginx_app_protect_signing_key.security_updates | default(nginx_app_protect_security_updates_default_signing_key_pgp) }}"
2628
when: ansible_os_family == "Debian"
2729

tasks/main.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,11 @@
3434

3535
- name: Set up signing keys
3636
include_tasks: "{{ role_path }}/tasks/common/keys/setup-keys.yml"
37-
when: nginx_app_protect_install_signatures | bool
38-
or nginx_app_protect_install_threat_campaigns | bool
3937
tags: nginx_app_protect_key
4038

4139
- name: Set up license
4240
include_tasks: "{{ role_path }}/tasks/common/install/setup-license.yml"
43-
when:
44-
- nginx_app_protect_install_signatures | bool
45-
or nginx_app_protect_install_threat_campaigns | bool
46-
- nginx_app_protect_setup_license | bool
41+
when: nginx_app_protect_setup_license | bool
4742
tags: nginx_app_protect_setup_license
4843

4944
- name: Install NGINX App Protect WAF

vars/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,22 @@ nginx_app_protect_security_updates_default_signing_key_rsa_pub: https://cs.nginx
6161

6262
# Default NGINX Plus repositories
6363
nginx_plus_default_repository_alpine: "https://pkgs.nginx.com/plus/alpine/v{{ ansible_facts['distribution_version'] | regex_search('^[0-9]+\\.[0-9]+') }}/main"
64-
nginx_plus_default_repository_debian: "deb [arch=amd64] https://pkgs.nginx.com/plus/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] }} nginx-plus"
64+
nginx_plus_default_repository_debian: "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg arch=amd64] https://pkgs.nginx.com/plus/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] }} nginx-plus"
6565
nginx_plus_default_repository_redhat: "https://pkgs.nginx.com/plus/centos/{{ ansible_distribution_major_version }}/$basearch/"
6666
nginx_plus_default_repository_amazon: "https://pkgs.nginx.com/plus/amzn{{ (ansible_facts['distribution_major_version'] is version('2', '==')) | ternary('2', '') }}/$releasever/$basearch"
6767

6868
# Default NGINX App Protect WAF repositories
6969
nginx_app_protect_default_repository_alpine: "https://pkgs.nginx.com/app-protect/alpine/v{{ ansible_distribution_version | regex_search('^[0-9]+\\.[0-9]+') }}/main"
70-
nginx_app_protect_default_repository_debian: "deb [arch=amd64] https://pkgs.nginx.com/app-protect/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus"
70+
nginx_app_protect_default_repository_debian: "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg arch=amd64] https://pkgs.nginx.com/app-protect/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus"
7171
nginx_app_protect_default_repository_redhat: "https://pkgs.nginx.com/app-protect/centos/{{ ansible_distribution_major_version }}/$basearch/"
7272
nginx_app_protect_default_repository_amazon: "https://pkgs.nginx.com/app-protect/centos/7/$basearch/"
7373

7474
# Default NGINX App Protect WAF Security Updates repositories
7575
nginx_app_protect_security_updates_default_repository_alpine: "https://pkgs.nginx.com/app-protect-security-updates/alpine/v{{ ansible_distribution_version | regex_search('^[0-9]+\\.[0-9]+') }}/main"
76-
nginx_app_protect_security_updates_default_repository_debian: "deb [arch=amd64] https://pkgs.nginx.com/app-protect-security-updates/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus"
76+
nginx_app_protect_security_updates_default_repository_debian: "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg arch=amd64] https://pkgs.nginx.com/app-protect-security-updates/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus"
7777
nginx_app_protect_security_updates_default_repository_redhat: "https://pkgs.nginx.com/app-protect-security-updates/centos/{{ ansible_distribution_major_version }}/$basearch/"
7878
nginx_app_protect_security_updates_default_repository_amazon: "https://pkgs.nginx.com/app-protect-security-updates/centos/7/$basearch/"
7979

8080
# Default NGINX App Protect DoS repositories
81-
nginx_app_protect_dos_default_repository_debian: "deb [arch=amd64] https://pkgs.nginx.com/app-protect-dos/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus"
81+
nginx_app_protect_dos_default_repository_debian: "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg arch=amd64] https://pkgs.nginx.com/app-protect-dos/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus"
8282
nginx_app_protect_dos_default_repository_redhat: "https://pkgs.nginx.com/app-protect-dos/centos/{{ ansible_distribution_major_version }}/$basearch/"

0 commit comments

Comments
 (0)