Skip to content

Commit b58a1c0

Browse files
committed
Add Misc Talks
1 parent 595382d commit b58a1c0

8 files changed

+395
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
# Nor these folders
88
!Conferences/
99
!Courses/
10+
!Talks/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
url: https://www.ted.com/talks/celeste_headlee_10_ways_to_have_a_better_conversation
3+
---
4+
5+
# 10 Ways to Have a Better Conversation
6+
7+
## 1. Don't multitask. Be present.
8+
9+
## 2. Don't pontificate
10+
> Everyone you'll ever meet will know something that you don't – Bill Nye
11+
12+
## 3. Use open-ended questions
13+
14+
## 4. Go with the flow.
15+
Let thoughts come out of your mind. Don't just hold on them and stop listening.
16+
17+
## 5. If you don't know, say that you don't know.
18+
19+
## 6. Don't equate your experience with theirs.
20+
They are never the same. All experiences are individual. It's not about yourself, conversations aren't an opportunity for self promotion.
21+
22+
## 7. Do not repeat yourself
23+
Do not just rephrase your point multiple time
24+
25+
## 8. Stay out of the weeds
26+
Forget the details
27+
28+
## 9. Listen
29+
Listen with the intend to understand, not the itend to reply
30+
31+
## 10. Be brief.
32+
> A good conversation is like a miniskirt, short enough to retain interest, but long enough to cover the subject.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
url: https://www.ted.com/talks/robb_willer_how_to_have_better_political_conversations
3+
---
4+
5+
# How to have better political conversations
6+
7+
- Both side don't cherish the same values.
8+
- When arguing with our own value, we are not asking the other to change their opinion, we are asking them to change their values.
9+
- We should adapt our message to use their values.

Talks/How to overcome our biases.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
url: https://www.ted.com/talks/verna_myers_how_to_overcome_our_biases_walk_boldly_toward_them
3+
---
4+
5+
# How to overcome our biases? Walk boldly toward them
6+
7+
1. Stop denial
8+
2. Walk towards them. To get comfortable, you'll first need to get uncomfortable
9+
3. Say it when someone is saying something wrong. This is the only way to stop the biases from perpetuating.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
url: https://youtu.be/Hez1QYc9yo8
3+
---
4+
5+
# Introduction to Ruby on Rails security
6+
7+
## SQL Injection
8+
> Nefarious SQL statements are inserted into an entry field for execution.
9+
10+
- Don't build your query yourself, use the ORM which protects you. That being said, [some methods](http://rails-sqli.org/) are unsafe to use.
11+
- Don't solely rely on the ORM, consider setting users and permissions at the database level so even if someone gets access to the database via SQL Injection, they don't have full access to the database.
12+
13+
## XSS
14+
> If an attacker adds a script and gets it to show to another user, he gets access to that user's session.
15+
16+
- Variables within an html template are automatically escaped.
17+
- Variables used in a helper, within style/script blocks and in non-html templates **aren't** escaped. Use partials instead.
18+
- Whitelist URL from user. Don't blacklist, it's too easy to forget to add a URL to the list or for someone to find a URL which isn't blacklisted.
19+
- Consider CSP as an additional protection.
20+
21+
## CSRF: Cross Site Request Forgery
22+
> Attack that forces an end user to execute unwanted actions on a web application in which they're currently authenticated.
23+
24+
- Rails check tokens for `POST`, `PATCH`, `PUT` and `DELETE` actions but not for `HEAD` and `GET` actions. Therefore, you should never modify the state within `HEAD` and `GET` requests.
25+
26+
## Direct Object Reference
27+
> Request a record by ID allow an attacker to guess and different record ID
28+
29+
- Always scope under current user (e.g. `current_user.invoices.find(params[:id])` instead of `Invoice.find(params[:id])`) which not only will protect the resource, but will raise 404 instead of 403 (unauthorised), leaking the least possible amount of information.
30+
- Basically, filter first and query second.
31+
32+
## Mass Assignment
33+
> A computer vulnerability where an active record pattern in a web application is abused to modify data items that the user should not normally be allowed to access such as password, granted permissions, or administrator status.
34+
35+
Use [strong parameters](http://weblog.rubyonrails.org/2012/3/21/strong-parameters/) to prevent mass assignment.
36+
37+
## Unexpected types
38+
`where` accepts a simple object or an array and use `=` or `IN` accordingly. Again, use strong parameters.
39+
40+
## Arbitrary Objct Deserialisation
41+
YAML can contain artitrary ruby objects which can result in Remote Code Execution (RCE).
42+
43+
## Gems to help
44+
- breakman: static analysis of security vulnerability for Rails app.
45+
- bundle-audit: check dependencies for know security issues.

Talks/OWASP Top 10 2013.md

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# OWASP Top 10 - Wellington Meetup 2016/11/29
2+
3+
Notes from the Wellington meetup on November 29th 2016, discussing the OWASP Top 10 Edition 2013 (2017 is in draft at the time of writing).
4+
5+
Check the [OWASP Top 10 Cheat Sheet](https://www.owasp.org/index.php/OWASP_Top_Ten_Cheat_Sheet) online for the latest version.
6+
7+
Check the [DVWA](dvwa.org.nz) (Damn Vulnerable Web Application) which is specifically designed to teach vulnerabilities.
8+
9+
## A1 - Injections
10+
11+
Vulnerabilities:
12+
13+
- Full Read/Write access to the DB.
14+
- Escalation of privileges.
15+
16+
Prevention:
17+
18+
- Use parameterises queries
19+
- Use your ORM
20+
21+
Verify:
22+
23+
- Put a `'` in your input fields. If it breaks, you're vulnerable.
24+
- Use [sqlmap](http://sqlmap.org/), an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers.
25+
26+
## A2 - Weak authentication and session management
27+
28+
HTTP is stateless so we use cookies to remember who someone is.
29+
30+
Vulnerabilities:
31+
32+
- Credentials could be stored insecurely on the server.
33+
- Cookies can be guessed or stolen (control of session, logging in as another user)
34+
- General logic might be flawed.
35+
36+
## A3 - XSS (Cross Site Scripting)
37+
38+
Mixing untrusted data within a webpage. If an attacker can add its own script to a page, he can alter the way it behaves.
39+
40+
Vulnerabilities:
41+
42+
- Runs JS on the user's browser
43+
- Proxy commands through their computer
44+
- Trick them into performing an action
45+
- Redirect to phishing or malware
46+
47+
Where:
48+
49+
- HTML, when displaying user input on the page
50+
- Form input
51+
- URI parameters
52+
- CSS, when allowing a user to set custom colours
53+
- JS, when loading data
54+
- HTML attributes, escaping function aren't the same for single or double quotes (i.e. your escaping function should match what your front-end use)
55+
56+
Prevention:
57+
58+
- Don't display user input if possible, otherwise:
59+
- Whitelist during input validation
60+
- Output encode all user supplied data.
61+
- See [OWASP XSS Prevention Check Sheet](www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet)
62+
- Set the right [CSP](https://content-security-policy.com/) (Content Security Policy) headers
63+
64+
Verify:
65+
66+
- Put a `<` in your input fields or url params which are later displayed. If it is shown unescaped, you are vulnerable.
67+
- Use [BeEF](http://beefproject.com/), a browser exploitation framework project.
68+
69+
## A4 - Insecure Direct Object References
70+
71+
Vulnerabilities:
72+
73+
- Accessing objects you're not supposed to by modifying the URI attributes.
74+
75+
Prevention:
76+
77+
- Whitelist rather than blacklist. It's easier to maintain.
78+
- Don't trust user input
79+
- Verify permissions
80+
- Consider mapping database IDs to a temporaty ID per user (see ESAPI)
81+
82+
## A5 - Security Misconfiguration
83+
84+
Software, server platform out of date or misconfigured.
85+
86+
## A6 - Sensitive Data Exposure
87+
88+
Missing encryption allows man in the middle attack.
89+
90+
Prevention:
91+
92+
- Use HTTPS
93+
- Use [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security)
94+
- a web security policy mechanism which helps to protect websites against protocol downgrade attacks and cookie hijacking; it allows web servers to declare that web browsers (or other complying user agents) should only interact with it using secure HTTPS connections,[1] and never via the insecure HTTP protocol
95+
- Use [key pinning](https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning)
96+
- a security mechanism which allows HTTPS websites to resist impersonation by attackers using mis-issued or otherwise fraudulent certificates.
97+
- Only collect what you need
98+
- Use standard strong algorithm
99+
- Generate, distribute and protect keys properly
100+
101+
## A7 - Missing Function Level Access Control
102+
103+
Failing to perform access checks on both client and server
104+
105+
Prevention:
106+
- Do authorisation checks on `GET` and `POST`
107+
- Block functions from certain users
108+
- Users, role or claims-based permission.
109+
- Whitelist rather than blacklist.
110+
111+
## A8 - Cross Site Request Forgery
112+
113+
Forcing a user's browser to make a request.
114+
115+
User access bad website which makes a request to target website and all credentials are passed through with the request
116+
117+
Prevention:
118+
119+
- Don't change data on `GET`, it should be idempotent
120+
- CSRF works when the attacker knows everything
121+
- Include something unknown in the form like a CSRF token
122+
123+
## A9 - Using Components with Known Vulnerabilities
124+
125+
Out of date components
126+
127+
Prevention:
128+
129+
- Keep components up to date
130+
- Catalogue components you depend on
131+
- Follow security bulletins
132+
133+
Verify:
134+
- [Retire.js](http://requirejs.org/) or [david](https://david-dm.org/) for JavaScript
135+
- Use `pip list --outdated` for Python
136+
137+
## 10 - Unvalidated Redirects and Forwards
138+
139+
Redirecting the browser to an unsafe url; typically, when using a `nextUrl` on a login page.
140+
141+
Prevention:
142+
143+
- Have a whitelist of what it is allowed to redirect to
144+
- Have regular expression to only allow internal urls
145+
146+
# Frameworks
147+
148+
Frameworks are a great way to migitate those risks as most of those issues have been resolved already.
149+
150+
## How to choose a framework?
151+
152+
- Choose a well known and well maintained (no abandonware) framework (it was originally phrased "something new" but we disagree with that)
153+
- Familiarise yourself with built-in protection
154+
- Build common code that new dev will leverage
155+
156+
See [OWASP Framework Security Matrix](https://www.owasp.org/index.php/Category:Framework_Security_Matrix) (still WIP) to check what each framework protects you against.
157+
158+
# Q&A
159+
160+
161+
## Is there a way to scan your application?
162+
163+
There are some code scanners (like [Fortify](https://en.wikipedia.org/wiki/Fortify_Software)) but those solutions are usually expensive.
164+
165+
Linters normally catch stylistic issues but might catch basic security issues as well.
166+
167+
Use the [OWASP Zed Attack Proxy](https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project) to pentest your app.
168+
169+
## User Input
170+
171+
It is well known that you should trust user input and sanitise it.
172+
173+
However, user input should be handled carefully even when it comes from your database. You might think that because it comes from the database it is safe, but you can never be too sure of how it was saved.
174+
175+
## Browsers
176+
177+
Vendors play their parts:
178+
179+
- Key pinning was actually introduced by browsers.
180+
- The browser will block script that appears in the url and in the page.
181+
- From January 2017, Chrome will [flag non HTTPS pages with password or credit-card fields as non-secure](https://security.googleblog.com/2016/09/moving-towards-more-secure-web.html).

Talks/The Future of Programming.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
url: https://vimeo.com/71278954
3+
---
4+
5+
# The Future of Programming (by Bret Victor)
6+
7+
> Technology changes quickly, people minds changes slowly. It can be easy to adopt new technology but hard to adopt new ways of thinking.
8+
9+
> Ideas required people to unlearn what they've learned and learn to think in a new way and there's often a lot amount of resistence.
10+
11+
Bret Victor runs the talk like it's the 70s, displaying his slides with a overhead projector, explaining the beggining of programming – coding procedures as text files in a sequential programming model — in a very satirical way, saying "it will never happen", which is exactly what happened.
12+
13+
He showcases innovative ways of thinking/programming of that time:
14+
- Sketchpad 1962, give constraints to the computer which "figures this out" (e.g. not teaching how to draw a rectangle, but constraints some lines to be mutually perpendicular).
15+
- Planner 1969, explains a program by goals (which will become logic programming).
16+
- Regular Expressions 1967, pattern matching.
17+
18+
It becomes apparent that like the binnary programmers who didn't want to learn assembly or Fortran in the 60s, we were (and are still) blind to those new ideas which fell into oblivion.
19+
20+
He concludes that it would be a shame if 40 years later (i.e. 2010s) we were still doing the same, and suggest that we didn't learn anything from the past. But more importantly, it would be a shame if we had forgotten those ideas and the fact that we can have new ideas about programming. It would be a shame if this was what we teach new generation as they would essentially grow up with dogma, which is really hard to break out of it. Once again, he is giving a satirical look at today's world.
21+
22+
> The most dangerous though you are gonna have as a creative person is to think that you know what you're doing, because [...] you stop looking around for other ways of doing things and you stop being able to see other ways of doing things.
23+
24+
In the 60s-70s, nobody knew what programming was so they would try anything they could think of. We, as a field, have to admit we don't know what programming is so we can embrace new ideas.

0 commit comments

Comments
 (0)