summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2017-12-11 18:23:11 +0100
committerAchilleas Pipinellis <axil@gitlab.com>2017-12-12 17:35:08 +0100
commit971584513ce4ec44563dbe1a47567c4da8e47105 (patch)
treed9ca913171f6f81cab2d2fc1681e1dc93df46997
parent2cbfc992c9005ed193b2d547a5537313dbf2ca0e (diff)
downloadgitlab-ce-971584513ce4ec44563dbe1a47567c4da8e47105.tar.gz
Add SAST docs
-rw-r--r--doc/ci/examples/README.md4
-rw-r--r--doc/ci/examples/sast.md49
-rw-r--r--doc/topics/autodevops/index.md14
3 files changed, 67 insertions, 0 deletions
diff --git a/doc/ci/examples/README.md b/doc/ci/examples/README.md
index d05b4db953a..a2a96c4b812 100644
--- a/doc/ci/examples/README.md
+++ b/doc/ci/examples/README.md
@@ -58,6 +58,10 @@ Apart from those, here is an collection of tutorials and guides on setting up yo
- [Analyze code quality with the Code Climate CLI](code_climate.md)
+### Static Application Security Testing (SAST)
+
+- [Scan your code for vulnerabilities](sast.md)
+
### Other
- [Using `dpl` as deployment tool](deployment/README.md)
diff --git a/doc/ci/examples/sast.md b/doc/ci/examples/sast.md
new file mode 100644
index 00000000000..43c0a6823a5
--- /dev/null
+++ b/doc/ci/examples/sast.md
@@ -0,0 +1,49 @@
+# Static application security testing with GitLab CI/CD
+
+This example shows how to run
+[static application security testing](https://en.wikipedia.org/wiki/Static_program_analysis)
+on your project's source code by using GitLab CI/CD.
+
+All you need is a GitLab Runner with the Docker executor. You can then add a
+new job to `.gitlab-ci.yml`, called `sast`:
+
+```yaml
+sast:
+ image: registry.gitlab.com/gitlab-org/gl-sast:latest
+ script:
+ - /app/bin/run .
+ artifacts:
+ paths: [gl-sast-report.json]
+```
+
+Behind the scenes, the [gl-sast Docker image](https://gitlab.com/gitlab-org/gl-sast)
+is used to detect the language/framework and in turn runs the matching scan tool.
+
+The above example will create a `sast` job in your CI pipeline and will allow
+you to download and analyze the report artifact in JSON format.
+
+The results are sorted by the priority of the vulnerability:
+
+1. High
+1. Medium
+1. Low
+1. Unknown
+1. Everything else
+
+NOTE: **Note:**
+For GitLab [Enterprise Edition Ultimate][ee] users, this information can
+be automatically extracted and shown right in the merge request widget.
+[Learn more on application security testing results shown in merge requests](https://docs.gitlab.com/ee/user/project/merge_requests/sast.html).
+
+## Supported languages and frameworks
+
+The following languages and frameworks are supported.
+
+| Language / framework | Scan tool |
+| -------------------- | --------- |
+| JavaScript | [Retire.js](https://retirejs.github.io/retire.js)
+| Python | [bandit](https://github.com/openstack/bandit) |
+| Ruby | [bundler-audit](https://github.com/rubysec/bundler-audit) |
+| Ruby on Rails | [brakeman](https://brakemanscanner.org) |
+
+[ee]: https://about.gitlab.com/gitlab-ee/
diff --git a/doc/topics/autodevops/index.md b/doc/topics/autodevops/index.md
index d100b431721..8d1a5a5bc39 100644
--- a/doc/topics/autodevops/index.md
+++ b/doc/topics/autodevops/index.md
@@ -19,6 +19,7 @@ project in an easy and automatic way:
1. [Auto Build](#auto-build)
1. [Auto Test](#auto-test)
1. [Auto Code Quality](#auto-code-quality)
+1. [Auto SAST (Static Application Security Testing)](#auto-sast)
1. [Auto Review Apps](#auto-review-apps)
1. [Auto Deploy](#auto-deploy)
1. [Auto Monitoring](#auto-monitoring)
@@ -198,6 +199,19 @@ out. In GitLab Enterprise Edition Starter, differences between the source and
target branches are
[shown in the merge request widget](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html).
+### Auto SAST
+
+> Introduced in GitLab 10.3.
+
+Static Application Security Testing (SAST) uses the
+[gl-sast Docker image](https://gitlab.com/gitlab-org/gl-sast) to run static
+analysis on the current code and checks for potential security issues. Once the
+report is created, it's uploaded as an artifact which you can later download and
+check out.
+
+In GitLab Enterprise Edition Ultimate, any security warnings are
+[shown in the merge request widget](https://docs.gitlab.com/ee/user/project/merge_requests/sast.html).
+
### Auto Review Apps
NOTE: **Note:**