The Wayback Machine - https://web.archive.org/web/20210301173857/https://github.com/github/codeql/pull/5083
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

Adding queries related to the Solorigate campaign #5083

Merged
merged 18 commits into from Feb 18, 2021

Conversation

@raulgarciamsft
Copy link
Contributor

@raulgarciamsft raulgarciamsft commented Feb 3, 2021

No description provided.

@raulgarciamsft raulgarciamsft requested a review from github/codeql-csharp as a code owner Feb 3, 2021
@intrigus-lgtm
Copy link
Contributor

@intrigus-lgtm intrigus-lgtm commented Feb 3, 2021

@raulgarciamsft I think you have to auto-format the ql code (Or is it formatted? Then ignore this)
You can do that by running codeql query format --in-place on the changed files or by using the CodeQL extension for VS Code (I think it's called Format Document in VS Code).

@raulgarciamsft
Copy link
Contributor Author

@raulgarciamsft raulgarciamsft commented Feb 3, 2021

@raulgarciamsft I think you have to auto-format the ql code (Or is it formatted? Then ignore this)
You can do that by running codeql query format --in-place on the changed files or by using the CodeQL extension for VS Code (I think it's called Format Document in VS Code).

I completely forgot about that during our internal review. I will fix the formatting right now.

@raulgarciamsft
Copy link
Contributor Author

@raulgarciamsft raulgarciamsft commented Feb 4, 2021

Question to the GitHub team. We are seeing a number of failures in the CodeQL task on files we did not modify. Is there anything we can/should do in this case? Thanks

@tibbes tibbes changed the base branch from master to main Feb 4, 2021
@hvitved
Copy link
Contributor

@hvitved hvitved commented Feb 4, 2021

Question to the GitHub team. We are seeing a number of failures in the CodeQL task on files we did not modify. Is there anything we can/should do in this case? Thanks

No, those errors are not caused by your changes, but instead a combination of this PR initially targeting master instead of main, and CodeScanning not being configured properly (fixed by #5086).

@hvitved hvitved added the C# label Feb 4, 2021
Copy link
Collaborator

@sj sj left a comment

Thank you very much for this, @raulgarciamsft! I've done a very cursory review with some initial comments. I''ll leave the in-depth review to the experts 😄

Copy link
Contributor

@hvitved hvitved left a comment

Thanks a lot for your contributions, Raul. This is a very interesting an novel use of CodeQL, at least not something I have seen before or thought about myself :-)

Changing the TimeBomb query to path-problem (any suggestions to improve it would be welcomed, no previous experience iwth path-problem queries)
…back will be welcomed
@hvitved
Copy link
Contributor

@hvitved hvitved commented Feb 5, 2021

I forgot to mention it on the first review, but would it be possible to add some tests for the new queries?

Copy link
Contributor

@shati-patel shati-patel left a comment

Thank you for this! I've had a look on behalf of the documentation team, to keep some of the style and terminology similar to our existing queries.

Since the "Solorigate-Readme" contains lots of helpful information, I've only suggested small additions to the .qhelp files. (As a future task, we could perhaps move more details into the .ql and .qhelp files themselves?)

@joshbw
Copy link

@joshbw joshbw commented Feb 6, 2021

I forgot to mention it on the first review, but would it be possible to add some tests for the new queries?

Yeah - we will do that early next week. We have been testing detection against the actual Orion implant so had overlooked our normal test dev. Sorry about that

@raulgarciamsft raulgarciamsft changed the base branch from main to lgtm.com Feb 8, 2021
@raulgarciamsft
Copy link
Contributor Author

@raulgarciamsft raulgarciamsft commented Feb 9, 2021

I forgot to mention it on the first review, but would it be possible to add some tests for the new queries?

Done. I added some unit tests. I tried to keep the tests simple, but let me know if you want me to make any changes. Thanks

@raulgarciamsft raulgarciamsft requested review from hvitved and sj Feb 9, 2021
Copy link
Collaborator

@sj sj left a comment

It turns out that I wrote a bunch of review comments last week that were never actually submitted in a review. Very sorry about that. Here they are. Let me know if you think it's feasible to make some of these changes in the next day or two; if not we'll note them for making later.

raulgarciamsft and others added 2 commits Feb 10, 2021
…te/Solorigate.qhelp

Co-authored-by: Bas van Schaik <5082246+sj@users.noreply.github.com>
@raulgarciamsft
Copy link
Contributor Author

@raulgarciamsft raulgarciamsft commented Feb 10, 2021

I think we have addressed all comments (BTW. Thanks a lot for all your feedback). Please let me know if we missed anything and I will fix it ASAP.

@raulgarciamsft
Copy link
Contributor Author

@raulgarciamsft raulgarciamsft commented Feb 11, 2021

I fixed the comments we were missing from @hvitved (for some reason I couldn't find them in the GitHub view, but we found them via email). Please reply to this message if there are any other comments we are missing and I will try to find the corresponding emails. Thanks a lot.

@raulgarciamsft
Copy link
Contributor Author

@raulgarciamsft raulgarciamsft commented Feb 12, 2021

There is a QHelp preview check that is failing. Not sure if it is caused by the Solorigate.qhelp file (that is shared for all the queries in this folder & only intended as an include for the individual .qhelp files) or something else. Please let us know what is the error & what can we do to fix it. Thanks

@shati-patel
Copy link
Contributor

@shati-patel shati-patel commented Feb 12, 2021

There is a QHelp preview check that is failing. Not sure if it is caused by the Solorigate.qhelp file (that is shared for all the queries in this folder & only intended as an include for the individual .qhelp files) or something else. Please let us know what is the error & what can we do to fix it. Thanks

I asked about this internally, and it looks like this is a limitation of the QHelp preview check itself. A possible fix would be to change the name of the included file to Solorigate.qhelp.inc (and change the includes to <include src="Solorigate.qhelp.inc" />).

If that doesn't work, you might have to duplicate the shared snippet as a way to unblock the check, and we can tidy it up later on!

Copy link
Contributor

@hvitved hvitved left a comment

I believe all my comments have now been addressed. Thanks for your patience @raulgarciamsft .

@raulgarciamsft raulgarciamsft requested a review from sj Feb 16, 2021
@tamasvajk
Copy link
Contributor

@tamasvajk tamasvajk commented Feb 17, 2021

@raulgarciamsft Can you tell me why the PR targets the lgtm.com branch? Could you please change it to main?

@raulgarciamsft raulgarciamsft changed the base branch from lgtm.com to main Feb 17, 2021
@raulgarciamsft raulgarciamsft dismissed hvitved’s stale review Feb 17, 2021

The base branch was changed.

@raulgarciamsft
Copy link
Contributor Author

@raulgarciamsft raulgarciamsft commented Feb 17, 2021

@raulgarciamsft Can you tell me why the PR targets the lgtm.com branch? Could you please change it to main?

Fixing the PR target... I changed the branch by mistake.

Copy link
Contributor

@tamasvajk tamasvajk left a comment

All changes appear to be addressed.

@tamasvajk tamasvajk dismissed sj’s stale review Feb 18, 2021

All changes appear to be addressed.

@tamasvajk tamasvajk merged commit 8e7a823 into github:main Feb 18, 2021
7 checks passed
7 checks passed
CodeQL-Build CodeQL-Build
Details
triage
Details
C# Language Tests (GitHub Actions) Internal CI run started by Qlucie
Details
C# QLDoc Checks (GitHub Actions) By qlucie
Details
Checks (GitHub Actions) Internal CI run started by Qlucie
Details
CodeQL No new or fixed alerts
Details
QHelp Preview Checks (GitHub Actions) Internal CI run started by Qlucie
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
7 participants