Skip to main content

UNKNOWN

Project description

AWSのセキュリティグループを管理するツールです。

セキュリティグループの設定をcsvでダウンロード、コメントをつけてバージョン管理、追加したものをAPI経由で保存という使い方ができます。

## インストール

```
$ pip install sg
```

OR

```
$ python setup.py install
```

## 使い方

適切なディレクトリを作成し`init`コマンドを実行してください。

設定が保存されます。

```
$ cd yourpath
$ sgsg.py init
enter your region[us-east-1]:
us-west-2
save to sg.cfg
enter your aws_access_key_id:
xxx
enter your aws_secret_access_key:
xxx
save to aws_key
```

### リモートからローカルへの同期

以下AWS上に保存された設定を「リモート設定」、csvとして保存されている設定を「ローカル設定」と呼びます。

リモート設定を保存するには`fetch`コマンドを利用します。

```
$ sgsg.py fetch
mkdir security_groups
GROUP: group
save to security_groups/group.csv
```

ダウンロードされたcsvファイルにはコメントなどを追加することができます。エクセルなどで編集してください(文字コードはutf-8を想定しています)。

なお、新たなリモート設定が追加された場合も`fetch`で取得できます。更新時もコメントなどを消すことはありません。


### 差分の表示

ローカルとリモートの差分を表示するには`diff`コマンドを使用します。

`L:`とついているのはローカル設定だけにあるもの、`R:`とついているのはリモート設定だけにあるものです。

```
$ sgsg.py diff
GROUP: somegroup
L:tcp 22 22 192.168.11.1/32
R:tcp 22 22 0.0.0.0/32
```

### ローカルからリモートへの同期

更新を反映するには`commit`コマンドを使用します。

csvに追加、または削除を行なったあと、以下のコマンドを実行します。差分が表示されるので確認後yを選択してください。

```
sgsg.py commit security_groups/somegroup.csv
GROUP: somegroup
post this setting?[y/N]
+tcp 80 80 192.168.0.1
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sg-0.0.4.tar.gz (9.1 kB view hashes)

Uploaded source

Built Distributions

sg-0.0.4.macosx-10.10-x86_64.tar.gz (18.3 kB view hashes)

Uploaded any

sg-0.0.4-py2.7.egg (24.9 kB view hashes)

Uploaded 2 7

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page