Skip to content
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

Docker deploy of webauthn and azuremfa #446

Merged
merged 35 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7120333
Docker deploy of webauthn and azuremfa
quartje Jan 10, 2024
9d095dc
Stepupapp: Fix permissions for image copy
quartje Jan 16, 2024
95031b3
Add option to deploy selfservice with Docker
quartje Jan 16, 2024
0bfb351
AzureMFA: Add restart handler and notifies
quartje Jan 16, 2024
aaf903d
Add docker logging to rsyslog
quartje Jan 16, 2024
34d5992
Stepup tiqr: Add docker deployment option
quartje Feb 9, 2024
a93a09e
Stepupselfservice: Add extra config parameters
quartje Feb 21, 2024
2cef1db
Stepup dockers: Fix logo location
quartje Mar 1, 2024
45d8c52
Stepuptiqr: Fix wording when running tasks meant for a vm deploy
quartje Mar 4, 2024
d754a7d
StepupazureMFA: Fix wording
quartje Mar 4, 2024
8351546
Stepupapps: Exit when deploying to a docker host when docker is not yet
quartje Mar 21, 2024
f43c01f
StepupRA: Migrate to docker
quartje Apr 3, 2024
f7f5c7a
Add fido metadata service files to webauthn
phavekes Apr 9, 2024
f740bd8
Tiqr config for new FCM API
phavekes Apr 9, 2024
014abf9
Fix tiqr Firebase service json location
phavekes Apr 9, 2024
8adf7f7
Fix casing in tiqr_firebase_credentialsfile
phavekes Apr 9, 2024
04ea3e6
Do not use tiqr_firebase_apikey when tiqr_firebase_credentialsfile is…
phavekes Apr 9, 2024
a1f39bc
tiqr_firebase_cachetokens is boolen
phavekes Apr 9, 2024
407edb3
tiqr_firebase_credentialsfile path
phavekes Apr 9, 2024
b6bedd1
File permissions for mds files
phavekes Apr 9, 2024
7479bce
Write fcm token cache in /tmp/
phavekes Apr 9, 2024
894b40a
fido mds directory permissions
phavekes Apr 10, 2024
b29a4a6
fiso mds cache directory
phavekes Apr 10, 2024
cba8898
Force download of mds and empty mds cache
phavekes Apr 11, 2024
e999130
Selfservice: Use correct host for SMTP on Docker
quartje Apr 16, 2024
372b47f
RA: Use correct logo location
quartje Apr 17, 2024
85e24d5
RA: New parameter for minimal loa
phavekes Apr 18, 2024
057a2fb
Gateway to Docker
quartje Apr 25, 2024
7ad3664
RA: Fix secret
quartje Apr 26, 2024
5f6d64d
Main playbook: Add gateway to docker deploy
quartje Apr 26, 2024
e0c943e
Gateway: Fix the logo location
quartje May 21, 2024
134ced4
Stepup tiqr: Remove whitespace in parameters.yaml
quartje Jun 10, 2024
ca3c1f1
Stepuptiqr: Remove some obsolete options from the config
quartje Jun 10, 2024
0c6a9e4
Stepupapps: Remove vm based tasks. Everything is docker now
quartje Jun 20, 2024
1e7fff9
Merge branch 'master' into feature/stepup_docker_deploy
quartje Jun 20, 2024
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
1 change: 1 addition & 0 deletions provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
- { role: stepupgateway, tags: ['stepupgateway' , 'stepup'] }
- { role: stepupselfservice, tags: ['stepupselfservice' , 'stepup'] }
- { role: stepupra , tags: ['stepupra' , 'stepup'] }
- { role: stepupgateway , tags: ['stepupgateway' , 'stepup'] }

- hosts: docker
become: true
Expand Down
2 changes: 2 additions & 0 deletions roles/rsyslog/templates/sc_ruleset.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ if $programname == "gateway" and $msg startswith ' {"message":"Intrinsic Loa Req

{% for stepupapp in stepupapps %}
:programname, isequal, "stepup-{{ stepupapp }}" { action(type="omfile" DynaFile="stepup-{{ stepupapp }}-{{item.name }}") stop }
if $programname == "{{ stepupapp }}" and $msg startswith " {{ stepupapp }}" then { action(type="omfile" DynaFile="apache-{{ stepupapp }}-{{item.name }}") stop }
:programname, isequal, "{{ stepupapp }}" { action(type="omfile" DynaFile="stepup-{{ stepupapp }}-{{item.name }}") stop }
:programname, isequal, "Apache-{{ stepupapp }}" { action(type="omfile" DynaFile="apache-{{ stepupapp }}-{{item.name }}") stop }
if $programname == "{{ stepupapp }}" and $msg startswith " {{ stepupapp }}" then { action(type="omfile" DynaFile="apache-{{ stepupapp }}-{{item.name }}") stop }
:programname, isequal, "{{ stepupapp }}" { action(type="omfile" DynaFile="stepup-{{ stepupapp }}-{{item.name }}") stop }
Expand Down
4 changes: 2 additions & 2 deletions roles/stepupapp/tasks/copyspcerts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
dest: "{{ current_release_config_file_dir_name }}/sp.key"
owner: "{{ appname}}"
group: "{{ appname }}"
mode: 400
mode: "0440"

- name: Write SP certificate | {{ appname }}
copy:
src: "{{ inventory_dir }}/files/certs/stepup/{{ appname }}_saml_sp.crt"
dest: "{{ current_release_config_file_dir_name }}/sp.crt"
group: "{{ appname }}"
mode: 400
mode: "0440"
6 changes: 6 additions & 0 deletions roles/stepupazuremfa/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@
service:
name: php72-php-fpm
state: reloaded

- name: restart azuremfa
community.docker.docker_container:
name: azuremfa
state: started
restart: true
96 changes: 56 additions & 40 deletions roles/stepupazuremfa/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,78 @@
- name: Install Apache and FPM config
include_role:
name: apachefpm
- name: Include docker vars
ansible.builtin.include_vars: docker.yml

- name: Install the symfony app
include_role:
name: stepupapp
- name: Add group {{ appname }}
ansible.builtin.group:
name: "{{ appname }}"
state: present
register: azuremfa_guid

- name: Add user {{ appname }}
ansible.builtin.user:
name: "{{ appname }}"
group: "{{ appname }}"
createhome: no
state: present
register: azuremfa_uid

- name: Create some dirs
ansible.builtin.file:
state: directory
dest: "{{ item }}"
owner: root
group: root
mode: "0755"
with_items:
- "{{ current_release_config_dir_name }}"
- "{{ current_release_appdir }}/public/images"

- name: Install images
include_role:
ansible.builtin.include_role:
name: stepupapp
tasks_from: copyimages

- name: Install the GSSP certificates
include_role:
ansible.builtin.include_role:
name: stepupapp
tasks_from: copygsspidpcerts

- name: Place parameters.yml
template:
ansible.builtin.template:
src: parameters.yaml.j2
dest: "{{ current_release_config_dir_name }}/parameters.yaml"
mode: 0640
mode: "0640"
owner: root
group: "{{ appname }}"
notify:
- clear cache {{ appname }}
- reload php72-fpm {{ appname }}
notify: restart azuremfa

- name: Put institutions.yaml from environment
template:
ansible.builtin.template:
src: "{{ inventory_dir }}/files/stepup-azuremfa/institutions.yaml.j2"
dest: "{{ current_release_config_dir_name }}/institutions.yaml"
mode: 0640
group: "{{ appname }}"
notify:
- clear cache {{ appname }}
- reload php72-fpm {{ appname }}

- name: Place .env file
template:
src: env.j2
dest: "{{ current_release_appdir }}/.env.local"
mode: 0640
mode: "0640"
owner: root
group: "{{ appname }}"
notify:
- clear cache {{ appname }}
- reload php72-fpm {{ appname }}

- name: Activate the symlink
file:
src: "{{ current_release_appdir }}/"
dest: "{{ current_release_symlink }}"
state: link
notify: restart azuremfa

- meta: flush_handlers

- name: Include post installation tasks
include_role:
name: stepupapp
tasks_from: postinstall
- name: Create the container
community.docker.docker_container:
name: "{{ appname }}"
image: ghcr.io/openconext/stepup-azuremfa/stepup-azuremfa:{{ azuremfa_version }}
pull: true
restart_policy: "always"
networks:
- name: "loadbalancer"
labels:
traefik.http.routers.azuremfa.rule: "Host(`azuremfa.{{ base_domain }}`)"
traefik.http.routers.azuremfa.tls: "true"
traefik.enable: "true"
env:
APACHE_UID: "#{{ azuremfa_uid.uid }}"
APACHE_GUID: "#{{ azuremfa_guid.gid }}"
mounts:
- source: /opt/openconext/azuremfa/public/images/header-logo.png
target: /var/www/html/public/build/images/header-logo.png
type: bind
- source: /opt/openconext/azuremfa
target: /var/www/html/config/openconext
type: bind
15 changes: 10 additions & 5 deletions roles/stepupazuremfa/templates/parameters.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
parameters:
{% if 'docker' in group_names %}
app_env: prod
app_debug: false
app_secret: {{ azuremfa_secret }}
{% endif %}
# All locales supported by the application
locales: [{{ enabled_locales | join(",") }}]

# SAML configuration
saml_idp_publickey: '{{ current_release_config_file_dir_name }}/cert.pem'
saml_idp_privatekey: '{{ current_release_config_file_dir_name }}/key.pem'
saml_idp_publickey: '{{ current_release_config_file_dir_name_in_config }}/cert.pem'
saml_idp_privatekey: '{{ current_release_config_file_dir_name_in_config }}/key.pem'
# NOTE: same key used for metadata and response/assertion signing
saml_metadata_publickey: '{{ current_release_config_file_dir_name }}/cert.pem'
saml_metadata_privatekey: '{{ current_release_config_file_dir_name }}/key.pem'
saml_metadata_publickey: '{{ current_release_config_file_dir_name_in_config }}/cert.pem'
saml_metadata_privatekey: '{{ current_release_config_file_dir_name_in_config }}/key.pem'

saml_remote_sp_entity_id: 'https://{{ gateway_vhost_name }}/gssp/azuremfa/metadata'
saml_remote_sp_certificate: '{{ current_release_config_file_dir_name }}/gateway.crt'
saml_remote_sp_certificate: '{{ current_release_config_file_dir_name_in_config }}/gateway.crt'
saml_remote_sp_acs: 'https://{{ gateway_vhost_name }}/gssp/azuremfa/consume-assertion'

# View parameters
Expand Down
4 changes: 4 additions & 0 deletions roles/stepupazuremfa/vars/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
current_release_appdir: /opt/openconext/azuremfa
current_release_config_file_dir_name: /opt/openconext/azuremfa
current_release_config_file_dir_name_in_config: /var/www/html/config/openconext
current_release_config_dir_name: /opt/openconext/azuremfa
1 change: 1 addition & 0 deletions roles/stepupazuremfa/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ stepup_gh_appname: "Azure-MFA"
current_release_symlink: "/opt/openconext/OpenConext-{{ appname }}"
current_release_appdir: "{{current_release_symlink }}-{{ appversion }}"
current_release_config_file_dir_name: "{{ current_release_appdir }}/app/files"
#current_release_config_file_dir_name_in_config: "{{ current_release_config_file_dir_name }}"
current_release_config_dir_name: "{{ current_release_appdir }}/config/packages"
gssp_idp_private_key: "{{ lookup('file', inventory_dir+'/files/certs/stepup/azuremfa_idp.key') }}"
fpmmemory: 128M
3 changes: 3 additions & 0 deletions roles/stepupgateway/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
service:
name: php72-php-fpm
state: reloaded

- name: restart gateway
command: docker restart gateway
Loading
Loading