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

Remove package-lock.json files when building artefacts #4341

Closed
siliconmeadow opened this issue Feb 10, 2021 · 3 comments · Fixed by #4344
Closed

Remove package-lock.json files when building artefacts #4341

siliconmeadow opened this issue Feb 10, 2021 · 3 comments · Fixed by #4344
Labels
Enhancement A feature or feature request

Comments

@siliconmeadow
Copy link
Contributor

Is your feature request related to a problem? Please describe.
A client has recently used Detectify to scan for vulnerabilities on their site and asked us to address the package-lock.json file present at https://client-site.dom/themes/custom/client-theme/package-lock.json.

Describe the solution you'd like
Since blt deploy does such a good job clearing out the node_modules directory when creating the build artefact, it would seems like it would be also handy to ensure any package-lock.json files were not present in the build artefact too. No?

Describe alternatives you've considered
We could address that by adding a .htaccess file to the theme directory to hide the file.

Additional context
Perhaps it is something which has been addressed in blt/blt.yml already and I just don't see it. If it's there, please put me out of my misery and I'm sorry for creating this ticket.

@siliconmeadow siliconmeadow added the Enhancement A feature or feature request label Feb 10, 2021
@danepowell
Copy link
Contributor

Since blt deploy does such a good job clearing out the node_modules directory when creating the build artefact

This statement could be interpreted incorrectly, so just to clarify: BLT does clear out node_modules when initializing the artifact, but it then runs the frontend install hooks that are expected to repopulate the node_modules directory with any production dependencies (i.e. frontend libraries).

If it excluded package-lock.json as part of the same rsync step, then the frontend install hooks would fail.

The proper way to fix this is by adding package-lock.json to your deploy .gitignore. I'd accept a PR for this as well.

More details on how to customize the build process, including the deploy .gitignore: https://docs.acquia.com/blt/extending-blt/#modifying-the-build-artifact

@danepowell danepowell added the Awaiting response Maintainer needs more info label Feb 10, 2021
@siliconmeadow
Copy link
Contributor Author

image

@no-response no-response bot removed the Awaiting response Maintainer needs more info label Feb 11, 2021
@siliconmeadow siliconmeadow reopened this Feb 11, 2021
@siliconmeadow
Copy link
Contributor Author

I closed this and then re-opened only minutes later after reading this:

https://www.bleepingcomputer.com/news/security/researcher-hacks-over-35-tech-firms-in-novel-supply-chain-attack/

siliconmeadow pushed a commit to siliconmeadow/blt that referenced this issue Feb 11, 2021
siliconmeadow pushed a commit to siliconmeadow/blt that referenced this issue Feb 11, 2021
danepowell pushed a commit that referenced this issue Feb 11, 2021
…default. (#4343)

* Removed sensiolabs/security-checker.

* Fixes #4341: package.json and package-lock.json files not rsynced by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants