Skip to content

Document Windows App Control Feature #2654

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

Open
wants to merge 10 commits into
base: devel
Choose a base branch
from
Open

Conversation

jborean93
Copy link
Contributor

This adds some documentation for a new feature added in Ansible 2.19.


The policy then should then add the certificate as a trusted publisher to the ``User Mode Signing Scenario``, for example this is an example policy configuration that contains a trusted publisher:

.. code-block:: text
Copy link
Contributor Author

@jborean93 jborean93 May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally had this as .. code-block:: xml to get some XML highlighting but it seems like we don't have it enabled/allowed in this repo. Happy with text here but if we want to enable xml I can always change this back.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey I'm not sure how do enable xml?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jFYI, https://github.com/ansible-community/ansible-pygments is used as a custom pygments in ansible doc, this is specified in conf.py by pygments = 'ansible'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failing message was at https://github.com/ansible/ansible-documentation/actions/runs/15195285949/job/42737710900

/home/runner/work/ansible-documentation/ansible-documentation/docs/docsite/rst/os_guide/windows_app_control.rst:31:4: Warning: literal block with disallowed language: xml. If the language should be allowed, the checker needs to be updated. Currently allowed languages are: ansible-output, bash, console, csharp, diff, ini, jinja, json, md, none, powershell, python, rst, sh, shell, shell-session, text.

We have some documentation on this at https://github.com/ansible/ansible-documentation/blob/510375f072a8dce15a389ced9888dda93975b29d/docs/docsite/rst/dev_guide/style_guide/index.rst#syntax-highlighting---pygments and the list/check is coded at

ALLOWED_LANGUAGES = {
"ansible-output",
"bash",
"console",
"csharp",
"diff",
"ini",
"jinja",
"json",
"md",
"none",
"powershell",
"python",
"rst",
"sh",
"shell",
"shell-session",
"text",
}
.

I'm not sure if it's just us simply adding xml to this list so the check doesn't fail or whether there are other things that need to be enabled in the build to get it working.


The policy then should then add the certificate as a trusted publisher to the ``User Mode Signing Scenario``, for example this is an example policy configuration that contains a trusted publisher:

.. code-block:: text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe?

Suggested change
.. code-block:: text
.. code-block:: XML

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the xml highlighting needs to be enabled in the project first.

@samccann
Copy link
Contributor

@oraNod PTAL

Once the code signing certificate has been generated and trusted by the Windows host, it can be used to sign the scripts that Ansible will run. The PowerShell script `New-AnsiblePowerShellSignature.ps1 <https://raw.githubusercontent.com/ansible/ansible-documentation/refs/heads/devel/examples/scripts/New-AnsiblePowerShellSignature.ps1>`_ can be used to sign both the execution wrapper used by Ansible to invoke modules and any PowerShell modules inside an Ansible collection. It requires the following to run:

* PowerShell 7.4 or later
* The `OpenAuthenticode <https://github.com/jborean93/PowerShell-OpenAuthenticode>`_ PowerShell module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just going to put this comment here for consideration. Should this repo move to the Ansible org so it is "more official" than a personal repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of why the feature is a tech preview and not something we support officially. A future version of Ansible will most likely include a tool we support and maintain that can sign content but for now it’s down to 3rd party tools.

Copy link
Contributor

@oraNod oraNod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jborean93 LGTM 👍

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

Successfully merging this pull request may close these issues.

4 participants