Skip to content

Commit

Permalink
Modify rule S6505: Fix FN by mentioning standalone yarn command (#3142
Browse files Browse the repository at this point in the history
)
  • Loading branch information
petertrr authored Sep 25, 2023
1 parent ac6f02d commit fd8de68
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rules/S6505/docker/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,21 @@ for dependencies to work correctly.
Doing this will reduce the attack surface and block a well-known supply chain
attack vector.

Commands that are subject to this issue are: `npm install`, `yarn install` and `yarn`
(`yarn` without an explicit command will execute `install`).


== Sensitive Code Example

[source,docker]
[source,docker,diff-id=1,diff-type=noncompliant]
----
FROM node:latest
# Sensitive
RUN npm install
----

[source,docker]
[source,docker,diff-id=2,diff-type=noncompliant]
----
FROM node:latest
Expand All @@ -39,14 +42,14 @@ RUN yarn install

== Compliant Solution

[source,docker]
[source,docker,diff-id=1,diff-type=compliant]
----
FROM node:latest
RUN npm install --ignore-scripts
----

[source,docker]
[source,docker,diff-id=2,diff-type=compliant]
----
FROM node:latest
Expand All @@ -72,7 +75,7 @@ ifdef::env-github,rspecator-view[]

=== Highlighting

Highlight the command and the subcommand, if the latter is present.
Highlight the command and the subcommand if the latter is present.

'''

Expand Down

0 comments on commit fd8de68

Please sign in to comment.