Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 52,673
    • Issues 52,673
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,546
    • Merge requests 1,546
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #340782
Closed
Open
Issue created Sep 14, 2021 by Illya Klymov@xanf💡Maintainer

Bypass Disabled Bitbucket Server import source Project Creation

Summary

As an admin, you can disable Bitbucket Server import source in admin page https://:gitlab_instance/admin/application_settings

However the user can still import project by using API This issue is similar to #29748 (closed)

Steps to reproduce

  • As an admin, disable Bitbucket Server import source in /admin/application_settings/general under Visibility and access controls

Screenshot-20210914065956-310x692

  • As a regular user, run the following curl command:
➜ curl --request POST \
  --url "http://localhost:3000/api/v4/import/bitbucket_server" \
  --header "content-type: application/json" \
  --header "PRIVATE-TOKEN: [REDACTED by nmalcolm]" \
  --data '{
    "bitbucket_server_url": "http://localhost:7990",
    "bitbucket_server_username": "admin",
    "personal_access_token": "[REDACTED by nmalcolm]",
    "bitbucket_server_project": "FOO",
    "bitbucket_server_repo": "bish"
}'

where:

  • http://localhost:3000 - is local gitlab instance
  • http://localhost:7990 - is local bitbucket server instance (requests to localhost/local networks are allowed for this test)

In my case I got the response

{"id":25,"name":"BISH","full_path":"/root/BISH","full_name":"Administrator / BISH","import_source":"http://localhost:7990/projects/FOO/repos/bish/browse","import_status":"scheduled","human_import_status_name":"scheduled","provider_link":"http://localhost:7990/projects/FOO/repos/bish/browse"}

and the project was imported anyway.

Impact

Bypass project creation despite the admin setting explcitily disallow it

What is the current bug behavior?

Bypass project creation despite the admin setting explcitily disallow it

Edited Nov 07, 2021 by Nick Malcolm
Assignee
Assign to
Time tracking