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

Invalid GUIDs for two scripts #149

Open
NiceGuyIT opened this issue May 15, 2023 · 2 comments
Open

Invalid GUIDs for two scripts #149

NiceGuyIT opened this issue May 15, 2023 · 2 comments

Comments

@NiceGuyIT
Copy link
Contributor

While working with the community scripts, I noticed two of them have invalid GUIDs. These are 1 character longer than regular GUIDs. Since changing the GUID will cause the script to disappear for anyone using it, maybe add the scripts with valid GUIDs and rename the existing scripts with a warning.

  {
    "guid": "5a60c13b-1882-4a92-bdfb-6dd1f6a11dd14",
    "filename": "Win_Windows_Update_RevertToDefault.ps1",
    "submittedBy": "https://github.com/silversword411",
    "name": "Windows Update - Re-enable Microsoft managed Windows Update",
    "description": "TRMM agent will set registry key to disable Windows Auto Updates. This will re-enable Windows standard update settings",
    "shell": "powershell",
    "category": "TRMM (Win):Updates",
    "supported_platforms": [
      "windows"
    ],
    "default_timeout": "90"
  }
  {
    "guid": "6e27d5341-88fa-4c2f-9c91-c3aeb1740e85",
    "filename": "Win_User_EnableDisable.ps1",
    "submittedBy": "https://github.com/silversword411",
    "name": "User - Enable or disable a user",
    "description": "Used to enable or disable local user",
    "syntax": "-Name <string>\n-Enabled { yes | no }",
    "shell": "powershell",
    "supported_platforms": [
      "windows"
    ],
    "category": "TRMM (Win):User Management"
  }

As a side note, the kernel can provide a random GUID.

$ cat /proc/sys/kernel/random/uuid
@silversword411
Copy link
Contributor

@NiceGuyIT Don't know how I missed this before...but aren't there multiple GUID formats/standards?

As long as they're unique, shouldn't matter if they're not an extra character. Maybe when we eventually fix the deleted/renamed script problems we have now we can make 'em all the same

@NiceGuyIT
Copy link
Contributor Author

While there are multiple GUID formats, these are one character extra and do not adhere to the format.

This is an issue for the community_scripts.schema.json to determine the type for the "GUID" field which can be used to validate if community_scripts.json is valid. The validation can be used to setup a CI/GitHub Actions to ensure only valid entries are submitted. If the GUID for these scripts are not corrected, the GUID is treated like a text field and validation is not possible.

Note: The fact these are not valid GUIDs implies TacticalRMM does not treat these fields like GUIDs. I.e. The Python script to load the JSON, The PostgreSQL field type, the API, etc. all treat this like a text field.

community_scripts.schema.json

      "guid": {
        "description": "Unique ID for the script.",
        "type": "uuid"
      },

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