やさぐれオペレーター日記

雰囲気でやってる元ネットワークエンジニアの日記

Azure DevOps Tips

※特筆しない限り、管理者でログインした環境で実施

  • パブリックプロジェクトの作成を許可しない設定

docs.microsoft.com

「Organization settings」->「Security」「Policies」->「Security policies」「Allow public project」を「Off」に設定
これにより、すべてのプロジェクトがprivate扱いになり、匿名ユーザでプロジェクトを閲覧することが不可能になる。
一般的な会社などの組織であれば、この設定は誤設定防止に有効。

一度無効化しても、再度有効化すると、public設定していたプロジェクトはpublicにもどり、外部から確認することができる。 Project settingsのVisibilityから変更できるが、Offにした状態では強制的にprivate扱いになり、変更できない。Onにすると、変更できるよう項目が表示される。

  • SSHキーを使った認証を行わない。

docs.microsoft.com

「Organization settings」->「Security」「Policies」->「Application connection policies」「SSH authentication」を「Off」に設定
これで、SSHキーを使った認証はできなくなる。
GUI上でSSHが使えるように表示されるが、実際には下記の結果になり、使用できない。

Onで接続できた時のログ

# git clone git@ssh.dev.azure.com:v3/~~~
Cloning into '~~~~'...
remote: Azure Repos
remote: Found xx objects to send. (x ms)
Receiving objects: 100% (xx/xx), done.

Offで接続できた時のログ

# git clone git@ssh.dev.azure.com:v3/~~~
Cloning into '~~~~'...
remote: Public key authentication failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.