Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #158

Merged
merged 27 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
40dd43d
Bump reuse from 0.11.1 to 0.12.1
dependabot[bot] Dec 18, 2020
a3cf3a1
Bump dunamai from 1.5.0 to 1.5.4
dependabot[bot] Jan 21, 2021
bc748ba
Bump splunktaucclib from 4.0.12 to 4.0.13
dependabot[bot] Feb 11, 2021
51a07f0
fix: bump splunktaucclib to 4.0.13
harshilgajera-crest Feb 11, 2021
f608750
Merge pull request #103 from splunk/bump-splunktaucclib-to-v4.0.13
harshilgajera-crest Feb 11, 2021
4cccd3c
Bump pytest-splunk-addon from 1.3.12 to 1.6.0
dependabot[bot] Feb 26, 2021
b026e1f
Bump deps/build/addonfactory_test_matrix_splunk
dependabot[bot] Mar 8, 2021
88d44a6
Bump poetry-dynamic-versioning from 0.12.0 to 0.12.4
dependabot[bot] Mar 8, 2021
5688ccd
test: Added semgrep scanning tool support (#120)
arjunkhunti-crest Mar 10, 2021
ad4880d
Merge pull request #85 from splunk/dependabot/pip/reuse-0.12.1
ryanfaircloth Mar 10, 2021
0b63109
Merge pull request #101 from splunk/dependabot/pip/splunktaucclib-4.0.13
ryanfaircloth Mar 10, 2021
2de7968
Merge pull request #117 from splunk/dependabot/submodules/deps/build/…
ryanfaircloth Mar 10, 2021
79245d6
Merge pull request #91 from splunk/dependabot/pip/dunamai-1.5.4
ryanfaircloth Mar 10, 2021
be1565f
Merge pull request #118 from splunk/dependabot/pip/poetry-dynamic-ver…
ryanfaircloth Mar 10, 2021
6d58aa2
test: fix the issue with semgrep-agent
arjunkhunti-crest Mar 19, 2021
093eda5
Merge pull request #134 from splunk/test/semgrep-failure
arjunkhunti-crest Mar 23, 2021
82ff138
Bump deps/build/addonfactory_test_matrix_splunk
dependabot[bot] Mar 29, 2021
b645723
Updated to work for REST inputs from AOB
tmartin14 Mar 30, 2021
4f68a89
Delete input.template.orig
tmartin14 Mar 30, 2021
2ce054b
Added validate_input()
tmartin14 Mar 30, 2021
ffbf43a
Bump splunktaucclib from 4.0.13 to 4.1.0
dependabot[bot] Mar 31, 2021
105ced9
replaced input.template to original and added new template for helpers
tmartin14 Mar 31, 2021
81686c5
Update input.template
tmartin14 Mar 31, 2021
b11e677
Merge pull request #149 from tmartin14/main
ryanfaircloth Mar 31, 2021
25caf77
Merge pull request #147 from splunk/dependabot/pip/splunktaucclib-4.1.0
ryanfaircloth Mar 31, 2021
0e4c1c5
Merge pull request #107 from splunk/dependabot/pip/pytest-splunk-addo…
ryanfaircloth Mar 31, 2021
cd44dee
Merge pull request #144 from splunk/dependabot/submodules/deps/build/…
ryanfaircloth Mar 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,44 @@ jobs:
name: Install Tools
command: |
pip install /tmp/workspace/dist/* --use-deprecated=legacy-resolver

semgrep:
environment:
SEMGREP_REPO_URL: << pipeline.project.git_url >>
SEMGREP_BRANCH: << pipeline.git.branch >>
docker:
- image: returntocorp/semgrep-agent:v1
user: root
resource_class: large
steps:
- checkout
- run:
name: "Install Dependencies"
command: |
pip3 install --upgrade semgrep
- run:
name: "Semgrep Scan"
no_output_timeout: 2h
command: |
export SEMGREP_REPO_NAME=splunk/${CIRCLE_PROJECT_REPONAME}
python -m semgrep_agent --publish-deployment ${SEMGREP_DEPLOYMENT_ID} --publish-token ${SEMGREP_PUBLISH_TOKEN}
# Generate the Semgrep Dashboard URL
export REPO_BRANCH=$(echo "<< pipeline.git.branch >>")
DASHBOARD_URL=$(python3 -c "from urllib.parse import quote; import os; print('https://semgrep.dev/manage/findings?repo=' + quote(os.environ['SEMGREP_REPO_NAME'], safe='') + '&tab=findings&ref_type=branch&ref=' + quote(os.environ['REPO_BRANCH'], safe=''))")
echo "View Result at Semgrep Dashboard: $DASHBOARD_URL"

# Semgrep Exclude files
dos2unix .semgrepignore
SEMGREP_EXCLUDE=$(sed "/^#/d" .semgrepignore | sed "/^:/d" | sed -r '/^\s*$/d' | sed ':a;N;$!ba;s/\n/ --exclude /g')
echo "Excluding Semgrep Files: --exclude $SEMGREP_EXCLUDE"
# Generate xml file
semgrep --config="p/r2c-ci" --config="p/r2c-security-audit" --config="p/bandit" --error --strict --timeout=0 --junit-xml -o /root/project/test-results/semgrep-scan.xml --exclude $SEMGREP_EXCLUDE
- store_artifacts:
path: test-results
destination: test-results
- store_test_results:
path: test-results

release:
docker:
- image: circleci/node:12
Expand Down Expand Up @@ -124,6 +162,12 @@ workflows:
build_test:
jobs:
- build
- semgrep:
context:
- gdi-semgrep
filters:
branches:
only: /.*/
- test:
requires:
- build
Expand Down
30 changes: 30 additions & 0 deletions .semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Default semgrep ignore
# Ignore git items
.gitignore
.git/
:include .gitignore

# Common large directories
node_modules/
build/
dist/
vendor/
env/
.env/
venv/
.venv/
*.min.js

# Common test directories
test/
tests/

# Semgrep rules folder
.semgrep

## Additional files to be ignored
.circleci/
.github/
.reuse/
.vscode/
.idea/
72 changes: 54 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ reuse = "*"

[tool.poetry.dev-dependencies]
pytest = "^6.0"
pytest-splunk-addon = { version = "^1.3", extras = [ "docker" ] }
pytest-splunk-addon = { version = "^1.6", extras = [ "docker" ] }
poetry-dynamic-versioning = "^0.12"

[tool.poetry-dynamic-versioning]
Expand Down
Loading