Skip to content
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

Expand properties for collected resource information #149

Closed
BernieWhite opened this issue Nov 30, 2022 · 1 comment
Closed

Expand properties for collected resource information #149

BernieWhite opened this issue Nov 30, 2022 · 1 comment

Comments

@BernieWhite
Copy link
Contributor

BernieWhite commented Nov 30, 2022

For PSRule for Azure to evaluate many rules properties must be able to be inspected for each resource. For example:

The property properties.sslEnforcement need to be inspected to determine if it set to Enabled.

---
# Synopsis: Enforce encrypted PostgreSQL connections.
apiVersion: github.com/microsoft/PSRule/v1
kind: Rule
metadata:
  name: Azure.PostgreSQL.UseSSL
  ref: AZR-000147
  tags:
    release: 'GA'
    ruleSet: '2020_06'
    Azure.WAF/pillar: 'Security'
  labels:
    Azure.ASB.v3/control: 'NS-2'
spec:
  type:
  - Microsoft.DBforPostgreSQL/servers
  condition:
    field: properties.sslEnforcement
    equals: Enabled

Currently the get API only retrieves the resource itself without the properties property.

https://github.com/JulianHayward/Azure-MG-Sub-Governance-Reporting/blob/74363de2e51343864fffc9ddab5792dfc9e863da/pwsh/AzGovVizParallel.ps1#L28264

Because we need to do this based the resource provider API version I propose we:

  • Get each resource provider API version.
  • Get each resource via resource ID using the latest API version reported by the resource provider.

Thoughts?


Related to PSRule for Azure issues:

@JulianHayward
Copy link
Owner

AzGovViz / PSRule integration under review. Findings and decision on how to proceed will be posted soon. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants