Hi, what would be wrong with this JSON formatting ...
# fleet
j
Hi, what would be wrong with this JSON formatting when submitting it as a policy to a team? I'm trying to use
fleetctl apply -f <thisfile> --policies-team <teamname>
I'm receiving the error:
Error: failed to unmarshal spec item error unmarshaling JSON: json: cannot unmarshal array into Go value of type spec.Metadata:
Copy code
{
  "name": "CIS - 2.3.17.1 - Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'\n",
  "platforms": "win10",
  "platform": "windows",
  "description": "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account.\nThe recommended state for this setting is: Enabled.\n",
  "resolution": "To establish the recommended configuration via GP, set the following UI path to Enabled:\n'Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account'\n",
  "query": "SELECT 1 FROM registry WHERE (path = 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Policies\\\\System\\FilterAdministratorToken' AND data == 1);\n",
  "purpose": "Informational",
  "tags": "compliance, CIS, CIS_Level1",
  "contributors": "rachelelysia"
}
k
Hi, JJ! It looks like you're missing the the
spec
and
kind
top level keys:
Copy code
{
  "kind":"policy",
  "spec":{
    "name": "CIS - 2.3.17.1 - Ensure 'User Account Control: Admin Approval Mode$
    "platforms": "win10",
    "platform": "windows",
    "description": "This policy setting controls the behavior of Admin Approval$
    "resolution": "To establish the recommended configuration via GP, set the f$
    "query": "SELECT 1 FROM registry WHERE (path = 'HKEY_LOCAL_MACHINE\\\\SOFTW$
    "purpose": "Informational",
    "tags": "compliance, CIS, CIS_Level1",
    "contributors": "rachelelysia"
  }
}