Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
004e517e
Commit
004e517e
authored
Feb 23, 2015
by
Edward Zarecor
Committed by
Feanil Patel
Mar 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing stubbed handler, adding ansible managed.
parent
dbf54e57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
18 deletions
+66
-18
playbooks/roles/edx_ecommerce/handlers/main.yml
+0
-18
playbooks/security.sh
+66
-0
No files found.
playbooks/roles/edx_ecommerce/handlers/main.yml
deleted
100644 → 0
View file @
dbf54e57
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Handlers for role edx_ecommerce
#
# Overview:
#
#
-
name
:
notify me
debug
:
msg="stub handler"
playbooks/security.sh
0 → 100644
View file @
004e517e
#!/bin/bash
set
-ex
# https://alas.aws.amazon.com/ALAS-2015-473.html
check_vulnerability
()
{
cat
>
glibc_check.c
<<
EOF
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
struct {
char buffer[1024];
char canary[sizeof(CANARY)];
} temp = { "buffer", CANARY };
int main(void) {
struct hostent resbuf;
struct hostent *result;
int herrno;
int retval;
/*** strlen (name) = size_needed - sizeof (*host_addr) - sizeof (*h_addr_ptrs) - 1; ***/
size_t len = sizeof(temp.buffer) - 16*sizeof(unsigned char) - 2*sizeof(char *) - 1;
char name[sizeof(temp.buffer)];
memset(name, '0', len);
name[len] = '\0';
retval = gethostbyname_r(name, &resbuf, temp.buffer, sizeof(temp.buffer), &result, &herrno);
if (strcmp(temp.canary, CANARY) != 0) {
puts("vulnerable");
exit(EXIT_SUCCESS);
}
if (retval == ERANGE) {
puts("not vulnerable");
exit(EXIT_SUCCESS);
}
puts("should not happen");
exit(EXIT_FAILURE);
}
/* from http://www.openwall.com/lists/oss-security/2015/01/27/9 */
EOF
gcc glibc_check.c
-o
glibc_check
./glibc_check
}
upgrade_packages
()
{
sudo
apt-get clean
sudo
mv /etc/apt/sources.list /tmp/sources.list.bk
sudo
sh
-c
'echo "deb http://http.us.debian.org/debian wheezy main contrib non-free" >> /etc/apt/sources.list'
sudo
sh
-c
'echo "deb http://security.debian.org wheezy/updates main contrib non-free" >> /etc/apt/sources.list'
sudo
apt-get update
-y
sudo
DEBIAN_FRONTEND
=
noninteractive apt-get install
-y
--force-yes
--only-upgrade
libgcc1 bash
sudo
mv /tmp/sources.list.bk /etc/apt/sources.list
sudo
apt-get clean
sudo
/etc/init.d/ssh restart
[
"
$(
check_vulnerability
)
"
==
"not vulnerable"
]
}
upgrade_packages
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment