syslogと/var/log/messages

特定用途以外のログは、syslogにより/var/log/messagesに吐き出されるので確認する。

S3 バケット容量 確認(2通り)

$ aws cloudwatch get-metric-statistics --region us-east-1 --namespace AWS/S3 --metric-name BucketSizeBytes --dimensions Name=BucketName,Value=emotion-s3 Name=StorageType,Value=StandardStorage --statistics Average --start-time 2017-05-14T00:00:00Z --end-time 2017-05-14T23:59:59Z --period 86400

{
“Datapoints”: [
{
“Timestamp”: “2017-05-14T00:00:00Z”,
“Average”: 1670515.0,
“Unit”: “Bytes”
}
],
“Label”: “BucketSizeBytes”
}

$ aws s3 ls --summarize --human-readable --recursive s3://emotion-s3

2017-04-27 23:17:36 5.0 KiB EmotionRegressionTriggerArtifacts/target/com.emotion.lambda-0.0.1-SNAPSHOT.jar
2017-04-16 23:47:55 67.0 KiB analysis3.csv
2017-05-02 23:26:12 93.1 KiB cloudformer.template

2017-04-18 12:34:17 0 Bytes emotion-emr/src/
2017-04-22 21:26:16 3.5 KiB emotion-emr/src/emotion-linear-regression_2.11-1.0.jar
2017-04-18 14:56:51 3.5 KiB emotion-emr/src/spark-sample-project_2.11-1.0.jar
2017-04-22 21:12:50 44.0 KiB emotion-emr/transition.csv
2017-04-16 23:47:56 398.4 KiB snapshot.jpg
2017-04-16 23:48:00 352.5 KiB snapshot1.jpg
2017-04-18 12:30:02 1.9 KiB transition.csv

Total Objects: 184
Total Size: 1.6 MiB

IAMポリシーでKMSを利用していない場合のみ特定IPアドレスで利用


{ "Effect":"Deny", "Principal":"*", "Action":"s3:PutObject", "Resource":"arn:aws:s3:::case1108980323/*", "Condition":{ "StringNotEquals":{ "s3:x-amz-server-side-encryption":"AES256" } }

DBの設定確認

SHOW ENGINE INNODB STATUS \G;
SHOW global STATUS;
show global status like 'Handler%';
SHOW global STATUS LIKE '%innodb%data%';
SHOW global STATUS LIKE '%pending%';
SHOW global STATUS LIKE '%com%';
SHOW global STATUS LIKE '%Com_update%';
SHOW global STATUS LIKE '%Com_insert%';
SHOW global STATUS LIKE '%Com_delete%';
show processlist;
SHOW global STATUS LIKE '%thread%';
select count(*) from lime_survey_989903;
select now();

ロック確認

select * from information_schema.innodb_lock_waits;
select * from information_schema.innodb_locks;

JSONデータ抜き出し

$ jq -r '.prefixes[] | select(.region == "ap-northeast-1") | select(.service == "EC2") | .ip_prefix' < ip-ranges.json
13.112.0.0/14
46.51.224.0/19
52.68.0.0/15
{
"syncToken": "1494364331",
"createDate": "2017-05-09-21-12-11",
"prefixes": [
{
"ip_prefix": "13.32.0.0/15",
"region": "GLOBAL",
"service": "AMAZON"
},
{
"ip_prefix": "13.54.0.0/15",
"region": "ap-southeast-2",
"service": "AMAZON"
}
]
}

IPアドレス分析

$ ipcalc 52.95.255.48/24

Address: 52.95.255.48 00110100.01011111.11111111. 00110000
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 52.95.255.0/24 00110100.01011111.11111111. 00000000
HostMin: 52.95.255.1 00110100.01011111.11111111. 00000001
HostMax: 52.95.255.254 00110100.01011111.11111111. 11111110
Broadcast: 52.95.255.255 00110100.01011111.11111111. 11111111
Hosts/Net: 254 Class A

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です