Skip to content

Commit

Permalink
Add guidance for Python datetime rule
Browse files Browse the repository at this point in the history
  • Loading branch information
danfiedler-msft committed May 22, 2024
1 parent 43bac74 commit 88d10ef
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void Rule_guidance_file_should_exist(DevSkimRule rule)
Assert.IsTrue(File.Exists(guidanceFile), $"Guidance file {guidanceFile} does not exist.");
}

[Ignore] // TODO: temporary to get missing guidance in.
[TestMethod]
[DynamicData(nameof(DefaultRules))]
public void Rule_guidance_should_be_complete(DevSkimRule rule)
Expand Down
2 changes: 1 addition & 1 deletion guidance/DS163877.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ HTML Entity Encode (for content going into HTML) or URL Encode (for content goin

## References

- [OWASP XSS Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html)
- [OWASP XSS Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html)
10 changes: 10 additions & 0 deletions guidance/DS600100.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Possible incorrect datetime format

## Summary

* The `%M` format is 'minute' but used like 'month'
* Resolve this issue by changing the format to `%m`.

## References

* [PHP Manual: strftime](https://www.php.net/manual/en/function.strftime.php)
2 changes: 1 addition & 1 deletion rules/default/correctness/datetime.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"Correctness.DateTime.Format"
],
"severity": "moderate",
"rule_info": "",
"rule_info": "DS600100.md",
"patterns": [
{
"confidence": "high",
Expand Down

0 comments on commit 88d10ef

Please sign in to comment.