Skip to content
← Back to activity

Immutable solution version

Why is GitLab CI SAST not exluding directories that I ask it to exclude?

Version 2Sign in to save

Complete solution

Why is GitLab CI SAST not exluding directories that I ask it to exclude?: Hope I'm not too late.

[Sencha23 (accepted answer)] Hope I'm not too late. I've encountered the same problem and what resolved it for me was to delete the space between the excluded paths. Your SASTEXCLUDEDPATHS variable should look like this: `` variables: SAST_EXCLUDED_PATHS: spec,test,tests,tmp,server/libs,assets,vendor,*.min.js

Context: Stack Overflow #70887133 (accepted answer, 10 votes, 2 answers): I have enabled SAST scanning in GitLab CI (GitLab Community Edition) 14.5.2. The SAST runs tools like semgrep and ESLint run over the source code and scan for vulnerabilities. This works... except it's not excluding paths and files from the results that I tell it to so my reports are filled with junk from 3rd party libs. Since I don't want test code or 3rd party stuff in the report I use the GitLab provided variable for this purpose called SASTEXCLUDEDPATHS that I use to exclude some dirs. My value is like this: ``` variables: SASTEXCLUDEDPATHS: spec, test, tests, tmp, server

Matched source

Source: Published skill Original query: "Why is GitLab CI SAST not exluding directories that I ask it to exclude?" Key terms: directories, exclude, exluding, gitlab, sast, that

Evidence

Source: Stack Overflow #70887133 (accepted answer, 10 votes, 2 answers): I have enabled SAST scanning in GitLab CI (GitLab Community Edition) 14.5.2. The SAST runs tools like semgrep and ESLint run over the source code and scan for vulnerabilities. This works... except it's not excluding paths and files from the results that I tell it to so my reports are filled with junk from 3rd party libs. Since I don't want test code or 3rd party stuff in the report I use the GitLab provided variable for this purpose called SASTEXCLUDEDPATHS that I use to exclude some dirs. My value is like this: ``` variables: SASTEXCLUDEDPATHS: spec, test, tests, tmp, server

Verified resolution: [Sencha23 (accepted answer)] Hope I'm not too late. I've encountered the same problem and what resolved it for me was to delete the space between the excluded paths. Your SASTEXCLUDEDPATHS variable should look like this: `` variables: SAST_EXCLUDED_PATHS: spec,test,tests,tmp,server/libs,assets,vendor,*.min.js

Source URL: https://stackoverflow.com/questions/70887133

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_el7KK4A6cVMxL_s_eNY1Aw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Why is GitLab CI SAST not exluding directories that I ask it to exclude? <span>— Vectle</span></a>

Why is GitLab CI SAST not exluding directories that I ask it to exclude? | Vectle