From be2d2ed3f9b0f0f6aab8f4e51c5ae8a502fcdddf Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Mon, 23 Sep 2024 13:34:17 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Update=20github=20policies=20to?= =?UTF-8?q?=20use=20new=20resource=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/mondoo-github-best-practices.mql.yaml | 12 ++++++------ core/mondoo-github-security.mql.yaml | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/mondoo-github-best-practices.mql.yaml b/core/mondoo-github-best-practices.mql.yaml index a6a058e9..60bfa9fc 100644 --- a/core/mondoo-github-best-practices.mql.yaml +++ b/core/mondoo-github-best-practices.mql.yaml @@ -92,10 +92,10 @@ queries: // if a .github repo exists, then check if the SUPPORT.md is there if ( github.organization.repositories.one(name == ".github") ) { github.organization.repositories.where( name == ".github").all( - files.one( name.downcase == "support.md") - ) || github.repository.files.one( name.downcase == "support.md") + supportFile.exists + ) || github.repository.supportFile.exists } else { - github.repository.files.one( name.downcase == "support.md") + github.repository.supportFile.exists } docs: desc: | @@ -113,10 +113,10 @@ queries: // if a .github repo exists, then check if the CODE_OF_CONDUCT.md is there if ( github.organization.repositories.one(name == ".github") ) { github.organization.repositories.where( name == ".github").all( - files.one( name.downcase == "code_of_conduct.md") - ) || github.repository.files.one( name.downcase == "code_of_conduct.md") + codeOfConductFile.exists + ) || github.repository.codeOfConductFile.exists } else { - github.repository.files.one( name.downcase == "code_of_conduct.md") + github.repository.codeOfConductFile.exists } docs: desc: | diff --git a/core/mondoo-github-security.mql.yaml b/core/mondoo-github-security.mql.yaml index de7d20f3..9fb6a7d5 100644 --- a/core/mondoo-github-security.mql.yaml +++ b/core/mondoo-github-security.mql.yaml @@ -255,10 +255,10 @@ queries: mql: | if ( github.organization.repositories.one(name == ".github") ) { github.organization.repositories.where( name == ".github").all( - files.one( name.downcase == "security.md") - ) || github.repository.files.one( name.downcase == "security.md") + securityFile.exists + ) || github.repository.securityFile.exists } else { - github.repository.files.one( name.downcase == "security.md") + github.repository.securityFile.exists } docs: desc: | @@ -503,7 +503,7 @@ queries: title: Ensure repository defines a security policy impact: 30 mql: | - github.repository.files.one( name.downcase == "security.md") + github.repository.securityFile.exists docs: desc: | This check tries to determine that the repository defines a security policy.