| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…dels and old_models.
…python models, inventory, and example alerts.
…ventory models. Added some example old models.
Changing metadata to under python namespace
There was a problem hiding this comment.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
Sorry, something went wrong.
There was a problem hiding this comment.
File layout 👍 for Python (did not review actual QL code yet)
Thanks for removing security tags for now, we should remember to add them when we want to publish these queries 😅 (I requested this to happen offline)
Sorry, something went wrong.
There was a problem hiding this comment.
The C++ file-layout generally looks ok to me. However, the split between inventory/new_models and inventory/old_models eludes me, especially since inventory/old_models is empty. What is the purpose of this?
Also per our contributing guide, all the queries will need to be tagged with the experimental tag, which seems to be missing ("Experimental queries need to include experimental in their @tags").
I'm also slightly concerned by the lack of tests.
Sorry, something went wrong.
|
The security and experimental tags has been deliberately removed to avoid any risk of these queries to be included in the experimental query suite. |
Sorry, something went wrong.
The new vs old models exists to keep consistency with each language. For CPP we don't have old models, but I also haven't done a deep dive to try to artificially create some. It's also possible I missed some. The tags were removed by request to avoid automatic pack inclusion. We have tests for some of sample alerts internally to Microsoft, but the point of these was to be examples, but we can definitely get tests for these. In terms of the CBOM queries, for this initial push, the focus was on getting our queries into a public space. I expect the underlying models will change and what is being alerted on might change in the near future as well, so our intent was that tests would be developed in the near future for these queries. In fact, we are currently figuring out what test means for bill of material queries as part of this effort (@pwntester is currently running cbom queries on various public repos). My thought was a test should compare the new vs old models so we have something to compare against for regression, which I believe is what @pwntester is currently experimenting with. |
Sorry, something went wrong.
That doesn't really tell me a lot. What's the purpose the the "old" models? Taking the word "old" face-value it's sound like something out dated that we do not want in the repo. |
Sorry, something went wrong.
In some languages there are existing models for cryptography, either partial or mature. Where those exist, we develop queries for CBOM using those models we call them "old" models compared to the current PQC bill of material effort. Queries built upon any new modeling for that purposes of PQC we are calling "new". |
Sorry, something went wrong.
That still doesn't help a lot. Are the old models ours or yours? If they're ours they will be located somewhere else already, and a copy seems unnecessary. If they're yours, why should we become responsible for maintaining something that still sounds like it's outdated? |
Sorry, something went wrong.
|
The queries in these directories are 'inventory' queries (as indicated by the parent directory). They are sub-categorized by if the inventory query uses an existing (older) model for crypto (which we simply import from the part of the repo it already exists in) or it uses a newer model developed for this PQC effort specifically (in which case the crypto models are in this PR). The confusion is that the name of the directory is giving the impression that it contains crypto models. It does not, it contains inventory queries using existing crypto models (just calling them old, but 'classic' might be a better word) or new models. |
Sorry, something went wrong.
|
Thanks for the clarification. I think there's a discussion to be had - at a later moment - as to whether we should have all these inventory queries, but the file-layout looks good as-is. |
Sorry, something went wrong.
There was a problem hiding this comment.
I'm generally fine with this. I haven't looked at the queries in detail. I'll trust the review of @RasmusWL and @jketema.
There is a lot of commented out code. I'd prefer that either the code is deleted, or there is a clear reason why the commented code should remain.
Also, there is a code scanning warning about using camel case of OpenSSL. I'm find either way.
Sorry, something went wrong.
| import experimental.cryptography.CryptoArtifact | ||
| import experimental.cryptography.CryptoAlgorithmNames | ||
|
|
||
| import experimental.cryptography.modules.OpenSSL as OpenSSL |
There was a problem hiding this comment.
For consistency with other names, can you change this to `OpenSsl
Sorry, something went wrong.
|
|
||
| abstract class CryptographicArtifact extends Expr { } | ||
|
|
||
| // /** |
There was a problem hiding this comment.
Any reason why this is commented out? Can you please include a comment explaining why, and why it is important to leave in, or else delete it.
Sorry, something went wrong.
|
|
||
| abstract string getAlgType(); | ||
|
|
||
| // string getAlgType(){ |
There was a problem hiding this comment.
Same as above.
Sorry, something went wrong.
| import experimental.cryptography.utils.OpenSSL.PassthroughFunction | ||
| import experimental.cryptography.utils.OpenSSL.CryptoAlgorithm | ||
| import experimental.cryptography.CryptoArtifact | ||
| // import semmle.code.cpp.ir.dataflow.TaintTracking |
There was a problem hiding this comment.
Delete
Sorry, something went wrong.
There was a problem hiding this comment.
Approving, assuming that the code can be cleaned up in a followup.
Sorry, something went wrong.
There was a problem hiding this comment.
As I said previously
File layout 👍 for Python (did not review actual QL code yet)
Thanks for removing security tags for now, we should remember to add them when we want to publish these queries 😅 (I requested this to happen offline)
Sorry, something went wrong.
…dels-libraries-and-queries-migration 16 cryptography models libraries and queries migration
…dels-libraries-and-queries-migration (#19) 16 cryptography models libraries and queries migration Co-authored-by: Rasmus Wriedt Larsen <rasmuswl@github.com>
…dels-libraries-and-queries-migration (#19) 16 cryptography models libraries and queries migration Co-authored-by: Rasmus Wriedt Larsen <rasmuswl@github.com>
| Back | FazBrowse Home | New Git URL |
Rebased microsoft#17 onto upstream/main.
@bdrodes: