Repository navigation
Conversation
The handler guards its configuration with `if not any((token, analysis_uuid))`, which only raises when both values are missing. When an analyst configures just one of them — an API key without an ANYRUN Analysis UUID, or the reverse — the guard passes and the `None` value flows straight into `SandboxConnector.windows(token, ...)` and the parser. The clear "ANY.RUN API-KEY and Analysis UUID must be specified." error is never shown; instead the import fails later with an opaque authorization or unspecified-exception message that hides the real, trivially fixable cause. Switching the check to `all` makes the guard match the error message it raises. Verified with flake8 on the changed module and the full test suite against a local modules server: 161 passed, 4 skipped, 5 subtests passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018dfYpyaSZd1nxSRLr8suj8
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLUF — A half-configured ANY.RUN import module now fails with its own clear error message.
anyrun_sandbox_import.pyusesif not any((token, analysis_uuid)), which only fires when both values are missing, so a module configured with just the API key or just the Analysis UUID passes aNoneintoSandboxConnector.windows()and the downstream parser.anytoallso the guard matches its own error message, which already states that both must be specified.The config guard in
anyrun_sandbox_import.pyusedany()instead ofall():not any((token, analysis_uuid))is only true when both values are missing, so supplying just one of the two lets aNoneflow straight intoSandboxConnector.windows(token, ...)and the downstream parser. This contradicts the module's own error message, which says both values "must be specified."Impact on a MISP user: a user who misconfigures the module with only the API key (or only the Analysis UUID) set does not get the clear "API-KEY and Analysis UUID must be specified" message. Instead the request fails later with an opaque error from the ANY.RUN SDK or parser, making misconfiguration much harder to diagnose.
Fix: changed
anytoall, so the guard now raises whenever either value is missing, matching the error message's stated requirement. This is a one-token change with no other behavior impact.No security default or contract was changed — this only makes an existing validation check match its own documented intent.
Verification
flake8 --extend-exclude=misp_modules/lib/,tests/,website/on the changed file: clean, no output.Found during a review of the repository; other findings are being submitted as separate PRs.
🤖 Generated with Claude Code