セキュリティグループの設定を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
```
Metadata
Release files for sg 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sg-0.0.4.tar.gz | 9.1 kB | Without provenance | Details for sg-0.0.4.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sg-0.0.4.macosx-10.10-x86_64.tar.gz | Details for sg-0.0.4.macosx-10.10-x86_64.tar.gz | |||
| sg-0.0.4-py2.7.egg | Legacy Egg format | - | - | Details for sg-0.0.4-py2.7.egg |
Total release size: 52.3 kB
Release files / sg-0.0.4.tar.gz
| Download URL | sg-0.0.4.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d42f7c1ad78cc3a79397422f52ffe39b1d440d1ef7d824023640baac8e29856
|
|
BLAKE2b-256 checksum How to use checksums |
e645ec581f9237e98aa3df08ff2b3bcf48d41e97a5ca8129d6668fa1d28b11ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sg-0.0.4.macosx-10.10-x86_64.tar.gz
| Download URL | sg-0.0.4.macosx-10.10-x86_64.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9df546fbad699dd0c5ecf929c5273258db07e31b04c6e6b94a04b9d8821c86e7
|
|
BLAKE2b-256 checksum How to use checksums |
fa970eb28611fd5a694ca87f3feed3e047a480e1644848d558a1299222b99f8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sg-0.0.4-py2.7.egg
| Download URL | sg-0.0.4-py2.7.egg |
|---|---|
| Size | 24.9 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
7a883d90d87b883aa339c4ef3870371baeb01db6530c556601f76d2ca036011e
|
|
BLAKE2b-256 checksum How to use checksums |
6b9054e09ef54a4e1247d7f93731fbd2b9f7b609c90395467fa52caa07796c92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for sg 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.