Граф коммитов

493 Коммитов

Автор SHA1 Сообщение Дата
Gabe Stocco 7b161f5d9e
Add basic sarif implementation for the analyze command. (#405)
* Add basic sarif implementation for the analyze command.

* Improvements to sarifwriter

* Reduce Redundancy in analyze command.

Fix behavior when no tags are present on a match (don't add if limiting based on number of matches per tag).

* Populate required message parameter.

* Add options to include repository information when outputting sarif.

* Dont collect context when outputting sarif.

* Improve option handling when format is sarif.

* Update Program.cs

* Fix check for number of tag matches.

* Support Metrics in any portion of tag

Fix #406.
2021-12-20 15:20:16 -08:00
Gabe Stocco 9bbfdb3f79
Fix incorrect internal visibility on new property. (#404)
* Fix wrong visibility on new property.

* Comments

* Don't double run CodeQL on PRs.
2021-12-10 09:27:22 -08:00
Gabe Stocco 860d9009b4
Fix #402 (#403)
* Fix #402

Adds an argument to limit the number of matches a given tag will produce.
2021-12-09 17:47:20 -08:00
Gabe Stocco a4993261d3
Bubble up the option to get all tag results from build files to the CLI. (#401) 2021-12-01 21:02:31 -08:00
Gabe Stocco 02766b1cc9
Update TextContainer.cs (#399) 2021-11-04 12:27:04 -07:00
Gabe Stocco 302a5d34e9
Fix #396 (#397)
If the first character of a file was '\n' we were incorrectly skipping adding the linestart for that line.
2021-11-03 13:09:32 -07:00
hiteshbedre 0e2ea0c2eb
Comments : Ruby : Skip code under multi-line commented portion (#394) 2021-09-13 12:10:17 -07:00
Michael Hendrickx 78cc806642
Fixed small markdown error in readme (#393)
The ``` -sequence in markdown marked that block as code, and it didn't render the link to build.md correctly.
2021-08-28 20:04:56 -07:00
Suraj Jacob 4e0f6d7958
Minor json fixes for rules (#385)
* Minor json fixes for rules

* one more

* one more

* correct pattern

* Update outbound_network.json

Co-authored-by: Gabe Stocco <98900+gfs@users.noreply.github.com>
2021-07-28 16:58:56 -07:00
Gabe Stocco 4faa00320a
Fix #390 (#391)
* Fix #390

Adds ability to pack embedded rules either alone or alongside custom rules.

* Fix broken rule verifier (custom rules) (#389)

* Fix broken rule verifier (custom rules)

* Fix test.

Co-authored-by: Gabe Stocco <98900+gfs@users.noreply.github.com>

* Fix #390

Adds ability to pack embedded rules either alone or alongside custom rules.

* Fix tests

Co-authored-by: Michael Scovetta <michael.scovetta@microsoft.com>
2021-07-28 16:01:21 -07:00
Michael Scovetta 2c5439e906
Fix broken rule verifier (custom rules) (#389)
* Fix broken rule verifier (custom rules)

* Fix test.

Co-authored-by: Gabe Stocco <98900+gfs@users.noreply.github.com>
2021-07-28 14:53:41 -07:00
David Alcantar 8b5707325d
Fix .Commands Package References to .Common (#387) 2021-07-02 13:26:21 -07:00
Gabe Stocco 01a71cc457
Fixes listing tags on report. (#383) 2021-06-17 14:21:18 -07:00
Gabe Stocco a76fb44fcf
Clean up existing rules (#381) 2021-06-10 12:59:44 -07:00
Gabe Stocco b076fc79c0
Rename argument to reduce confusion if attempting to use regular strings with the old -k (#380)
* Rename argument to reduce confusion if attempting to use regular strings with the old -k

* Update tests

* Bump to 1.4

* Fix TagDiff -k option

* Update Docs

* Bring better options parity between Analyze and TagDiff commands

* Update README.md

* Remove No File Metadata option from tagdiff

It never returned file metadata.

* Update CLICmdOptions.cs
2021-06-01 11:43:32 -07:00
Gabe Stocco 4ce91639d6
Fix Producing Both JSON and HTML reports (#379)
* Don't produce both JSON and HTML

* Bump Dependencies

* Fix eample in options

* Refactor Logging into Common Libary

* Fix GetTags Behavior

* Add option to skip collecting file metadata

* Reduce amount gathering by excerpt to avoid gathering huge amounts of data

* Explain new context-lines behavior in Options description

* Add test for multifile tags behavior

* Unify how rules are gotten between regular and async

* Improve cache behavior
2021-05-27 09:13:17 -07:00
Gabe Stocco d9f849d0b2 Fix TagDiff 2021-05-25 14:59:06 -07:00
Gabe Stocco 11310fd01d
Fix -k option (#376)
* Fix -k option

* Dont publish from development

* use recursive extractors built in deny filters
2021-05-25 13:13:57 -07:00
Gabe Stocco 043a0df2ba
Release 1.3 (#375)
* First Commit 1.3 Beta (#344)

* Add an AsyncEnumerable version of getting results.

* Fix

* Add rewritten parallel implementation

* Use the new methods

* Fix metadata in HTML report

* Adds a progress bar

* Use the data from the metadata object for the progress bar

* Fixes

* Fix not incrementing number of total files.

* clean up

* Fix end of line finding for comment checking.

* Simplify pack rules

* Refactor FileChecksPassed

* Don't serialize unneeded values.

* Fix test case

* Adds the GetTags command

* Remove tests that test removed functionality

* Build Fixes

* Nullability fixes

* Fix tests

* Fix GetTags and tests

* Fix MetaData.cs

* Fix test

* Fix #342

Adds per file timeout

* Adds timeout to gettags

* typo

* Improve progress bar

* Add Metadata for files scanned and time taken to scan

* Add ScanState field for analyze metadata

* Fix

* Add file timings to get tags command.

* Rewrite Metadata and Metadata helper to simplify collection.

* Misc Cleanup

* Fixes

* Update GetTagsCommand.cs

* Spruce up progress bars.

* Nicer progress information

* Add ETA to progress

* More progress bar improvements.

* use built in eta

* Simplify PopulateRecords

* Disable parallel extraction

* Update version.json

* Catch overflow exceptions

* Use GetTags instead of Analyze command for TagDiff and TagTest

* Update core-pipeline.yml

* Remove Unused UniqueTagsExceptions

* Simplify Skip logic

* Clean up

* Fix Exclusions bug

* Fix binary file exclusions

* Dont open browser

* Remove browser open

* only chomp 1024 bytes

* Fix logging

* Change timeout to milliseconds

* Fix binary file detection

* Only check 1024 characters for control characters

* Fix binary checking

* Update MetaDataHelper.cs

* fix html tests

* Update Utils.cs

* Improve binary checking

* Remove tag output only option from analyze

Use the get tags command.

* Code Cleanup

* improve some variable names

* Remove Simple Tags Tests

* Bump dependencies.

* Simplify JsonWriter

* Remove extraneous header on text results

* Clean up

* Simplify last updated

* Remove unused lastupdated references

* Fix #343

* Update GetTagsCommand.cs

* Clean up Dependencies

* Save access and create times

* Fix printing to console over progress bar.

Console output is saved until after the progress bar completes.

* Show file counts in progress bar

* Fix cancelling.

* Remove unused Dummy Writers

* Gfs/cli timeout (#349)

* Add overall processing time out for GetTags and Analyze commands

* Separate state for timed out skipped

* Update FileRecord.cs

* Fix binary checking (#351)

* Fix binary checking

* Fix Binary Checking in GetTags

* Update GetTagsCommand.cs

* Update AnalyzeCommand.cs

* Add async (#354)

* Add Async Versions of GetResult appropriate for WASM use

* Fix GetTags command uniqueness

* Update RuleProcessor.cs

* Build fix

* Fix #353

* Add async tests

* Fixes enumeration printing (#357)

* Fix enumeration count of entries.

* Build fix

* Dont list meaningless info when running get tags progress bar

* Update RuleProcessor.cs

* Options for Skipping gathering excerpts and skipping unknown files (#361)

* Add option to grab number of lines of context and disable gathering on GetTags for performance

* Use concurrent que in stead of bag for performance.

* Default skip unknown files

* build fix

* Bump dependencies

* Publish Beta Builds from Development

* Gfs/some tests (#363)

* Fix Unknown files being scanned by all language rules.

* New tests and fixes for unknown file type scans

* Update AnalyzeJsonWriter.cs

* Write Faster GetLastIndex

* Slightly faster again

* Make fast IndexOf method

* Fix

* Fix test bug

* Test fix

* Minor performance improvements. (#364)

* Performance and misc improvements (#365)

* Keep track of column for matches properly

* Recfactor try catch

* Fix excertp gathering for async analyze

* Rethrow instead of clobbering

* Use substring when possible for performance

Seeing significant performance uplift.

* Fix exception getting version info

* Fix OatSubstringIndexOperation

* Update AnalyzeBenchmark.cs

* Fix rule verifier

* Support case insensitive string and substring operations

* Enable verify rules test

* Fix default rules verification to actually check embedded rules.

* Clean up isbetween a bit

* clean up

* Remove unneeded test

* Test fix

* Add OAT validation to rule validator

* Fix same-line findings

* Add a rule verification for the within conditions.

* Fix rule verifier

* Fix storage rules

* Add an exporting progress bar. (#367)

* Add an exporting progress bar.

* Fix gettags command to return actual exit code.

* Cache Results of IsCommented (#369)

* Improve Scope Match performance

* Fix

* Update TextContainer.cs

* Test fix

* Update TestAnalyzeCmd.cs

* Update TextContainer.cs

* Update TextContainer.cs

* Update TextContainer.cs

* Update TextContainer.cs

* Clean up text container

* Update RuleProcessor.cs

* Use Globs for file exclusions

* Update AnalyzeCommand.cs

* Update CLICmdOptions.cs

* Add none to disable

* Update GetTagsCommand.cs

* Fix build

* Fix Text Contains

Respect parallel in rule processor
Update descriptions for command options
Reduce sleep frequency

* Fix filter tests

* Update TestGetTagsCmd.cs

* Repro of null rules in match

* Remove TagTest

GetTags seems to perform the same task.

* Remove TagTest command

* Limit parallelization to decrease timeouts

* Fix test

* Fix regexword implementation

* Clean up rules

Improve some rules, remove some unneeded fields.

* Fix Rules and RulePacker

Fix Regex Word behavior

* Fix Pack Rules

* Narrow media regexes

* Fix tests

* Fix test

* Improve TagDiff performane

* Fix async analyze

* Update TestAnalyzeCmd.cs

* Update TestAnalyzeCmd.cs

* Update TestAnalyzeCmd.cs

* Workaround for IndexOf on Windows

* Update OatSubstringIndexOperation.cs

* Remove multithread enumerating

* Update TextContainer.cs

* Update RuleProcessor.cs

* Don't precheck matches count.

* Respect numcontextlines

* Update AnalyzeBenchmark.cs

* Add Multi path option

* Update TestGetTagsCmd.cs

* Fix verifier

* simplify regex word construction

* Better simplify

* Update TestGetTagsCmd.cs

* Update test numbers to match fixed behavior of regex-word

* Update Ruleset.cs

* Fix test numbers with fixed regex word

* Update TagDiffCommand.cs

* Make Get-Tags an option of Analyze

GetTags and Analyze were mostly duplicative so instead the GetTags behavior is now provided by giving `-t`  or `TagsOnly` to Analyze.

* bump to RC

* fixes

* Rename tests to accurately reflect using analyze command

* Support multiple input for TagDiff via comma separated

* Remove test for removed functionality

* Add missing comments

* More comments.

* Make FilePathExclusions parsed automatically.

* Roslynator Changes

* Respond to comments.

* Fix tests

* Fix tests

* More Roslynator Changes

* Improve Exclusion Speed (#374)

* Shrink Icon

Fix #330

* Skip files earlier

* Update AnalyzeCommand.cs

* fix bad merge

* Update version.json

* Fix linebreaks to show finished progressbars
2021-05-25 07:33:23 -07:00
Gabe Stocco c4c02e2fc4
Fix #370 (#371) 2021-05-19 10:30:29 -07:00
Gabe Stocco 405c4f8461
Skip Unknown File Types by Default (#360)
* Skip Unknown File Types by Default

* Bump Dependencies
2021-05-10 10:23:02 -07:00
Gabe Stocco 25ac4c1e96
Backport Binary File Skipping to 1.2 (#350)
* Add Binary file check to skip.

* Update AnalyzeCommand.cs

* Update AnalyzeCommand.cs

* Update AnalyzeCommand.cs

* Update AnalyzeCommand.cs

* Update AnalyzeCommand.cs
2021-05-05 15:32:49 -07:00
Gabe Stocco 0bc540692a
Fix result loss bug while running parallel (#348)
* Fix result loss bug while running parallel

* Update AnalyzeCommand.cs
2021-05-05 11:34:04 -07:00
Gabe Stocco 7ba3e09198
Remove incorrect line number from template. (#347) 2021-04-26 08:12:14 -07:00
Gabe Stocco 46710cfc12
Fix potential issue fetching keys (#335)
* Don't create unneeded dictionaries.

* Update .gitignore

* Code cleanup

* Update MetaData.cs

* Address Nullability Issues

* Simplify excerpt
2021-03-30 13:34:44 -07:00
Gabe Stocco 8fb53d0fd1
.NET 5 ify (#334)
* .NET 5 ify

* More net changes

* Update rules packer to .net 5.0
2021-03-30 11:42:41 -07:00
Gabe Stocco d5674d8098
Update tagreportgroups.json (#333)
* Update tagreportgroups.json

* Update tagreportgroups.json
2021-03-30 10:59:08 -07:00
Gabe Stocco cb43e5a111
Reduce memory usage (#332)
* Reduce memory usage

Removes duplicate copies of full contents of files.

* Check for carriage returns
2021-03-30 10:55:55 -07:00
Gabe Stocco cac68e72ec
Add FileNamesRegex field to App inspector rules (#327)
* Add Regex Support to Applies To

* Split Applies To and FileName regexes

* Add Rule Verification for FileRegexes

Fix bug in CompiledFileRegex getter

* Update Rule.cs

* Union instead of add to prevent rule dupes

* remove unneeded tolist

* dont serialize compiledfileregexes

* Update RuleProcessor.cs

* Remove extraneous :
2021-03-17 11:18:00 -07:00
Gabe Stocco 72d7dae735
Fix skip logic (#326)
* Update AnalyzeCommand.cs

* fix concurrency bugs.

* Fix tests

* Fix test regression.
2021-03-15 17:56:28 -07:00
Gabe Stocco 248354bc3e
Fix Zero Length FileEntry Parsing bug (#325)
* Fix Zero Length FileEntry Parsing bug

* Use single threaded recursive extractor

* Update AnalyzeCommand.cs

* Incorporate changes from #324
2021-03-15 09:41:41 -07:00
David Alcantar 765393d8bc Update WriteOnce.cs 2021-03-12 13:41:14 -08:00
David Alcantar 9a0fb6c9ce
Update core-pipeline.yml (#323) 2021-03-12 13:38:45 -08:00
Michael Scovetta 36eaa5a97e
Re-authorize and update service connection. (#322) 2021-03-11 12:12:50 -08:00
Gabe Stocco 5b18da37a0
Now scan unknown filetypes (#321)
* Now scan unknown filetypes

* Whitespace

* ensure LanguageInfo isn't null

Fix files skipped not incrementing.

* Add TreatEverythingAsCode option
2021-03-10 19:16:48 -08:00
Guy Acosta ddf3ae3302
Web app rules (#318)
* Support for issue #307 web attributes detection added including HTML5 key features use, session cookie attributes, HTML security/other headers detection and others.

* Adds pipeline tool and web app results to html key features report including many of the new web app feature detection patterns, static analyzers, linters, and more.
2020-12-12 15:05:38 -07:00
Gabe Stocco 1deb5f2e8f
OAT Usage Fixes (#317)
* OAT Usage Fixes

* Unit test correction for OAT clauses fix

Co-authored-by: Guy Acosta <guacosta@microsoft.com>
2020-12-11 13:44:36 -07:00
Guy Acosta b5acc89d2d
Fix for #308 (proposed) (#314)
* Fix for #308 (proposed)

* Id updates only

* Description cleanup and final tool selection.

* Remove extraneous empty style tags
2020-12-03 08:32:11 -07:00
David Alcantar cbaea8e627
Update codeql-analysis.yml 2020-12-02 12:33:47 -08:00
David Alcantar 49f69ae9f6
Update README.md 2020-12-02 10:32:45 -08:00
David Alcantar af40b0b7b2
Bump NBGV to Fix CodeQL Workflow (#315)
* Update nbgv build props and version.json

* Bump nbgv sln references

* Update codeql-analysis.yml
2020-11-25 20:00:59 -07:00
Guy Acosta 1436f4f908
Poli check edit and env rule adds (#312)
* Adds required policheck task to sdl pipeline.

* Enables ability to see Guardian exports for code scans like Policheck

* Minor edit for regional lang scanner and enhancement to environment read/write rule support i.e. #309

* Correction to regex needed.  Note rulespacker binaries need updating to align to new verification checks.
2020-10-27 16:44:49 -06:00
Guy Acosta ae537ae86d
Add code scan report artifact (#311)
* Adds required policheck task to sdl pipeline.

* Enables ability to see Guardian exports for code scans like Policheck
2020-10-27 11:33:58 -06:00
Guy Acosta e2fc979897
Adds required policheck task to sdl pipeline. (#310) 2020-10-27 10:29:05 -06:00
Guy Acosta a29059b656
Update README.md 2020-10-18 11:51:08 -06:00
David Alcantar b27a533c3d Update core-pipeline.yml for Azure Pipelines 2020-10-07 00:39:07 -07:00
David Alcantar f8c964df50 Update core-pipeline.yml for Azure Pipelines 2020-10-05 19:58:27 -07:00
Guy Acosta 275dbc0449
Update js lib versions (#305)
* Adds rule improvements for Android Intents, IOS permissions, UWP capability declarations.

* Updates to new rules, pattern aggregation and description updates.  Fix for endLocationLine if match is on last line of the file.  Minor wording improvements on html report.

* Tag and description updates

* Updates popper lib version.  D3 cannot be updated as it breaks existing functionality.  D3 ref is kept but copy is added to code for safekeeping.

* #262, #303 fixes.  Also orders feature groups more alphabetically.

* Identified ref for 3 js libs allowing removal of local copies.
2020-09-29 20:43:03 -06:00
Guy Acosta 74a80a6e85
Device permissions support added (#304)
* Adds rules for Android Intents, IOS permissions, UWP capability declarations.

* Updates to new rules, pattern aggregation and description updates.  Fix for endLocationLine if match is on last line of the file.  Minor wording improvements on html report.

* Tag and description updates
2020-09-29 16:24:12 -06:00
David Alcantar a8de9ba208 Update core-pipeline.yml for Azure Pipelines 2020-09-28 13:29:51 -07:00