Skip to content

Commit 8349d87

Browse files
authored
Merge pull request #19 from nginxinc/sig-repo-update
Signatures Repo Update and Refactoring
2 parents 1cabf77 + aa0dbb4 commit 8349d87

File tree

9 files changed

+47
-49
lines changed

9 files changed

+47
-49
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Before creating a PR, run through this checklist and mark each as complete.
77
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx-app-protect/blob/main/CONTRIBUTING.md) document
88
- [ ] I have added Molecule tests that prove my fix is effective or that my feature works
99
- [ ] I have checked that all Molecule tests pass after adding my changes
10-
- [ ] I have updated any relevant documentation (`defaults/main/*.yml`, `README.md` and `CHANGELOG.md`)
10+
- [ ] I have updated any relevant documentation (`defaults/main/*.yml` and `README.md`)

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ nginx_app_protect_delete_license: true
104104
# Otherwise, it will source packages from CentOS' repositories.
105105
nginx_app_protect_use_rhel_subscription_repos: false
106106

107+
# OPTIONAL: Choose where to fetch the NGINX App Protect and Security Updates signing keys from.
108+
# Default settings are the official NGINX signing key hosts.
109+
nginx_app_protect_signing_keys:
110+
nginx_plus: https://cs.nginx.com/static/keys/nginx_signing.key
111+
app_protect: https://cs.nginx.com/static/keys/app-protect.key
112+
security_updates: https://cs.nginx.com/static/keys/app-protect-security-updates.key
113+
107114
# For use with the nginx_app_protect_configure option to determine if the default security policy will be written to the target host
108115
# Used when `nginx_app_protect_configure: true`.
109116
nginx_app_protect_security_policy_template_enable: true

defaults/main.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,23 @@ nginx_app_protect_delete_license: true
2828
# Otherwise, it will source packages from CentOS' repositories.
2929
nginx_app_protect_use_rhel_subscription_repos: false
3030

31+
# Choose where to fetch the NGINX App Protect and Security Updates signing keys from.
32+
# Default settings are the official NGINX signing key hosts.
33+
nginx_app_protect_signing_keys:
34+
nginx_plus: https://cs.nginx.com/static/keys/nginx_signing.key
35+
app_protect: https://cs.nginx.com/static/keys/app-protect.key
36+
security_updates: https://cs.nginx.com/static/keys/app-protect-security-updates.key
37+
3138
# Start/Restart NGINX service when App Protect related changes are complete.
3239
# Default is true.
3340
nginx_app_protect_start: true
3441

35-
# Increase NGINX service timeout to accomdate ruleset loading from default 90s
42+
# Increase NGINX service timeout to accommodate ruleset loading from default 90s
3643
nginx_app_protect_timeout: 180
3744

3845
# App Protect Temporary Directory to use (Default: /tmp)
3946
nginx_app_protect_tempdir: /tmp
4047

41-
# Choose where to fetch the NGINX signing key from.
42-
# Default is the official NGINX signing key host.
43-
# nginx_app_protect_signing_key: https://cs.nginx.com/static/keys/nginx_signing.key
44-
45-
# Choose where to fetch the NGINX App Protect signing key from.
46-
# Default is the official NGINX App Protect signing key host.
47-
# nginx_app_protect_signing_key: https://cs.nginx.com/static/keys/app-protect.key
48-
4948
# populate this dictionary of lists with appropriate values from the ansible_distribution and ansible_distribution_version facts
5049
nginx_app_protect_linux_families:
5150
CentOS:

tasks/install/setup-debian-repos.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
- name: Setup Debian and Ubuntu NGINX App Protect repository
33
apt_repository:
44
repo: deb [arch=amd64] https://plus-pkgs.nginx.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus
5-
filename: nginx-plus
5+
filename: nginx-app-protect
66
update_cache: false
77
state: "{{ nginx_app_protect_license_status | default ('present') }}"
88

9-
- name: Setup Debian and Ubuntu NGINX App Protect signatures repository
9+
- name: Setup Debian and Ubuntu NGINX App Protect security updates repository
1010
apt_repository:
11-
repo: deb [arch=amd64] https://app-protect-sigs.nginx.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus
12-
filename: app-protect-sigs
11+
repo: deb [arch=amd64] https://app-protect-security-updates.nginx.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus
12+
filename: app-protect-security-updates
1313
update_cache: false
1414
state: "{{ nginx_app_protect_license_status | default ('present') }}"
1515

@@ -25,15 +25,15 @@
2525
state: "{{ nginx_app_protect_license_status | default ('present') }}"
2626
mode: 0444
2727

28-
- name: Setup NGINX App Protect signatures license
28+
- name: Setup NGINX App Protect security updates license
2929
blockinfile:
30-
path: /etc/apt/apt.conf.d/90app-protect-sigs
30+
path: /etc/apt/apt.conf.d/90app-protect-security-updates
3131
create: true
3232
block: |
33-
Acquire::https::app-protect-sigs.nginx.com::Verify-Peer "true";
34-
Acquire::https::app-protect-sigs.nginx.com::Verify-Host "true";
35-
Acquire::https::app-protect-sigs.nginx.com::SslCert "/etc/ssl/nginx/{{ nginx_app_protect_license.certificate | basename }}";
36-
Acquire::https::app-protect-sigs.nginx.com::SslKey "/etc/ssl/nginx/{{ nginx_app_protect_license.key | basename }}";
33+
Acquire::https::app-protect-security-updates.nginx.com::Verify-Peer "true";
34+
Acquire::https::app-protect-security-updates.nginx.com::Verify-Host "true";
35+
Acquire::https::app-protect-security-updates.nginx.com::SslCert "/etc/ssl/nginx/{{ nginx_app_protect_license.certificate | basename }}";
36+
Acquire::https::app-protect-security-updates.nginx.com::SslKey "/etc/ssl/nginx/{{ nginx_app_protect_license.key | basename }}";
3737
state: "{{ nginx_app_protect_license_status | default ('present') }}"
3838
mode: 0444
3939

tasks/install/setup-redhat-repos.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@
2828
sslclientkey: "/etc/ssl/nginx/{{ nginx_app_protect_license.key | basename }}"
2929
enabled: true
3030
gpgcheck: true
31-
gpgkey: https://cs.nginx.com/static/keys/app-protect.key
31+
gpgkey: "{{ nginx_app_protect_signing_keys.app_protect }}"
3232
state: "{{ nginx_app_protect_license_status | default ('present') }}"
3333

34-
- name: Setup NGINX App Protect signatures repository
34+
- name: Setup NGINX App Protect security updates repository
3535
yum_repository:
36-
name: nginx-app-protect-signatures
36+
name: nginx-app-protect-security-updates
3737
baseurl: >-
3838
https://app-protect-sigs.nginx.com/centos/{{ redhat_major_version }}/$basearch/
39-
description: NGINX App Protect Signatures Repository
39+
description: NGINX App Protect Security Updates Repository
4040
sslclientcert: "/etc/ssl/nginx/{{ nginx_app_protect_license.certificate | basename }}"
4141
sslclientkey: "/etc/ssl/nginx/{{ nginx_app_protect_license.key | basename }}"
4242
enabled: true
4343
gpgcheck: true
44-
gpgkey: https://cs.nginx.com/static/keys/app-protect.key
44+
gpgkey: "{{ nginx_app_protect_signing_keys.security_updates }}"
4545
state: "{{ nginx_app_protect_license_status | default ('present') }}"

tasks/keys/apt-key.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
---
2-
- name: Set APT NGINX signing key URL
3-
set_fact:
4-
nginx_keysite: "{{ nginx_app_protect_signing_key | default('https://cs.nginx.com/static/keys/nginx_signing.key') }}"
5-
6-
- name: Set APT NGINX App Protect signing key URL
7-
set_fact:
8-
app_protect_keysite: "{{ nginx_app_protect_signing_key | default('https://cs.nginx.com/static/keys/app-protect.key') }}"
9-
10-
- name: Add APT NGINX signing key
2+
- name: Add APT NGINX Plus signing key
113
apt_key:
12-
url: "{{ nginx_keysite }}"
4+
url: "{{ nginx_app_protect_signing_keys.nginx_plus }}"
135

146
- name: Add APT NGINX App Protect signing key
157
apt_key:
16-
url: "{{ app_protect_keysite }}"
8+
url: "{{ nginx_app_protect_signing_keys.app_protect }}"
9+
10+
- name: Add APT NGINX App Protect security updates signing key
11+
apt_key:
12+
url: "{{ nginx_app_protect_signing_keys.security_updates }}"

tasks/keys/rpm-key.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
---
2-
- name: Set default RPM NGINX signing key
3-
set_fact:
4-
nginx_keysite: "{{ nginx_app_protect_signing_key | default('https://cs.nginx.com/static/keys/nginx_signing.key') }}"
5-
6-
- name: Set default RPM NGINX App Protect signing key
7-
set_fact:
8-
app_protect_keysite: "{{ nginx_app_protect_signing_key | default('https://cs.nginx.com/static/keys/app-protect.key') }}"
2+
- name: Add RPM NGINX Plus signing key
3+
rpm_key:
4+
key: "{{ nginx_app_protect_signing_keys.nginx_plus }}"
95

10-
- name: Add RPM NGINX signing key
6+
- name: Add RPM NGINX App Protect signing key
117
rpm_key:
12-
key: "{{ nginx_keysite }}"
8+
key: "{{ nginx_app_protect_signing_keys.app_protect }}"
139

14-
- name: Add RPM NGINX signing key
10+
- name: Add RPM NGINX App Protect security updates signing key
1511
rpm_key:
16-
key: "{{ app_protect_keysite }}"
12+
key: "{{ nginx_app_protect_signing_keys.security_updates }}"

tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
include_tasks: "{{ role_path }}/tasks/install/install-app-protect.yml"
6565
tags: nginx_app_protect_install_app_protect
6666

67-
- name: Install NGINX App Protect signatures and threat campaigns
68-
include_tasks: "{{ role_path }}/tasks/install/install-signatures-threat-campaigns.yml"
67+
- name: Install NGINX App Protect security updates (signatures and threat campaigns)
68+
include_tasks: "{{ role_path }}/tasks/install/install-security-updates.yml"
6969
when:
7070
- nginx_app_protect_install_signatures | bool
7171
- nginx_app_protect_install_threat_campaigns | bool

0 commit comments

Comments
 (0)