Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions docs/command-acl.md
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
```
- ๊ธฐ์กด ์‚ฌ์šฉ์ž์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ผ๋ฐ˜ ์‚ฌ์šฉ์ž๋Š” ์ž์‹ ์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณ€๊ฒฝํ•˜๋„๋ก ์ œ๊ณตํ•ด์•ผ ํ•˜์ง€ ์•Š๋Š” ์ง€?

Copy link
Member Author

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๊ฐ€ ์ž์‹  ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ"ํ•˜๋Š” ๊ฒฝ์šฐ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๊ฒฐ์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.


### 6) ์‚ฌ์šฉ์ž ๊ถŒํ•œ ๋ณ€๊ฒฝ - `acl user permissions`

```sh
./arcusctl acl user permissions sample app kv,attr
# admin name: alice
# admin password:
# OK
```
- ๊ธฐ์กด ์‚ฌ์šฉ์ž์˜ ๊ถŒํ•œ์„ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

admin ์‚ฌ์šฉ์ž๋งŒ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค๊ณ  ๋ช…์‹œ ํ•„์š”

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„๋ž˜ ๋ฌธ๊ตฌ๋ฅผ ์ถ”๊ฐ€ํ•ฉ์‹œ๋‹ค.

  • logAll ์„ค์ •์€ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ์‚ฌ์šฉ์ž ์ƒ์„ฑ ์‹œ์—๋งŒ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

- `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๋ฅผ ์š”๊ตฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

40 changes: 40 additions & 0 deletions docs/config-file.md
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
```

ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋Š” ์„ค์ • ํŒŒ์ผ์˜ ๊ฐ’๋ณด๋‹ค ์šฐ์„ ์ ์œผ๋กœ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.

Loading