Skip to content

Commit 2f3a550

Browse files
mingsong-huMingsong HuMingsong Hu
authored
[GOVCMSD9-160] Add required modules and default configurations (#121)
* [GOVCMSD9-160] Add required modules and default configurations * [GOVCMSD9-37] Automatically enable TFA * [GOVCMSD9-160] Move TFA configuration to test folder and import them for Tugboat testing * [GOVCMSD9-160] Correct Drush import command for Tugboat * [GOVCMSD9-160] Remove duplicated drush import command * [GOVCMSD9-160] Copy test configurations to install folder instead of partial importing * [GOVCMSD9-160] Correct the option of cp command * Copy the test configs before linking it to the web folder Co-authored-by: Mingsong Hu <mingsonghu@Mingsongs-MBP.gateway> Co-authored-by: Mingsong Hu <mingsonghu@Mingsongs-MBP-2.home>
1 parent 6f168f5 commit 2f3a550

File tree

6 files changed

+84
-1
lines changed

6 files changed

+84
-1
lines changed

.tugboat/config.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ services:
4444
# Create the Drupal private and public files directories.
4545
- mkdir -p "${TUGBOAT_ROOT}/files-private" "${DOCROOT}/sites/default/files"
4646

47+
# Copy test configurations to install folder.
48+
- cp -af "${TUGBOAT_ROOT}/config/test/." "${TUGBOAT_ROOT}/config/install/"
49+
4750
# Link the config and private files paths.
4851
- ln -snf "${TUGBOAT_ROOT}/config" "${DOCROOT}/../config"
4952
- ln -snf "${TUGBOAT_ROOT}/files-private" "${DOCROOT}/../files-private"
@@ -71,6 +74,7 @@ services:
7174
build:
7275
- COMPOSER_MEMORY_LIMIT=-1 composer update
7376
- drush cache:rebuild
74-
- drush config:import --partial -y
77+
# Partial importing is still having some issues with Druah 10 and Drupal 9.
78+
#- drush config-import --partial --source="${TUGBOAT_ROOT}/config/test" -y
7579
- drush updatedb -y
7680
- drush cache:rebuild
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
check_profile_status: true
2+
allow_deprecated_plugins: false
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
langcode: en
2+
status: true
3+
dependencies:
4+
config:
5+
- key.key.tfa_key
6+
module:
7+
- real_aes
8+
id: tfa_encryption
9+
label: 'TFA Encryption'
10+
encryption_method: real_aes
11+
encryption_key: tfa_key
12+
encryption_method_configuration: { }

config/test/key.key.tfa_key.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
langcode: en
2+
status: true
3+
dependencies: { }
4+
id: tfa_key
5+
label: 'TFA Key'
6+
description: ''
7+
key_type: encryption
8+
key_type_settings:
9+
key_size: 256
10+
key_provider: config
11+
key_provider_settings:
12+
base64_encoded: false
13+
key_value: 'UGN~?-#RfgR+wJg4Yh/Sp2~Z^wb{C^2X'
14+
key_input: text_field
15+
key_input_settings:
16+
base64_encoded: false

config/test/tfa.settings.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
enabled: 1
2+
required_roles:
3+
authenticated: authenticated
4+
govcms_content_author: '0'
5+
govcms_content_approver: '0'
6+
govcms_site_administrator: '0'
7+
send_plugins: { }
8+
login_plugins: { }
9+
default_validation_plugin: tfa_email_code
10+
validation_plugin_settings:
11+
ga_login_hotp:
12+
counter_window: 10
13+
site_name_prefix: 1
14+
name_prefix: TFA
15+
issuer: GovCMS
16+
ga_login_totp:
17+
time_skew: 2
18+
site_name_prefix: 1
19+
name_prefix: TFA
20+
issuer: GovCMS
21+
tfa_email_code:
22+
code_validity_period: 60
23+
email_setting:
24+
subject: '[site:name] Authentication code'
25+
body: "[user:display-name],\r\n\r\nThis code is valid for [length] minutes. Your code is: [code]\r\n\r\nThis code will be expired after login."
26+
tfa_recovery_code:
27+
recovery_codes_amount: 10
28+
allowed_validation_plugins:
29+
tfa_email_code: tfa_email_code
30+
help_text: 'Contact support to reset your access'
31+
validation_skip: 3
32+
encryption: tfa_encryption
33+
trust_cookie_expiration: 2592000
34+
cookie_name: TFA
35+
tfa_flood_uid_only: 1
36+
tfa_flood_window: 300
37+
tfa_flood_threshold: 6
38+
mail:
39+
tfa_enabled_configuration:
40+
subject: 'Your [site:name] account now has two-factor authentication'
41+
body: "[user:display-name],\r\n\r\nThanks for configuring two-factor authentication on your [site:name] account!\r\n\r\nThis additional level of security will help to ensure that only you are able to log in to your account.\r\n\r\nIf you ever lose the device you configured, you should act quickly to delete its association with this account.\r\n\r\n--\r\n[site:name] team"
42+
tfa_disabled_configuration:
43+
subject: 'Your [site:name] account no longer has two-factor authentication'
44+
body: "[user:display-name],\r\n\r\nTwo-factor authentication has been disabled on your [site:name] account.\r\n\r\nIf you did not take this action, please contact a site administrator immediately.\r\n\r\n--\r\n[site:name] team"

modules/custom/core/govcms_security/govcms_security.info.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ description: Enhance security of GovCMS websites.
44
package: GovCMS
55
core_version_requirement: ^8 || ^9
66
dependencies:
7+
- encrypt
8+
- ga_login
79
- honeypot:honeypot
10+
- key
811
- login_security:login_security
912
- password_policy:password_policy
1013
- password_policy:password_policy_characters
1114
- password_policy:password_policy_character_types
1215
- password_policy:password_policy_history
1316
- password_policy:password_policy_length
1417
- password_policy:password_policy_username
18+
- real_aes
1519
- seckit:seckit
20+
- tfa
1621
- update_notifications_disable:update_notifications_disable
1722
- username_enumeration_prevention:username_enumeration_prevention

0 commit comments

Comments
 (0)