Policy

The policy setup is probably the most complex of the qaskx-cli due to the flexibility it can provide. The flexibility allows configuation via policy on your initial defaults and some ongoing values.

Policy is configured via editing a JSON file.

The command help is shown below.

Usage: qaskx-cli setup policy --remote=<URL> --token=<file path>  [-v] [--colourCLI]

The setup policy configures the policy and location for qaskx-cli.

The location is a central server.   The default location is at Internet site https://qaskx.one
but this can be changed. Changing the value does require an encrypted value
from the software origination.  The requirement for the encrypted value
is to provide some mitigation controls on software supply chains threat vectors.

For more details see the documentation at https://docs.qaskx.one/qaskx-cli/cmd/setup/policy/ .
                    
Options:            
      --remote      Remote policy server
      --token       Policy token file
  -v, --verbose     Verbose logging
      --vv          Verbose logging level 3
      --vvv         Verbose logging level 5
      --colourCLI   Colour terminal and command line (env $QASKX_COLOUR_CLI)
      --env         Environment file to use (default ".env")

Details

A past central policy file is shown below as a sample. This policy file can change and yuo can review it at any time at location https://qaskx.one/policy//070cbef1-e65c-4953-aa55-cf334d21a6c0/main_policy.json

The GUID above in the URL is the Installation Identifier. Others can exist and can be private or public.

If your Installion ID in you dotqaskx-config.json is different, then your main policy file is located elsewhere.

{
    "public_key_uri": "  key   ",
    "main": {
        "expiry": "",
        "created": "",
        "expires": "",
        "dot_qaskx": {
            "GitProvider": "gitea",
            "GitHost": "https://tea.merebox.com",
            "GitApi": "https://tea.merebox.com/api/v1",
            "GitOrg": "",
            "GitRepoUser": "",
            "GitBranch": "main",
            "GitUserEmail": "",
            "TemplateHost": "https://tea.merebox.com/qaskx/qaskx.template.git",
            "TemplateFolder": "",
            "TemplateName": "base",
            "TemplateLocalStorage": "",
            "Organisation": "",
            "Name": "",
            "BusinessUnit": "",
            "Team": "",
            "ServiceOwner": "",
            "ServiceOwnerEmail": "",
            "ServiceDomain": "",
            "PrimaryProgramLanguage": "go",
            "LintApiLevel": "warn",
            "InstallationID": "070cbef1-e65c-4953-aa55-cf334d21a6c0",
            "PolicyUrl": "https://qaksx.one/policy/",
            "CheckUpdate": true,
            "UpdateUrl": "https://qaskx.one/updater/",
            "DisableLocalStorage": false,
            "LocalStoragePath": "*dotqaskx"
        },
        "qaskx_config": {
            "Environment": "production",
            "Folders": {
                "Data": "",
                "Config": ""
            },
            "Application": {
                "Name": "Qaskx Command Line Tool",
                "Version": "0.0.1"
            },
            "Rediops": {
                "DependencyTemplate": ""
            },
            "GeneratorHandlers": {
                "Generators": null,
                "PolicyURI": null,
                "FQDN": null
            },
            "Run": {
                "LintOpen": {
                    "ContainerImage": null,
                    "RulesFile": ".spectral.yaml",
                    "SkipPull": true
                },
                "LintAsync": null
            },
            "Log": {
                "Provider": "",
                "LevelBase": "",
                "Level": 2,
                "LogWriter": ""
            },
            "VaultFile": "",
            "FileFormat": {
                "LeftQuote": "'",
                "RightQuote": "'",
                "Separator": ",",
                "EscapeM": "'",
                "EscapeV": "\\'",
                "CharEscape": true,
                "NumEscape": false
            },
            "Scan": {
                "Options": {
                    "SkipFile": "",
                    "RegexFile": ""
                },
                "SkipFiles": [],
                "Regex": []
            },
            "Activities": {
                "Engines": [
                    {
                        "OsEnvironment": "windows",
                        "Category": "TEST",
                        "Name": "pwsh-command",
                        "Command": "pwsh.exe",
                        "Option": "-Command"
                    },
                    {
                        "OsEnvironment": "windows",
                        "Category": "TEST",
                        "Name": "pwsh-script",
                        "Command": "pwsh.exe",
                        "Option": "-File"
                    },
                    {
                        "OsEnvironment": "linux",
                        "Category": "TEST",
                        "Name": "pwsh-command",
                        "Command": "pwsh",
                        "Option": "-Command"
                    },
                    {
                        "OsEnvironment": "linux",
                        "Category": "TEST",
                        "Name": "pwsh-script",
                        "Command": "pwsh",
                        "Option": "-File"
                    },
                    {
                        "OsEnvironment": "windows",
                        "Category": "BUILD",
                        "Name": "",
                        "Command": "pwsh.exe",
                        "Option": "-Command"
                    },
                    {
                        "OsEnvironment": "windows",
                        "Category": "BUILD",
                        "Name": "pwsh-command",
                        "Command": "pwsh.exe",
                        "Option": "-Command"
                    },
                    {
                        "OsEnvironment": "windows",
                        "Category": "BUILD",
                        "Name": "pwsh-script",
                        "Command": "pwsh.exe",
                        "Option": "-File"
                    },
                    {
                        "OsEnvironment": "linux",
                        "Category": "BUILD",
                        "Name": "pwsh-command",
                        "Command": "pwsh",
                        "Option": "-Command"
                    },
                    {
                        "OsEnvironment": "linux",
                        "Category": "BUILD",
                        "Name": "pwsh-script",
                        "Command": "pwsh",
                        "Option": "-File"
                    },
                    {
                        "OsEnvironment": "windows",
                        "Category": "INSTALL",
                        "Name": "",
                        "Command": "pwsh.exe",
                        "Option": "-Command"
                    },
                    {
                        "OsEnvironment": "windows",
                        "Category": "INSTALL",
                        "Name": "pwsh-command",
                        "Command": "pwsh.exe",
                        "Option": "-Command"
                    },
                    {
                        "OsEnvironment": "windows",
                        "Category": "INSTALL",
                        "Name": "pwsh-script",
                        "Command": "pwsh.exe",
                        "Option": "-File"
                    },
                    {
                        "OsEnvironment": "linux",
                        "Category": "INSTALL",
                        "Name": "pwsh-command",
                        "Command": "pwsh",
                        "Option": "-Command"
                    },
                    {
                        "OsEnvironment": "linux",
                        "Category": "INSTALL",
                        "Name": "pwsh-script",
                        "Command": "pwsh",
                        "Option": "-File"
                    }
                ]
            }
        }
    },
    "handler": {
        "generators": {
            "default": {
                "title": "Base template",
                "uri": "https://tea.merebox.com/qaskx/qaskx.template.git",
                "refresh": "ignore"
            },
            "gateway": {
                "title": "Gateway template",
                "uri": "https://tea.merebox.com/qaskx/qaskgo.template.git",
                "secion_path": "{{.Qaskx}}/template_storage/qaskgo.template/run/local/{{.Format}}/decl",
                "refresh": "cache"
            }
        }
    }
}