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

Strengthen auth linter to require managed identity by default #785

Open
4 tasks done
tg-msft opened this issue May 6, 2024 · 2 comments
Open
4 tasks done

Strengthen auth linter to require managed identity by default #785

tg-msft opened this issue May 6, 2024 · 2 comments
Assignees
Labels
design:needed A design request has been raised that needs a proposal needs-area

Comments

@tg-msft
Copy link
Member

tg-msft commented May 6, 2024

Clear and concise description of the problem

We should strengthen https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-core/src/rules/auth-required.ts to require managed identity for all services and suppress the warning for anything brownfield. We need to make a corresponding change to Azure's guidelines tracked at microsoft/api-guidelines#544.

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For feature request in the typespec language or core libraries file it in the TypeSpec repo
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@markcowl markcowl added the design:needed A design request has been raised that needs a proposal label May 7, 2024
@markcowl markcowl self-assigned this May 7, 2024
@markcowl
Copy link
Member

markcowl commented May 7, 2024

@tg-msft We don't describe mechanisms for acquiring tokens in API Specs, do we want to discourage authentication mechanisms other than 0auth in API SPecs (like ApiKeyAuth), or is there some other ask here?

There are some API patterns apart from spec authentication that are problematic, such as passing secrets in PUT / POST (Create) payloads, not marking properties named 'password' or 'credential' or 'token' as @secret, etc. Are there some API-specific practices like these that we would like to lint for as well?

@markcowl markcowl removed their assignment May 7, 2024
@markcowl markcowl added the needs-info Mark an issue that needs reply from the author or it will be closed automatically label May 7, 2024
@tg-msft
Copy link
Member Author

tg-msft commented May 8, 2024

do we want to discourage authentication mechanisms other than 0auth in API SPecs (like ApiKeyAuth), or is there some other ask here?

The current linting rule validates that any auth mechanism is present and will be happy with just api keys. I'm asking to validate everyone has OAuth so services who don't support it have to explicitly #suppress, explain why to reviewers, and be easily tracked. I don't think we need to do anything about other auth mechanisms for now.

We could probably do more security linting for worst practices, but this issue is scoped to just aligning this linting rule with whatever we do for microsoft/api-guidelines#544.

@microsoft-github-policy-service microsoft-github-policy-service bot added needs-team-attention and removed needs-info Mark an issue that needs reply from the author or it will be closed automatically labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design:needed A design request has been raised that needs a proposal needs-area
Projects
None yet
Development

No branches or pull requests

3 participants