Skip to content

Conversation

@isaac-fletcher
Copy link
Contributor

Summary:
Previously, TTPForge would only log a warning when a TTP required superuser privileges on Windows but wouldn't actually enforce the requirement. This change implements proper administrator privilege checking on Windows using golang.org/x/sys/windows to check if the process token is elevated.

The implementation uses Go build tags to provide platform-specific implementations of superuser checking. Unix-based systems continue to use os.Geteuid() == 0 while Windows now uses token elevation checking.

Reviewed By: RoboticPrism

Differential Revision: D85156306

Isaac Fletcher added 3 commits October 23, 2025 07:01
Summary: The move command incorrectly processed directories as Forge files which could have resulted in improper moves. Eventually, we'd like to add the capability to move entire directories, but it makes the most sense right now to go ahead patch this bug.

Differential Revision: D85156302
Summary: This exposes the existing UUID generation mechanism used internally by `ttpforge create ttp` as a standalone command for user convenience. While TTPs created with `create ttp` already include an automatically generated UUID, users sometimes need to manually generate UUIDs when manually creating or editing TTP files.

Differential Revision: D85156307
Summary: The enum ttps command had a local `verbose` flag that duplicated the global verbose logging configuration. This refactors the command to use the existing global setting instead.

Differential Revision: D85156304
@meta-codesync
Copy link

meta-codesync bot commented Oct 23, 2025

@isaac-fletcher has exported this pull request. If you are a Meta employee, you can view the originating Diff in D85156306.

isaac-fletcher added a commit to isaac-fletcher/TTPForge that referenced this pull request Oct 23, 2025
Summary:

Previously, TTPForge would only log a warning when a TTP required superuser privileges on Windows but wouldn't actually enforce the requirement. This change implements proper administrator privilege checking on Windows using `golang.org/x/sys/windows` to check if the process token is elevated.

The implementation uses Go build tags to provide platform-specific implementations of superuser checking. Unix-based systems continue to use `os.Geteuid() == 0` while Windows now uses token elevation checking.

Reviewed By: RoboticPrism

Differential Revision: D85156306
isaac-fletcher added a commit to isaac-fletcher/TTPForge that referenced this pull request Oct 23, 2025
Summary:

Previously, TTPForge would only log a warning when a TTP required superuser privileges on Windows but wouldn't actually enforce the requirement. This change implements proper administrator privilege checking on Windows using `golang.org/x/sys/windows` to check if the process token is elevated.

The implementation uses Go build tags to provide platform-specific implementations of superuser checking. Unix-based systems continue to use `os.Geteuid() == 0` while Windows now uses token elevation checking.

Reviewed By: RoboticPrism

Differential Revision: D85156306
isaac-fletcher added a commit to isaac-fletcher/TTPForge that referenced this pull request Oct 23, 2025
Summary:

Previously, TTPForge would only log a warning when a TTP required superuser privileges on Windows but wouldn't actually enforce the requirement. This change implements proper administrator privilege checking on Windows using `golang.org/x/sys/windows` to check if the process token is elevated.

The implementation uses Go build tags to provide platform-specific implementations of superuser checking. Unix-based systems continue to use `os.Geteuid() == 0` while Windows now uses token elevation checking.

Reviewed By: RoboticPrism

Differential Revision: D85156306
isaac-fletcher added a commit to isaac-fletcher/TTPForge that referenced this pull request Oct 23, 2025
Summary:

Previously, TTPForge would only log a warning when a TTP required superuser privileges on Windows but wouldn't actually enforce the requirement. This change implements proper administrator privilege checking on Windows using `golang.org/x/sys/windows` to check if the process token is elevated.

The implementation uses Go build tags to provide platform-specific implementations of superuser checking. Unix-based systems continue to use `os.Geteuid() == 0` while Windows now uses token elevation checking.

Reviewed By: RoboticPrism

Differential Revision: D85156306
isaac-fletcher added a commit to isaac-fletcher/TTPForge that referenced this pull request Oct 23, 2025
Summary:

Previously, TTPForge would only log a warning when a TTP required superuser privileges on Windows but wouldn't actually enforce the requirement. This change implements proper administrator privilege checking on Windows using `golang.org/x/sys/windows` to check if the process token is elevated.

The implementation uses Go build tags to provide platform-specific implementations of superuser checking. Unix-based systems continue to use `os.Geteuid() == 0` while Windows now uses token elevation checking.

Reviewed By: RoboticPrism

Differential Revision: D85156306
isaac-fletcher added a commit to isaac-fletcher/TTPForge that referenced this pull request Oct 23, 2025
Summary:

Previously, TTPForge would only log a warning when a TTP required superuser privileges on Windows but wouldn't actually enforce the requirement. This change implements proper administrator privilege checking on Windows using `golang.org/x/sys/windows` to check if the process token is elevated.

The implementation uses Go build tags to provide platform-specific implementations of superuser checking. Unix-based systems continue to use `os.Geteuid() == 0` while Windows now uses token elevation checking.

Reviewed By: RoboticPrism

Differential Revision: D85156306
isaac-fletcher added a commit to isaac-fletcher/TTPForge that referenced this pull request Oct 23, 2025
Summary:

Previously, TTPForge would only log a warning when a TTP required superuser privileges on Windows but wouldn't actually enforce the requirement. This change implements proper administrator privilege checking on Windows using `golang.org/x/sys/windows` to check if the process token is elevated.

The implementation uses Go build tags to provide platform-specific implementations of superuser checking. Unix-based systems continue to use `os.Geteuid() == 0` while Windows now uses token elevation checking.

Reviewed By: RoboticPrism

Differential Revision: D85156306
Summary:
Pull Request resolved: facebookincubator#568

Previously, TTPForge would only log a warning when a TTP required superuser privileges on Windows but wouldn't actually enforce the requirement. This change implements proper administrator privilege checking on Windows using `golang.org/x/sys/windows` to check if the process token is elevated.

The implementation uses Go build tags to provide platform-specific implementations of superuser checking. Unix-based systems continue to use `os.Geteuid() == 0` while Windows now uses token elevation checking.

Reviewed By: RoboticPrism

Differential Revision: D85156306
@meta-codesync
Copy link

meta-codesync bot commented Oct 23, 2025

This pull request has been merged in 45590c2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants