Mitigation Strategy: Use Official or Verified Runner Images (via act
configuration)
Mitigation Strategy: Use Official or Verified Runner Images (via act
configuration)
-
Description:
- Identify Trusted Sources: Determine the official
nektos/act
images or images from trusted providers. - Pull Images: Use
docker pull
to download the chosen images (e.g.,docker pull nektos/act:latest-ubuntu-22.04
). - Configure
act
with-P
or--platform
: When runningact
, use the-P
or--platform
flag to explicitly specify the image to use. This overridesact
's default image selection logic. Example:act -P ubuntu-latest=nektos/act:latest-ubuntu-22.04
. This ensures that even ifact
's default behavior changes, you're still using the image you intend. You can specify multiple platforms if your workflow runs on different operating systems. - .actrc file (optional): You can make this configuration persistent by adding platform mappings to an
.actrc
file in your project's root directory or your home directory. Example.actrc
content:-P ubuntu-latest=nektos/act:latest-ubuntu-22.04 -P ubuntu-20.04=nektos/act:latest-ubuntu-20.04
- Identify Trusted Sources: Determine the official
-
Threats Mitigated:
- Compromised Docker Images (Runner Images): (Severity: Critical) - Ensures
act
uses a specific, trusted image, preventing it from accidentally using a malicious or vulnerable image. - Vulnerable Software in Images: (Severity: High) - By explicitly choosing a well-maintained image, you reduce the risk of using an image with outdated and vulnerable software.
- Compromised Docker Images (Runner Images): (Severity: Critical) - Ensures
-
Impact:
- Compromised Docker Images: Risk reduction: High.
- Vulnerable Software in Images: Risk reduction: Medium-High.
-
Currently Implemented: (Hypothetical) Partially implemented.
-P
flag is used sometimes, but not consistently. -
Missing Implementation: (Hypothetical) No
.actrc
file is used. The-P
flag is not used for allact
invocations.
Mitigation Strategy: Use Secret Files for Sensitive Information (via act
's -s
or --secret-file
option)
Mitigation Strategy: Use Secret Files for Sensitive Information (via act
's -s
or --secret-file
option)
-
Description:
- Create a Secret File: Create a text file (e.g.,
secrets.txt
) to store secrets, one per line, inKEY=VALUE
format. - Secure the File: Set appropriate file permissions (e.g.,
chmod 600 secrets.txt
). - Use
-s
or--secret-file
: When runningact
, use the-s
option to specify individual secrets directly on the command line (less secure, but useful for testing), or, preferably, use the--secret-file
option to provide the path to your secrets file. Example:act --secret-file secrets.txt
. This tellsact
to load secrets from the specified file. - Avoid -s for production: Avoid using -s option in production or scripts.
- Create a Secret File: Create a text file (e.g.,
-
Threats Mitigated:
- Exposure of Secrets: (Severity: High) - Prevents secrets from being hardcoded in workflow files or passed as environment variables (which can be logged or accidentally exposed).
- Unauthorized Access to Secrets: (Severity: High) - Relies on file system permissions to protect the secrets file.
-
Impact:
- Exposure of Secrets: Risk reduction: High.
- Unauthorized Access to Secrets: Risk reduction: High.
-
Currently Implemented: (Hypothetical) Fully implemented.
--secret-file
is used consistently. -
Missing Implementation: (Hypothetical) None.
Mitigation Strategy: Use --bind
option
Mitigation Strategy: Use --bind
option
-
Description:
- Understand the Risk: By default,
act
mounts your project directory into the container. If a workflow is compromised, it could potentially modify files in your project directory. - Use
--bind
: Use the--bind
flag when runningact
. This mounts the project directory as read-only within the container. Example:act --bind
. This prevents the workflow from writing to your project directory, limiting the impact of a potential compromise.
- Understand the Risk: By default,
-
Threats Mitigated:
- Workflow Code Execution in a Privileged Context (Limited Scope): (Severity: Medium) - While it doesn't prevent all privileged context issues, it specifically mitigates the risk of the workflow modifying your source code or other files in the project directory.
- Accidental File Modification/Deletion: (Severity: Medium) - Prevents the workflow from accidentally (or maliciously) changing or deleting files in your project.
-
Impact:
- Workflow Code Execution in a Privileged Context (Limited Scope): Risk reduction: Medium.
- Accidental File Modification/Deletion: Risk reduction: High.
-
Currently Implemented: (Hypothetical) Not implemented.
-
Missing Implementation: (Hypothetical)
act
is run without the--bind
flag, allowing workflows to potentially modify the project directory.