attocode-code-intel 0.1.0__py3-none-any.whl
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.
- attocode_code_intel-0.1.0.dist-info/METADATA +221 -0
- attocode_code_intel-0.1.0.dist-info/RECORD +345 -0
- attocode_code_intel-0.1.0.dist-info/WHEEL +4 -0
- attocode_code_intel-0.1.0.dist-info/entry_points.txt +2 -0
- attocode_code_intel-0.1.0.dist-info/licenses/LICENSE +21 -0
- attocode_intel/GUIDELINES.md +432 -0
- attocode_intel/__init__.py +52 -0
- attocode_intel/_internal/__init__.py +1 -0
- attocode_intel/_internal/errors/__init__.py +126 -0
- attocode_intel/_internal/integrations/__init__.py +1 -0
- attocode_intel/_internal/integrations/context/__init__.py +1 -0
- attocode_intel/_internal/integrations/context/architecture_drift.py +354 -0
- attocode_intel/_internal/integrations/context/ast_chunker.py +202 -0
- attocode_intel/_internal/integrations/context/ast_service.py +1483 -0
- attocode_intel/_internal/integrations/context/blob_oid.py +423 -0
- attocode_intel/_internal/integrations/context/cache_manifest.py +221 -0
- attocode_intel/_internal/integrations/context/cas.py +466 -0
- attocode_intel/_internal/integrations/context/code_analyzer.py +528 -0
- attocode_intel/_internal/integrations/context/codebase_ast.py +1461 -0
- attocode_intel/_internal/integrations/context/codebase_context.py +1736 -0
- attocode_intel/_internal/integrations/context/cross_mode.py +263 -0
- attocode_intel/_internal/integrations/context/cross_references.py +616 -0
- attocode_intel/_internal/integrations/context/embedding_rotation.py +597 -0
- attocode_intel/_internal/integrations/context/embeddings.py +282 -0
- attocode_intel/_internal/integrations/context/frecency.py +427 -0
- attocode_intel/_internal/integrations/context/fuzzy.py +320 -0
- attocode_intel/_internal/integrations/context/hierarchical_explorer.py +331 -0
- attocode_intel/_internal/integrations/context/hydration.py +90 -0
- attocode_intel/_internal/integrations/context/index_repair.py +87 -0
- attocode_intel/_internal/integrations/context/index_store.py +586 -0
- attocode_intel/_internal/integrations/context/memory_store.py +602 -0
- attocode_intel/_internal/integrations/context/module_resolution.py +52 -0
- attocode_intel/_internal/integrations/context/query_constraints.py +361 -0
- attocode_intel/_internal/integrations/context/query_history.py +417 -0
- attocode_intel/_internal/integrations/context/reranker.py +351 -0
- attocode_intel/_internal/integrations/context/semantic_search.py +2931 -0
- attocode_intel/_internal/integrations/context/syntax_evidence.py +94 -0
- attocode_intel/_internal/integrations/context/systemone_ranker.py +245 -0
- attocode_intel/_internal/integrations/context/temporal_coupling.py +411 -0
- attocode_intel/_internal/integrations/context/trigram_index.py +820 -0
- attocode_intel/_internal/integrations/context/trigram_regex.py +171 -0
- attocode_intel/_internal/integrations/context/ts_parser.py +2199 -0
- attocode_intel/_internal/integrations/context/vector_store.py +795 -0
- attocode_intel/_internal/integrations/feature_flags/__init__.py +357 -0
- attocode_intel/_internal/integrations/lsp/__init__.py +1 -0
- attocode_intel/_internal/integrations/lsp/client.py +1140 -0
- attocode_intel/_internal/integrations/mcp/__init__.py +1 -0
- attocode_intel/_internal/integrations/mcp/client.py +253 -0
- attocode_intel/_internal/integrations/security/__init__.py +1 -0
- attocode_intel/_internal/integrations/security/custom_rules.py +176 -0
- attocode_intel/_internal/integrations/security/dataflow.py +522 -0
- attocode_intel/_internal/integrations/security/dependency_audit.py +303 -0
- attocode_intel/_internal/integrations/security/matcher.py +44 -0
- attocode_intel/_internal/integrations/security/patterns.py +724 -0
- attocode_intel/_internal/integrations/security/scanner.py +351 -0
- attocode_intel/_internal/integrations/utilities/__init__.py +1 -0
- attocode_intel/_internal/integrations/utilities/ignore.py +64 -0
- attocode_intel/_internal/integrations/utilities/token_estimate.py +51 -0
- attocode_intel/_internal/tricks/__init__.py +1 -0
- attocode_intel/_internal/tricks/recursive_context.py +357 -0
- attocode_intel/_internal/types/__init__.py +1 -0
- attocode_intel/_internal/types/events.py +289 -0
- attocode_intel/_internal/types/severity.py +15 -0
- attocode_intel/_shared.py +341 -0
- attocode_intel/analysis_coverage.py +56 -0
- attocode_intel/api/__init__.py +1 -0
- attocode_intel/api/access.py +32 -0
- attocode_intel/api/app.py +247 -0
- attocode_intel/api/auth/__init__.py +128 -0
- attocode_intel/api/auth/api_keys.py +61 -0
- attocode_intel/api/auth/context.py +34 -0
- attocode_intel/api/auth/jwt.py +66 -0
- attocode_intel/api/auth/oauth.py +146 -0
- attocode_intel/api/auth/passwords.py +15 -0
- attocode_intel/api/deps.py +351 -0
- attocode_intel/api/knowledge_bridge.py +13 -0
- attocode_intel/api/mcp_transport.py +51 -0
- attocode_intel/api/middleware.py +411 -0
- attocode_intel/api/models.py +698 -0
- attocode_intel/api/providers/__init__.py +1 -0
- attocode_intel/api/providers/db_provider.py +1106 -0
- attocode_intel/api/providers/local_provider.py +476 -0
- attocode_intel/api/providers/remote_provider.py +740 -0
- attocode_intel/api/repository_source.py +21 -0
- attocode_intel/api/routes/__init__.py +1 -0
- attocode_intel/api/routes/_pin_helper.py +158 -0
- attocode_intel/api/routes/activity.py +148 -0
- attocode_intel/api/routes/adr.py +102 -0
- attocode_intel/api/routes/analysis.py +515 -0
- attocode_intel/api/routes/api_keys.py +170 -0
- attocode_intel/api/routes/auth.py +428 -0
- attocode_intel/api/routes/branches.py +262 -0
- attocode_intel/api/routes/cross_repo_search.py +198 -0
- attocode_intel/api/routes/embeddings.py +386 -0
- attocode_intel/api/routes/files.py +132 -0
- attocode_intel/api/routes/files_v2.py +388 -0
- attocode_intel/api/routes/gc.py +322 -0
- attocode_intel/api/routes/git_v2.py +433 -0
- attocode_intel/api/routes/graph.py +174 -0
- attocode_intel/api/routes/graph_viz.py +160 -0
- attocode_intel/api/routes/health.py +62 -0
- attocode_intel/api/routes/history.py +175 -0
- attocode_intel/api/routes/jobs.py +84 -0
- attocode_intel/api/routes/learning.py +205 -0
- attocode_intel/api/routes/lsp.py +272 -0
- attocode_intel/api/routes/notify.py +623 -0
- attocode_intel/api/routes/operations.py +27 -0
- attocode_intel/api/routes/orgs.py +924 -0
- attocode_intel/api/routes/preferences.py +100 -0
- attocode_intel/api/routes/presence.py +42 -0
- attocode_intel/api/routes/projects.py +116 -0
- attocode_intel/api/routes/repos.py +47 -0
- attocode_intel/api/routes/search.py +180 -0
- attocode_intel/api/routes/snapshots.py +614 -0
- attocode_intel/api/routes/webhooks.py +313 -0
- attocode_intel/api/routes/websocket.py +116 -0
- attocode_intel/api/static/graph.html +239 -0
- attocode_intel/api/utils.py +96 -0
- attocode_intel/artifacts/__init__.py +45 -0
- attocode_intel/artifacts/hashing.py +230 -0
- attocode_intel/artifacts/provenance.py +190 -0
- attocode_intel/artifacts/retrieval_pin.py +159 -0
- attocode_intel/audit.py +59 -0
- attocode_intel/bug_finder.py +206 -0
- attocode_intel/bundle.py +80 -0
- attocode_intel/catalog.py +242 -0
- attocode_intel/change_review.py +75 -0
- attocode_intel/cli.py +3062 -0
- attocode_intel/community.py +63 -0
- attocode_intel/confidence/__init__.py +144 -0
- attocode_intel/confidence/jev.py +234 -0
- attocode_intel/confidence/llm.py +330 -0
- attocode_intel/confidence/redact.py +44 -0
- attocode_intel/confidence/settings.py +74 -0
- attocode_intel/config.py +256 -0
- attocode_intel/crypto.py +31 -0
- attocode_intel/db/__init__.py +7 -0
- attocode_intel/db/base.py +33 -0
- attocode_intel/db/engine.py +61 -0
- attocode_intel/db/models.py +529 -0
- attocode_intel/entrypoint.py +185 -0
- attocode_intel/focused_evidence.py +130 -0
- attocode_intel/freshness.py +154 -0
- attocode_intel/gateway.py +734 -0
- attocode_intel/git/__init__.py +7 -0
- attocode_intel/git/credentials.py +75 -0
- attocode_intel/git/manager.py +493 -0
- attocode_intel/git/models.py +96 -0
- attocode_intel/git/storage.py +98 -0
- attocode_intel/graph_query_parser.py +761 -0
- attocode_intel/helpers.py +712 -0
- attocode_intel/indexing/__init__.py +29 -0
- attocode_intel/indexing/debouncer.py +136 -0
- attocode_intel/indexing/delta_indexer.py +151 -0
- attocode_intel/indexing/full_indexer.py +323 -0
- attocode_intel/indexing/incremental.py +240 -0
- attocode_intel/indexing/parser.py +403 -0
- attocode_intel/indexing/summarizer.py +264 -0
- attocode_intel/installer.py +1896 -0
- attocode_intel/knowledge.py +269 -0
- attocode_intel/local_knowledge.py +77 -0
- attocode_intel/migrations/alembic.ini +36 -0
- attocode_intel/migrations/env.py +71 -0
- attocode_intel/migrations/script.py.mako +27 -0
- attocode_intel/migrations/versions/001_initial_schema.py +219 -0
- attocode_intel/migrations/versions/002_branch_version_and_embeddings.py +61 -0
- attocode_intel/migrations/versions/003_embedding_uniqueness_and_cascade.py +51 -0
- attocode_intel/migrations/versions/004_audit_events.py +38 -0
- attocode_intel/migrations/versions/005_user_preferences.py +30 -0
- attocode_intel/migrations/versions/006_google_oauth.py +27 -0
- attocode_intel/migrations/versions/007_pgvector_embeddings.py +28 -0
- attocode_intel/migrations/versions/008_symbol_references.py +37 -0
- attocode_intel/migrations/versions/009_webhook_secret_encryption.py +25 -0
- attocode_intel/migrations/versions/010_add_commits_table.py +40 -0
- attocode_intel/migrations/versions/011_commit_changed_files.py +25 -0
- attocode_intel/migrations/versions/012_branch_merged_at.py +25 -0
- attocode_intel/migrations/versions/013_revoked_tokens.py +32 -0
- attocode_intel/migrations/versions/014_blame_hunks.py +40 -0
- attocode_intel/migrations/versions/015_commit_file_stats.py +40 -0
- attocode_intel/migrations/versions/016_embedding_provenance_columns.py +179 -0
- attocode_intel/migrations/versions/017_provenance_table.py +102 -0
- attocode_intel/migrations/versions/018_repo_snapshots.py +178 -0
- attocode_intel/migrations/versions/019_symref_caller.py +42 -0
- attocode_intel/migrations/versions/020_shared_knowledge.py +29 -0
- attocode_intel/onboarding.py +258 -0
- attocode_intel/output.py +178 -0
- attocode_intel/precision.py +133 -0
- attocode_intel/presence.py +160 -0
- attocode_intel/probe.py +110 -0
- attocode_intel/project_dir.py +97 -0
- attocode_intel/pubsub.py +113 -0
- attocode_intel/query_ranking.py +242 -0
- attocode_intel/readiness.py +972 -0
- attocode_intel/redis.py +51 -0
- attocode_intel/reference_pages.py +60 -0
- attocode_intel/remote.py +131 -0
- attocode_intel/repo_ranker.py +246 -0
- attocode_intel/request_context.py +82 -0
- attocode_intel/rules/__init__.py +28 -0
- attocode_intel/rules/ci.py +320 -0
- attocode_intel/rules/combinators.py +293 -0
- attocode_intel/rules/enricher.py +127 -0
- attocode_intel/rules/evolution.py +452 -0
- attocode_intel/rules/executor.py +531 -0
- attocode_intel/rules/filters/__init__.py +5 -0
- attocode_intel/rules/filters/pipeline.py +151 -0
- attocode_intel/rules/formatter.py +198 -0
- attocode_intel/rules/hygiene.py +242 -0
- attocode_intel/rules/importers/__init__.py +1 -0
- attocode_intel/rules/importers/semgrep.py +382 -0
- attocode_intel/rules/loader.py +292 -0
- attocode_intel/rules/marketplace.py +375 -0
- attocode_intel/rules/metavar.py +181 -0
- attocode_intel/rules/model.py +317 -0
- attocode_intel/rules/packs/__init__.py +1 -0
- attocode_intel/rules/packs/community/_license_templates/Apache-2.0.txt +176 -0
- attocode_intel/rules/packs/community/_license_templates/MIT.txt +21 -0
- attocode_intel/rules/packs/community/bandit-python/LICENSE +176 -0
- attocode_intel/rules/packs/community/bandit-python/NOTICE +13 -0
- attocode_intel/rules/packs/community/bandit-python/PORTING.md +23 -0
- attocode_intel/rules/packs/community/bandit-python/manifest.yaml +14 -0
- attocode_intel/rules/packs/community/bandit-python/rules/B105-hardcoded-password.yaml +23 -0
- attocode_intel/rules/packs/community/bandit-python/rules/B303-weak-md5.yaml +21 -0
- attocode_intel/rules/packs/community/bandit-python/rules/B304-weak-des.yaml +20 -0
- attocode_intel/rules/packs/community/bandit-python/rules/B307-use-of-eval.yaml +22 -0
- attocode_intel/rules/packs/community/bandit-python/rules/B324-weak-sha1.yaml +21 -0
- attocode_intel/rules/packs/community/bandit-python/rules/B501-no-cert-validation.yaml +23 -0
- attocode_intel/rules/packs/community/bandit-python/rules/B602-shell-true.yaml +22 -0
- attocode_intel/rules/packs/community/bandit-python/rules/B608-sqli.yaml +22 -0
- attocode_intel/rules/packs/community/eslint-typescript/LICENSE +21 -0
- attocode_intel/rules/packs/community/eslint-typescript/NOTICE +13 -0
- attocode_intel/rules/packs/community/eslint-typescript/PORTING.md +23 -0
- attocode_intel/rules/packs/community/eslint-typescript/manifest.yaml +14 -0
- attocode_intel/rules/packs/community/eslint-typescript/rules/eqeqeq.yaml +20 -0
- attocode_intel/rules/packs/community/eslint-typescript/rules/no-eval.yaml +22 -0
- attocode_intel/rules/packs/community/eslint-typescript/rules/no-implied-eval.yaml +20 -0
- attocode_intel/rules/packs/community/eslint-typescript/rules/no-new-func.yaml +21 -0
- attocode_intel/rules/packs/community/eslint-typescript/rules/no-throw-literal.yaml +19 -0
- attocode_intel/rules/packs/community/eslint-typescript/rules/no-var.yaml +20 -0
- attocode_intel/rules/packs/community/eslint-typescript/rules/no-with.yaml +18 -0
- attocode_intel/rules/packs/community/gosec-go/LICENSE +176 -0
- attocode_intel/rules/packs/community/gosec-go/NOTICE +13 -0
- attocode_intel/rules/packs/community/gosec-go/PORTING.md +23 -0
- attocode_intel/rules/packs/community/gosec-go/manifest.yaml +14 -0
- attocode_intel/rules/packs/community/gosec-go/rules/G101-hardcoded-credentials.yaml +22 -0
- attocode_intel/rules/packs/community/gosec-go/rules/G102-bind-all-interfaces.yaml +21 -0
- attocode_intel/rules/packs/community/gosec-go/rules/G103-unsafe-block.yaml +21 -0
- attocode_intel/rules/packs/community/gosec-go/rules/G201-sql-format.yaml +21 -0
- attocode_intel/rules/packs/community/gosec-go/rules/G304-file-inclusion.yaml +23 -0
- attocode_intel/rules/packs/community/gosec-go/rules/G401-weak-cipher.yaml +20 -0
- attocode_intel/rules/packs/community/gosec-go/rules/G402-tls-min-version.yaml +20 -0
- attocode_intel/rules/packs/community/gosec-go/rules/G501-md5-import.yaml +21 -0
- attocode_intel/rules/packs/examples/cpp/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/cpp/rules/security.yaml +90 -0
- attocode_intel/rules/packs/examples/cpp/rules/structural.yaml +42 -0
- attocode_intel/rules/packs/examples/csharp/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/csharp/rules/security.yaml +69 -0
- attocode_intel/rules/packs/examples/csharp/rules/structural.yaml +42 -0
- attocode_intel/rules/packs/examples/go/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/go/rules/performance.yaml +136 -0
- attocode_intel/rules/packs/examples/go/rules/security.yaml +48 -0
- attocode_intel/rules/packs/examples/go/rules/structural.yaml +58 -0
- attocode_intel/rules/packs/examples/go/taint/sanitizers.yaml +24 -0
- attocode_intel/rules/packs/examples/go/taint/sinks.yaml +51 -0
- attocode_intel/rules/packs/examples/go/taint/sources.yaml +26 -0
- attocode_intel/rules/packs/examples/java/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/java/rules/correctness.yaml +55 -0
- attocode_intel/rules/packs/examples/java/rules/structural.yaml +48 -0
- attocode_intel/rules/packs/examples/java/taint/sinks.yaml +37 -0
- attocode_intel/rules/packs/examples/java/taint/sources.yaml +21 -0
- attocode_intel/rules/packs/examples/kotlin/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/kotlin/rules/correctness.yaml +50 -0
- attocode_intel/rules/packs/examples/kotlin/rules/structural.yaml +38 -0
- attocode_intel/rules/packs/examples/php/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/php/rules/security.yaml +66 -0
- attocode_intel/rules/packs/examples/php/rules/structural.yaml +41 -0
- attocode_intel/rules/packs/examples/python/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/python/rules/performance.yaml +90 -0
- attocode_intel/rules/packs/examples/python/rules/structural.yaml +55 -0
- attocode_intel/rules/packs/examples/ruby/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/ruby/rules/security.yaml +73 -0
- attocode_intel/rules/packs/examples/ruby/rules/structural.yaml +41 -0
- attocode_intel/rules/packs/examples/rust/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/rust/rules/correctness.yaml +51 -0
- attocode_intel/rules/packs/examples/rust/rules/structural.yaml +49 -0
- attocode_intel/rules/packs/examples/typescript/manifest.yaml +4 -0
- attocode_intel/rules/packs/examples/typescript/rules/performance.yaml +70 -0
- attocode_intel/rules/packs/examples/typescript/rules/structural.yaml +48 -0
- attocode_intel/rules/packs/pack_loader.py +244 -0
- attocode_intel/rules/plugins/__init__.py +1 -0
- attocode_intel/rules/plugins/plugin_loader.py +132 -0
- attocode_intel/rules/profiling.py +332 -0
- attocode_intel/rules/registry.py +213 -0
- attocode_intel/rules/sarif.py +187 -0
- attocode_intel/rules/synthesis.py +420 -0
- attocode_intel/rules/testing.py +326 -0
- attocode_intel/server.py +734 -0
- attocode_intel/service.py +3416 -0
- attocode_intel/sharing.py +57 -0
- attocode_intel/storage/__init__.py +6 -0
- attocode_intel/storage/branch_overlay.py +352 -0
- attocode_intel/storage/content_store.py +220 -0
- attocode_intel/storage/dependency_store.py +143 -0
- attocode_intel/storage/diff_engine.py +187 -0
- attocode_intel/storage/embedding_store.py +594 -0
- attocode_intel/storage/provenance_store.py +137 -0
- attocode_intel/storage/security_scanner_db.py +164 -0
- attocode_intel/storage/symbol_store.py +160 -0
- attocode_intel/structural_evidence.py +144 -0
- attocode_intel/symbol_inspection.py +141 -0
- attocode_intel/symbol_links.py +167 -0
- attocode_intel/telemetry.py +42 -0
- attocode_intel/test_ranking.py +73 -0
- attocode_intel/testing/__init__.py +43 -0
- attocode_intel/testing/fixtures.py +122 -0
- attocode_intel/testing/helpers.py +75 -0
- attocode_intel/testing/mocks.py +99 -0
- attocode_intel/tools/__init__.py +2 -0
- attocode_intel/tools/adr_tools.py +628 -0
- attocode_intel/tools/analysis_tools.py +382 -0
- attocode_intel/tools/composite_tools.py +695 -0
- attocode_intel/tools/cross_mode_tools.py +173 -0
- attocode_intel/tools/dead_code_tools.py +582 -0
- attocode_intel/tools/distill_tools.py +353 -0
- attocode_intel/tools/frecency_tools.py +220 -0
- attocode_intel/tools/fuzzy_tools.py +255 -0
- attocode_intel/tools/history_tools.py +486 -0
- attocode_intel/tools/learning_tools.py +222 -0
- attocode_intel/tools/lsp_tools.py +218 -0
- attocode_intel/tools/maintenance_tools.py +1662 -0
- attocode_intel/tools/navigation_tools.py +220 -0
- attocode_intel/tools/overlay_tools.py +540 -0
- attocode_intel/tools/pin_store.py +432 -0
- attocode_intel/tools/pin_tools.py +266 -0
- attocode_intel/tools/query_constraints_tools.py +262 -0
- attocode_intel/tools/query_history_tools.py +158 -0
- attocode_intel/tools/readiness_tools.py +44 -0
- attocode_intel/tools/rule_tools.py +992 -0
- attocode_intel/tools/search_tools.py +770 -0
- attocode_intel/tools/snapshot_tools.py +624 -0
- attocode_intel/workers/__init__.py +1 -0
- attocode_intel/workers/job_utils.py +111 -0
- attocode_intel/workers/jobs.py +573 -0
- attocode_intel/workers/run.py +30 -0
- attocode_intel/workers/settings.py +61 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Support. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or support.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# NOTICE — bandit-python
|
|
2
|
+
|
|
3
|
+
Rule patterns adapted from Bandit (https://github.com/PyCQA/bandit). Original copyright PyCQA. Licensed under Apache-2.0.
|
|
4
|
+
|
|
5
|
+
Upstream: https://github.com/PyCQA/bandit
|
|
6
|
+
Commit: (unspecified)
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
|
|
9
|
+
Modifications:
|
|
10
|
+
- Translated rule patterns to attocode UnifiedRule schema
|
|
11
|
+
- Subset selection (high-value rules first)
|
|
12
|
+
|
|
13
|
+
See LICENSE for full license terms.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Porting checklist — bandit-python
|
|
2
|
+
|
|
3
|
+
Rules from bandit (https://github.com/PyCQA/bandit) are not YAML-defined upstream
|
|
4
|
+
and require manual porting. Each ported rule MUST include the
|
|
5
|
+
attribution comment header at the top of its YAML file:
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
# Adapted from bandit rule '<original-id>'
|
|
9
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Porting targets:
|
|
13
|
+
|
|
14
|
+
- [ ] B105 hardcoded_password_string
|
|
15
|
+
- [ ] B303 weak_md5_hash
|
|
16
|
+
- [ ] B304 weak_des_cipher
|
|
17
|
+
- [ ] B306 mktemp_temp_dir
|
|
18
|
+
- [ ] B307 use_of_eval
|
|
19
|
+
- [ ] B321 ftp_lib_used
|
|
20
|
+
- [ ] B324 weak_sha1_hash
|
|
21
|
+
- [ ] B501 request_with_no_cert_validation
|
|
22
|
+
- [ ] B602 subprocess_with_shell_true
|
|
23
|
+
- [ ] B608 hardcoded_sql_expressions
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: bandit-python
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
languages:
|
|
4
|
+
- python
|
|
5
|
+
description: Hand-ported subset of bandit rules. See PORTING.md for the porting checklist.
|
|
6
|
+
source: community
|
|
7
|
+
source_url: https://github.com/PyCQA/bandit
|
|
8
|
+
source_commit: ''
|
|
9
|
+
source_license: Apache-2.0
|
|
10
|
+
attribution: Rule patterns adapted from Bandit (https://github.com/PyCQA/bandit).
|
|
11
|
+
Original copyright PyCQA. Licensed under Apache-2.0.
|
|
12
|
+
imported_at: '2026-04-16T12:20:09Z'
|
|
13
|
+
upstream_rule_count: 10
|
|
14
|
+
imported_rule_count: 0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Adapted from bandit rule 'B105 hardcoded_password_string'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: B105-hardcoded-password
|
|
5
|
+
name: Hardcoded password string
|
|
6
|
+
message: Possible hardcoded password assignment
|
|
7
|
+
severity: high
|
|
8
|
+
category: security
|
|
9
|
+
languages: [python]
|
|
10
|
+
confidence: 0.7
|
|
11
|
+
cwe: CWE-798
|
|
12
|
+
pattern: '(?i)\b(password|passwd|pwd|secret|token|api_key|apikey)\s*=\s*[''"][^''"]{3,}[''"]'
|
|
13
|
+
explanation: |
|
|
14
|
+
Storing credentials in source code makes them easy to leak via version
|
|
15
|
+
control, logs, or stack traces. Bandit B105 catches the string-assignment
|
|
16
|
+
variant.
|
|
17
|
+
recommendation: |
|
|
18
|
+
Move credentials to a secret manager (env vars, AWS Secrets Manager,
|
|
19
|
+
Vault) and read them at runtime. For tests, use clearly-non-credential
|
|
20
|
+
placeholders (e.g. ``"PLACEHOLDER"``).
|
|
21
|
+
references:
|
|
22
|
+
- https://bandit.readthedocs.io/en/latest/plugins/b105_hardcoded_password_string.html
|
|
23
|
+
- https://cwe.mitre.org/data/definitions/798.html
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Adapted from bandit rule 'B303 weak_md5_hash'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: B303-weak-md5
|
|
5
|
+
name: Use of weak MD5 hash
|
|
6
|
+
message: MD5 is cryptographically broken; use SHA-256 or stronger
|
|
7
|
+
severity: high
|
|
8
|
+
category: security
|
|
9
|
+
languages: [python]
|
|
10
|
+
confidence: 0.85
|
|
11
|
+
cwe: CWE-327
|
|
12
|
+
pattern: '\bhashlib\.md5\s*\('
|
|
13
|
+
explanation: |
|
|
14
|
+
MD5 is vulnerable to collision attacks and is no longer considered
|
|
15
|
+
cryptographically secure. Bandit B303 flags any use as a security issue.
|
|
16
|
+
recommendation: |
|
|
17
|
+
Use ``hashlib.sha256`` (or SHA-3) for cryptographic hashing. If the use
|
|
18
|
+
is non-security (e.g. cache key), pass ``usedforsecurity=False`` (Python 3.9+).
|
|
19
|
+
references:
|
|
20
|
+
- https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html
|
|
21
|
+
- https://cwe.mitre.org/data/definitions/327.html
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Adapted from bandit rule 'B304 weak_cipher'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: B304-weak-des
|
|
5
|
+
name: Use of weak DES cipher
|
|
6
|
+
message: DES/3DES are cryptographically weak; use AES-GCM
|
|
7
|
+
severity: high
|
|
8
|
+
category: security
|
|
9
|
+
languages: [python]
|
|
10
|
+
confidence: 0.85
|
|
11
|
+
cwe: CWE-327
|
|
12
|
+
pattern: '\b(DES|TripleDES|ARC2|ARC4|Blowfish)\.new\s*\('
|
|
13
|
+
explanation: |
|
|
14
|
+
DES has a 56-bit key (brute-forceable), 3DES is deprecated by NIST,
|
|
15
|
+
and RC4/RC2 have known biases. These ciphers should not be used.
|
|
16
|
+
recommendation: |
|
|
17
|
+
Use AES-256-GCM via ``cryptography`` library
|
|
18
|
+
(``Cipher(algorithms.AES(key), modes.GCM(iv))``).
|
|
19
|
+
references:
|
|
20
|
+
- https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Adapted from bandit rule 'B307 use_of_eval'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: B307-use-of-eval
|
|
5
|
+
name: Use of dynamic code evaluation
|
|
6
|
+
message: Avoid eval/exec on dynamic input — leads to arbitrary code execution
|
|
7
|
+
severity: critical
|
|
8
|
+
category: security
|
|
9
|
+
languages: [python]
|
|
10
|
+
confidence: 0.8
|
|
11
|
+
cwe: CWE-95
|
|
12
|
+
pattern: '\b(eval|exec)\s*\('
|
|
13
|
+
explanation: |
|
|
14
|
+
``eval`` and ``exec`` interpret arbitrary strings as Python code. If any
|
|
15
|
+
part of the input is influenced by an external source, an attacker can
|
|
16
|
+
execute commands.
|
|
17
|
+
recommendation: |
|
|
18
|
+
Use ``ast.literal_eval`` for trusted literal expressions, or a proper
|
|
19
|
+
parser/DSL for dynamic logic.
|
|
20
|
+
references:
|
|
21
|
+
- https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html
|
|
22
|
+
- https://cwe.mitre.org/data/definitions/95.html
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Adapted from bandit rule 'B324 weak_sha1_hash'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: B324-weak-sha1
|
|
5
|
+
name: Use of weak SHA-1 hash
|
|
6
|
+
message: SHA-1 is cryptographically broken; use SHA-256 or stronger
|
|
7
|
+
severity: high
|
|
8
|
+
category: security
|
|
9
|
+
languages: [python]
|
|
10
|
+
confidence: 0.85
|
|
11
|
+
cwe: CWE-327
|
|
12
|
+
pattern: '\bhashlib\.sha1\s*\('
|
|
13
|
+
explanation: |
|
|
14
|
+
SHA-1 has known collision attacks (SHAttered, 2017) and should not be
|
|
15
|
+
used for cryptographic purposes.
|
|
16
|
+
recommendation: |
|
|
17
|
+
Use ``hashlib.sha256`` (or SHA-3). For non-security hashing such as
|
|
18
|
+
ETags or cache keys, pass ``usedforsecurity=False``.
|
|
19
|
+
references:
|
|
20
|
+
- https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html
|
|
21
|
+
- https://cwe.mitre.org/data/definitions/327.html
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Adapted from bandit rule 'B501 request_with_no_cert_validation'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: B501-no-cert-validation
|
|
5
|
+
name: HTTPS request with TLS verification disabled
|
|
6
|
+
message: TLS certificate verification disabled — vulnerable to MITM
|
|
7
|
+
severity: high
|
|
8
|
+
category: security
|
|
9
|
+
languages: [python]
|
|
10
|
+
confidence: 0.85
|
|
11
|
+
cwe: CWE-295
|
|
12
|
+
pattern: '\bverify\s*=\s*False\b'
|
|
13
|
+
explanation: |
|
|
14
|
+
Setting ``verify=False`` on requests/httpx/urllib3 calls disables TLS
|
|
15
|
+
certificate validation. An attacker on the network can intercept,
|
|
16
|
+
read, or modify the traffic.
|
|
17
|
+
recommendation: |
|
|
18
|
+
Leave verification enabled. If self-signed CAs are needed, point
|
|
19
|
+
``verify`` at a CA bundle path (``verify="/path/to/ca.crt"``) rather
|
|
20
|
+
than disabling.
|
|
21
|
+
references:
|
|
22
|
+
- https://bandit.readthedocs.io/en/latest/plugins/b501_request_with_no_cert_validation.html
|
|
23
|
+
- https://cwe.mitre.org/data/definitions/295.html
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Adapted from bandit rule 'B602 subprocess_with_shell_true'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: B602-shell-true
|
|
5
|
+
name: Subprocess invoked with shell=True
|
|
6
|
+
message: subprocess with shell=True is vulnerable to command injection
|
|
7
|
+
severity: high
|
|
8
|
+
category: security
|
|
9
|
+
languages: [python]
|
|
10
|
+
confidence: 0.8
|
|
11
|
+
cwe: CWE-78
|
|
12
|
+
pattern: '\bsubprocess\.\w+\([^)]*\bshell\s*=\s*True'
|
|
13
|
+
explanation: |
|
|
14
|
+
``subprocess.run/Popen/call`` with ``shell=True`` invokes the shell to
|
|
15
|
+
parse the command. If any argument comes from user input, the shell
|
|
16
|
+
will interpret meta-characters (``;``, ``|``, ``&&``, backticks).
|
|
17
|
+
recommendation: |
|
|
18
|
+
Pass arguments as a list (``subprocess.run(["ls", "-la", path])``)
|
|
19
|
+
without ``shell=True``. The OS calls execve directly — no shell parsing.
|
|
20
|
+
references:
|
|
21
|
+
- https://bandit.readthedocs.io/en/latest/plugins/b602_subprocess_popen_with_shell_equals_true.html
|
|
22
|
+
- https://cwe.mitre.org/data/definitions/78.html
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Adapted from bandit rule 'B608 hardcoded_sql_expressions'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: B608-sqli
|
|
5
|
+
name: SQL string built via concatenation or f-string
|
|
6
|
+
message: SQL string interpolation — possible injection
|
|
7
|
+
severity: high
|
|
8
|
+
category: security
|
|
9
|
+
languages: [python]
|
|
10
|
+
confidence: 0.6
|
|
11
|
+
cwe: CWE-89
|
|
12
|
+
pattern: '(SELECT|INSERT|UPDATE|DELETE)\s+[^;''"]*[''"]\s*[+%]\s*\w+'
|
|
13
|
+
explanation: |
|
|
14
|
+
Building SQL by concatenating user input or formatting variables into
|
|
15
|
+
the query string is the classic SQL-injection pattern. The bandit
|
|
16
|
+
variant catches both ``+`` concatenation and ``%`` formatting.
|
|
17
|
+
recommendation: |
|
|
18
|
+
Use parameterized queries (``cursor.execute(sql, (var,))``) so the
|
|
19
|
+
database driver handles escaping. ORMs do this automatically.
|
|
20
|
+
references:
|
|
21
|
+
- https://bandit.readthedocs.io/en/latest/plugins/b608_hardcoded_sql_expressions.html
|
|
22
|
+
- https://cwe.mitre.org/data/definitions/89.html
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) <YEAR> <COPYRIGHT HOLDERS>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# NOTICE — eslint-typescript
|
|
2
|
+
|
|
3
|
+
Rule patterns adapted from ESLint core rules (https://github.com/eslint/eslint). Original copyright OpenJS Foundation and contributors. Licensed under MIT.
|
|
4
|
+
|
|
5
|
+
Upstream: https://github.com/eslint/eslint
|
|
6
|
+
Commit: (unspecified)
|
|
7
|
+
License: MIT
|
|
8
|
+
|
|
9
|
+
Modifications:
|
|
10
|
+
- Translated rule patterns to attocode UnifiedRule schema
|
|
11
|
+
- Subset selection (high-value rules first)
|
|
12
|
+
|
|
13
|
+
See LICENSE for full license terms.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Porting checklist — eslint-typescript
|
|
2
|
+
|
|
3
|
+
Rules from eslint (https://github.com/eslint/eslint) are not YAML-defined upstream
|
|
4
|
+
and require manual porting. Each ported rule MUST include the
|
|
5
|
+
attribution comment header at the top of its YAML file:
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
# Adapted from eslint rule '<original-id>'
|
|
9
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Porting targets:
|
|
13
|
+
|
|
14
|
+
- [ ] no-eval
|
|
15
|
+
- [ ] no-implied-eval
|
|
16
|
+
- [ ] no-new-func
|
|
17
|
+
- [ ] no-script-url
|
|
18
|
+
- [ ] no-return-await
|
|
19
|
+
- [ ] no-var
|
|
20
|
+
- [ ] prefer-const
|
|
21
|
+
- [ ] eqeqeq
|
|
22
|
+
- [ ] no-with
|
|
23
|
+
- [ ] no-throw-literal
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: eslint-typescript
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
languages:
|
|
4
|
+
- typescript
|
|
5
|
+
description: Hand-ported subset of eslint rules. See PORTING.md for the porting checklist.
|
|
6
|
+
source: community
|
|
7
|
+
source_url: https://github.com/eslint/eslint
|
|
8
|
+
source_commit: ''
|
|
9
|
+
source_license: MIT
|
|
10
|
+
attribution: Rule patterns adapted from ESLint core rules (https://github.com/eslint/eslint).
|
|
11
|
+
Original copyright OpenJS Foundation and contributors. Licensed under MIT.
|
|
12
|
+
imported_at: '2026-04-16T12:20:09Z'
|
|
13
|
+
upstream_rule_count: 10
|
|
14
|
+
imported_rule_count: 0
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Adapted from eslint rule 'eqeqeq'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: eqeqeq
|
|
5
|
+
name: Loose equality comparison
|
|
6
|
+
message: Use === / !== instead of == / !=
|
|
7
|
+
severity: medium
|
|
8
|
+
category: correctness
|
|
9
|
+
languages: [javascript, typescript]
|
|
10
|
+
confidence: 0.85
|
|
11
|
+
pattern: '[^!=<>]==[^=]|[^!]!=[^=]'
|
|
12
|
+
explanation: |
|
|
13
|
+
``==`` and ``!=`` perform implicit type coercion, leading to
|
|
14
|
+
surprising comparisons (``"" == 0`` is true, ``[] == false`` is true).
|
|
15
|
+
Strict equality avoids the trap.
|
|
16
|
+
recommendation: |
|
|
17
|
+
Use ``===`` and ``!==``. If type coercion is genuinely intended,
|
|
18
|
+
add a comment so the next reader knows it's deliberate.
|
|
19
|
+
references:
|
|
20
|
+
- https://eslint.org/docs/latest/rules/eqeqeq
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Adapted from eslint rule 'no-eval'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: no-eval
|
|
5
|
+
name: Dynamic code evaluation
|
|
6
|
+
message: Avoid dynamic code evaluation — arbitrary code execution risk
|
|
7
|
+
severity: critical
|
|
8
|
+
category: security
|
|
9
|
+
languages: [javascript, typescript]
|
|
10
|
+
confidence: 0.85
|
|
11
|
+
cwe: CWE-95
|
|
12
|
+
pattern: '\beval\s*\('
|
|
13
|
+
explanation: |
|
|
14
|
+
The eval function interprets arbitrary strings as JavaScript and runs
|
|
15
|
+
them in the local scope. Hard to sandbox; trivial to abuse if any
|
|
16
|
+
input crosses a trust boundary.
|
|
17
|
+
recommendation: |
|
|
18
|
+
Use JSON.parse for JSON, a real parser for DSLs, or feature flags /
|
|
19
|
+
dispatch tables for dynamic behavior.
|
|
20
|
+
references:
|
|
21
|
+
- https://eslint.org/docs/latest/rules/no-eval
|
|
22
|
+
- https://cwe.mitre.org/data/definitions/95.html
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Adapted from eslint rule 'no-implied-eval'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: no-implied-eval
|
|
5
|
+
name: Implied dynamic code evaluation
|
|
6
|
+
message: setTimeout/setInterval with a string argument runs as code
|
|
7
|
+
severity: high
|
|
8
|
+
category: security
|
|
9
|
+
languages: [javascript, typescript]
|
|
10
|
+
confidence: 0.8
|
|
11
|
+
cwe: CWE-95
|
|
12
|
+
pattern: '\b(setTimeout|setInterval)\s*\(\s*[''"]'
|
|
13
|
+
explanation: |
|
|
14
|
+
Passing a string (instead of a function) to setTimeout / setInterval
|
|
15
|
+
evaluates that string as code at the global scope — equivalent to
|
|
16
|
+
using the eval function.
|
|
17
|
+
recommendation: |
|
|
18
|
+
Pass an arrow function or function reference: setTimeout(() => doX(), 100).
|
|
19
|
+
references:
|
|
20
|
+
- https://eslint.org/docs/latest/rules/no-implied-eval
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Adapted from eslint rule 'no-new-func'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: no-new-func
|
|
5
|
+
name: Function constructor used to evaluate code
|
|
6
|
+
message: Function constructor compiles strings into code
|
|
7
|
+
severity: high
|
|
8
|
+
category: security
|
|
9
|
+
languages: [javascript, typescript]
|
|
10
|
+
confidence: 0.85
|
|
11
|
+
cwe: CWE-95
|
|
12
|
+
pattern: '\bnew\s+Function\s*\('
|
|
13
|
+
explanation: |
|
|
14
|
+
Constructing a function from a string source compiles arbitrary code
|
|
15
|
+
at runtime, bypassing lexical scope and lint/type analysis.
|
|
16
|
+
recommendation: |
|
|
17
|
+
Define functions inline or via factory closures. If runtime code
|
|
18
|
+
generation is genuinely needed, isolate it in a worker with limited
|
|
19
|
+
capabilities.
|
|
20
|
+
references:
|
|
21
|
+
- https://eslint.org/docs/latest/rules/no-new-func
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Adapted from eslint rule 'no-throw-literal'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: no-throw-literal
|
|
5
|
+
name: Throwing a non-Error literal
|
|
6
|
+
message: Throw an Error subclass, not a raw string or object literal
|
|
7
|
+
severity: medium
|
|
8
|
+
category: correctness
|
|
9
|
+
languages: [javascript, typescript]
|
|
10
|
+
confidence: 0.8
|
|
11
|
+
pattern: '\bthrow\s+[''"`{]'
|
|
12
|
+
explanation: |
|
|
13
|
+
Throwing a string or object literal loses the stack trace and the
|
|
14
|
+
``instanceof Error`` check that downstream catch handlers rely on.
|
|
15
|
+
recommendation: |
|
|
16
|
+
``throw new Error("...")`` (or a custom subclass) so callers get the
|
|
17
|
+
expected interface.
|
|
18
|
+
references:
|
|
19
|
+
- https://eslint.org/docs/latest/rules/no-throw-literal
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Adapted from eslint rule 'no-var'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: no-var
|
|
5
|
+
name: Use of var keyword
|
|
6
|
+
message: Prefer let or const over var
|
|
7
|
+
severity: low
|
|
8
|
+
category: style
|
|
9
|
+
languages: [javascript, typescript]
|
|
10
|
+
confidence: 0.95
|
|
11
|
+
pattern: '^\s*var\s+\w'
|
|
12
|
+
explanation: |
|
|
13
|
+
``var`` declarations are function-scoped and hoisted, leading to
|
|
14
|
+
surprising behavior. ``let`` and ``const`` are block-scoped and
|
|
15
|
+
match developer intuition.
|
|
16
|
+
recommendation: |
|
|
17
|
+
Replace ``var`` with ``const`` for constants or ``let`` for
|
|
18
|
+
reassignable bindings.
|
|
19
|
+
references:
|
|
20
|
+
- https://eslint.org/docs/latest/rules/no-var
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Adapted from eslint rule 'no-with'
|
|
2
|
+
# See ../LICENSE and ../NOTICE for license terms.
|
|
3
|
+
|
|
4
|
+
id: no-with
|
|
5
|
+
name: Use of with statement
|
|
6
|
+
message: with statement is forbidden in strict mode
|
|
7
|
+
severity: high
|
|
8
|
+
category: correctness
|
|
9
|
+
languages: [javascript, typescript]
|
|
10
|
+
confidence: 0.9
|
|
11
|
+
pattern: '\bwith\s*\('
|
|
12
|
+
explanation: |
|
|
13
|
+
``with`` extends the scope chain at runtime, making variable
|
|
14
|
+
resolution ambiguous. It's banned in strict mode and ES modules.
|
|
15
|
+
recommendation: |
|
|
16
|
+
Bind the object to a local variable and access fields explicitly.
|
|
17
|
+
references:
|
|
18
|
+
- https://eslint.org/docs/latest/rules/no-with
|