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

🐛 allow running shodan provider with inventory file #4763

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

imilchev
Copy link
Member

Using an inventory file which provides the Shodan token as a vault secret triggeres an error. This is now fixed and we can run scans with vault secrets for Shodan

Signed-off-by: Ivan Milchev <ivan@mondoo.com>
@@ -51,10 +52,9 @@ func (s *Service) ParseCLI(req *plugin.ParseCLIReq) (*plugin.ParseCLIRes, error)
if token == "" {
token = os.Getenv("SHODAN_TOKEN")
}
if token == "" {
return nil, errors.New("no shodan token provided, use --token or SHODAN_TOKEN")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also validated in the connection. We don't need to check it here. This makes sure inventory files with vault secrets are accepted. If no token is provided, we will error out when the connection is created

if token == "" {
return nil, errors.New("a valid Shodan token is required, pass --token '<yourtoken>' or set SHODAN_TOKEN environment variable")
}

Copy link
Contributor

Test Results

3 116 tests  ±0   3 115 ✅ ±0   1m 36s ⏱️ -1s
  371 suites ±0       1 💤 ±0 
   28 files   ±0       0 ❌ ±0 

Results for commit ffa7135. ± Comparison against base commit 6cb6c4e.

Copy link
Contributor

@afiune afiune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imilchev imilchev merged commit b13bf2f into main Oct 17, 2024
15 checks passed
@imilchev imilchev deleted the ivan/shodan-inventory-files branch October 17, 2024 09:54
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants