Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwittig committed Sep 7, 2018
1 parent 7a5c8a6 commit 59b30a5
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 38 deletions.
61 changes: 30 additions & 31 deletions security/account-password-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,40 +130,39 @@ Resources:
Type: 'AWS::Lambda::Function'
Properties:
Code:
ZipFile:
!Sub |
'use strict';
const AWS = require('aws-sdk');
const response = require('cfn-response');
const iam = new AWS.IAM({apiVersion: '2010-05-08'});
exports.handler = (event, context, cb) => {
console.log(`Invoke: ${!JSON.stringify(event)}`);
const done = (err) => {
if (err) {
console.log(`Error: ${!JSON.stringify(err)}`);
response.send(event, context, response.FAILED, {});
} else {
response.send(event, context, response.SUCCESS, {});
}
};
if (event.RequestType === 'Delete') {
iam.deleteAccountPasswordPolicy({}, done);
} else if (event.RequestType === 'Create' || event.RequestType === 'Update') {
iam.updateAccountPasswordPolicy({
AllowUsersToChangePassword: Boolean(event.ResourceProperties.AllowUsersToChangePassword),
HardExpiry: Boolean(event.ResourceProperties.HardExpiry),
MaxPasswordAge: event.ResourceProperties.MaxPasswordAge,
MinimumPasswordLength: event.ResourceProperties.MinimumPasswordLength,
PasswordReusePrevention: event.ResourceProperties.PasswordReusePrevention,
RequireLowercaseCharacters: Boolean(event.ResourceProperties.RequireLowercaseCharacters),
RequireNumbers: Boolean(event.ResourceProperties.RequireNumbers),
RequireSymbols: Boolean(event.ResourceProperties.RequireSymbols),
RequireUppercaseCharacters: Boolean(event.ResourceProperties.RequireUppercaseCharacters),
}, done);
ZipFile: |
'use strict';
const AWS = require('aws-sdk');
const response = require('cfn-response');
const iam = new AWS.IAM({apiVersion: '2010-05-08'});
exports.handler = (event, context, cb) => {
console.log(`Invoke: ${JSON.stringify(event)}`);
const done = (err) => {
if (err) {
console.log(`Error: ${JSON.stringify(err)}`);
response.send(event, context, response.FAILED, {});
} else {
cb(new Error(`unsupported RequestType: ${!event.RequestType}`));
response.send(event, context, response.SUCCESS, {});
}
};
if (event.RequestType === 'Delete') {
iam.deleteAccountPasswordPolicy({}, done);
} else if (event.RequestType === 'Create' || event.RequestType === 'Update') {
iam.updateAccountPasswordPolicy({
AllowUsersToChangePassword: Boolean(event.ResourceProperties.AllowUsersToChangePassword),
HardExpiry: Boolean(event.ResourceProperties.HardExpiry),
MaxPasswordAge: event.ResourceProperties.MaxPasswordAge,
MinimumPasswordLength: event.ResourceProperties.MinimumPasswordLength,
PasswordReusePrevention: event.ResourceProperties.PasswordReusePrevention,
RequireLowercaseCharacters: Boolean(event.ResourceProperties.RequireLowercaseCharacters),
RequireNumbers: Boolean(event.ResourceProperties.RequireNumbers),
RequireSymbols: Boolean(event.ResourceProperties.RequireSymbols),
RequireUppercaseCharacters: Boolean(event.ResourceProperties.RequireUppercaseCharacters),
}, done);
} else {
cb(new Error(`unsupported RequestType: ${event.RequestType}`));
}
};
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'LambdaRole.Arn'
Expand Down
4 changes: 2 additions & 2 deletions security/auth-proxy-ha-github-orga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ Resources:
nginx: []
files:
'/etc/nginx/conf.d/http2https.conf':
content: !Sub |
content: |
server {
listen 8080 default_server;
server_name _;
Expand Down Expand Up @@ -654,7 +654,7 @@ Resources:
owner: root
group: root
'/etc/init.d/oauth2_proxy':
content: !Sub |
content: |
#!/bin/sh
### BEGIN INIT INFO
# Provides:
Expand Down
2 changes: 1 addition & 1 deletion security/cloudtrail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Resources:
Type: 'AWS::SNS::TopicPolicy'
Properties:
PolicyDocument:
Version: '2008-10-17'
Version: '2012-10-17'
Statement:
- Sid: AWSCloudTrailSNSPolicy
Effect: Allow
Expand Down
4 changes: 2 additions & 2 deletions wordpress/wordpress-ha-aurora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ Resources:
httpd: []
files:
'/root/php.sh':
content: !Sub |
content: |
#!/bin/bash -ex
sed -i 's/max_execution_time = 30/max_execution_time = 300/' /etc/php.ini
sed -i 's/max_input_time = 60/max_input_time = 300/' /etc/php.ini
Expand All @@ -789,7 +789,7 @@ Resources:
owner: root
group: root
'/etc/httpd/conf.d/wordpress.conf':
content: !Sub |
content: |
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Expand Down
4 changes: 2 additions & 2 deletions wordpress/wordpress-ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ Resources:
httpd: []
files:
'/root/php.sh':
content: !Sub |
content: |
#!/bin/bash -ex
sed -i 's/max_execution_time = 30/max_execution_time = 300/' /etc/php.ini
sed -i 's/max_input_time = 60/max_input_time = 300/' /etc/php.ini
Expand All @@ -777,7 +777,7 @@ Resources:
owner: root
group: root
'/etc/httpd/conf.d/wordpress.conf':
content: !Sub |
content: |
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Expand Down

0 comments on commit 59b30a5

Please sign in to comment.