Skip to content

Commit

Permalink
Update check policy to v9 (#387)
Browse files Browse the repository at this point in the history
* Update check policy to v9
* v9-ize the GPG check

Signed-off-by: Ben Rockwood <[email protected]>
  • Loading branch information
benr authored Nov 8, 2023
1 parent 244678b commit 7079438
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
21 changes: 10 additions & 11 deletions test/cnspec/check-certificate.mql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@
policies:
- uid: check-certificate
name: Check Mondoo's public code signing certificate
version: "1.0.0"
version: 1.1.0
tags:
mondoo.com/category: security,certificate
mondoo.com/platform: local
authors:
- name: Mondoo Inc
email: [email protected]
tags:
mondoo.com/platform: local
mondoo.com/category: security,certificate
specs:
- asset_filter:
query: asset.family.contains( _ == 'linux' )
scoring_queries:
check-certificate-not-expired:
groups:
- filters: asset.family.contains("unix")
checks:
- uid: check-certificate-not-expired

queries:
- uid: check-certificate-not-expired
title: Ensure the code signing certificate is not expired
docs:
desc: |
Code Signing Certificates are used by Mondoo to digitally sign executables, packages and scripts as a way for end-users to verify that the code they receive has not been altered or compromised by a third party.
query: parse.certificates('public-code-signing.cer') { expiresIn.days > 30 }

mql: parse.certificates('public-code-signing.cer') { expiresIn.days > 30 }
25 changes: 10 additions & 15 deletions test/cnspec/check-gpg.mql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@
policies:
- uid: check-gpg
name: Check Mondoo's public package signing key
version: "1.0.0"
version: 1.0.0
tags:
mondoo.com/category: security,gpg
mondoo.com/platform: local
authors:
- name: Mondoo Inc
email: [email protected]
tags:
mondoo.com/platform: local
mondoo.com/category: security,gpg
specs:
- asset_filter:
query: asset.family.contains( _ == 'linux' )
scoring_queries:
check-gpg-not-expired:
groups:
- filters: asset.family.contains("unix")
checks:
- uid: check-gpg-not-expired
queries:
- uid: check-gpg-not-expired
title: Ensure the package signing gpg key is not expired
docs:
desc: |
GPG keys are used by Mondoo to digitally sign Linux/ UNix packages as a way for end-users to verify that the packages they receive has not been altered or compromised by a third party.
query: |
parse.openpgp( path: "./public-package-signing.gpg" ).all(
identities.all(
signatures.all( keyExpiresIn.days > 30 )
)
)
mql: |-
parse.openpgp( path: "./public-package-signing.gpg")[0]{ identities{ signatures{ keyExpiresIn.days > 30 } } }

0 comments on commit 7079438

Please sign in to comment.