index

A

admin processes, in twelve-factor app 253

admin tasks, in cloud environments 266269

advanced constraints

catching 149151

invariants 149

ORM frameworks and 155

upholding, builder pattern for 151154

aggregate 7377

ambiguous parameter lists, replacing 297303

direct approach 299300

discovery approach 299302

new API approach 299, 302303

antifragility 356

APIs

hardening with domain primitive library 119120

application-focused tests 211212

APT attacks 272, 274

audit trails 257, 264

auditability. See traceability

automated testing 210213

availability 9, 9092, 213, 265266, 269. See also CIA-T

avoid logging to file 263

defined 237

designing for 237244

in microservices 330

logging as a service and 263266

testing for 213215

estimating headroom 213215

exploiting domain rules 215

B

backing services 252, 260

backtracking, regular expression 200201

bad data 244249

echoing input verbatim, avoiding 247248

never repair 245247

overview 244

XSS Polyglots 248249

bank robbery example 56

Bees with Machine Guns 214

Billion Laughs attack 2329

boundary behavior testing 194197

boundary input testing 191, 194197

bounded contexts 7785

context mapping 8385, 329

identifying 7881

identifying in legacy code 296

interactions between 8185

language, model and 78

microservices as 325329

API design 326328

semantics and evolving services 329

splitting monoliths 328

ubiquitous language and 7778

bug bounty programs 350351

builder pattern

ambiguous parameters and 297299

for upholding advanced constraints 151154

bulkheads 241243

business concerns, security concerns equal priority as 1920

business exceptions 225232

C

centralized load balancing, in cloud environments 269270

change, increasing to reduce risk 272

checklist, security code review 345

checksums 109110

CIA-T (confidentiality, integrity, availability, and traceability) 89, 213, 237, 330331

circuit breakers 238241

classes, explicit concepts as 45

client-side load balancing, in cloud environments 270271

closed state, of circuit breakers 239

cloud environments

admin tasks 266269

configuration, storing 253258

in code, avoiding 254255

in environment 256258

in resource files, avoiding 255256

load balancing 269271

centralized 269270

client-side 270271

logging in 261266

as a service 263266

to file on disk, avoid 261263

overview 251252

running apps as separate processes 258261

processing instances don’t hold state 259260

security benefits 261

Three R’s, enterprise security 271277

increase change to reduce risk 272273

repairing vulnerable software 276277

repaving servers 274275

rotating secrets 273274

cloud-native applications, defined 253

code security reviews 344346

codebase, in twelve-factor app 252

collections, securing integrity of 160163

Command Query Responsibility Segregation (CQRS) 178

command-query separation (CQS) principle 148

concurrency, in twelve-factor app 252

confidentiality 7, 213, 264, 266, 269. See also CIA-T

in microservices 330

logging as a service and 264265

logging to file and 262

through domain-oriented logger API 337341

configuration

storing (cloud environments) 253258

encryption 257258

in code, avoiding 254255

in environment 256258

in resource files, avoiding 255256

validating 216221

automated tests 218219

causes of configuration-related security flaws 216218

overview 216

verifying implicit behaviors 219221

configuration hot spots 218

confirmation bias 129

constructors

number of 154

upholding invariants in 99101

containers 242, 275

context-driven testing 349350

context mapping 8385, 329

contracts. See also Design by Contract

as solution to defensive code constructs 308309

Conway’s Law 84

CQRS (Command Query Responsibility Segregation) 178

CQS (command-query separation) principle 148

credentials

ephemeral 273274

in code 255

credit card numbers, respresented by strings 42

critical complexity 52

cross-site scripting (XSS) attacks 12, 245, 247, 248249

cryptographic hash function 334

D

data integrity. See integrity

data leaks

caused by evolving code 125127

implicit, identifying 304305

data syntax, checking 109110

data transfer objects (DTOs) 120

DDD (Domain-Driven Design)

bounded contexts 7785

context mapping 8385, 329

identifying 7881

interactions between 8185

language, model and 78

ubiquitous language and 7778

models in 5177

as simplifications 5356

building blocks for 6577

capturing deep understanding 5961

choosing 6162

forming ubiquitous language 6365

strictness of 5659

terminology 56

overview 4951

DDoS (distributed denial of service) attacks 213215

decision-making 11

deep modeling 4346

deep understanding, capturing 5961

defensive code constructs 305310

contracts and domain primitives as solution to 308309

example 306308

optional data types in 309310

delivery pipelines 190191, 346, 349

denial of service (DoS) attacks 109, 213215

dependencies

DRY principle and 311312

hidden 242

in twelve-factor app 252

Dependency Inversion Principle 10

design, defining 911

design approach to security 1421

advantages of 1821

example 1518

Design by Contract

coining of term 95

example 9597

DevOps culture 344, 353

direct approach, to replacing ambiguous parameter lists 299300

discovery approach, to replacing ambiguous parameter lists 300302

disposability, in twelve-factor app 252

distilling models 6162

distributed denial of service (DDoS) attacks 213215

distributed monolith 323

Document Type Definition (DTD) 2223

domain, defined 56

domain DoS attacks 215

domain exceptions 236

domain focus 20

domain language 6364

domain model

as simplifications 5356

building blocks for 6577

aggregates 7377

entities 6670

value objects 7073

capturing deep understanding 5960

circuit breakers and 240241

choosing 6162

defined 56

forming ubiquitous language 6365

strictness of 5659

terminology 56

domain primitives 17, 114136

advantages of using 132

as smallest building blocks 114118

as solution to defensive code constructs 308309

context boundaries and 116118

in entities, when to use 132133

library of

hardening APIs with 119120

overview 118119

overview 114

partial, in legacy codebases 316321

encompassing conceptual whole 319321

implicit, contextual currency 317319

read-once objects as 121127

replacing ambiguous parameters with 298

where to apply in legacy code 296297

domain rules 192, 215

DoS (denial of service) attacks 109, 213215

DRY (Don’t Repeat Yourself) principle 82

defined 82

misapplications of 310313

false negatives 312313

false positives 311

problems caused by 311312

syntactic duplication 8183

DTD (Document Type Definition) 22

DTOs (data transfer objects) 120

dynamic tests 193

E

echoing input verbatim, avoiding 247248

eclectic approach to software security 21

Eiffel programming language 97

encryption 257258

Enterprise Resource Planning (ERP) 57

enterprise security, in cloud environments (three R’s) 271277

increasing change to reduce risk 272

repairing vulnerable software 276277

repaving servers 274275

rotating secrets 273274

entities 6670

consistent on creation 140146

catching advanced constraints 149151

construction with fluent interface 147149

example when not 140

mandatory fields as constructor arguments 143146

no-arg constructors, problems with 140143

ORM frameworks and advanced constraints 155

upholding advanced constraints, builder pattern for 151154

decluttering 129132

domain primitives in 132133

general discussion 127129

integrity of 156163

getter and setter methods 156157

mutable objects, avoiding sharing of 158160

securing integrity of collections 160163

locked 178179

managing mutable states using 138139

partially immutable 166168, 187

security vulnerabilities and 127

entity expansion, XML 2325, 28. See also Billion Laughs Attack

entity relay 181188

example 181183

splitting state graph into phases 183186

when to form 186188

entity snapshots 174180

changing state of underlying entity 177180

entities represented with immutable objects 175177

overview 174175

when to use 180

entity state graphs, complicated 181

entity state objects 168174

implementing entity state as separate object 172174

overview 168

upholding entity state rules 168172

ERP (Enterprise Resource Planning) 57

estimating headroom 213215

Evans, Eric 50, 74, 147

exceptions

handling failures without 232237

intermixing, business and technical 226227

using for failures 224232

exception payload 231232

handling exceptions 227230

overview 224225

throwing exceptions 225227

explicit domain exceptions 229230

externally unique identifiers 68

extreme input testing 191, 200201

F

failures

as different from exceptions 232234

fail-fast approach 101102, 240

handling without exceptions 232237

using exceptions for 224232

exception payload 231232

handling exceptions 227230

overview 224225

throwing exceptions 225227

fallback answers 240

feature toggles 201210

as developmental tool 202205

auditing 209

example of mishap with 201202

testing 205209

automatically 205

multiple toggles 209

features, vs. security concerns 58

findFirst method 227

flow-of-materials systems 57

fluent interface 147149

G

gambling sites, online 172

getter methods 156157

global exception handlers 228, 231

globally unique identifiers 68

H

Hack the Pentagon program 351

half-open state, of circuit breakers 239

headroom, estimating 213215

I

IaC (infrastructure as code) 212

identity , of entities 6669

immutability 8895

immutable entities, partially 166168

immutable objects entities represented with 174177

implicit behaviors, verifying configuration 219221

implicit concepts

making them explicit 4546

shallow modeling 4043

incident handling 354

independent runtimes, microservices 324

independent updates, microservices 324

indirect coupling, between feature toggles 209

infinite timeouts 240

infrastructure as code (IaC) 212

infrastructure-focused tests 211212

injection attack, See <script>alert('pwned')</script>

input, echoing verbatim 247248

input validation 102

integrity 8, 90, 9294, 266, 269. See also CIA-T

in microservices 330

logging as a service and 265

logging to file and 262

of aggregated log data 333334

internal XML entities 2223

invalid input, testing for 191, 197200

invariants 73

advanced constraints as 149151

domain primitives and 114116

internal, in entities 67

upholding in constructors 99101

J

JavaBeans specification 146

java.util.Date class 159

JPA (Java Persistence API) 142143. See also ORM

K

keywords, synchronized 89, 166, 174

L

least privilege principle 258

legacy codebases

ambiguous parameter lists in, replacing 297303

direct approach 299300

discovery approach 300302

new API approach 302303

defensive code constructs in 305310

contracts and domain primitives as solution to 308309

example 306308

optional data types in 309310

defined 295

domain primitives in 296297

domain primitives in, partial 316321

encompassing conceptual whole 319320

implicit, contextual currency 317319

DRY principle misapplied in 310313

false negatives 312313

false positives 311

problems caused by 311312

insufficient testing in 315316

insufficient validation in domain types in 313315

logging unchecked strings in 303305

identifying 303304

identifying implicit data leakage 304305

length check, validation 103, 105106

lexical content, check 

validation 103, 107109

Billion Laughs attack 2529

load balancing, in cloud environments 269271

centralized 269270

client-side 270

logging

in cloud environments 261266

as a service 263266

to file on disk, avoid 261263

in microservices 332341

confidentiality through a domain-oriented logger API 337341

integrity of aggregated log data 333334

traceability in log data 334337

in twelve-factor app 253

levels 337

unchecked strings in legacy codebases 303305

identifying 303304

identifying implicit data leakage 304305

login page 7

M

mandatory fields, as constructor arguments 143146

message queues 242

microservices

as bounded context 325329

API design 326328

semantics and evolving services 329

splitting monoliths 328

designed for down 324

independent runtimes 324

independent updates 324

logging in 332341

confidentiality through a domain-oriented logger API 337341

integrity of aggregated log data 333334

traceability in log data 334337

overview 323

sensitive data across 329332

broad meaning of sensitive 331332

CIA-T in microservice architecture 330331

microservices architecture 292, 323

models. See domain model

monoliths, splitting 328

mutability, issues with 8894

mutable objects, avoiding sharing of 158160

mutable states

managing using entities 138139

overview 137138

N

network security 332

new API approach, to replacing ambiguous parameter lists 302303

no-arg constructors 140143

normal input testing 191, 193194

normalizing log data 334

O

object management systems 57

object-relational mapper framework 142143, 155

online gambling sites 172

open state, of circuit breakers 239

Open Web Application Security Project. See OWASP

operational constraints 28

optional data types 309310

origin of data, checking 103105

ORM frameworks

no-arg constructors 142143

advanced constraints 155

Öst-Götha Bank robbery 56

overcluttered entity methods

decluttering 129132

general discussion 127129

OWASP (Open Web Application Security Project) 24

Builders’ community 358

Top 10 12, 351

P

PaaS (Platform-as-a-Service) 253, 270, 273

parameter lists, ambiguous , replacing

direct approach 299300

discovery approach 299302

new API approach 299, 302303

parser configuration 2324

parsers, as target of DoS attacks 109

partially immutable entities 166168

passwords

as domain primitive 124125

in code 255

treated as ephemeral 273274

penetration testing 12, 21, 347351

challenging design using 348

context-driven testing 349350

frequency of 349

learning from feedback from 349

reports of results from 357358

Platform-as-a-Service (PaaS) 253, 270, 273

port binding 252

Postel’s Law 27

preconditions 9599

prioritizing work, on vulnerabilities 347

problem resolution 353355

processes, in twelve-factor app 252

propagation policy, tainting 134

Q

queues 238

R

race condition 165166

Reactive Manifesto 243244

reactive systems 243244

read-once objects 121127

detecting unintentional use 123125

domain primitives as 121127

example 121123

overview 121

read-once pattern. See read-once objects

repairing vulnerable software 276277

repaving servers 274275

resilience 237, 356358

responsiveness 238

robbery example 56

root of aggregates 75

rotating

logs 269

secrets 273274

S

SAX parser (Simple API for XML) 25

second-order attacks 245

secrets

rotating 273274

sharing 257

storing

in code, avoiding 254255

in resources files, avoiding 255256

secure entities, replacing ambiguous parameters with 298

security

studying field of 351353

thinking explicitly about 14

traditional approach to 1114

security code review checklist 345

security concerns

categorizing 89

vs. features 58

security in depth 2829

security incident mechanism 353358

incident handling 354

problem resolution 354355

semantic versioning 335336

semantics 78

changing, between microservices 329

checking, validation 103, 110111

sensitive data, across microservices 329332

broad meaning of sensitive 331332

CIA-T in microservice architecture 330331

servers, repaving 274275

service discovery 270

service methods, rules embedded in 169

services, separating 280281

set/get naming convention 146

setter-based initialization 141

shallow modeling 4043

how emerges 4142

implicit concepts 4243

single-threaded shielding environment 166

Single Writer Principle 178

size of data, validation 103, 105106

slow systems 238

Social Security numbers (SSNs), represented by strings 42

ssh access 267

standard systems 57

stateless requests, processes serving 259260, 261

strictness of domain models 56

strings

credit card numbers respresented by 42

Social Security numbers respresented by 42

unchecked, in legacy codebases 303305

identifying 303304

identifying implicit data leakage 304305

structs, entities as  169

synchronized keywords 8994, 125126, 166, 174175, 180

syntax, validation 103, 109110

system theory 356

T

taint analysis 133136

technical exceptions 225227, 236

testing 191201. See also penetration testing

automated 210213

boundary behavior 194197

feature toggles 205209

for availability 213215

estimating headroom 213215

exploiting domain rules 215

multiple toggles 209

normal behavior 193194

of the extreme 200201

only good enough, in legacy code 315316

overview 191192

with input that causes eventual harm 199

with invalid input 197198

thread contention 89

Three R’s of Enterprise Security 271277

timeouts 239

toggles. See feature toggles

tokenizers 107

Tolerant Reader pattern 27

traceability 9. See also logging

in log data 334337

in microservices 330331

traditional approach to security 1114

transactions, identifying across system 336337

twelve-factor app, defined 252

U

ubiquitous language 6365, 7778

unchecked strings in legacy codebases, logging 303305

identifying 303304

identifying implicit data leakage 304305

untainting 133135

use cases 6

V

Validate utility class 98, 101

validation 102

configuration 216221

automated tests 218219

causes of configuration-related security flaws 216218

overview 216

verifying implicit behaviors 219221

data semantics 110111

data syntax 109110

insufficient, in legacy code 313315

lexical content of data 107109

origin of data, checking 103105

overview 102

repairing data, never before 245247

size of data 105106

value objects 17, 7075, 114115, 121, 159, 314. See also domain primitives

VMs (virtual machines) 242, 274275

vulnerable software, repairing 276277

W

Wolff’s law 356358

work queues 238

X

XML (Extensible Markup Language) 2229

Billion Laughs attack 2329

internal XML entities 2223

lexical content check 107108

XSS (cross-site scripting) attacks 1213,199–200, 245249

XSS polyglots 248249

logging (continued)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.116.183