sandstrike 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. sandstrike-1.0.0/.github/workflows/publish.yml +38 -0
  2. sandstrike-1.0.0/.gitignore +281 -0
  3. sandstrike-1.0.0/CLI_CHEATSHEET.md +445 -0
  4. sandstrike-1.0.0/CLI_TESTING_GUIDE.md +368 -0
  5. sandstrike-1.0.0/INSTALL_INSTRUCTIONS.md +189 -0
  6. sandstrike-1.0.0/LICENSE +201 -0
  7. sandstrike-1.0.0/PKG-INFO +263 -0
  8. sandstrike-1.0.0/PUBLISHING.md +137 -0
  9. sandstrike-1.0.0/README.md +220 -0
  10. sandstrike-1.0.0/REPOSITORY_STRUCTURE.md +153 -0
  11. sandstrike-1.0.0/USER_GUIDE.md +458 -0
  12. sandstrike-1.0.0/avenlis_config.yaml +75 -0
  13. sandstrike-1.0.0/pyproject.toml +146 -0
  14. sandstrike-1.0.0/requirements.txt +35 -0
  15. sandstrike-1.0.0/sandstrike/README.md +312 -0
  16. sandstrike-1.0.0/sandstrike/__init__.py +15 -0
  17. sandstrike-1.0.0/sandstrike/__main__.py +11 -0
  18. sandstrike-1.0.0/sandstrike/api.py +200 -0
  19. sandstrike-1.0.0/sandstrike/auth.py +238 -0
  20. sandstrike-1.0.0/sandstrike/cli/README.md +377 -0
  21. sandstrike-1.0.0/sandstrike/cli/__init__.py +5 -0
  22. sandstrike-1.0.0/sandstrike/cli/commands/README.md +302 -0
  23. sandstrike-1.0.0/sandstrike/cli/commands/__init__.py +7 -0
  24. sandstrike-1.0.0/sandstrike/cli/commands/auth.py +106 -0
  25. sandstrike-1.0.0/sandstrike/cli/commands/collections.py +449 -0
  26. sandstrike-1.0.0/sandstrike/cli/commands/database.py +383 -0
  27. sandstrike-1.0.0/sandstrike/cli/commands/grader.py +150 -0
  28. sandstrike-1.0.0/sandstrike/cli/commands/prompts.py +656 -0
  29. sandstrike-1.0.0/sandstrike/cli/commands/reports.py +815 -0
  30. sandstrike-1.0.0/sandstrike/cli/commands/sessions.py +309 -0
  31. sandstrike-1.0.0/sandstrike/cli/commands/targets.py +409 -0
  32. sandstrike-1.0.0/sandstrike/cli/commands/ui.py +297 -0
  33. sandstrike-1.0.0/sandstrike/cli/commands/variables.py +263 -0
  34. sandstrike-1.0.0/sandstrike/cli/main.py +78 -0
  35. sandstrike-1.0.0/sandstrike/config.py +254 -0
  36. sandstrike-1.0.0/sandstrike/data/collections.yaml +1 -0
  37. sandstrike-1.0.0/sandstrike/data/dynamic_variables.yaml +20 -0
  38. sandstrike-1.0.0/sandstrike/data/gradingIntents.yaml +35 -0
  39. sandstrike-1.0.0/sandstrike/data/prompts/sample_prompts_additional.yaml +102 -0
  40. sandstrike-1.0.0/sandstrike/data/prompts/sample_prompts_primary.yaml +102 -0
  41. sandstrike-1.0.0/sandstrike/data/sessions.json +64 -0
  42. sandstrike-1.0.0/sandstrike/data/targets.yaml +8 -0
  43. sandstrike-1.0.0/sandstrike/encoding/__init__.py +20 -0
  44. sandstrike-1.0.0/sandstrike/encoding/encoders.py +519 -0
  45. sandstrike-1.0.0/sandstrike/exceptions.py +40 -0
  46. sandstrike-1.0.0/sandstrike/grading/README.md +295 -0
  47. sandstrike-1.0.0/sandstrike/grading/__init__.py +36 -0
  48. sandstrike-1.0.0/sandstrike/grading/assertions.py +478 -0
  49. sandstrike-1.0.0/sandstrike/grading/config.py +302 -0
  50. sandstrike-1.0.0/sandstrike/grading/grading_engine.py +325 -0
  51. sandstrike-1.0.0/sandstrike/grading/providers.py +578 -0
  52. sandstrike-1.0.0/sandstrike/images/avenlis_icon.png +0 -0
  53. sandstrike-1.0.0/sandstrike/images/mitre_atlas.png +0 -0
  54. sandstrike-1.0.0/sandstrike/images/owasp_llm.png +0 -0
  55. sandstrike-1.0.0/sandstrike/images/sandstrike_white.png +0 -0
  56. sandstrike-1.0.0/sandstrike/info/ATLAS.yaml +5539 -0
  57. sandstrike-1.0.0/sandstrike/info/LLM01_PromptInjection.md +125 -0
  58. sandstrike-1.0.0/sandstrike/info/LLM02_SensitiveInformationDisclosure.md +115 -0
  59. sandstrike-1.0.0/sandstrike/info/LLM03_SupplyChain.md +140 -0
  60. sandstrike-1.0.0/sandstrike/info/LLM04_DataModelPoisoning.md +76 -0
  61. sandstrike-1.0.0/sandstrike/info/LLM05_ImproperOutputHandling.md +70 -0
  62. sandstrike-1.0.0/sandstrike/info/LLM06_ExcessiveAgency.md +106 -0
  63. sandstrike-1.0.0/sandstrike/info/LLM07_SystemPromptLeakage.md +76 -0
  64. sandstrike-1.0.0/sandstrike/info/LLM08_VectorAndEmbeddingWeaknesses.md +90 -0
  65. sandstrike-1.0.0/sandstrike/info/LLM09_Misinformation.md +95 -0
  66. sandstrike-1.0.0/sandstrike/info/LLM10_UnboundedConsumption.md +153 -0
  67. sandstrike-1.0.0/sandstrike/llm_providers.py +482 -0
  68. sandstrike-1.0.0/sandstrike/main_storage.py +2855 -0
  69. sandstrike-1.0.0/sandstrike/redteam/README.md +418 -0
  70. sandstrike-1.0.0/sandstrike/redteam/__init__.py +11 -0
  71. sandstrike-1.0.0/sandstrike/redteam/core.py +586 -0
  72. sandstrike-1.0.0/sandstrike/redteam/encoders.py +317 -0
  73. sandstrike-1.0.0/sandstrike/redteam/session.py +344 -0
  74. sandstrike-1.0.0/sandstrike/reports/html_generator.py +70 -0
  75. sandstrike-1.0.0/sandstrike/reports/html_generator.py.backup +70 -0
  76. sandstrike-1.0.0/sandstrike/sandstrike_auth.py +457 -0
  77. sandstrike-1.0.0/sandstrike/schemas/__init__.py +27 -0
  78. sandstrike-1.0.0/sandstrike/schemas/yaml_schemas.py +248 -0
  79. sandstrike-1.0.0/sandstrike/server.py +4053 -0
  80. sandstrike-1.0.0/sandstrike/storage/README.md +14 -0
  81. sandstrike-1.0.0/sandstrike/storage/__init__.py +20 -0
  82. sandstrike-1.0.0/sandstrike/storage/database.py +329 -0
  83. sandstrike-1.0.0/sandstrike/storage/hybrid_storage.py +899 -0
  84. sandstrike-1.0.0/sandstrike/storage/yaml_loader.py +463 -0
  85. sandstrike-1.0.0/sandstrike/templates/adversarial_prompts_template.yaml +35 -0
  86. sandstrike-1.0.0/sandstrike/templates/attack_types_and_vulnerabilities_template.yaml +45 -0
  87. sandstrike-1.0.0/sandstrike/templates/collection_template.yaml +52 -0
  88. sandstrike-1.0.0/sandstrike/templates/scan_results_template.json +36 -0
  89. sandstrike-1.0.0/sandstrike/templates/session_config_template.yaml +57 -0
  90. sandstrike-1.0.0/sandstrike/templates/sessions_template.json +37 -0
  91. sandstrike-1.0.0/sandstrike/utils/README.md +511 -0
  92. sandstrike-1.0.0/sandstrike/utils/__init__.py +6 -0
  93. sandstrike-1.0.0/sandstrike/utils/logging.py +103 -0
  94. sandstrike-1.0.0/sandstrike/utils/validation.py +107 -0
  95. sandstrike-1.0.0/sandstrike/web-ui/.eslintrc.js +20 -0
  96. sandstrike-1.0.0/sandstrike/web-ui/Dockerfile +23 -0
  97. sandstrike-1.0.0/sandstrike/web-ui/Dockerfile.backend +28 -0
  98. sandstrike-1.0.0/sandstrike/web-ui/README.md +272 -0
  99. sandstrike-1.0.0/sandstrike/web-ui/docker-compose.yml +36 -0
  100. sandstrike-1.0.0/sandstrike/web-ui/eslint.config.js +1 -0
  101. sandstrike-1.0.0/sandstrike/web-ui/index.html +17 -0
  102. sandstrike-1.0.0/sandstrike/web-ui/package.json +63 -0
  103. sandstrike-1.0.0/sandstrike/web-ui/run-without-npm.bat +36 -0
  104. sandstrike-1.0.0/sandstrike/web-ui/run-without-npm.sh +39 -0
  105. sandstrike-1.0.0/sandstrike/web-ui/src/App.tsx +54 -0
  106. sandstrike-1.0.0/sandstrike/web-ui/src/components/common/CustomDropdown.tsx +239 -0
  107. sandstrike-1.0.0/sandstrike/web-ui/src/components/common/CustomTooltip.tsx +229 -0
  108. sandstrike-1.0.0/sandstrike/web-ui/src/components/common/EncodingSelector.tsx +258 -0
  109. sandstrike-1.0.0/sandstrike/web-ui/src/components/common/SlideOverlay.tsx +117 -0
  110. sandstrike-1.0.0/sandstrike/web-ui/src/components/layout/Sidebar.tsx +545 -0
  111. sandstrike-1.0.0/sandstrike/web-ui/src/contexts/SocketContext.tsx +72 -0
  112. sandstrike-1.0.0/sandstrike/web-ui/src/contexts/SubscriptionContext.tsx +97 -0
  113. sandstrike-1.0.0/sandstrike/web-ui/src/contexts/TimezoneContext.tsx +105 -0
  114. sandstrike-1.0.0/sandstrike/web-ui/src/index.css +145 -0
  115. sandstrike-1.0.0/sandstrike/web-ui/src/main.tsx +40 -0
  116. sandstrike-1.0.0/sandstrike/web-ui/src/pages/Collections.tsx +636 -0
  117. sandstrike-1.0.0/sandstrike/web-ui/src/pages/Dashboard.tsx +444 -0
  118. sandstrike-1.0.0/sandstrike/web-ui/src/pages/MitreAtlas.tsx +684 -0
  119. sandstrike-1.0.0/sandstrike/web-ui/src/pages/OwaspLlm.tsx +587 -0
  120. sandstrike-1.0.0/sandstrike/web-ui/src/pages/Prompts.tsx +1077 -0
  121. sandstrike-1.0.0/sandstrike/web-ui/src/pages/Reports.tsx +557 -0
  122. sandstrike-1.0.0/sandstrike/web-ui/src/pages/Scan.tsx +1703 -0
  123. sandstrike-1.0.0/sandstrike/web-ui/src/pages/Sessions.tsx +865 -0
  124. sandstrike-1.0.0/sandstrike/web-ui/src/pages/Targets.tsx +414 -0
  125. sandstrike-1.0.0/sandstrike/web-ui/src/utils/dateFormat.ts +48 -0
  126. sandstrike-1.0.0/sandstrike/web-ui/start-dev.bat +37 -0
  127. sandstrike-1.0.0/sandstrike/web-ui/start-dev.sh +53 -0
  128. sandstrike-1.0.0/sandstrike/web-ui/tsconfig.json +34 -0
  129. sandstrike-1.0.0/sandstrike/web-ui/tsconfig.node.json +13 -0
  130. sandstrike-1.0.0/sandstrike/web-ui/vite.config.ts +51 -0
  131. sandstrike-1.0.0/tests/README.md +599 -0
  132. sandstrike-1.0.0/tests/__init__.py +3 -0
  133. sandstrike-1.0.0/tests/collections/test_collections.py +127 -0
  134. sandstrike-1.0.0/tests/prompts/import_test.json +14 -0
  135. sandstrike-1.0.0/tests/prompts/test_prompts.py +402 -0
  136. sandstrike-1.0.0/tests/reports/test_reports.py +160 -0
  137. sandstrike-1.0.0/tests/sessions/test_sessions.py +169 -0
  138. sandstrike-1.0.0/tests/targets/test_targets.py +259 -0
  139. sandstrike-1.0.0/tests/test.py +13 -0
  140. sandstrike-1.0.0/tests/test_auth.py +81 -0
  141. sandstrike-1.0.0/tests/test_avenlis_main.py +53 -0
  142. sandstrike-1.0.0/tests/variables/test_variables.py +188 -0
@@ -0,0 +1,38 @@
1
+ # Publish SandStrike to PyPI when a new release is created.
2
+ # Setup: Add PyPI API token as GitHub secret named PYPI_API_TOKEN.
3
+
4
+ name: Publish to PyPI
5
+
6
+ on:
7
+ release:
8
+ types: [published]
9
+ # Optional: also publish when pushing a tag like v1.0.0
10
+ # push:
11
+ # tags:
12
+ # - 'v*'
13
+
14
+ jobs:
15
+ publish:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.11"
24
+
25
+ - name: Install build dependencies
26
+ run: pip install build twine
27
+
28
+ - name: Build package
29
+ run: python -m build
30
+
31
+ - name: Check package
32
+ run: twine check dist/*
33
+
34
+ - name: Publish to PyPI
35
+ env:
36
+ TWINE_USERNAME: __token__
37
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
38
+ run: twine upload dist/*
@@ -0,0 +1,281 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be added to the global gitignore or merged into this project gitignore. For a PyCharm
158
+ # project, it is generally recommended to exclude the project-specific files:
159
+ .idea/
160
+
161
+ # VS Code
162
+ .vscode/
163
+
164
+ # macOS
165
+ .DS_Store
166
+
167
+ # Windows
168
+ Thumbs.db
169
+ ehthumbs.db
170
+ Desktop.ini
171
+
172
+ # Avenlis specific
173
+ *.log
174
+
175
+ # SandStrke Database (UNCOMMENT THIS LINE TO EXCLUDE SUBSEQUENT DATABASE CHANGES)
176
+ # .avenlis/
177
+
178
+ # Node.js / npm
179
+ node_modules/
180
+ avenlis/web-ui/node_modules/
181
+ npm-debug.log*
182
+ yarn-debug.log*
183
+ yarn-error.log*
184
+ .npm
185
+ .yarn-integrity
186
+ package-lock.json
187
+ yarn.lock
188
+ .pnpm-debug.log*
189
+
190
+ # Build outputs
191
+ dist/
192
+ build/
193
+ .next/
194
+ .nuxt/
195
+ .vuepress/dist/
196
+
197
+ # Runtime data
198
+ pids
199
+ *.pid
200
+ *.seed
201
+ *.pid.lock
202
+
203
+ # Coverage directory used by tools like istanbul
204
+ coverage/
205
+ *.lcov
206
+
207
+ # nyc test coverage
208
+ .nyc_output
209
+
210
+ # Grunt intermediate storage
211
+ .grunt
212
+
213
+ # Bower dependency directory
214
+ bower_components
215
+
216
+ # node-waf configuration
217
+ .lock-wscript
218
+
219
+ # Compiled binary addons
220
+ build/Release
221
+
222
+ # Dependency directories
223
+ jspm_packages/
224
+
225
+ # TypeScript cache
226
+ *.tsbuildinfo
227
+
228
+ # Optional npm cache directory
229
+ .npm
230
+
231
+ # Optional eslint cache
232
+ .eslintcache
233
+
234
+ # Microbundle cache
235
+ .rpt2_cache/
236
+ .rts2_cache_cjs/
237
+ .rts2_cache_es/
238
+ .rts2_cache_umd/
239
+
240
+ # Optional REPL history
241
+ .node_repl_history
242
+
243
+ # Output of 'npm pack'
244
+ *.tgz
245
+
246
+ # Yarn Integrity file
247
+ .yarn-integrity
248
+
249
+ # dotenv environment variables file
250
+ .env
251
+ .env.test
252
+ .env.local
253
+ .env.development.local
254
+ .env.test.local
255
+ .env.production.local
256
+
257
+ # parcel-bundler cache
258
+ .cache
259
+ .parcel-cache
260
+
261
+ # Next.js build output
262
+ .next
263
+
264
+ # Nuxt.js build / generate output
265
+ .nuxt
266
+ dist
267
+
268
+ # Gatsby files
269
+ .cache/
270
+ public
271
+
272
+ # Storybook build outputs
273
+ .out
274
+ .storybook-out
275
+
276
+ # Temporary folders
277
+ tmp/
278
+ temp/
279
+
280
+ # External project folders
281
+ # tests/