Skip to content
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

Add support for Content Security Policy (CSP) settings #450

Closed
valentijnscholten opened this issue Oct 10, 2024 · 1 comment
Closed

Add support for Content Security Policy (CSP) settings #450

valentijnscholten opened this issue Oct 10, 2024 · 1 comment

Comments

@valentijnscholten
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.26.0
  • Ruby: 2.7.4
  • Distribution: Debian
  • Module version: 10.0.0

How to reproduce (e.g Puppet code you use)

The current module doesn't support content security policy settings.

What are you seeing

The current module doesn't support content security policy settings.

What behaviour did you expect instead

Support for setting the content security policy settings

Any additional information you'd like to impart

From: https://docs.gitlab.com/omnibus/settings/configuration.html#set-a-content-security-policy

Basic example (by default it is disabled)

gitlab_rails['content_security_policy'] = {
    enabled: true,
    report_only: false
}

Supported directives:

gitlab_rails['content_security_policy'] = {
  'enabled' => false,
  'report_only' => false,
  # Each directive is a String (e.g. "'self'").
  # This section only needs to be set if you need custom CSP directives
  # See https://docs.gitlab.com/omnibus/settings/configuration.html#set-a-content-security-policy
  'directives' => {
    'base_uri' => nil,
    'child_src' => nil,
    'connect_src' => nil,
    'default_src' => nil,
    'font_src' => nil,
    'form_action' => nil,
    'frame_ancestors' => nil,
    'frame_src' => nil,
    'img_src' => nil,
    'manifest_src' => nil,
    'media_src' => nil,
    'object_src' => nil,
    'script_src' => nil,
    'style_src' => nil,
    'worker_src' => nil,
    'report_uri' => nil,
  }
 }
@valentijnscholten
Copy link
Author

Looks like it's already possible via something like:

      # CSP settings
      'content_security_policy' => {
        'enabled' => true,
        'directives' => {
          'frame_ancestors' => 'self'
        }
      }

Sorry, puppet newbie here.

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

No branches or pull requests

1 participant