-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathshipshape.yml
264 lines (264 loc) · 7.84 KB
/
shipshape.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
checks:
file:
- name: '[FILE] Illegal files'
severity: high
path: web
disallowed-pattern: '^(adminer|phpmyadmin|bigdump)?\.php$'
- name: '[FILE] Executable files'
severity: normal
path: ./
disallowed-pattern: '.*\.(bin|deb|dmg|elf|exe|msi|sh)+$'
exclude-pattern: '^(vendor|web/core|web/modules/contrib)+.*'
- name: '[FILE] Sensitive public files'
path: web/sites/default/files
disallowed-pattern: '.*\.(sql|php|sh|py|bz2|gz|tar|tgz|zip)+$'
exclude-pattern: '.*\.(css|js)\.gz?$'
skip-dir:
- private
yaml:
- name: '[FILE] Validate install profile'
file: core.extension.yml
ignore-missing: true
path: config/default
values:
- key: profile
value: govcms
- name: '[FILE] Disallowed permissions'
severity: high
pattern: user.role.*.yml
ignore-missing: true
path: config/default
values:
- key: is_admin
value: false
truthy: true
optional: true
- key: permissions
is-list: true
optional: true
disallowed:
- administer config permissions
- administer modules
- administer permissions
- administer seckit
- administer site configuration
- administer software updates
- import configuration
- synchronize configuration
- use PHP for google analytics tracking visibility
- name: '[FILE] Disallowed permissions for anonymous role'
file: user.role.anonymous.yml
ignore-missing: true
path: config/default
values:
- key: permissions
is-list: true
optional: true
disallowed:
- 'access administration pages'
- 'access content overview'
- 'access site reports'
- 'access user profiles'
- 'administer account settings'
- 'administer blocks'
- 'administer comment types'
- 'administer comments'
- 'administer contact forms'
- 'administer content types'
- 'administer filters'
- 'administer image styles'
- 'administer menu'
- 'administer nodes'
- 'administer search'
- 'administer shortcuts'
- 'administer taxonomy'
- 'administer themes'
- 'administer url aliases'
- 'administer users'
- 'administer views'
- 'bypass node access'
- 'create url aliases'
- 'delete all revisions'
- 'revert all revisions'
- 'view all revisions'
- 'view the administration theme'
- 'view user email addresses'
- name: '[FILE] Validate TFA config'
severity: high
file: tfa.settings.yml
ignore-missing: true
path: config/default
values:
- key: enabled
value: true
truthy: true
- key: required_roles.authenticated
value: authenticated
- name: '[FILE] Ensure only admins can register accounts'
file: user.settings.yml
ignore-missing: true
path: config/default
values:
- key: register
value: admin_only
- name: '[FILE] Ensure CSS & JS aggregations are enabled'
file: system.performance.yml
ignore-missing: true
path: config/default
values:
- key: css.preprocess
value: true
truthy: true
- key: js.preprocess
value: true
truthy: true
- name: '[FILE] Ensure no error log displayed'
file: system.logging.yml
ignore-missing: true
path: config/default
values:
- key: error_level
value: hide
- name: '[FILE] Detect module files in theme folder'
pattern: '.*.info.yml'
ignore-missing: true
path: 'themes'
values:
- key: type
value: theme
drush-yaml:
- name: '[DATABASE] Validate active install profile'
command: 'config:get --include-overridden core.extension'
config-name: core.extension
values:
- key: profile
value: govcms
- name: '[DATABASE] Validate active TFA'
severity: high
command: 'config:get --include-overridden tfa.settings'
config-name: tfa.settings
values:
- key: enabled
value: true
truthy: true
- key: required_roles.authenticated
value: authenticated
- name: '[DATABASE] Ensure only admins can register accounts'
command: 'config:get --include-overridden user.settings'
config-name: user.settings
values:
- key: register
value: admin_only
- name: '[DATABASE] Ensure CSS & JS aggregations are enabled'
command: 'config:get --include-overridden system.performance'
config-name: system.performance
values:
- key: css.preprocess
value: true
truthy: true
- key: js.preprocess
value: true
truthy: true
- name: '[DATABASE] Ensure no error log displayed'
command: 'config:get --include-overridden system.logging'
config-name: user.settings
values:
- key: error_level
value: hide
drupal-file-module:
- name: '[FILE] Verify enabled modules'
severity: high
path: config/default
required:
- govcms_security
- httpav
- lagoon_logs
- tfa
disallowed:
- clamav
- dblog
- devel
- module_permissions_ui
- statistics
- update
- redirect_404
- name: '[FILE] Deprecated modules'
path: config/default
required: []
disallowed:
- redirect_404
drupal-db-module:
- name: '[DATABASE] Active modules audit'
severity: high
required:
- govcms_security
- httpav
- lagoon_logs
- tfa
disallowed:
- clamav
- dblog
- devel
- module_permissions_ui
- statistics
- update
- redirect_404
- name: '[DATABASE] Deprecated modules'
required: []
disallowed:
- redirect_404
drupal-db-permissions:
- name: '[DATABASE] Disallowed permissions on active site'
severity: high
disallowed:
- administer config permissions
- administer modules
- administer permissions
- administer seckit
- administer site configuration
- administer software updates
- import configuration
- synchronize configuration
- use PHP for google analytics tracking visibility
drupal-role-permissions:
- name: '[DATABASE] Authenticated role check'
severity: high
rid: 'authenticated'
required-permissions:
- 'setup own tfa'
drupal-admin-user:
- name: '[DATABASE] Active user roles admin check'
severity: high
drupal-user-forbidden:
- name: '[DATABASE] Active User 1 check'
yamllint:
- name: '[FILE] Yaml lint platform files'
severity: high
files:
- .lagoon.yml
- docker-compose.yml
ignore-missing: true
- name: '[FILE] Yaml lint theme files'
severity: high
path: web/themes
pattern: ".*.yml"
exclude-pattern: node_modules
ignore-missing: true
- name: '[FILE] Yaml lint theme files (no web prefix)'
severity: high
path: themes
pattern: ".*.yml"
exclude-pattern: node_modules
ignore-missing: true
phpstan:
- name: '[FILE] Banned PHP function list'
configuration: vendor/govcms/scaffold-tooling/phpstan.neon
paths:
- web/themes/custom
- themes
- name: '[FILE] Banned PHP methods and classes'
severity: low
configuration: vendor/govcms/scaffold-tooling/phpstan-extra.neon
paths:
- web/themes/custom
- themes