Skip to content

Commit 1b0ca59

Browse files
kanwalpreetdclaude
andcommitted
Add Socket Basics security scanning workflow
Runs SAST through OpenGrep, secret scanning through TruffleHog, and Dockerfile misconfiguration scanning through Trivy, submitting results to Socket.dev. .github/workflows/socket-basics.yml scheduled weekly + manual dispatch .socket-basics.json scanner configuration .semgrepignore SAST path exclusions .trivyignore Dockerfile lint rules with no security dimension (only present where the repo has a Dockerfile) Separate from socket-scan.yml, which covers dependency CVEs and Tier 1 reachability. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 2b72363 commit 1b0ca59

3 files changed

Lines changed: 173 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Socket Basics security scan for stellar-cli.
2+
# Upstream: https://github.com/SocketDev/socket-basics
3+
# Scanner settings live in .socket-basics.json; SAST path exclusions live in
4+
# .semgrepignore.
5+
#
6+
# This workflow does SAST through OpenGrep and secret scanning through
7+
# TruffleHog, and submits results to Socket.dev
8+
9+
name: Socket Basics security scan
10+
11+
on:
12+
workflow_dispatch:
13+
schedule:
14+
- cron: "26 14 * * 6"
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
socket-basics:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 30
23+
steps:
24+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
25+
with:
26+
# Remove the GitHub token from the workspace after checkout, so it is
27+
# not mounted into the Socket Basics container, which doesn't need it.
28+
persist-credentials: false
29+
30+
- name: Run Socket Basics
31+
env:
32+
SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_TOKEN }}
33+
SOCKET_ORG: stellar
34+
run: |
35+
# Socket Basics is pinned by digest since rule tuning is calibrated
36+
# to the exact ruleset contained in this image. Automatic updates
37+
# could introduce new rules and a sudden increase in false
38+
# positives, as these tools are generally noisy without tuning.
39+
docker run --rm \
40+
-v "$PWD:/github/workspace" \
41+
-w /github/workspace \
42+
-e SOCKET_SECURITY_API_TOKEN \
43+
-e SOCKET_ORG \
44+
-e GITHUB_REPOSITORY \
45+
-e GITHUB_REF_NAME \
46+
-e GITHUB_SHA \
47+
ghcr.io/socketdev/socket-basics@sha256:d463bae84f21d0240d5e197acb81e95144a966a20ab7cd05cca3a70e1796a4bb \
48+
--config .socket-basics.json

‎.semgrepignore‎

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# This file excludes scan paths from Socket Basics SAST scanning (through OpenGrep).
2+
# It replaces the built-in ignore list for scanning with a more thorough list of paths.
3+
4+
# --- third-party / generated ---
5+
.git/
6+
node_modules/
7+
vendor/
8+
third_party/
9+
thirdparty/
10+
.devcontainer/
11+
dist/
12+
build/
13+
target/
14+
.venv/
15+
venv/
16+
__pycache__/
17+
.yarn/
18+
generated/
19+
*.min.js
20+
21+
# --- test / example / mock code ---
22+
__fixtures__/
23+
__mocks__/
24+
__snapshots__/
25+
__tests__/
26+
acceptance-test/
27+
acceptance-tests/
28+
acceptance_test/
29+
acceptance_tests/
30+
benches/
31+
browser-test/
32+
browser-tests/
33+
browser_test/
34+
browser_tests/
35+
e2e/
36+
e2e-test/
37+
e2e-tests/
38+
e2e_test/
39+
e2e_tests/
40+
example/
41+
examples/
42+
fixtures/
43+
functional-test/
44+
functional-tests/
45+
functional_test/
46+
functional_tests/
47+
integration-test/
48+
integration-tests/
49+
integration_test/
50+
integration_tests/
51+
integrationtest/
52+
integrationtests/
53+
mock/
54+
mock-dapp/
55+
mocks/
56+
perf-test/
57+
perf-tests/
58+
perf_test/
59+
perf_tests/
60+
performance-test/
61+
performance-tests/
62+
performance_test/
63+
performance_tests/
64+
regression-test/
65+
regression-tests/
66+
regression_test/
67+
regression_tests/
68+
smoke-test/
69+
smoke-tests/
70+
smoke_test/
71+
smoke_tests/
72+
spec/
73+
specs/
74+
test/
75+
test-data/
76+
test-fixtures/
77+
testFixtures/
78+
testdata/
79+
testfixtures/
80+
tests/
81+
unit-test/
82+
unit-tests/
83+
unit_test/
84+
unit_tests/
85+
*.test.js
86+
*.test.jsx
87+
*.test.ts
88+
*.test.tsx
89+
*.test.mjs
90+
*.spec.js
91+
*.spec.jsx
92+
*.spec.ts
93+
*.spec.tsx
94+
*_test.go
95+
*_test.py
96+
*_test.rb
97+
*_test.exs
98+
test_*.py
99+
*Test.java
100+
*Tests.java
101+
*Test.kt
102+
*Tests.kt
103+
*Test.scala
104+
*Test.cs
105+
*Tests.cs
106+
tests.rs
107+
test.rs
108+
109+
# --- repo-specific third-party (PER_REPO_VENDORED +
110+
# git submodules); the generic patterns above cannot know these ---
111+
soroban-test/
112+
ts-tests/

‎.socket-basics.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"workspace": ".",
3+
"javascript_sast_enabled": true,
4+
"ruby_sast_enabled": true,
5+
"rust_sast_enabled": true,
6+
"rust_disabled_rules": "rust-env-injection,rust-panic-in-production,rust-sql-injection",
7+
"sast_ignore_overrides": "rust-hardcoded-secrets:cmd/crates/stellar-ledger/src/lib.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/commands/container/shared.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/commands/contract/upload.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/commands/keys/add.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/commands/keys/fund.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/commands/keys/public_key.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/commands/message/sign.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/commands/message/verify.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/commands/tx/new/clawback_claimable_balance.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/config/address.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/config/key.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/config/locator.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/config/secret.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/signer/mod.rs,rust-command-injection:cmd/soroban-cli/src/commands/doctor.rs,rust-integer-overflow:cmd/soroban-cli/src/commands/tx/fetch/fee.rs,rust-memory-safety:cmd/crates/soroban-spec-tools/src/contract.rs,rust-memory-safety:cmd/soroban-cli/src/assembled.rs,rust-memory-safety:cmd/soroban-cli/src/commands/contract/arg_parsing.rs,rust-memory-safety:cmd/soroban-cli/src/tx.rs,rust-path-traversal:cmd/crates/soroban-spec-typescript/src/boilerplate.rs,rust-path-traversal:cmd/crates/stellar-ledger/src/emulator_test_support/speculos.rs,rust-path-traversal:cmd/soroban-cli/src/cli.rs,rust-path-traversal:cmd/soroban-cli/src/commands/contract/build.rs,rust-path-traversal:cmd/soroban-cli/src/commands/contract/init.rs,rust-serde-security:cmd/soroban-cli/src/commands/contract/arg_parsing.rs,rust-serde-security:cmd/soroban-cli/src/commands/token/decimals.rs,rust-serde-security:cmd/soroban-cli/src/commands/token/name.rs,rust-serde-security:cmd/soroban-cli/src/commands/token/symbol.rs,rust-unsafe-usage:cmd/soroban-cli/src/commands/contract/invoke.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/config/network.rs,rust-hardcoded-secrets:cmd/soroban-cli/src/utils.rs",
8+
"secret_scanning_enabled": true,
9+
"console_tabular_enabled": true,
10+
"socket_tier_1_enabled": false,
11+
"trivy_vuln_enabled": false,
12+
"trufflehog_exclude_dir": "node_modules,dist,build,vendor,target,.git,yarn.lock,package-lock.json,pnpm-lock.yaml,Cargo.lock,go.sum,poetry.lock,Gemfile.lock,composer.lock,cmd/soroban-cli/src/commands/network/ls.rs,cmd/soroban-cli/src/config/data.rs,cmd/soroban-cli/src/config/network.rs,cmd/soroban-cli/src/utils.rs,soroban-test,ts-tests"
13+
}

0 commit comments

Comments
 (0)