Skip to content

Commit 8c70be3

Browse files
vintaclaude
andcommitted
Configure npm to ignore install scripts for security
Add npm config task to set ignore-scripts flag before package installation. This prevents arbitrary code execution from install scripts in dependencies. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 3543d6b commit 8c70be3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

playbooks/roles/node/tasks/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
args:
2626
executable: /bin/bash
2727

28+
- name: Configure npm
29+
shell: |
30+
export NVM_DIR="${HOME}/.nvm"
31+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
32+
npm config set ignore-scripts true
33+
args:
34+
executable: /bin/bash
35+
2836
- name: Install Node.js packages
2937
shell: |
3038
export NVM_DIR="${HOME}/.nvm"

0 commit comments

Comments
 (0)