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

add links from CLI output to capa rules website #2337

Closed
williballenthin opened this issue Aug 27, 2024 · 7 comments · Fixed by #2338
Closed

add links from CLI output to capa rules website #2337

williballenthin opened this issue Aug 27, 2024 · 7 comments · Fixed by #2338
Labels
enhancement New feature or request

Comments

@williballenthin
Copy link
Collaborator

we can use a modern terminal feature to make some text a link to a URL, such as described here: https://www.willmcgugan.com/blog/tech/post/real-working-hyperlinks-in-the-terminal-with-rich/

So, for example, each rule name in the default output could be a link to the rules website, showing the rule content.

I think that for terminals that don't support this feature, the link degrades to text, just like is shown today.

The rich library that we use for rendering already has a link feature that we can use here.

@williballenthin williballenthin added the enhancement New feature or request label Aug 27, 2024
@williballenthin
Copy link
Collaborator Author

williballenthin commented Aug 27, 2024

other places:

  • if/when we show global prevalence information, those terms could link to VT searches
  • ATT&CK and MBC links
  • reference links
  • sample SHA256 on VT

@williballenthin
Copy link
Collaborator Author

image

@williballenthin
Copy link
Collaborator Author

but when combining with color characters, tabulate (i think) gets confused about the cell width:

image

we may need to migrate to rich to build the tables or hack around a bit.

@williballenthin
Copy link
Collaborator Author

image

@fariss
Copy link
Collaborator

fariss commented Aug 27, 2024

Does this feature work with all terminal emulators? I imagine only modern consoles supporting this
EDIT: If unsupported consoles display normally (i.e. the output remains unaffected), this would be a great addition

@williballenthin
Copy link
Collaborator Author

Yeah, when unsupported, then the text falls back to how it's shown today. And I don't think there's logic that does this - the terminal emulator just ignores the control codes it doesn't understand.

@williballenthin
Copy link
Collaborator Author

It doesn't work under tmux but does under zellij and xterm. i can test Windows Thermal Terminal later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants