IT |
気になる、記になる… |
Amazon、63時間限定のビッグセール「タイムセール祭り」を4月24日より開催へ |
https://taisy0.com/2021/04/17/139091.html
|
amazon |
2021-04-17 04:38:53 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
ルジャンドル(Legendre)多項式の零点(分点)と重みを求める |
https://qiita.com/TOgura/items/0acfcb6266b9943fd840
|
ルジャンドル多項式は漸化式を用いて再帰的に、零点はニュートン法で求めます。 |
2021-04-17 13:39:03 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
matplotでグラフを書く. |
https://qiita.com/michitaka523/items/9948666c07de0592d447
|
|
2021-04-17 13:07:16 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
Unityで2D objectが表示されない |
https://teratail.com/questions/333686?rss=all
|
地面を作ろうと思い、タイルマップを敷こうと思ったのですが、ゲームオブジェクトの中を探してもDnbspobjectという項目がありませんでした。 |
2021-04-17 13:55:58 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
Java 奇数、偶数診断アプリ |
https://teratail.com/questions/333685?rss=all
|
Java奇数、偶数診断アプリ前提・実現したいことJavaで奇数、偶数診断アプリというへんなのをつくっています。 |
2021-04-17 13:48:31 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
wordpress マルチサイト 小サイトの不具合 |
https://teratail.com/questions/333684?rss=all
|
wordpressマルチサイト小サイトの不具合とあるwordpressサイトを引き継ぎ、マルチサイトで起きてる問題に躓いてるので質問させてください。 |
2021-04-17 13:46:10 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
google colaboratoryとgoole drive の接続が上手くできません. |
https://teratail.com/questions/333683?rss=all
|
googlecolaboratoryとgooledriveの接続が上手くできません前提・実現したいことここに質問の内容を詳しく書いてください。 |
2021-04-17 13:43:42 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
Java 繰り返し処理のネスト文 |
https://teratail.com/questions/333682?rss=all
|
Java繰り返し処理のネスト文Javaで競技プログラミングの勉強をしております。 |
2021-04-17 13:29:36 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
mdファイルの開き方 |
https://teratail.com/questions/333681?rss=all
|
windowsnbspnotepad |
2021-04-17 13:26:54 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
firebaseのメッセージでiosにthreadIdentifierを渡すことはできますか |
https://teratail.com/questions/333680?rss=all
|
firebaseのメッセージでiosにthreadIdentifierを渡すことはできますかXcodeでアプリを開発しており、firebaseのメッセージでプッシュ通知を送信しています。 |
2021-04-17 13:19:52 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
!!!問題丸投げです。大丈夫な方のみお願いします。!!! Javaを使用した簡易アニメーションのプログラム穴埋め問題 |
https://teratail.com/questions/333679?rss=all
|
問題丸投げです。 |
2021-04-17 13:09:35 |
Linux |
Ubuntuタグが付けられた新着投稿 - Qiita |
Ubuntu 18.04にRails6.0をインストールする |
https://qiita.com/ponzuTester/items/9d35d89434387ddd2f2d
|
yarn と は nodejs の パッケージ マネージャ という こと な ので まずは Nodejs を インストール し ます 。 |
2021-04-17 13:30:33 |
Linux |
CentOSタグが付けられた新着投稿 - Qiita |
CentOS 8 Stream の Emacs 26.1 で package-refresh-contents できなかった。 |
https://qiita.com/ryo-sato/items/5fbfedb1c9170c657a45
|
結論時点で最新のEmacsをインストールすることで通るようになる。 |
2021-04-17 13:07:05 |
技術ブログ |
Developers.IO |
[新機能]AWS Glue Studio Spark SQLクエリを使用した変換が可能になりました |
https://dev.classmethod.jp/articles/202010416-aws-glue-transform-spark-sql/
|
awsgluestudio |
2021-04-17 04:23:14 |
技術ブログ |
Developers.IO |
[AWS利用者必読] アクセスキー漏洩による不正利用について |
https://dev.classmethod.jp/articles/unauthorized-use-of-aws-access-keys-due-to-leakage/
|
閲覧 |
2021-04-17 04:01:07 |
海外TECH |
DEV Community |
Context Api React |
https://dev.to/guscarpim/context-api-react-49p7
|
Context Api ReactHeeeeey guys My name is Gustavo Scarpim and I will show you how to add Context Api simply and quickly to your project ºCreate a folder called context inside your src folder example ºInside index we will create your global context example import React from react import ColorDefaultContextProvider from template components colors const GlobalContext children gt return lt gt lt ColorDefaultContextProvider gt children lt ColorDefaultContextProvider gt lt gt export default GlobalContextºI created a folder called components to separate my states in my colors js folder I create all my global states related to color I m taking the value of localStorage but the correct thing is to get the data from an API Well the example below is a pattern of the context just follow this step that is in the code below that will workimport React createContext useState from react const colorCard localStorage getItem colorCard const colorBackAvatar localStorage getItem colorBackAvatar const colorTitle localStorage getItem colorTitle const colorSubTitle localStorage getItem colorSubTitle const DEFAULT VALUE state colorCard colorCard colorBackAvatar colorBackAvatar colorTitle colorTitle colorSubTitle colorSubTitle setState gt const Context createContext DEFAULT VALUE const ColorDefaultContextProvider children gt const state setState useState DEFAULT VALUE state return lt Context Provider value state setState gt children lt Context Provider gt export ColorDefaultContextProvider export default Context ºFinally just import the context that we will use in your component down here I show you how to call and edit its global state import React useContext useRef from react import as S from styles custom import ContextColors from context template components colors export default function Custom const setState setGlobalState useContext ContextColors const state useContext ContextColors const colorCard useRef state colorSubTitle const handleChangeColorBackCard e gt setTimeout gt Here I m taking all the state I have in my context and I m changing a specific state then save it in localStorage not required to save in localStorage setGlobalState state colorCard e target value localStorage setItem colorCard state colorCard return lt S Container gt lt S ContentColor gt lt input ref colorCard defaultValue state colorCard type color onChange e gt handleChangeColorBackCard e gt lt S Label gt Background card lt S Label gt lt S ContentColor gt lt S Container gt ºMost importantly for the context to work throughout your application you need to import it into your main indeximport React from react import ReactDOM from react dom import Context from context import App from App ReactDOM render lt React StrictMode gt lt Context gt lt App gt lt Context gt lt React StrictMode gt document getElementById root And ready you applied your context api to your project See the project working See the complete code here on GitHub Click hereCheck out the Project in action DeployThanks for reading |
2021-04-17 04:40:39 |
海外TECH |
DEV Community |
AWS GuardDuty Combine With Security Hub And Slack |
https://dev.to/vumdao/aws-guardduty-combine-with-security-hub-and-slack-17eh
|
AWS GuardDuty Combine With Security Hub And Slack This post bases on the blog Automatically block suspicious traffic with AWS Network Firewall and Amazon GuardDuty but also send all MEDIUM and HIGH findings to slack Build completely this infrastructure using AWS CDK What s In This DocumentWrite Lambda function to block an IP address update dynamodb table and network firewall then notify to slackWrite Lambda function to notify finding from Security hubCreate Network Firewall rule groupsStep function and state machine for catching IPvCloudwatch Event Rule for Security Hub GuardDuty findings with remote IPStep function and state machine for finding othersCloudwatch Event Rule for Security Hub GuardDuty findings othersTest by execute step function with sample finding Write Lambda function to block an IP addressThere are two lambda functon here both handle input from cloudwatch event where catching the IPvUpdate the IPv to dynamodb for keep track and or prune the IP laterimport jsonimport osimport botoimport dateutil parserACLMETATABLE os environ ACLMETATABLE ddb boto resource dynamodb table ddb Table ACLMETATABLE def convert to epoch timestamp parsed t dateutil parser parse timestamp t in seconds parsed t strftime s print t in seconds return t in secondsdef create ddb rule record response table put item Item record ReturnValues ALL OLD if response ResponseMetadata HTTPStatusCode if Attributes in response print updated existing record no new IP return False else print log successfully added DDB state entry s record return True else print log error adding DDB state entry for s record print response raisedef getAllIPs IPList try response table scan if response Items print log found records for item in response Items print HostIp s item HostIp IPList append IP item HostIp else print log no entries found except Exception as e print something went wrong raise return IPListdef handler event context print log Event s json dumps event epoch time convert to epoch str event Timestamp record HostIp str event HostIp Timestamp str event Timestamp CreatedAt int epoch time FindingId str event FindingId AccountId str event AccountId Region str event Region result create ddb rule record if result record IPList getAllIPs record NewIP True else record NewIP False return recordUpdate network firewallimport osimport jsonimport botoRuleGroupArn os environ FIREWALLRULEGROUP RuleGroupPriority os environ RULEGROUPPRI CustomActionName os environ CUSTOMACTIONNAME CustomActionValue os environ CUSTOMACTIONVALUE client boto client network firewall def create sources block list response list for i in block list response append AddressDefinition str i IP return responsedef get rg config response client describe rule group RuleGroupArn RuleGroupArn Type STATELESS return responsedef update rg config block list cur rg config get rg config rg priority dst int RuleGroupPriority Create new rule from dictionary of IPs CIDRS to block new rules RuleDefinition MatchAttributes Sources create sources block list Actions aws drop CustomActionName Priority int RuleGroupPriority RuleDefinition MatchAttributes Destinations create sources block list Actions aws drop CustomActionName Priority int rg priority dst Custom Actions provide CloudWatch metrics custom actions ActionName CustomActionName ActionDefinition PublishMetricAction Dimensions Value CustomActionValue Preserve current rules not used here in rule group by appending to new rule new rg config cur rg config RuleGroup RulesSource StatelessRulesAndCustomActions StatelessRules try for r in new rg config if int r Priority not in int RuleGroupPriority int rg priority dst new rules append r Update the rule group print f Update Rule Group ARN RuleGroupArn response client update rule group UpdateToken cur rg config UpdateToken RuleGroupArn RuleGroupArn RuleGroup RulesSource StatelessRulesAndCustomActions StatelessRules new rules CustomActions custom actions Type STATELESS Description GDNFW Blog Sample DryRun False except Exception as e print something went wrong raisedef handler event context print log Event s json dumps event Retrieve a list of IPs delivered from the previous step in the State Machine block list event IPList If empty provide a fake entry rule group update requires at least one entry if len block list block list IP update the AWS Network Firewall Rule Group replace with the updated list of IPs update rg config block list check if the function was called for blocking or pruning if HostIp in event blocking completed pass the data on to the next step record HostIp str event HostIp Timestamp str event Timestamp FindingId str event FindingId AccountId str event AccountId Region str event Region Result True return record else this was a pruning action return PruningSuccessful True Notify block IP to slackimport requestsfrom datetime import datetimeimport jsondef send slack region messageId Send payload to slack webhook url footer icon color EEA level boom ALERT boom curr time datetime now strftime Y m d H M S message f Finding new IP messageId console url fallback f finding console url home region region findings search id D messageId payload username SecurityHub attachments fallback fallback pretext level color color text f AWS SecurityHub finding in region message footer f curr time n fallback footer icon footer icon requests post webhook url data json dumps payload headers Content Type application json def handler event context message id event HostIp region event Region send slack region message id return Status Ok Write Lambda function to notify finding from Security hubimport requestsfrom datetime import datetimeimport jsondef send slack region f id msg Send payload to slack webhook url footer icon color EEA level boom ALERT boom curr time datetime now strftime Y m d H M S console url fallback f finding console url home region region findings search id D f id payload username SecurityHub attachments fallback fallback pretext level color color text f AWS SecurityHub finding in region msg footer f curr time n fallback footer icon footer icon requests post webhook url data json dumps payload headers Content Type application json def handler event context finding id event Finding ID finding desc event Finding description region event Region severity event severity finding type event Finding Type msg f Finding new detection severity severity type finding type finding desc send slack region finding id msg return Status Ok Create Network Firewall rule groupsThis is the new service and only applied to some regions rg property network fw CfnRuleGroup RuleGroupProperty rule variables None rules source network fw CfnRuleGroup RulesSourceProperty stateless rules and custom actions network fw CfnRuleGroup StatelessRulesAndCustomActionsProperty stateless rules network fw CfnRuleGroup StatelessRuleProperty priority rule definition network fw CfnRuleGroup RuleDefinitionProperty actions aws drop match attributes network fw CfnRuleGroup MatchAttributesProperty destinations network fw CfnRuleGroup AddressProperty address definition nf rule group network fw CfnRuleGroup scope self id GuardDutyNetworkFireWallRuleGroup capacity rule group name guardduty network firewall type STATELESS description Guard Duty network firewall rule group tags core CfnTag key Name value cfn rule group stack rule group rg property Step function and state machine for catching IPv Cloudwatch Event Rule for Security Hub GuardDuty findings with remote IP detail type GuardDuty Finding detail findings ProductFields aws guardduty service action networkConnectionAction remoteIpDetails ipAddressV exists true source aws securityhub account Step function and state machine for finding others Cloudwatch Event Rule for Security Hub GuardDuty findings others detail type Security Hub Findings Imported detail severity source aws securityhub account Test by execute step function with sample findingStart execution of step function using Finding SampleTest Blog · Github · Web · Linkedin · Group · Page · Twitter |
2021-04-17 04:25:23 |
ニュース |
BBC News - Home |
The Papers: 'Queen bids farewell', and Helen McCrory tributes |
https://www.bbc.co.uk/news/blogs-the-papers-56781228
|
funeral |
2021-04-17 04:37:11 |
ニュース |
BBC News - Home |
Bellator 257: Watch Britain's Paul Daley in thriller versus Sabah Homasi |
https://www.bbc.co.uk/sport/av/mixed-martial-arts/56783083
|
Bellator Watch Britain x s Paul Daley in thriller versus Sabah HomasiBritain s Paul Semtex Daley secures his nd career knockout after a thrilling back and forth battle with American Sabah Homasi at Bellator |
2021-04-17 04:12:50 |
北海道 |
北海道新聞 |
高齢者ワクチン 後志管内20市町村の接種開始予定(16日現在) |
https://www.hokkaido-np.co.jp/article/534240/
|
新型コロナウイルス |
2021-04-17 13:18:28 |
北海道 |
北海道新聞 |
こいのぼり見納め 来春閉校の北見・上仁頃小 22匹が舞い泳ぐ |
https://www.hokkaido-np.co.jp/article/534303/
|
閉校 |
2021-04-17 13:18:07 |
北海道 |
北海道新聞 |
まん延防止で時短要請決定、愛知 感染急増懸念、緊急宣言の声も |
https://www.hokkaido-np.co.jp/article/534338/
|
新型コロナウイルス |
2021-04-17 13:03:00 |
ビジネス |
東洋経済オンライン |
日本女性の「パリ好き」の源がハリウッドの必然 住まう人たちの息づかいが伝わるフランス映画 | 映画・音楽 | 東洋経済オンライン |
https://toyokeizai.net/articles/-/422147?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
amazonprimevideo |
2021-04-17 14:00:00 |
コメント
コメントを投稿