-
Notifications
You must be signed in to change notification settings - Fork 0
DOCS: Add acl guide #31
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| # Arcus ACL ๊ด๋ฆฌ ๊ฐ์ด๋ | ||
|
|
||
| Arcus์ ACL ๊ธฐ๋ณธ ๊ฐ์์ ๋ํ ์ค๋ช ์ [์บ์ ์๋ฒ ๋ฌธ์](https://github.com/naver/arcus-memcached/blob/master/docs/administration/sasl.md) ์ฐธ๊ณ ๋ฐ๋๋๋ค. | ||
|
|
||
| ### 0) ์ฌ์ ์ค๋น | ||
|
|
||
| Arcus ACL ์ ๋ณด๋ฅผ ์ ์ฅ, ๊ด๋ฆฌํ๋ ZooKeeper์ ์ฐ๊ฒฐํ๊ธฐ ์ํ์ฌ, [์ค์ ํ์ผ ๋๋ ํ๊ฒฝ ๋ณ์](./config-file.md)๋ฅผ ํตํด zookeeper ์ฃผ์๋ฅผ ์ง์ ํฉ๋๋ค. | ||
|
|
||
| ### 1) ๊ทธ๋ฃน ์์ฑ - `acl group add` | ||
|
|
||
| ```sh | ||
| ./arcusctl acl group add sample | ||
| # admin name: alice | ||
| # password: | ||
| # repeat password: | ||
| # OK | ||
| ``` | ||
| - ์๋ก์ด ๊ทธ๋ฃน์ ์์ฑํฉ๋๋ค. | ||
| - ๊ทธ๋ฃน ๊ด๋ฆฌ์ username๊ณผ password๋ฅผ ์ค์ ํด์ผ ํฉ๋๋ค. | ||
| - ์์ฑ๋ ๊ทธ๋ฃน์๋ ๊ด๋ฆฌ์๋ง ์ฌ์ฉ์๋ฅผ ์ถ๊ฐ/์ ๊ฑฐํ ์ ์์ต๋๋ค. | ||
|
|
||
| ### 2) ๊ทธ๋ฃน ๋ชฉ๋ก ํ์ธ - `acl group list` | ||
|
|
||
| ``` | ||
| ./arcusctl acl group list | ||
| # * sample | ||
| # * dev | ||
| # * prod | ||
| # Total: 3 | ||
| ``` | ||
| - ZooKeeper์ ์ ์ฅ๋ ์ ์ฒด ๊ทธ๋ฃน ๋ชฉ๋ก์ ํ์ธํฉ๋๋ค. | ||
|
|
||
| ### 3) ์ฌ์ฉ์ ์ถ๊ฐ - `acl user add` | ||
|
|
||
| ```sh | ||
| ./arcusctl acl user add sample app kv,list,set,map,btree,attr,scan,flush | ||
| # admin name: alice | ||
| # admin password: | ||
| # user password: | ||
| # repeat user password: | ||
| # OK | ||
|
|
||
| ./arcusctl acl user add sample operator attr,scan,flush,admin logAll | ||
| # admin name: alice | ||
| # admin password: | ||
| # user password: | ||
| # repeat user password: | ||
| # OK | ||
| ``` | ||
| - ๊ทธ๋ฃน์ ์ฌ์ฉ์๋ฅผ ์ถ๊ฐํฉ๋๋ค. | ||
| - ์ฌ์ฉ์์๊ฒ ๋ถ์ฌํ ๊ถํ์ `,`์ผ๋ก ์ฐ๊ฒฐํ์ฌ ์ ๋ฌํฉ๋๋ค. ๊ถํ ๋ชฉ๋ก์ [์บ์ ์๋ฒ ๋ฌธ์](https://github.com/naver/arcus-memcached/blob/master/docs/administration/sasl.md#permissions)์์ ํ์ธํ ์ ์์ต๋๋ค. | ||
| - logAll ์ธ์ ์ถ๊ฐ๋ก ์ง์ ํ๋ฉด ํด๋น ๊ณ์ ์ผ๋ก ์๋ฒ์์ ์ํํ๋ ๋ชจ๋ ๋ช ๋ น ์ด๋ ฅ์ด ๊ฐ์ฌ ๋ก๊ทธ๋ก ๋จ๊ฒ ๋ฉ๋๋ค. | ||
|
|
||
| ### 4) ์ฌ์ฉ์ ๋ชฉ๋ก ํ์ธ - `acl user list` | ||
|
|
||
| ```sh | ||
| ./arcusctl acl user list sample | ||
| # * app [kv list set map btree attr flush] | ||
| # * operator [attr scan flush admin] logAll | ||
| # Total: 2 | ||
| ``` | ||
| - ํน์ ๊ทธ๋ฃน์ ์ํ ์ฌ์ฉ์ ๋ชฉ๋ก์ ์กฐํํฉ๋๋ค. | ||
|
|
||
| ### 5) ์ฌ์ฉ์ ๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ - `acl user passwd` | ||
|
|
||
| ```sh | ||
| ./arcusctl acl user passwd sample app | ||
| # admin name: alice | ||
| # admin password: | ||
| # user password: | ||
| # repeat user password: | ||
| # OK | ||
| ``` | ||
| - ๊ธฐ์กด ์ฌ์ฉ์์ ๋น๋ฐ๋ฒํธ๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค. | ||
|
|
||
| ### 6) ์ฌ์ฉ์ ๊ถํ ๋ณ๊ฒฝ - `acl user permissions` | ||
|
|
||
| ```sh | ||
| ./arcusctl acl user permissions sample app kv,attr | ||
| # admin name: alice | ||
| # admin password: | ||
| # OK | ||
| ``` | ||
| - ๊ธฐ์กด ์ฌ์ฉ์์ ๊ถํ์ ๋ณ๊ฒฝํฉ๋๋ค. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. admin ์ฌ์ฉ์๋ง ์ํํ ์ ์๋ค๊ณ ๋ช ์ ํ์
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ์๋ ๋ฌธ๊ตฌ๋ฅผ ์ถ๊ฐํฉ์๋ค.
|
||
| - `logAll` ์ค์ ์ ๋ณ๊ฒฝํ ์ ์์ผ๋ฉฐ, ์ฌ์ฉ์ ์์ฑ ์์๋ง ์ค์ ํ ์ ์๋ค. | ||
|
|
||
| ### 7) ์ฌ์ฉ์ ์ ๊ฑฐ - `acl user remove` | ||
|
|
||
| ```sh | ||
| ./arcusctl acl user remove sample app | ||
| # admin name: alice | ||
| # admin password: | ||
| # OK | ||
| ``` | ||
| - ์ฌ์ฉ์๋ฅผ ๊ทธ๋ฃน์์ ์ ๊ฑฐํฉ๋๋ค. | ||
|
|
||
| ### 8) ๊ด๋ฆฌ์ ๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ - `acl admin passwd` | ||
|
|
||
| ```sh | ||
| ./arcusctl acl admin passwd sample | ||
| # admin name: alice | ||
| # password: | ||
| # new admin password: | ||
| # repeat new admin password: | ||
| # OK | ||
| ``` | ||
| - ๊ทธ๋ฃน์ ๊ด๋ฆฌ์ ๋น๋ฐ๋ฒํธ๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค. | ||
|
|
||
| ### 9) ๊ทธ๋ฃน ์ ๊ฑฐ - `acl group remove` | ||
|
|
||
| ```sh | ||
| ./arcusctl acl group remove sample | ||
| # OK | ||
| ``` | ||
| - ๊ทธ๋ฃน์ ์ ๊ฑฐํฉ๋๋ค. | ||
| - ํด๋น ๊ทธ๋ฃน ํ์์ ์ฌ์ฉ์๊ฐ ์๋ฌด๋ ์๋ ์ํ์ฌ์ผ ํฉ๋๋ค. | ||
| - ๋น ๊ทธ๋ฃน์ ์ ๊ฑฐํ๊ธฐ ์ํด ๊ด๋ฆฌ์ username / password๋ฅผ ์๊ตฌํ์ง ์์ต๋๋ค. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # ์ค์ ๊ฐ์ด๋ | ||
|
|
||
| ## ์ค์ ํ์ผ | ||
|
|
||
| `arcusctl`์ ์๋์ ๊ฐ์ ์ค์ ํ์ผ์ ์ฌ์ฉํฉ๋๋ค. | ||
| ```yaml | ||
| zookeeper: "10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181" | ||
| # Alternatively, you can use a domain address. | ||
| # zookeeper: "zookeeper.example.com:2181" | ||
| ``` | ||
|
|
||
| ## ์ค์ ํ์ผ ์์น | ||
|
|
||
| `arcusctl`์ ๋ค์ ์์๋๋ก ์ค์ ํ์ผ์ ์ฐพ์ต๋๋ค: | ||
|
|
||
| 1. ์ฌ์ฉ์ ์ง์ ๊ฒฝ๋ก (`--config-file` ์ต์ ) | ||
| ```sh | ||
| ./arcusctl --config-file /path/to/config.yaml | ||
| ``` | ||
|
|
||
| 2. ์คํ ํ์ผ ๋๋ ํ ๋ฆฌ | ||
| - `arcusctl` ๋ฐ์ด๋๋ฆฌ๊ฐ ์์นํ ๋๋ ํ ๋ฆฌ | ||
|
|
||
| 3. ํ์ฌ ์์ ๋๋ ํ ๋ฆฌ | ||
| - ๋ช ๋ น์ด๋ฅผ ์คํํ๋ ๋๋ ํ ๋ฆฌ | ||
|
|
||
| > [!NOTE] | ||
| > `--config-file` ์ฌ์ฉํ์ฌ ํ์ผ ์ง์ ์ง์ ํ๋ ๊ฒฝ์ฐ ์ ์ธํ๊ณ ํ์ผ๋ช ์ `config.yaml`์ด์ด์ผ ํฉ๋๋ค. | ||
|
|
||
| ## ํ๊ฒฝ ๋ณ์ | ||
|
|
||
| `ARCUSCTL_` ์ ๋์ฌ๋ฅผ ์ฌ์ฉํ์ฌ ํ๊ฒฝ ๋ณ์๋ก ์ค์ ๊ฐ์ ์ฌ์ ์ํ ์ ์์ต๋๋ค. | ||
|
|
||
| **์์:** | ||
| ```sh | ||
| ARCUSCTL_ZOOKEEPER="localhost:2181" ./arcusctl | ||
| ``` | ||
|
|
||
| ํ๊ฒฝ ๋ณ์๋ ์ค์ ํ์ผ์ ๊ฐ๋ณด๋ค ์ฐ์ ์ ์ผ๋ก ์ ์ฉ๋ฉ๋๋ค. | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ผ๋ฐ ์ฌ์ฉ์๋ ์์ ์ ๋น๋ฐ๋ฒํธ๋ฅผ ๋ณ๊ฒฝํ๋๋ก ์ ๊ณตํด์ผ ํ์ง ์๋ ์ง?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด์ ๋ ผ์์์ ZooKeeper ACL์ ํน์ฑ์ ๋ฐ๋ฅธ ๊ตฌํ ๋ณต์ก์ฑ ๋๋ฌธ์ admin์ ์ํ ๋ณ๊ฒฝ๋ง ์ง์ํ๋ ๊ฒ์ผ๋ก ํ์๋๋ฐ,
arcus user๊ฐ ์์ ์ ๋น๋ฐ๋ฒํธ๋ฅผ ๋ณ๊ฒฝํ ์ ์๋๋ก ํ ๊น์?
์ด ๊ฒฝ์ฐ, "admin์ด user ๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ" / "user๊ฐ ์์ ๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ"ํ๋ ๊ฒฝ์ฐ ์ธํฐํ์ด์ค๋ฅผ ๊ฒฐ์ ํด์ผ ํฉ๋๋ค.