Skip to content

Commit 383da98

Browse files
adriendupuisglyemnocon
authored
How to handle security advisories (#3278)
* Add security_advisories.md * Use security_advisories.md * Update docs/infrastructure_and_maintenance/security/security_checklist.md * install_ibexa_dxp.md: Rm Php82HideDeprecationsErrorHandler * install_ibexa_dxp.md: Why ~E_DEPRECATED * code_samples.yaml: mv to config.policy.advisories.ignore-id --------- Co-authored-by: Gunnstein Lye <289744+glye@users.noreply.github.com> Co-authored-by: Marek Nocoń <mnocon@users.noreply.github.com>
1 parent 0336dff commit 383da98

6 files changed

Lines changed: 149 additions & 77 deletions

File tree

.github/workflows/code_samples.yaml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,39 +49,40 @@ jobs:
4949
- name: Ignore audit advisory for PHP 7.4
5050
if: matrix.php == '7.4'
5151
run: |
52-
composer config audit.ignore --json '{
52+
composer config policy.advisories.ignore-id --json '{
5353
"GHSA-68jq-c3rv-pcrr": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
5454
"GHSA-fc86-6rv6-2jpm": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
5555
"GHSA-r7cg-qjjm-xhqq": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
56-
"PKSA-5k7f-wvjj-jrgw": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
57-
"PKSA-sjvz-tbbr-vwth": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
58-
"PKSA-h8hf-ytnd-5t9q": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
59-
"PKSA-wwb1-81rc-pd65": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
60-
"PKSA-hgmw-wn4d-hpcy": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
61-
"PKSA-kvv6-36cr-fkzb": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
62-
"PKSA-n14z-jjjg-g8vd": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
63-
"PKSA-3mcc-k66d-pydb": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
64-
"PKSA-gw7n-z4yx-7xjt": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
65-
"PKSA-dpx1-78wg-1kqs": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
56+
"PKSA-1tmc-rt7x-12w6": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
6657
"PKSA-21g2-dzjv-sky5": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
67-
"PKSA-yhcn-xrg3-68b1": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
58+
"PKSA-2rbx-bjdx-4d4d": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
6859
"PKSA-2wrf-1xmk-1pky": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
60+
"PKSA-3mcc-k66d-pydb": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
61+
"PKSA-5k7f-wvjj-jrgw": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
6962
"PKSA-6319-ffpf-gx66": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
70-
"PKSA-n7sg-8f52-pqtf": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
7163
"PKSA-8kk8-h2xr-h5nx": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
72-
"PKSA-2rbx-bjdx-4d4d": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
73-
"PKSA-fs5b-x5k4-1h39": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
64+
"PKSA-8zx5-v2nz-58pb": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
65+
"PKSA-dpx1-78wg-1kqs": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
7466
"PKSA-fbvq-z33h-r2np": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
67+
"PKSA-fs5b-x5k4-1h39": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
7568
"PKSA-g9zw-qxh8-pq8w": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
69+
"PKSA-gw7n-z4yx-7xjt": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
70+
"PKSA-h8hf-ytnd-5t9q": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
71+
"PKSA-hgmw-wn4d-hpcy": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
72+
"PKSA-kvv6-36cr-fkzb": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
73+
"PKSA-n14z-jjjg-g8vd": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
74+
"PKSA-n7sg-8f52-pqtf": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
75+
"PKSA-sjvz-tbbr-vwth": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
76+
"PKSA-wwb1-81rc-pd65": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
77+
"PKSA-xx6c-6d96-db2w": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
7678
"PKSA-yd6k-t2gh-1m43": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
77-
"PKSA-1tmc-rt7x-12w6": "As this is for code quality tests and not to run a production DXP, this can be ignored.",
78-
"PKSA-xx6c-6d96-db2w": "As this is for code quality tests and not to run a production DXP, this can be ignored."
79+
"PKSA-yhcn-xrg3-68b1": "As this is for code quality tests and not to run a production DXP, this can be ignored."
7980
}'
8081
8182
- name: Ignore audit advisory for PHP 8.2
8283
if: matrix.php == '8.2'
8384
run: |
84-
composer config audit.ignore --json '{
85+
composer config policy.advisories.ignore-id --json '{
8586
"PKSA-fs5b-x5k4-1h39": "As this is for code quality tests and not to run a production DXP, this can be ignored."
8687
}'
8788

docs/getting_started/install_ibexa_dxp.md

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ month_change: true
1313

1414
!!! note "Installing [[= product_name_oss =]]"
1515

16-
This installation guide shows in details how to install [[= product_name =]] for users who have a subscription agreement with [[= product_name_base =]].
16+
This installation guide shows in detail how to install [[= product_name =]] for users who have a subscription agreement with [[= product_name_base =]].
1717
If you want to install [[= product_name_oss =]], you don't need authentication tokens or an account on updates.ibexa.co, but must adapt the steps shown here to the product edition and the `ibexa/oss-skeleton` repository.
1818

1919
## Prepare work environment
@@ -29,7 +29,7 @@ Additional requirements:
2929

3030
For production, you need to [configure an HTTP server](#configure-an-http-server), Apache or nginx (Apache is used as an example below).
3131

32-
Before getting started, make sure you review other [requirements](requirements.md) to see the systems that is supported and used for testing.
32+
Before getting started, make sure you review other [requirements](requirements.md) to see the systems that are supported and used for testing.
3333

3434
### Get Composer
3535

@@ -68,12 +68,12 @@ Log in to your Service portal on [support.ibexa.co](https://support.ibexa.co/),
6868
1. Select **Create token** (this requires the **Portal administrator** access level).
6969
2. Fill in a label describing the use of the token.
7070
This allows you to revoke access later.
71-
3. Save the password, **you aren't able to access it again**.
71+
3. Save the password. **You won't be able to access it again**.
7272

7373
!!! tip "Save the authentication token in `auth.json` to avoid re-typing it"
7474

7575
Composer asks whether you want to save the token every time you perform an update.
76-
If you prefer, you can decline and create an `auth.json` file globally in [`COMPOSER_HOME`](https://getcomposer.org/doc/03-cli.md#composer-home) directory for machine-wide use:
76+
If you prefer, you can decline and create an `auth.json` file globally in the [`COMPOSER_HOME`](https://getcomposer.org/doc/03-cli.md#composer-home) directory for machine-wide use:
7777

7878
``` bash
7979
composer config --global http-basic.updates.ibexa.co <installation-key> <token-password>
@@ -164,7 +164,11 @@ To use Composer to instantly create a project in the current folder with all the
164164

165165
<a id="authentication-token"></a>If you added credentials to the `COMPOSER_AUTH` variable, at this point add this variable to `auth.json` (for example, by running `echo $COMPOSER_AUTH > auth.json`).
166166

167-
!!! tip
167+
!!! caution "Security advisories"
168+
169+
If you encounter security advisories that prevent the install, see [Package security advisories](security_advisories.md#package-security-advisories).
170+
171+
!!! tip "Version constraint"
168172

169173
You can set [different version constraints](https://getcomposer.org/doc/articles/versions.md), for example, specific tag (`[[= latest_tag_4_6 =]]`), version range (`~4.6.10`), or stability (`^4.6@rc`):
170174

@@ -193,7 +197,7 @@ git init; git add . > /dev/null; git commit -m "init" > /dev/null
193197

194198
### Change installation parameters
195199

196-
At this point configure your database via the `DATABASE_URL` in the `.env` file, depending of the database you're using:
200+
At this point, configure your database via the `DATABASE_URL` in the `.env` file, depending on the database you're using:
197201

198202
`DATABASE_URL=mysql://user:password@host:port/database_name`.
199203

@@ -217,7 +221,7 @@ It's used by Symfony when generating [CSRF tokens]([[= symfony_doc =]]/security/
217221

218222
The app secret is crucial to the security of your installation.
219223
Be careful about how you generate it, and how you store it.
220-
Here's one way to generate a 64 characters long, secure random string as your secret, from command line:
224+
Here's one way to generate a secure random string of 64 characters as your secret, from the command line:
221225

222226
``` bash
223227
php -r "print bin2hex(random_bytes(32));"
@@ -227,13 +231,13 @@ It's used by Symfony when generating [CSRF tokens]([[= symfony_doc =]]/security/
227231
If you have any suspicion that the secret may have been exposed, replace it with a new one.
228232
The same goes for other secrets, like database password, Varnish invalidate token, JWT passphrase, and more.
229233

230-
After changing the app secret, make sure that you clear the application cache and log out all the users.
234+
After changing the app secret, make sure that you clear the application cache and log out all users.
231235

232236
For more information, see [Symfony documentation]([[= symfony_doc =]]/reference/configuration/framework.html#secret).
233237

234-
It's recommended to store the database credentials in your `.env.local` file and not commit it to the Version Control System.
238+
It's recommended that you store the database credentials in your `.env.local` file, and not commit that file to the Version Control System.
235239

236-
In `DATABASE_VERSION` you can also configure the database server version (for a MariaDB database, prefix the value with `mariadb-`).
240+
In `DATABASE_VERSION`, you can also configure the database server version (for a MariaDB database, prefix the value with `mariadb-`).
237241

238242
!!! tip "Using PostgreSQL"
239243

@@ -267,12 +271,23 @@ You may choose to replace the [default search engine](legacy_search_overview.md)
267271

268272
Install [[= product_name =]] and create a database with:
269273

270-
``` bash
271-
php bin/console ibexa:install
272-
php bin/console ibexa:graphql:generate-schema
273-
```
274+
=== "PHP 8.4"
275+
276+
Deprecation warnings must be suppressed when using PHP 8.4, otherwise the installation fails due to errors such as "headers have already been sent".
277+
278+
``` bash
279+
php -d error_reporting=`php -r 'echo E_ALL & ~E_DEPRECATED;'` bin/console ibexa:install
280+
php bin/console ibexa:graphql:generate-schema
281+
```
282+
283+
=== "PHP 8.3 and older"
284+
285+
``` bash
286+
php bin/console ibexa:install
287+
php bin/console ibexa:graphql:generate-schema
288+
```
274289

275-
Before executing the command make sure that the database user has sufficient permissions.
290+
Before executing the command, make sure that the database user has sufficient permissions.
276291

277292
### Run post-installation script
278293

@@ -290,7 +305,7 @@ For development you can use the built-in PHP server.
290305
php -S 127.0.0.1:8000 -t public
291306
```
292307

293-
Your PHP web server is accessible at `http://127.0.0.1:8000`
308+
Your PHP web server is accessible at `http://127.0.0.1:8000`.
294309

295310
You can also use [Symfony CLI](https://symfony.com/download):
296311

@@ -300,7 +315,7 @@ symfony serve
300315

301316
## Prepare installation for development
302317

303-
Consider adding the Symfony DebugBundle which fixes memory outage when dumping objects with circular references.
318+
Consider adding the Symfony DebugBundle, which prevents running out of memory when dumping objects with circular references.
304319
The DebugBundle contains the [VarDumper]([[= symfony_doc =]]/components/var_dumper.html) and [its Twig integration]([[= symfony_doc =]]/components/var_dumper.html#debugbundle-and-twig-integration).
305320

306321
``` bash
@@ -313,7 +328,7 @@ For detailed information about request treatment, you can also install [Symfony
313328
composer require --dev symfony/profiler-pack
314329
```
315330

316-
To get both features in one go use:
331+
To get both features in one go, use:
317332

318333
``` bash
319334
composer require --dev symfony/debug-pack
@@ -325,7 +340,7 @@ To use [[= product_name =]] with an HTTP server, you need to [set up directory p
325340

326341
### Set up permissions
327342

328-
For development needs, the web user can be made the owner of all your files (for example with the `www-data` web user):
343+
For development needs, the web user can be made the owner of all your files (for example, with the `www-data` web user):
329344

330345
``` bash
331346
chown -R www-data:www-data <your installation directory>
@@ -336,7 +351,7 @@ Future files and directories created by these two users need to inherit those pe
336351

337352
!!! caution
338353

339-
For security reasons, in production, the web server cannot have write access to other directories than `var`.
354+
For security reasons, in production, the web server mustn't have write access to any directory other than `var`.
340355
Skip the step above and follow the link below for production needs instead.
341356

342357
You must also make sure that the web server cannot interpret the files in the `var` directory through PHP.
@@ -370,18 +385,18 @@ Prepare a [virtual host configuration](https://en.wikipedia.org/wiki/Virtual_hos
370385

371386
Finally, restart the Apache server.
372387
The command may vary depending on your Linux distribution.
373-
For example, on Ubuntu use:
388+
For example, on Ubuntu, use:
374389

375390
``` bash
376391
service apache2 restart
377392
```
378393

379394
=== "nginx"
380395

381-
You can use [this example vhost file](https://raw.githubusercontent.com/ibexa/post-install/main/resources/templates/nginx/vhost.template) and modify it to fit your project. You also need the `ibexa_params.d` files that should reside in a subdirectory below where the main file is, [as is shown here](https://github.com/ibexa/post-install/tree/main/resources/templates/nginx).
396+
You can use [this example vhost file](https://raw.githubusercontent.com/ibexa/post-install/main/resources/templates/nginx/vhost.template) and modify it to fit your project. You also need the `ibexa_params.d` files, which should reside in a subdirectory below the main file, [as shown here](https://github.com/ibexa/post-install/tree/main/resources/templates/nginx).
382397

383398
Specify `/<your installation directory>/public` as the `root`, or ensure `BASEDIR` is set in the environment.
384-
Ensure `APP_ENV` is set to `prod` or `dev` in the environment, depending on the environment that you're configuring, and uncomment the line that starts with `#if[APP_ENV`.
399+
Ensure `APP_ENV` is set to `prod` or `dev` in the environment, depending on which environment you're configuring, and uncomment the line that starts with `#if [APP_ENV]`.
385400

386401
When the virtual host file is ready, enable the virtual host and disable the default.
387402
Finally, restart the nginx server.

0 commit comments

Comments
 (0)