-
Notifications
You must be signed in to change notification settings - Fork 372
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 Github Token as argument to appsec:ruleset:update
task
#3895
Conversation
tasks/appsec.rake
Outdated
http.request(req) do |res| | ||
case res | ||
when Net::HTTPSuccess | ||
File.open("lib/datadog/appsec/assets/waf_rules/#{ruleset}.json", 'wb') do |f| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Perhaps validate whether the file exist before sending http request. Kind of being protective when people refactor code and move files around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it definitely makes sense to check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added here: e3a7fcd
BenchmarksBenchmark execution time: 2024-09-06 14:40:18 Comparing candidate commit e3a7fcd in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 23 metrics, 2 unstable metrics. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3895 +/- ##
=======================================
Coverage 97.85% 97.86%
=======================================
Files 1277 1277
Lines 76403 76403
Branches 3744 3744
=======================================
+ Hits 74767 74772 +5
+ Misses 1636 1631 -5 ☔ View full report in Codecov by Sentry. |
What does this PR do?
This PR modifies
appsec:ruleset:update
rake task to useGITHUB_TOKEN
env variable for fetching AppSec rulesets.Motivation:
Repository
appsec-event-rules
is now private, so we can't download ruleset files without a token.Additional Notes:
-
How to test the change?
Run
GITHUB_TOKEN=... bundle exec rake appsec:ruleset:update[1.13.1]