From ce568b3ea6a02d304ca463db7b27b457a0841039 Mon Sep 17 00:00:00 2001
From: "SecOps[bot]" <136828330+svc-secops@users.noreply.github.com>
Date: Tue, 30 Jan 2024 08:25:35 -0500
Subject: [PATCH] feat: SECOPS-2525 - add semgrep job (#7820)
## Motivation / Implements
This PR adds or updates the necessary configuration to enable
[Semgrep](https://semgrep.dev/docs/semgrep-code/overview/) to run on PRs
on this repo. The Apollo Security team uses Semgrep to test our source
for potential security vulnerabilities.
Once this is accepted and merged, the Security team plans to make a
passing Semgrep check a requirement for PRs to merge into this repo.
This will prevent net-new severe issues from being introduced. The job
proposed by this PR runs in a diff-aware mode, so it will only alert if
net-new issues are introduced in a branch.
In the event that a severe issue _is_ detected on a PR, the CI job will
add a comment to the PR associated with the detection to provide
instructions on how to properly resolve the detection. The comment added
to PRs will also include instructions on how to get further support if
needed.
If maintainers reviewing this PR have questions, please reach out in the
`#security` channel in Slack or contact Matt Peake directly at
`matt[.]peake@apollographql[.]com`.
## Changed
- Updated `.circleci/config.yml` to include appropriate configuration to
enable Semgrep as a CI check. These changes were programmatically
generated, so YAML formatting may have been modified to conform to the
YAML spec.
- Updated SecOps orb to latest version
---------
Co-authored-by: Matt Peake <7741049+peakematt@users.noreply.github.com>
---
.circleci/config.yml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 0d2f60c9e1c..ad05bc72a1d 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -2,7 +2,7 @@ version: 2.1
orbs:
node: circleci/node@5.0.0
- secops: apollo/circleci-secops-orb@2.0.1
+ secops: apollo/circleci-secops-orb@2.0.7
commands:
install-volta:
@@ -161,3 +161,8 @@ workflows:
- secops-oidc
git-base-revision: <<#pipeline.git.base_revision>><><>
git-revision: << pipeline.git.revision >>
+ - secops/semgrep:
+ context:
+ - secops-oidc
+ - github-orb
+ git-base-revision: <<#pipeline.git.base_revision>><><>