Skip to content

Commit

Permalink
POL-1398 Azure Expiring Credentials - fix Days Until Expiration bug (#…
Browse files Browse the repository at this point in the history
…2772)

* change on line 351 to correct calculation on days until expiration

* update changelog with changes made

* Update Meta Parent Policy Templates (#2773)

Co-authored-by: nia-vf1 <nia-vf1@users.noreply.github.com>

* update policy permissions list

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: nia-vf1 <nia-vf1@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 22, 2024
1 parent 79fe884 commit 115134a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6516,7 +6516,7 @@
{
"id": "./operational/azure/azure_certificates/azure_certificates.pt",
"name": "Azure Expiring Certificates",
"version": "4.0.0",
"version": "4.0.1",
"providers": [
{
"name": "azure_rm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3780,7 +3780,7 @@
required: true
- id: "./operational/azure/azure_certificates/azure_certificates.pt"
name: Azure Expiring Certificates
version: 4.0.0
version: 4.0.1
:providers:
- :name: azure_rm
:permissions:
Expand Down
4 changes: 4 additions & 0 deletions operational/azure/azure_certificates/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v4.0.1

- Fixed issue where policy incident would show incorrect `Days Until Expiration` for several resources

## v4.0.0

- Added ability to delete Azure certificates automatically or manually
Expand Down
4 changes: 2 additions & 2 deletions operational/azure/azure_certificates/azure_certificates.pt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ category "Operational"
severity "low"
default_frequency "daily"
info(
version: "4.0.0",
version: "4.0.1",
provider: "Azure",
service: "PaaS",
policy_set: "Expiring Certificates"
Expand Down Expand Up @@ -348,7 +348,7 @@ script "js_azure_certificates_expiring", type: "javascript" do
if (today >= expiration_date) {
status = "Expired"
} else {
days_until_expiration = Math.round((today - expiration_date) / 86400000)
days_until_expiration = Math.round((expiration_date - today) / 86400000)
}
if (status == "Expired" || days_until_expiration <= param_expiration_days) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ category "Meta"
default_frequency "15 minutes"
info(
provider: "Azure",
version: "4.0.0", # This version of the Meta Parent Policy Template should match the version of the Child Policy Template as it appears in the Catalog for best reliability
version: "4.0.1", # This version of the Meta Parent Policy Template should match the version of the Child Policy Template as it appears in the Catalog for best reliability
publish: "true",
deprecated: "false"
)
Expand Down

0 comments on commit 115134a

Please sign in to comment.