A how-to for suppressing vulnerability notifications inline and by using an .amplifyignore file.
.amplifyignore
file.
@amplify-ignore
. For example:
@amplify-ignore
code comment must be made on the vulnerable line as reported by Amplify.
Commenting on the lines above or below the vulnerable line will not currently ignore the vulnerability..amplifyignore
file.amplifyignore
file to ignore vulnerabilities, first create a file in the root of your project directly named .amplifyignore
.
This file mostly follows the familiar syntax of the well-known .gitignore
file, for which the specification can be found in the Git documentation.
The below section, Pattern Format, is for the most part verbatim to the Git documentation, but has been updated to reflect the .amplifyignore
filename and omit patterns which reference relative paths, as Amplify only supports a .amplifyignore
file in the root of the project.
\
”) in front of the first hash for patterns that begin with a hash.\
”).!
” which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined. Put a backslash (“\
”) in front of the first “!
” for patterns that begin with a literal “!
”, for example, “\!important!.txt
”./
” is used as the directory separator. Separators may occur at the beginning, middle or end of the .amplifyignore
search pattern.doc/frotz/
matches doc/frotz
directory, but not a/doc/frotz
directory; however frotz/
matches frotz
and a/frotz
that is a directory (all paths are relative from the .amplifyignore
file).*
” matches anything except a slash. The character “?
” matches any one character except “/
”. The range notation, e.g. [a-zA-Z]
, can be used to match one of the characters in a range.**
”) in patterns matched against full pathname may have special meaning:
*
” followed by a slash means match in all directories. For example, “*/foo
” matches file or directory “foo
” anywhere, the same as pattern “foo
”. “*/foo/bar
” matches file or directory “bar
” anywhere that is directly under directory “foo
”./**
” matches everything inside. For example, “abc/**
” matches all files inside directory “abc
”, relative to the location of the .gitignore
file, with infinite depth.a/**/b
” matches “a/b
”, “a/x/b
”, “a/x/y/b
” and so on.