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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Allow defining allow rules for catalog providers #24721

Open
2 tasks done
drodil opened this issue May 10, 2024 · 4 comments
Open
2 tasks done

馃殌 Feature: Allow defining allow rules for catalog providers #24721

drodil opened this issue May 10, 2024 · 4 comments
Labels
area:catalog Related to the Catalog Project Area enhancement New feature or request

Comments

@drodil
Copy link
Contributor

drodil commented May 10, 2024

馃敄 Feature description

There's already support for rules for catalog locations:

catalog:
  rules:
    - allow: [Component, API, Location, Template]

  locations:
    - type: url
      target: https://github.com/org/example/blob/master/org-data.yaml
      rules:
        - allow: [Group]

However, this is not possible to be defined for providers separately.

馃帳 Context

To be able to have more fine-grained control over what kind of entities each provider can produce, the config should allow rules to be defined for providers:

catalog:
  providers:
    github:
      providerId:
        organization: 'backstage'
        catalogPath: '/catalog-info.yaml' 
        filters:
          branch: 'main' 
          repository: '.*' 
        schedule:
          frequency: { minutes: 30 }
          timeout: { minutes: 3 }
      rules:
        - allow: [Component]
    githubOrg:
      id: github
      githubUrl: https://github.com
      orgs: ['organization-1', 'organization-2', 'organization-3']
      schedule:
        initialDelay: { seconds: 30 }
        frequency: { hours: 1 }
        timeout: { minutes: 50 }
      rules:
        - allow: [Group]

鉁岋笍 Possible Implementation

No response

馃憖 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

Are you willing to submit PR?

None

@drodil drodil added the enhancement New feature or request label May 10, 2024
@github-actions github-actions bot added the area:catalog Related to the Catalog Project Area label May 10, 2024
@drodil
Copy link
Contributor Author

drodil commented May 10, 2024

Related #4977 and #5014

@Rugvip
Copy link
Member

Rugvip commented May 10, 2024

Generally I agree that this could be good to have in some form, perhaps by just giving access to the standardized rule config and logic to entity providers.

These examples are perhaps not the best though, org data providers are fairly hardcoded to just ingest users and groups. If we don't trust them enough to do that there's a bigger problem than what can be solved in code, we'd need to sandbox them somehow at that point. If what we're looking for is filtering I'm thinking it's better to implement it as such.

The GitHub discovery provider doesn't actually ingest these entities directly. It emits Location entities that are then later read by the catalog, which means you'd need to be forwarding these rules to those locations somehow, or something like that. Lot more discussion around that in #12880, where we ultimately landed on #14584 as the solution.

@drodil
Copy link
Contributor Author

drodil commented May 10, 2024

Yeah, the locations are a bit hard for this. The main reason for this was that I would only like to get groups from Github org data and as the users are coming already from Azure. Of course, it could be possible to add a specific config for the GithubOrgDataProvider but thinking here again more generic way for all (even custom) providers to limit the entity types.

@Rugvip
Copy link
Member

Rugvip commented May 13, 2024

@drodil yep thinking it's probably best to keep that behind more explicit config to exclude users tbh. Using rules you might want to trigger an alert if someone tries to ingest a disallowed entity, so it could be good to avoid using it for deliberate filtering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:catalog Related to the Catalog Project Area enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants