Skip to content

Changed the directory structure for certificates for Platform #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f19644a
TLS enabled for mongodb
mazam32-itential Jul 2, 2025
e2c991b
TLS enabled flag should be false by default
mazam32-itential Jul 2, 2025
19d0f76
Removed hosts.yaml from .gitignore
mazam32-itential Jul 2, 2025
2740762
Making sure no certificates and keys are uploaded to github
mazam32-itential Jul 3, 2025
1dc2aa3
Deployer now initializes platform with TLS enabled
mazam32-itential Jul 7, 2025
e97dd49
Merge branch 'itential:main' into main
mazam32-itential Jul 8, 2025
88a47a8
Code review changes
mazam32-itential Jul 8, 2025
52ca84b
Directories rearranged
mazam32-itential Jul 8, 2025
14499ac
Linting error fixed
mazam32-itential Jul 8, 2025
4b79752
resolved conflict
mazam32-itential Jul 8, 2025
2f418b7
platform_redis_tls_enabled ranmed to platform_redis_tls
mazam32-itential Jul 9, 2025
aa5a261
Merge pull request #1 from mazam32-itential/redis-name-relabelling
mazam32-itential Jul 9, 2025
2170bfc
Node changes reverted
mazam32-itential Jul 9, 2025
0fbb7cf
Merge pull request #2 from mazam32-itential/redis-name-relabelling
mazam32-itential Jul 9, 2025
0dd1486
Merge branch 'itential:main' into main
mazam32-itential Jul 11, 2025
2e4e558
Merge branch 'itential:main' into main
mazam32-itential Jul 11, 2025
e326028
Merge branch 'main' into gateway-TLS
mazam32-itential Jul 11, 2025
5a16ee9
Code review changes
mazam32-itential Jul 14, 2025
96d0986
code review changes
mazam32-itential Jul 15, 2025
c4dd42f
Merge branch 'itential:main' into main
mazam32-itential Jul 15, 2025
3ea68e1
Merge branch 'main' into gateway-TLS
mazam32-itential Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
**/*.gz
**/*.pem
**/*.log
**/*.keep
**/*.keep
4 changes: 2 additions & 2 deletions roles/platform/defaults/main/webserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ platform_webserver_https_enabled: false
platform_webserver_https_port: 3443

# The path to the public key file used for HTTPS connections.
platform_webserver_https_key: /opt/itential/platform/server/keys/key.pem
platform_webserver_https_key: "{{ platform_tls_dir }}/private/server.key"

# The passphrase for the private key used to enable TLS sessions.
platform_webserver_https_passphrase:

# The path to the certificate file used for HTTPS connections.
platform_webserver_https_cert: /opt/itential/platform/server/keys/cert.pem
platform_webserver_https_cert: "{{ platform_tls_dir }}/certs/server.crt"

# The set of allowed SSL/TLS protocol versions.
platform_webserver_https_secure_protocol: TLSv1_2_method
Expand Down
43 changes: 27 additions & 16 deletions roles/platform/tasks/copy-certs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,45 @@
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
---

# TODO: Do we want to continue to support copying the cert?
# Should the cert/key be copied to /etc/ssl?
- name: Ensure the private directory exists
ansible.builtin.file:
path: "{{ platform_tls_dir }}/private"
state: directory
owner: root
group: itential
mode: '0750'

- name: Ensure the certs directory exists
ansible.builtin.file:
path: "{{ platform_tls_dir }}/certs"
state: directory
owner: root
group: root
mode: '0755'

- name: Put the HTTPS key file in the correct location
ansible.builtin.copy:
remote_src: true
src: "{{ platform_install_dir }}/keys/key.pem"
dest: "{{ platform_install_dir }}/keys/itential.key"
mode: "0400"
owner: "{{ platform_user }}"
group: "{{ platform_group }}"
src: "{{ platform_keyfile_source }}"
dest: "{{ platform_webserver_https_key }}"
mode: "0640"
owner: root
group: itential

- name: Put the HTTPS cert file in the correct location
ansible.builtin.copy:
remote_src: true
src: "{{ platform_install_dir }}/keys/cert.pem"
dest: "{{ platform_install_dir }}/keys/itential.cert"
mode: "0400"
owner: "{{ platform_user }}"
group: "{{ platform_group }}"
src: "{{ platform_certfile_source }}"
dest: "{{ platform_webserver_https_cert }}"
mode: "0644"
owner: root
group: root

- name: Copy MongoDB root CA file to the appropriate location
ansible.builtin.copy:
src: "{{ platform_mongodb_root_ca_file_source }}"
dest: "{{ platform_mongodb_root_ca_file_destination }}"
mode: "0400"
group: "{{ platform_group }}"
owner: "{{ platform_user }}"
group: "{{ platform_group }}"
when:
- mongodb_tls_enabled | bool
- platform_mongo_tls_enabled | bool
- platform_mongodb_root_ca_file_source is defined
13 changes: 6 additions & 7 deletions roles/platform/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,12 @@
ansible.builtin.include_tasks:
file: configure-vault.yml

# TODO: Re-work the copy certs tasks
# - name: Copy certs
# tags: copy_certs
# block:
# - name: Copy certs
# ansible.builtin.include_tasks:
# file: copy-certs.yml
- name: Copy certs
tags: copy_certs
block:
- name: Copy certs
ansible.builtin.include_tasks:
file: copy-certs.yml

- name: Configure Platform
tags: configure_platform
Expand Down
1 change: 1 addition & 0 deletions roles/platform/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ platform_root_dir: /opt/itential/platform
platform_install_dir: "{{ platform_root_dir }}/server"
platform_service_dir: "{{ platform_root_dir }}/services"
platform_config_dir: /etc/itential
platform_tls_dir: /etc/ssl/itential-platform
Loading