published on Wednesday, Aug 26, 2026 by Pulumi
published on Wednesday, Aug 26, 2026 by Pulumi
The gitlab.ProjectSecuritySettings resource allows managing security settings on a project.
Only
secretPushProtectionEnabledcan currently be changed through this API. The other attributes are read-only and reflect the project’s current security configuration.
When you destroy this resource,
secretPushProtectionEnabledis reverted to the value it had before Terraform started managing the project (captured on create or import), rather than being set tofalse.
Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = new gitlab.Project("example", {name: "example"});
const exampleProjectSecuritySettings = new gitlab.ProjectSecuritySettings("example", {
project: example.id,
secretPushProtectionEnabled: true,
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.Project("example", name="example")
example_project_security_settings = gitlab.ProjectSecuritySettings("example",
project=example.id,
secret_push_protection_enabled=True)
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v10/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := gitlab.NewProject(ctx, "example", &gitlab.ProjectArgs{
Name: pulumi.String("example"),
})
if err != nil {
return err
}
_, err = gitlab.NewProjectSecuritySettings(ctx, "example", &gitlab.ProjectSecuritySettingsArgs{
Project: example.ID().ToIDOutput().ToStringOutput(),
SecretPushProtectionEnabled: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var example = new GitLab.Project("example", new()
{
Name = "example",
});
var exampleProjectSecuritySettings = new GitLab.ProjectSecuritySettings("example", new()
{
Project = example.Id,
SecretPushProtectionEnabled = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.ProjectSecuritySettings;
import com.pulumi.gitlab.ProjectSecuritySettingsArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Project("example", ProjectArgs.builder()
.name("example")
.build());
var exampleProjectSecuritySettings = new ProjectSecuritySettings("exampleProjectSecuritySettings", ProjectSecuritySettingsArgs.builder()
.project(example.id())
.secretPushProtectionEnabled(true)
.build());
}
}
resources:
example:
type: gitlab:Project
properties:
name: example
exampleProjectSecuritySettings:
type: gitlab:ProjectSecuritySettings
name: example
properties:
project: ${example.id}
secretPushProtectionEnabled: true
pulumi {
required_providers {
gitlab = {
source = "pulumi/gitlab"
}
}
}
resource "gitlab_project" "example" {
name = "example"
}
resource "gitlab_projectsecuritysettings" "example" {
project = gitlab_project.example.id
secret_push_protection_enabled = true
}
Create ProjectSecuritySettings Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectSecuritySettings(name: string, args: ProjectSecuritySettingsArgs, opts?: CustomResourceOptions);@overload
def ProjectSecuritySettings(resource_name: str,
args: ProjectSecuritySettingsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectSecuritySettings(resource_name: str,
opts: Optional[ResourceOptions] = None,
project: Optional[str] = None,
secret_push_protection_enabled: Optional[bool] = None)func NewProjectSecuritySettings(ctx *Context, name string, args ProjectSecuritySettingsArgs, opts ...ResourceOption) (*ProjectSecuritySettings, error)public ProjectSecuritySettings(string name, ProjectSecuritySettingsArgs args, CustomResourceOptions? opts = null)
public ProjectSecuritySettings(String name, ProjectSecuritySettingsArgs args)
public ProjectSecuritySettings(String name, ProjectSecuritySettingsArgs args, CustomResourceOptions options)
type: gitlab:ProjectSecuritySettings
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "gitlab_project_security_settings" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ProjectSecuritySettingsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ProjectSecuritySettingsArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProjectSecuritySettingsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectSecuritySettingsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectSecuritySettingsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var projectSecuritySettingsResource = new GitLab.ProjectSecuritySettings("projectSecuritySettingsResource", new()
{
Project = "string",
SecretPushProtectionEnabled = false,
});
example, err := gitlab.NewProjectSecuritySettings(ctx, "projectSecuritySettingsResource", &gitlab.ProjectSecuritySettingsArgs{
Project: pulumi.String("string"),
SecretPushProtectionEnabled: pulumi.Bool(false),
})
resource "gitlab_project_security_settings" "projectSecuritySettingsResource" {
lifecycle {
create_before_destroy = true
}
project = "string"
secret_push_protection_enabled = false
}
var projectSecuritySettingsResource = new ProjectSecuritySettings("projectSecuritySettingsResource", ProjectSecuritySettingsArgs.builder()
.project("string")
.secretPushProtectionEnabled(false)
.build());
project_security_settings_resource = gitlab.ProjectSecuritySettings("projectSecuritySettingsResource",
project="string",
secret_push_protection_enabled=False)
const projectSecuritySettingsResource = new gitlab.ProjectSecuritySettings("projectSecuritySettingsResource", {
project: "string",
secretPushProtectionEnabled: false,
});
type: gitlab:ProjectSecuritySettings
properties:
project: string
secretPushProtectionEnabled: false
ProjectSecuritySettings Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProjectSecuritySettings resource accepts the following input properties:
- Project string
- The ID or full path of the project to change the security settings of.
- Secret
Push boolProtection Enabled - Whether to enable secret push protection for the project.
- Project string
- The ID or full path of the project to change the security settings of.
- Secret
Push boolProtection Enabled - Whether to enable secret push protection for the project.
- project string
- The ID or full path of the project to change the security settings of.
- secret_
push_ boolprotection_ enabled - Whether to enable secret push protection for the project.
- project String
- The ID or full path of the project to change the security settings of.
- secret
Push BooleanProtection Enabled - Whether to enable secret push protection for the project.
- project string
- The ID or full path of the project to change the security settings of.
- secret
Push booleanProtection Enabled - Whether to enable secret push protection for the project.
- project str
- The ID or full path of the project to change the security settings of.
- secret_
push_ boolprotection_ enabled - Whether to enable secret push protection for the project.
- project String
- The ID or full path of the project to change the security settings of.
- secret
Push BooleanProtection Enabled - Whether to enable secret push protection for the project.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectSecuritySettings resource produces the following output properties:
- Auto
Fix boolContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- Container
Scanning boolFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- Continuous
Vulnerability boolScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- Id string
- The provider-assigned unique ID for this managed resource.
- Auto
Fix boolContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- Container
Scanning boolFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- Continuous
Vulnerability boolScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- Id string
- The provider-assigned unique ID for this managed resource.
- auto_
fix_ boolcontainer_ scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ booldast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ booldependency_ scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ boolsast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container_
scanning_ boolfor_ registry_ enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous_
vulnerability_ boolscans_ enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- id string
- The provider-assigned unique ID for this managed resource.
- auto
Fix BooleanContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container
Scanning BooleanFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous
Vulnerability BooleanScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- id String
- The provider-assigned unique ID for this managed resource.
- auto
Fix booleanContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix booleanDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto
Fix booleanDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix booleanSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container
Scanning booleanFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous
Vulnerability booleanScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- id string
- The provider-assigned unique ID for this managed resource.
- auto_
fix_ boolcontainer_ scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ booldast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ booldependency_ scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ boolsast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container_
scanning_ boolfor_ registry_ enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous_
vulnerability_ boolscans_ enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- id str
- The provider-assigned unique ID for this managed resource.
- auto
Fix BooleanContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container
Scanning BooleanFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous
Vulnerability BooleanScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ProjectSecuritySettings Resource
Get an existing ProjectSecuritySettings resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ProjectSecuritySettingsState, opts?: CustomResourceOptions): ProjectSecuritySettings@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auto_fix_container_scanning: Optional[bool] = None,
auto_fix_dast: Optional[bool] = None,
auto_fix_dependency_scanning: Optional[bool] = None,
auto_fix_sast: Optional[bool] = None,
container_scanning_for_registry_enabled: Optional[bool] = None,
continuous_vulnerability_scans_enabled: Optional[bool] = None,
project: Optional[str] = None,
secret_push_protection_enabled: Optional[bool] = None) -> ProjectSecuritySettingsfunc GetProjectSecuritySettings(ctx *Context, name string, id IDInput, state *ProjectSecuritySettingsState, opts ...ResourceOption) (*ProjectSecuritySettings, error)public static ProjectSecuritySettings Get(string name, Input<string> id, ProjectSecuritySettingsState? state, CustomResourceOptions? opts = null)public static ProjectSecuritySettings get(String name, Output<String> id, ProjectSecuritySettingsState state, CustomResourceOptions options)resources: _: type: gitlab:ProjectSecuritySettings get: id: ${id}import {
to = gitlab_project_security_settings.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Auto
Fix boolContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- Container
Scanning boolFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- Continuous
Vulnerability boolScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- Project string
- The ID or full path of the project to change the security settings of.
- Secret
Push boolProtection Enabled - Whether to enable secret push protection for the project.
- Auto
Fix boolContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- Auto
Fix boolSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- Container
Scanning boolFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- Continuous
Vulnerability boolScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- Project string
- The ID or full path of the project to change the security settings of.
- Secret
Push boolProtection Enabled - Whether to enable secret push protection for the project.
- auto_
fix_ boolcontainer_ scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ booldast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ booldependency_ scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ boolsast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container_
scanning_ boolfor_ registry_ enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous_
vulnerability_ boolscans_ enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- project string
- The ID or full path of the project to change the security settings of.
- secret_
push_ boolprotection_ enabled - Whether to enable secret push protection for the project.
- auto
Fix BooleanContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container
Scanning BooleanFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous
Vulnerability BooleanScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- project String
- The ID or full path of the project to change the security settings of.
- secret
Push BooleanProtection Enabled - Whether to enable secret push protection for the project.
- auto
Fix booleanContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix booleanDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto
Fix booleanDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix booleanSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container
Scanning booleanFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous
Vulnerability booleanScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- project string
- The ID or full path of the project to change the security settings of.
- secret
Push booleanProtection Enabled - Whether to enable secret push protection for the project.
- auto_
fix_ boolcontainer_ scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ booldast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ booldependency_ scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto_
fix_ boolsast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container_
scanning_ boolfor_ registry_ enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous_
vulnerability_ boolscans_ enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- project str
- The ID or full path of the project to change the security settings of.
- secret_
push_ boolprotection_ enabled - Whether to enable secret push protection for the project.
- auto
Fix BooleanContainer Scanning - Whether auto-fix for container scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanDast - Whether auto-fix for DAST is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanDependency Scanning - Whether auto-fix for dependency scanning is enabled. Read-only, reflects the project's current configuration.
- auto
Fix BooleanSast - Whether auto-fix for SAST is enabled. Read-only, reflects the project's current configuration.
- container
Scanning BooleanFor Registry Enabled - Whether container scanning for registry is enabled. Read-only, reflects the project's current configuration.
- continuous
Vulnerability BooleanScans Enabled - Whether continuous vulnerability scans are enabled. Read-only, reflects the project's current configuration.
- project String
- The ID or full path of the project to change the security settings of.
- secret
Push BooleanProtection Enabled - Whether to enable secret push protection for the project.
Import
Starting in Terraform v1.5.0, you can use an import block to import gitlab.ProjectSecuritySettings. For example:
Importing using the CLI is supported with the following syntax:
GitLab project security settings can be imported using the project ID or full path, e.g.
$ pulumi import gitlab:index/projectSecuritySettings:ProjectSecuritySettings example "12345"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlabTerraform Provider.
published on Wednesday, Aug 26, 2026 by Pulumi