Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class AnonymousJobsRecipe extends Recipe {
public class AnonymousJobs extends Recipe {

String displayName = "Find jobs without descriptive names";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class ArtifactSecurityRecipe extends Recipe {
public class ArtifactSecurity extends Recipe {

// Dangerous paths that may contain credentials or sensitive information
private static final Set<String> DANGEROUS_PATHS = new HashSet<>(Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class BotConditionsRecipe extends Recipe {
public class BotConditions extends Recipe {

// Known bot actor IDs that should be compared numerically, not as strings
private static final Set<String> KNOWN_BOT_ACTOR_IDS = new HashSet<>(Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class CachePoisoningRecipe extends Recipe {
public class CachePoisoning extends Recipe {

// Actions that have caching capabilities and could be vulnerable
private static final Set<String> CACHE_AWARE_ACTIONS = new HashSet<>(Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class DangerousTriggersRecipe extends Recipe {
public class DangerousTriggers extends Recipe {

private static final Set<String> DANGEROUS_TRIGGERS = new HashSet<>(Arrays.asList(
"pull_request_target",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class ExcessivePermissionsRecipe extends Recipe {
public class ExcessivePermissions extends Recipe {

private static final Set<String> HIGH_RISK_PERMISSIONS = new HashSet<>(Arrays.asList(
"actions", "attestations", "contents", "deployments", "id-token",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class ForbiddenUsesRecipe extends Recipe {
public class ForbiddenUses extends Recipe {

@Option(displayName = "Additional dangerous actions",
description = "Additional actions to flag as dangerous, beyond the built-in list. " +
Expand Down Expand Up @@ -77,12 +77,12 @@ public class ForbiddenUsesRecipe extends Recipe {
Set<String> allDangerousActions;
Set<String> allSuspiciousPatterns;

public ForbiddenUsesRecipe() {
public ForbiddenUses() {
this(null, null);
}

@JsonCreator
public ForbiddenUsesRecipe(
public ForbiddenUses(
@Nullable List<String> additionalDangerousActions,
@Nullable List<String> additionalSuspiciousPatterns) {
this.additionalDangerousActions = additionalDangerousActions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class GitHubEnvRecipe extends Recipe {
public class GitHubEnv extends Recipe {

// Dangerous triggers that make GITHUB_ENV usage risky
private static final Set<String> DANGEROUS_TRIGGERS = new HashSet<>(Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class HardcodedCredentialsRecipe extends Recipe {
public class HardcodedCredentials extends Recipe {

private static final Pattern GITHUB_EXPRESSION_PATTERN = Pattern.compile("\\$\\{\\{.*?\\}\\}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class InsecureCommandsRecipe extends Recipe {
public class InsecureCommands extends Recipe {

private static final String INSECURE_COMMANDS_VAR = "ACTIONS_ALLOW_UNSECURE_COMMANDS";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class ObfuscationRecipe extends Recipe {
public class Obfuscation extends Recipe {

// Pattern to detect potentially obfuscated expressions
private static final Pattern OBFUSCATED_EXPRESSION_PATTERN = Pattern.compile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class RefVersionMismatchRecipe extends Recipe {
public class RefVersionMismatch extends Recipe {

private static final Pattern SHA_PATTERN = Pattern.compile("^[a-f0-9]{40}$");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class SecretsInheritRecipe extends Recipe {
public class SecretsInherit extends Recipe {

String displayName = "Find unconditional secrets inheritance";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class SelfHostedRunnerRecipe extends Recipe {
public class SelfHostedRunner extends Recipe {

String displayName = "Find usage of self-hosted runners";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class TemplateInjectionRecipe extends Recipe {
public class TemplateInjection extends Recipe {

// User-controllable contexts that can lead to injection vulnerabilities
private static final Set<String> DANGEROUS_CONTEXTS = new HashSet<>(Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class TrustedPublishingRecipe extends Recipe {
public class TrustedPublishing extends Recipe {

private static final Set<String> KNOWN_PYTHON_TP_REGISTRIES = new HashSet<>(Arrays.asList(
"https://upload.pypi.org/legacy/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class UndocumentedPermissionsRecipe extends Recipe {
public class UndocumentedPermissions extends Recipe {

String displayName = "Document permissions usage";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class UnpinnedActionsRecipe extends Recipe {
public class UnpinnedActions extends Recipe {

private static final Pattern UNPINNED_ACTION_PATTERN = Pattern.compile(
"^([^/@]+/[^/@]+)(@(main|master|HEAD|latest|v?\\d+(\\.\\d+)*(\\.\\d+)*))??$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@Value
@EqualsAndHashCode(callSuper = false)
public class UnpinnedDockerImagesRecipe extends Recipe {
public class UnpinnedDockerImages extends Recipe {

private static final Pattern DOCKER_IMAGE_PATTERN = Pattern.compile(
"^(?:docker://)?([^/:]+(?:\\.[^/:]+)*(?::[0-9]+)?/)?([^/:]+(?:/[^/:]+)*):([^@]+)(?:@(.+))?$"
Expand Down
38 changes: 19 additions & 19 deletions src/main/resources/META-INF/rewrite/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.AnonymousJobsRecipe
recipeName: org.openrewrite.github.security.AnonymousJobs
examples:
- description: '`AnonymousJobsRecipeTest#shouldFlagJobWithoutName`'
sources:
Expand Down Expand Up @@ -818,7 +818,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.ArtifactSecurityRecipe
recipeName: org.openrewrite.github.security.ArtifactSecurity
examples:
- description: '`ArtifactSecurityRecipeTest#shouldFlagCredentialPersistenceRisk`'
sources:
Expand Down Expand Up @@ -856,7 +856,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.BotConditionsRecipe
recipeName: org.openrewrite.github.security.BotConditions
examples:
- description: '`BotConditionsRecipeTest#shouldFlagSpoofableActorNameCheck`'
sources:
Expand All @@ -882,7 +882,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.CachePoisoningRecipe
recipeName: org.openrewrite.github.security.CachePoisoning
examples:
- description: '`CachePoisoningRecipeTest#shouldDetectCacheInReleaseWorkflow`'
sources:
Expand Down Expand Up @@ -918,7 +918,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.DangerousTriggersRecipe
recipeName: org.openrewrite.github.security.DangerousTriggers
examples:
- description: '`DangerousTriggersRecipeTest#shouldDetectPullRequestTarget`'
sources:
Expand All @@ -940,7 +940,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.ExcessivePermissionsRecipe
recipeName: org.openrewrite.github.security.ExcessivePermissions
examples:
- description: '`ExcessivePermissionsRecipeTest#shouldFlagWriteAllPermissions`'
sources:
Expand All @@ -966,7 +966,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.ForbiddenUsesRecipe
recipeName: org.openrewrite.github.security.ForbiddenUses
examples:
- description: '`ForbiddenUsesRecipeTest#shouldFlagDangerousAction`'
sources:
Expand All @@ -992,7 +992,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.GitHubEnvRecipe
recipeName: org.openrewrite.github.security.GitHubEnv
examples:
- description: '`GitHubEnvRecipeTest#shouldDetectGitHubEnvInPullRequestTarget`'
sources:
Expand Down Expand Up @@ -1022,7 +1022,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.HardcodedCredentialsRecipe
recipeName: org.openrewrite.github.security.HardcodedCredentials
examples:
- description: '`HardcodedCredentialsRecipeTest#shouldDetectHardcodedContainerPassword`'
sources:
Expand Down Expand Up @@ -1054,7 +1054,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.InsecureCommandsRecipe
recipeName: org.openrewrite.github.security.InsecureCommands
examples:
- description: '`InsecureCommandsRecipeTest#shouldDetectInsecureCommandsAtWorkflowLevel`'
sources:
Expand Down Expand Up @@ -1082,7 +1082,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.ObfuscationRecipe
recipeName: org.openrewrite.github.security.Obfuscation
examples:
- description: '`ObfuscationRecipeTest#shouldFlagObfuscatedUsesWithDot`'
sources:
Expand All @@ -1106,7 +1106,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.RefVersionMismatchRecipe
recipeName: org.openrewrite.github.security.RefVersionMismatch
examples:
- description: '`RefVersionMismatchRecipeTest#shouldFlagMismatchedVersionComment`'
sources:
Expand All @@ -1132,7 +1132,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.SecretsInheritRecipe
recipeName: org.openrewrite.github.security.SecretsInherit
examples:
- description: '`SecretsInheritRecipeTest#shouldDetectSecretsInherit`'
sources:
Expand All @@ -1156,7 +1156,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.SelfHostedRunnerRecipe
recipeName: org.openrewrite.github.security.SelfHostedRunner
examples:
- description: '`SelfHostedRunnerRecipeTest#shouldFlagSelfHostedRunner`'
sources:
Expand All @@ -1180,7 +1180,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.TemplateInjectionRecipe
recipeName: org.openrewrite.github.security.TemplateInjection
examples:
- description: '`TemplateInjectionRecipeTest#shouldFlagPullRequestTitleInjection`'
sources:
Expand All @@ -1204,7 +1204,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.TrustedPublishingRecipe
recipeName: org.openrewrite.github.security.TrustedPublishing
examples:
- description: '`TrustedPublishingRecipeTest#shouldFlagPyPIPublishWithPassword`'
sources:
Expand Down Expand Up @@ -1234,7 +1234,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.UndocumentedPermissionsRecipe
recipeName: org.openrewrite.github.security.UndocumentedPermissions
examples:
- description: '`UndocumentedPermissionsRecipeTest#shouldFlagUndocumentedWorkflowPermissions`'
sources:
Expand Down Expand Up @@ -1264,7 +1264,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.UnpinnedActionsRecipe
recipeName: org.openrewrite.github.security.UnpinnedActions
examples:
- description: '`UnpinnedActionsRecipeTest#shouldFlagUnpinnedActionWithTagVersion`'
sources:
Expand All @@ -1290,7 +1290,7 @@ examples:
language: yaml
---
type: specs.openrewrite.org/v1beta/example
recipeName: org.openrewrite.github.security.UnpinnedDockerImagesRecipe
recipeName: org.openrewrite.github.security.UnpinnedDockerImages
examples:
- description: '`UnpinnedDockerImagesRecipeTest#shouldFlagUnpinnedContainerImage`'
sources:
Expand Down
Loading
Loading